From 7f8730fb98ac01e68a4572ed597b0c719e4cc4ac Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 24 Sep 2012 08:40:52 +0000 Subject: [PATCH] 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. --- harbour/ChangeLog | 38 ++++- harbour/contrib/hbqt/qtgui/qth/QWidget.qth | 6 +- harbour/contrib/hbqt/tests/activex.hbp | 20 --- harbour/contrib/hbqt/tests/activex.prg | 102 ------------- harbour/contrib/hbqt/tests/activex.ui | 159 --------------------- harbour/utils/hbmk2/hbmk2.prg | 14 +- 6 files changed, 50 insertions(+), 289 deletions(-) delete mode 100644 harbour/contrib/hbqt/tests/activex.hbp delete mode 100644 harbour/contrib/hbqt/tests/activex.prg delete mode 100644 harbour/contrib/hbqt/tests/activex.ui diff --git a/harbour/ChangeLog b/harbour/ChangeLog index caf8fd65b2..509f3c00e7 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -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) diff --git a/harbour/contrib/hbqt/qtgui/qth/QWidget.qth b/harbour/contrib/hbqt/qtgui/qth/QWidget.qth index 254e91f1f7..160bff79cf 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QWidget.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QWidget.qth @@ -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 ) diff --git a/harbour/contrib/hbqt/tests/activex.hbp b/harbour/contrib/hbqt/tests/activex.hbp deleted file mode 100644 index 5355b4ba85..0000000000 --- a/harbour/contrib/hbqt/tests/activex.hbp +++ /dev/null @@ -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 - - diff --git a/harbour/contrib/hbqt/tests/activex.prg b/harbour/contrib/hbqt/tests/activex.prg deleted file mode 100644 index 6619289577..0000000000 --- a/harbour/contrib/hbqt/tests/activex.prg +++ /dev/null @@ -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 - -/*----------------------------------------------------------------------*/ - diff --git a/harbour/contrib/hbqt/tests/activex.ui b/harbour/contrib/hbqt/tests/activex.ui deleted file mode 100644 index 66b566bfd2..0000000000 --- a/harbour/contrib/hbqt/tests/activex.ui +++ /dev/null @@ -1,159 +0,0 @@ - - - FormActiveX - - - - 0 - 0 - 607 - 569 - - - - ActiveX - - - - - - - 16777215 - 53 - - - - - - - - - - Navigate - - - - - - - - 300 - 0 - - - - - - - - Navigate - - - - - - - Refresh - - - - - - - - - - - 16777215 - 20 - - - - QFrame::StyledPanel - - - - - - - - - - QFrame::Panel - - - QFrame::Raised - - - - - - - 0 - 0 - - - - - 100 - 0 - - - - - 0 - 0 - - - - Qt::Horizontal - - - - - 0 - 0 - - - - - 100 - 0 - - - - 5 - - - false - - - - 1 - - - - - - - 1 - 0 - - - - QFrame::Panel - - - QFrame::Raised - - - - - - - - - - - - diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index 1e07bb9ec1..971c04755d 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -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 )