2012-09-24 10:39 UTC+0200 Viktor Szakats (harbour syenar.net)

* utils/hbmk2/hbmk2.prg
    + added support for 'hbstart.hb' script that gets
      executed _line by line_ on each startup. File is
      looked for in current dir than in the dir of
      hbrun/hbmk2 executable.
    ! fixed -run option on Windows for GUI executables (f.e. gtwvt)
      Thanks to Klas for details and Qatan for initial report
      [ It's possible similar patch is needed for OS/2. Please
      test and report. ]

  * contrib/hbqt/qtgui/qth/QWidget.qth
    ! disabled HBQT methods working differently on each platform.
      meaning they can only be used in platform dependent way (ie.
      they are non-portable methods) while HBQT is to be a portable
      component.
      - If .qth files start to support conditionals, it can
        be readded as built-time option:
           HB_BUILD_PRGFLAGS=-DHBQT_NON_PORTABLE
      - or kept as local patch for those who need this.
      - or moving HBQT/HBXBP/HBIDE to separate repository with
        (http://sourceforge.net/projects/hbqt/)
        Pritpal as project lead. It will be great benefit
        for both project, leaving them both focusing on
        their apparently different goals and development style.

  - contrib/hbqt/tests/activex.hbp
  - contrib/hbqt/tests/activex.prg
  - contrib/hbqt/tests/activex.ui
    - Deleted Windows-specific code added to the portable 
      HBQT component. Please readd it in separate HBQT project.
This commit is contained in:
Viktor Szakats
2012-09-24 08:40:52 +00:00
parent 8e8fb37f3c
commit 7f8730fb98
6 changed files with 50 additions and 289 deletions

View File

@@ -16,18 +16,50 @@
The license applies to all entries newer than 2009-04-28.
*/
2012-09-24 10:39 UTC+0200 Viktor Szakats (harbour syenar.net)
* utils/hbmk2/hbmk2.prg
+ added support for 'hbstart.hb' script that gets
executed _line by line_ on each startup. File is
looked for in current dir than in the dir of
hbrun/hbmk2 executable.
! fixed -run option on Windows for GUI executables (f.e. gtwvt)
Thanks to Klas for details and Qatan for initial report
[ It's possible similar patch is needed for OS/2. Please
test and report. ]
* contrib/hbqt/qtgui/qth/QWidget.qth
! disabled HBQT methods working differently on each platform.
meaning they can only be used in platform dependent way (ie.
they are non-portable methods) while HBQT is to be a portable
component.
- If .qth files start to support conditionals, it can
be readded as built-time option:
HB_BUILD_PRGFLAGS=-DHBQT_NON_PORTABLE
- or kept as local patch for those who need this.
- or moving HBQT/HBXBP/HBIDE to separate repository with
(http://sourceforge.net/projects/hbqt/)
Pritpal as project lead. It will be great benefit
for both project, leaving them both focusing on
their apparently different goals and development style.
- contrib/hbqt/tests/activex.hbp
- contrib/hbqt/tests/activex.prg
- contrib/hbqt/tests/activex.ui
- Deleted Windows-specific code added to the portable
HBQT component. Please readd it in separate HBQT project.
2012-09-23 11:32 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
* contrib/hbqt/tests/activex.hbp
* contrib/hbqt/tests/activex.prg
* contrib/hbqt/tests/activex.ui
+ Added: a demonstration applying HbQt's controvertial
QWidget():winID() call to be used with Harbour's native
+ Added: a demonstration applying HbQt's controvertial
QWidget():winID() call to be used with Harbour's native
ActiveX engine. The demo is less than 70 lines of code
and blends Qt Creator, HbQt, hbWIN in a meaningful way.
2012-09-22 08:58 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
* contrib/hbide/main.prg
! Fixed: regression - IdeDBU was not showing up auto when
! Fixed: regression - IdeDBU was not showing up auto when
HbIDE was invoked in DBU mode, reported by Massimo, thanks.
2012-09-22 12:23 UTC+0200 Viktor Szakats (harbour syenar.net)

View File

@@ -71,7 +71,7 @@ Qt::ContextMenuPolicy contextMenuPolicy () const
QCursor cursor () const
#
# non-portable
WId effectiveWinId () const
// WId effectiveWinId () const
void ensurePolished () const
Qt::FocusPolicy focusPolicy () const
QWidget * focusProxy () const
@@ -275,7 +275,7 @@ bool updatesEnabled () const
QRegion visibleRegion () const
QString whatsThis () const
int width () const
WId winId () const
// WId winId () const
QWidget * window () const
QString windowFilePath () const
Qt::WindowFlags windowFlags () const
@@ -292,7 +292,7 @@ int x () const
//Qt::HANDLE x11PictureHandle () const
int y () const
QWidget * find ( WId id )
// QWidget * find ( WId id )
QWidget * keyboardGrabber ()
QWidget * mouseGrabber ()
void setTabOrder ( QWidget * first, QWidget * second )

View File

@@ -1,20 +0,0 @@
#
# $Id$
#
-3rd=hbide_version=1.0
-3rd=hbide_title=ActiveX
-3rd=hbide_output=activex
-inc
-w3
-es2
hbqt.hbc
gtwvg.hbc
activex.prg
activex.ui

View File

@@ -1,102 +0,0 @@
/*
* $Id$
*/
/* W A R N I N G : Windows Only Code
*
* Demonstrate the usage of Windows ActiveX functionality
* available in HbQt via QWidget():winID() call. This demonstration
* is one of the many benefits :winID() facilitates without breaking
* compatilibility. The programmer ( me, here ) knows what he/she is
* doing. On the contrary, I am free TO do mathematical operations
* with :winID(), like, IF o:winID() > 99999999 ; WOW() ; ELSE sigh()
*
* To build I am inclusing GtWVG as it already has class to construct activex window.
* This is just to cut the time short. Anyway we will be using activeX on windows only
*
* This can be argued that if this all can be done in pure Windows, then why through HbQt ?
*
* The answer is simple: Harbour's WINAPI related infrastructure is so inadequate that it is
* extremely difficult IF not impossible. There are two reasons: 1. Harbour does not have
* any upper level GUI library, 2. Structure support in Harbour, as of current, is broken.
* So the effective GUI library is HbQt, complete with all GUI stuff, which can be exploited
* to harness the power of Windows exclusive functionality via winID() call.
*
* This less than 70 lines of code demonstrate what can be achieved with WINAPI in hundreds...
*
* Pritpal Bedi 23Sep2012
*/
/*----------------------------------------------------------------------*/
#include "hbqtgui.ch"
#include "hbtrace.ch"
/*----------------------------------------------------------------------*/
FUNCTION Main()
LOCAL oUI, oActiveX
hbqt_errorsys()
oUI := hbqtui_activex()
oActiveX := BuildActiveX( oUI )
oUI:connect( QEvent_Resize, {|| oActiveX:setSize( { oUI:frameActiveX:width(), oUI:frameActiveX:height() } ) } )
oUI:editNavigate:setText( "http://hbide.vouch.info" )
oUI:btnNavigate:connect( "clicked()", {|| HandleNavigation( oUI, oActiveX ) } )
oUI:btnRefresh:connect( "clicked()" , {|| oActiveX:refresh() } )
oUI:treeUrls:setHeaderHidden( .T. )
oUI:treeUrls:setTooltip( "Click on any url to navigate !" )
oUI:treeUrls:connect( "itemPressed(QTreeWidgetItem*,int)", {|q,i| oActiveX:navigate( q:text( i ) ) } )
oUI:splitterOne:connect( "splitterMoved(int,int)", {|| oActiveX:setSize( { oUI:frameActiveX:width(), oUI:frameActiveX:height() } ) } )
oUI:editNavigate:connect( "returnPressed()", {|| oUI:btnNavigate:click() } )
oUI:editNavigate:setFocus()
oUI:show()
oUI:btnNavigate:click()
oUI:resize( 1000, 500 )
oUI:treeUrls:setFocus()
QApplication():exec()
RETURN oActiveX
/*----------------------------------------------------------------------*/
FUNCTION BuildActiveX( oUI )
LOCAL oXbp, oActiveX
oXbp := WvgWindow():new( , , { 0, 0 }, { 640, 400 }, , .T. )
oXbp:hWnd := oUI:frameActiveX:winID()
oActiveX := WvgActiveXControl():new( oXbp, , { 0, 0 }, { 100, 100 }, , .t. )
oActiveX:CLSID := "Shell.Explorer.2"
oActiveX:mapEvent( 269, {|| oUI:labelStatus:setText( ' E X P L O R E R - 2 6 9' ) } )
oActiveX:mapEvent( 105, {|| oUI:labelStatus:setText( ' E X P L O R E R - 105' ) } )
oActiveX:create()
RETURN oActiveX
/*----------------------------------------------------------------------*/
FUNCTION HandleNavigation( oUI, oActiveX )
LOCAL qItm := QTreeWidgetItem()
oActiveX:navigate( oUI:editNavigate:text() )
qItm:setText( 0, oUI:editNavigate:text() )
oUI:treeUrls:addTopLevelItem( qItm )
RETURN NIL
/*----------------------------------------------------------------------*/

View File

@@ -1,159 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>FormActiveX</class>
<widget class="QWidget" name="FormActiveX">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>607</width>
<height>569</height>
</rect>
</property>
<property name="windowTitle">
<string>ActiveX</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>53</height>
</size>
</property>
<property name="title">
<string/>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Navigate </string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="editNavigate">
<property name="minimumSize">
<size>
<width>300</width>
<height>0</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="btnNavigate">
<property name="text">
<string>Navigate</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="btnRefresh">
<property name="text">
<string>Refresh</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QLabel" name="labelStatus">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>20</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="QFrame" name="frame">
<property name="frameShape">
<enum>QFrame::Panel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QSplitter" name="splitterOne">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<widget class="QTreeWidget" name="treeUrls">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="indentation">
<number>5</number>
</property>
<attribute name="headerVisible">
<bool>false</bool>
</attribute>
<column>
<property name="text">
<string notr="true">1</string>
</property>
</column>
</widget>
<widget class="QFrame" name="frameActiveX">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::Panel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
</widget>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@@ -7004,9 +7004,9 @@ FUNCTION hbmk( aArgs, nArgTarget, /* @ */ lPause, nLevel )
#if defined( __PLATFORM__WINDOWS )
IF hbmk[ _HBMK_lGUI ]
IF hb_osIsWinNT()
cCommand := 'start "" ' + FNameEscape( cCommand, _ESC_DBLQUOTE )
cCommand := GetEnv( "COMSPEC" ) + " /C " + 'start "" ' + FNameEscape( cCommand, _ESC_DBLQUOTE )
ELSE
cCommand := "start " + cCommand
cCommand := GetEnv( "COMSPEC" ) + " /C " + "start " + cCommand
ENDIF
ENDIF
#elif defined( __PLATFORM__OS2 )
@@ -12760,6 +12760,8 @@ STATIC PROCEDURE __hbshell_plugins_unload( plugins )
#include "inkey.ch"
#include "setcurs.ch"
#define _SCRIPT_INIT "hbstart.hb"
/* TODO: rewrite the full-screen shell to be a simple stdout/stdin shell */
STATIC PROCEDURE __hbshell_prompt( aParams, aCommand )
LOCAL GetList
@@ -12770,6 +12772,7 @@ STATIC PROCEDURE __hbshell_prompt( aParams, aCommand )
LOCAL lResize := .F.
LOCAL plugins
LOCAL cCommand
LOCAL cFileName
LOCAL cDomain := ""
LOCAL cPrompt
@@ -12803,6 +12806,13 @@ STATIC PROCEDURE __hbshell_prompt( aParams, aCommand )
__hbshell_Exec( "?? hb_Version()" )
IF hb_FileExists( cFileName := _SCRIPT_INIT ) .OR. ;
hb_FileExists( cFileName := ( hb_DirBase() + _SCRIPT_INIT ) )
FOR EACH cCommand IN hb_ATokens( StrTran( hb_MemoRead( cFileName ), Chr( 13 ), Chr( 10 ) ), Chr( 10 ) )
__hbshell_Exec( cCommand )
NEXT
ENDIF
IF HB_ISARRAY( aCommand )
FOR EACH cCommand IN aCommand
IF HB_ISSTRING( cCommand )