2009-04-07 11:45 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)
* contrib/hbqt/generator/hbqtgen.prg
! Updated to post latest demoqt.prg.
This commit is contained in:
@@ -8,6 +8,10 @@
|
||||
2009-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org)
|
||||
*/
|
||||
|
||||
2009-04-07 11:45 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)
|
||||
* contrib/hbqt/generator/hbqtgen.prg
|
||||
! Updated to post latest demoqt.prg.
|
||||
|
||||
2009-04-07 19:00 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
|
||||
* utils/hbmk2/hbmk2.prg
|
||||
+ Turned on line number permanently.
|
||||
|
||||
@@ -691,8 +691,11 @@ STATIC FUNCTION ParseProto( cProto, cWidget, txt_, doc_, aEnum, func_ )
|
||||
aA[ PRT_DOC ] := 'p'+ cDocNM
|
||||
|
||||
CASE aA[ PRT_L_AND ]
|
||||
aA[ PRT_BODY ] := '*hbqt_par_' + aA[ PRT_CAST ] + '( ' + cHBIdx + ' )'
|
||||
//aA[ PRT_BODY ] := '( '+ aA[ PRT_CAST ]+'& )' + 'hbqt_par_' + aA[ PRT_CAST ] + '( ' + cHBIdx + ' )'
|
||||
#if 0
|
||||
aA[ PRT_BODY ] := '( '+ aA[ PRT_CAST ]+'& )' + 'hbqt_par_' + aA[ PRT_CAST ] + '( ' + cHBIdx + ' )'
|
||||
#else
|
||||
aA[ PRT_BODY ] := '*hbqt_par_' + aA[ PRT_CAST ] + '( ' + cHBIdx + ' )'
|
||||
#endif
|
||||
aA[ PRT_DOC ] := 'p'+ cDocNM
|
||||
#if 0
|
||||
CASE aA[ PRT_CAST ] == 'QRect'
|
||||
@@ -800,8 +803,11 @@ STATIC FUNCTION ParseProto( cProto, cWidget, txt_, doc_, aEnum, func_ )
|
||||
cPrgRet := 'p'+cDocNM
|
||||
|
||||
CASE aA[ PRT_L_AND ] .and. aA[ PRT_L_CONST ]
|
||||
//cCmd := 'hb_retptr( &( ( '+ aA[ PRT_CAST ] + '& ) ' + cCmn + ' ) )'
|
||||
cCmd := 'hb_retptr( new '+ aA[ PRT_CAST ] + '( ' + cCmn + ' ) )'
|
||||
#if 0
|
||||
cCmd := 'hb_retptr( &( ( '+ aA[ PRT_CAST ] + '& ) ' + cCmn + ' ) )'
|
||||
#else
|
||||
cCmd := 'hb_retptr( new '+ aA[ PRT_CAST ] + '( ' + cCmn + ' ) )'
|
||||
#endif
|
||||
cPrgRet := 'p'+cDocNM
|
||||
|
||||
CASE aA[ PRT_L_CONST ]
|
||||
@@ -843,8 +849,11 @@ STATIC FUNCTION ParseProto( cProto, cWidget, txt_, doc_, aEnum, func_ )
|
||||
OTHERWISE
|
||||
/* No attribute is attached to return value */
|
||||
IF left( aA[ PRT_CAST ], 1 ) == 'Q'
|
||||
//cCmd := 'hb_retptr( &( ( '+ aA[ PRT_CAST ] + '& ) ' + cCmn + ' ) )'
|
||||
cCmd := 'hb_retptr( new '+ aA[ PRT_CAST ] + '( ' + cCmn + ' ) )'
|
||||
#if 0
|
||||
cCmd := 'hb_retptr( &( ( '+ aA[ PRT_CAST ] + '& ) ' + cCmn + ' ) )'
|
||||
#else
|
||||
cCmd := 'hb_retptr( new '+ aA[ PRT_CAST ] + '( ' + cCmn + ' ) )'
|
||||
#endif
|
||||
cPrgRet := 'p'+cDocNM
|
||||
|
||||
ELSE
|
||||
@@ -858,7 +867,6 @@ STATIC FUNCTION ParseProto( cProto, cWidget, txt_, doc_, aEnum, func_ )
|
||||
|
||||
IF !empty( cCmd )
|
||||
cCmd := strtran( cCmd, '( )', '()' ) +';'
|
||||
//OutStd( cCmd + s_NewLine )
|
||||
ENDIF
|
||||
ENDIF
|
||||
ENDIF
|
||||
@@ -888,8 +896,8 @@ STATIC FUNCTION ParseProto( cProto, cWidget, txt_, doc_, aEnum, func_ )
|
||||
aadd( txt_, "" )
|
||||
ENDIF
|
||||
|
||||
/* One line function body */
|
||||
aadd( txt_, " "+ cCmd )
|
||||
//aadd( aA[ PRT_BODY_PRE ], { 'int i'+cDocNM+' = 0;', nHBIdx, 'int', cDocNM } )
|
||||
|
||||
/* Return values back to PRG */
|
||||
IF !empty( aPre )
|
||||
@@ -1044,16 +1052,19 @@ STATIC FUNCTION BuildDocument( cWidget, doc_, cPathDoc )
|
||||
LOCAL dcc_:={}
|
||||
LOCAL hHandle, cFile
|
||||
|
||||
aadd( dcc_, ' ' )
|
||||
aadd( dcc_, '< HBQtGen v1.0 - Harbour Callable Wrappers Generator for QT v4.5 >' )
|
||||
aadd( dcc_, ' ' )
|
||||
aadd( dcc_, '< Please do not modify this document as it is subject to change in future. >' )
|
||||
aadd( dcc_, ' ' )
|
||||
aadd( dcc_, '< Pritpal Bedi <pritpal@vouchcac.com> >' )
|
||||
aadd( dcc_, ' ' )
|
||||
aadd( dcc_, '< '+dtoc( date() ) + ' - ' + time() + ' >' )
|
||||
aadd( dcc_, ' ' )
|
||||
aadd( dcc_, ' ' )
|
||||
BuildHeader( @dcc_ )
|
||||
|
||||
aadd( dcc_, '/* ' )
|
||||
aadd( dcc_, ' * HBQtGen v1.0 - Harbour Callable Wrappers Generator for QT v4.5 >' )
|
||||
aadd( dcc_, ' * ' )
|
||||
aadd( dcc_, ' * Please do not modify this document as it is subject to change in future. >' )
|
||||
aadd( dcc_, ' * ' )
|
||||
aadd( dcc_, ' * Pritpal Bedi <pritpal@vouchcac.com> >' )
|
||||
aadd( dcc_, ' * ' )
|
||||
aadd( dcc_, ' * '+dtoc( date() ) + ' - ' + time() + ' >' )
|
||||
aadd( dcc_, ' * ' )
|
||||
aadd( dcc_, ' */ ' )
|
||||
aadd( dcc_, ' ' )
|
||||
|
||||
aeval( doc_, {|e| aadd( dcc_, e ) } )
|
||||
|
||||
@@ -1113,9 +1124,8 @@ STATIC FUNCTION Build_Class( cWidget, cls_, doc_, cPathOut )
|
||||
FOR EACH s IN doc_
|
||||
n := at( '-> ', s )
|
||||
IF n > 0
|
||||
// cRet := substr( s, n+3 )
|
||||
s := substr( s, 1, n-1 )
|
||||
s := strtran( s, '@', '' ) /* Just in Case */
|
||||
s := strtran( s, '@', '' ) /* Just in Case */
|
||||
s := strtran( s, '::', '_' ) /* Just in Case */
|
||||
|
||||
n := at( cWidget, s )
|
||||
@@ -1141,7 +1151,9 @@ STATIC FUNCTION Build_Class( cWidget, cls_, doc_, cPathOut )
|
||||
aadd( txt_, '/*----------------------------------------------------------------------*/' )
|
||||
aadd( txt_, '' )
|
||||
|
||||
//n := ascan( cls_, {|e_| lower( e_[ 1 ] ) == 'new' } )
|
||||
#if 0
|
||||
n := ascan( cls_, {|e_| lower( e_[ 1 ] ) == 'new' } )
|
||||
#endif
|
||||
cM := 'New( pParent )'
|
||||
|
||||
aadd( txt_, 'METHOD '+ cM + ' CLASS '+ cWidget )
|
||||
@@ -1423,8 +1435,6 @@ STATIC FUNCTION Build_HBQT_H( cPathOut )
|
||||
aadd( txt_, "QSizeF hbqt_const_QSizeF( int ); " )
|
||||
aadd( txt_, "QPointF hbqt_const_QPointF( int ); " )
|
||||
aadd( txt_, " " )
|
||||
aadd( txt_, "void hb_ToOutDebug( const char * sTraceMsg, ... ); " )
|
||||
aadd( txt_, " " )
|
||||
aadd( txt_, "#endif " )
|
||||
aadd( txt_, " " )
|
||||
aadd( txt_, "#endif /* __HBQT_H */ " )
|
||||
@@ -2164,236 +2174,257 @@ STATIC FUNCTION Build_Demo()
|
||||
|
||||
BuildHeader( @txt_, 2 )
|
||||
|
||||
aadd( txt_, '#define QT_PTROF( oObj ) ( oObj:pPtr ) ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, '#define QT_EVE_TRIGGERED "triggered(bool)" ' )
|
||||
aadd( txt_, '#define QT_EVE_TRIGGERED_B "triggered(bool)" ' )
|
||||
aadd( txt_, '#define QT_EVE_HOVERED "hovered()" ' )
|
||||
aadd( txt_, '#define QT_EVE_CLICKED "clicked()" ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, '/*----------------------------------------------------------------------*/ ' )
|
||||
aadd( txt_, '/* ' )
|
||||
aadd( txt_, ' * A NOTE ' )
|
||||
aadd( txt_, ' * ' )
|
||||
aadd( txt_, ' * This demo is built on auto generated classes by the engine. No attemp ' )
|
||||
aadd( txt_, ' * is exercised to refine the way the code must be written. At this moment ' )
|
||||
aadd( txt_, ' * my emphasis is on testing phase of QT wrapper functions and classes ' )
|
||||
aadd( txt_, ' * generated thereof. In near future the actual implementation will be ' )
|
||||
aadd( txt_, ' * based on the Xbase++ XBPParts compatible framework. You just are ' )
|
||||
aadd( txt_, ' * encouraged to sense the power of QT through this expression. ' )
|
||||
aadd( txt_, ' * ' )
|
||||
aadd( txt_, ' * Pritpal Bedi ' )
|
||||
aadd( txt_, ' */ ' )
|
||||
aadd( txt_, '/*----------------------------------------------------------------------*/ ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, 'INIT PROCEDURE Qt_Start() ' )
|
||||
aadd( txt_, ' qt_qapplication() ' )
|
||||
aadd( txt_, ' RETURN ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, 'EXIT PROCEDURE Qt_End() ' )
|
||||
aadd( txt_, ' qt_qapplication_exec() ' )
|
||||
aadd( txt_, ' RETURN ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, '/*----------------------------------------------------------------------*/ ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, 'PROCEDURE Main() ' )
|
||||
aadd( txt_, ' Local oLabel ' )
|
||||
aadd( txt_, ' Local oWnd ' )
|
||||
aadd( txt_, ' Local oMenuBar ' )
|
||||
aadd( txt_, ' Local oMenuA, pAction ' )
|
||||
aadd( txt_, ' LOCAL oPS, oPPrv, oMB, oWZ, oCD, oWP ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, ' oWnd := QMainWindow():new() ' )
|
||||
aadd( txt_, ' oWnd:setWindowTitle("Testing - QMainWindow, QMenu, QMenuBar and QAction " ) ' )
|
||||
aadd( txt_, ' oWnd:resize( 640, 400 ) ' )
|
||||
aadd( txt_, ' oWnd:Show() ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, ' Build_MenuBar( oWnd ) ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, ' oLabel := QLabel():New( QT_PTROF( oWnd ) ) ' )
|
||||
aadd( txt_, ' oLabel:setText( "Testing Harbour + Qt" ) ' )
|
||||
aadd( txt_, ' oLabel:move( 200,100 ) ' )
|
||||
aadd( txt_, ' oLabel:show() ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, ' RETURN ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, '/*----------------------------------------------------------------------*/ ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, 'STATIC FUNCTION Build_MenuBar( oWnd ) ' )
|
||||
aadd( txt_, ' LOCAL oMenuBar, oMenu ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, ' oMenuBar := QMenuBar():new( QT_PTROF( oWnd ) ) ' )
|
||||
aadd( txt_, ' oMenuBar:resize( oWnd:width(), 25 ) ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, ' oMenu := QMenu():new( QT_PTROF( oMenuBar ) ) ' )
|
||||
aadd( txt_, ' oMenu:setTitle( "&File" ) ' )
|
||||
aadd( txt_, ' Qt_Connect_Signal( oMenu:addAction_1( "new.png" , "&New" ), QT_EVE_TRIGGERED_B, {|w,l| FileDialog( "New" , w, l ) } )' )
|
||||
aadd( txt_, ' Qt_Connect_Signal( oMenu:addAction_1( "open.png", "&Open" ), QT_EVE_TRIGGERED_B, {|w,l| FileDialog( "Open", w, l ) } )' )
|
||||
aadd( txt_, ' oMenu:addSeparator() ' )
|
||||
aadd( txt_, ' Qt_Connect_Signal( oMenu:addAction_1( "save.png", "&Save" ), QT_EVE_TRIGGERED_B, {|w,l| FileDialog( "Save", w, l ) } )' )
|
||||
aadd( txt_, ' oMenu:addSeparator() ' )
|
||||
aadd( txt_, ' Qt_Connect_Signal( oMenu:addAction( "E&xit" ), QT_EVE_TRIGGERED_B, {|w,l| MsgInfo( "Exit ?" ) } ) ' )
|
||||
aadd( txt_, ' oMenuBar:addMenu( QT_PTROF( oMenu ) ) ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, ' oMenu := QMenu():new( QT_PTROF( oMenuBar ) ) ' )
|
||||
aadd( txt_, ' oMenu:setTitle( "&Dialogs" ) ' )
|
||||
aadd( txt_, ' Qt_Connect_Signal( oMenu:addAction( "&Colors" ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "Colors" , w, l ) } ) ' )
|
||||
aadd( txt_, ' Qt_Connect_Signal( oMenu:addAction( "&Fonts" ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "Fonts" , w, l ) } ) ' )
|
||||
aadd( txt_, ' oMenu:addSeparator() ' )
|
||||
aadd( txt_, ' Qt_Connect_Signal( oMenu:addAction( "&PageSetup" ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "PageSetup", w, l ) } ) ' )
|
||||
aadd( txt_, ' Qt_Connect_Signal( oMenu:addAction( "P&review" ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "Preview" , w, l ) } ) ' )
|
||||
aadd( txt_, ' oMenu:addSeparator() ' )
|
||||
aadd( txt_, ' Qt_Connect_Signal( oMenu:addAction( "&Wizard" ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "Wizard" , w, l ) } ) ' )
|
||||
aadd( txt_, ' Qt_Connect_Signal( oMenu:addAction( "W&ebPage" ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "WebPage" , w, l ) } ) ' )
|
||||
aadd( txt_, ' oMenuBar:addMenu( QT_PTROF( oMenu ) ) ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, ' oMenuBar:show() ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, ' RETURN nil ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, '/*----------------------------------------------------------------------*/ ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, 'FUNCTION MsgInfo( cMsg ) ' )
|
||||
aadd( txt_, ' LOCAL oMB ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, ' oMB := QMessageBox():new() ' )
|
||||
aadd( txt_, ' oMB:setInformativeText( cMsg ) ' )
|
||||
aadd( txt_, ' oMB:setWindowTitle( "Harbour-QT" ) ' )
|
||||
aadd( txt_, ' oMB:show() ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, ' RETURN nil ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, '/*----------------------------------------------------------------------*/ ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, 'STATIC FUNCTION FileDialog( cType, w, l ) ' )
|
||||
aadd( txt_, ' LOCAL oFD := QFileDialog():new() ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, ' oFD:setWindowTitle( "Select a File" ) ' )
|
||||
aadd( txt_, ' oFD:show() ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, ' RETURN nil ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, '/*----------------------------------------------------------------------*/ ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, 'STATIC FUNCTION Dialogs( cType, w, l ) ' )
|
||||
aadd( txt_, ' LOCAL oDlg, oUrl ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, ' DO CASE ' )
|
||||
aadd( txt_, ' CASE cType == "PageSetup" ' )
|
||||
aadd( txt_, ' oDlg := QPageSetupDialog():new() ' )
|
||||
aadd( txt_, ' oDlg:setWindowTitle( "Harbour-QT PageSetup Dialog" ) ' )
|
||||
aadd( txt_, ' oDlg:show() ' )
|
||||
aadd( txt_, ' CASE cType == "Preview" ' )
|
||||
aadd( txt_, ' oDlg := QPrintPreviewDialog():new() ' )
|
||||
aadd( txt_, ' oDlg:setWindowTitle( "Harbour-QT Preview Dialog" ) ' )
|
||||
aadd( txt_, ' oDlg:show() ' )
|
||||
aadd( txt_, ' CASE cType == "Wizard" ' )
|
||||
aadd( txt_, ' oDlg := QWizard():new() ' )
|
||||
aadd( txt_, ' oDlg:setWindowTitle( "Harbour-QT Wizard to Show Slides etc." ) ' )
|
||||
aadd( txt_, ' oDlg:show() ' )
|
||||
aadd( txt_, ' CASE cType == "Colors" ' )
|
||||
aadd( txt_, ' oDlg := QColorDialog():new() ' )
|
||||
aadd( txt_, ' oDlg:setWindowTitle( "Harbour-QT Color Selection Dialog" ) ' )
|
||||
aadd( txt_, ' oDlg:show() ' )
|
||||
aadd( txt_, ' CASE cType == "WebPage" ' )
|
||||
aadd( txt_, ' oDlg := QWebView():new() ' )
|
||||
aadd( txt_, ' oUrl := QUrl():new() ' )
|
||||
aadd( txt_, ' oUrl:setUrl( "http://www.harbour.vouch.info" ) ' )
|
||||
aadd( txt_, ' QT_QWebView_SetUrl( QT_PTROF( oDlg ), QT_PTROF( oUrl ) ) ' )
|
||||
aadd( txt_, ' oDlg:setWindowTitle( "Harbour-QT Web Page Navigator" ) ' )
|
||||
aadd( txt_, ' oDlg:show() ' )
|
||||
aadd( txt_, ' CASE cType == "Fonts" ' )
|
||||
aadd( txt_, ' oDlg := QFontDialog():new() ' )
|
||||
aadd( txt_, ' oDlg:setWindowTitle( "Harbour-QT Font Selector" ) ' )
|
||||
aadd( txt_, ' oDlg:show() ' )
|
||||
aadd( txt_, ' ENDCASE ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, ' RETURN nil ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, '/*----------------------------------------------------------------------*/ ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, 'PROCEDURE hb_GtSys() ' )
|
||||
aadd( txt_, ' HB_GT_GUI_DEFAULT() ' )
|
||||
aadd( txt_, ' RETURN ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, '/*----------------------------------------------------------------------*/ ' )
|
||||
aadd( txt_, '/* ' )
|
||||
aadd( txt_, ' * Just to Link Every New Widget ' )
|
||||
aadd( txt_, ' */ ' )
|
||||
aadd( txt_, 'STATIC FUNCTION Dummies() ' )
|
||||
aadd( txt_, ' LOCAL oSome ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, ' oSome := QAction():new() ' )
|
||||
aadd( txt_, ' oSome := QBoxLayout():new() ' )
|
||||
aadd( txt_, ' oSome := QCalendarWidget():new() ' )
|
||||
aadd( txt_, ' oSome := QCheckBox():new() ' )
|
||||
aadd( txt_, ' oSome := QColorDialog():new() ' )
|
||||
aadd( txt_, ' oSome := QComboBox():new() ' )
|
||||
aadd( txt_, ' oSome := QCommandLinkButton():new() ' )
|
||||
aadd( txt_, ' oSome := QDateEdit():new() ' )
|
||||
aadd( txt_, ' oSome := QDateTimeEdit():new() ' )
|
||||
aadd( txt_, ' oSome := QDial():new() ' )
|
||||
aadd( txt_, ' oSome := QDialog():new() ' )
|
||||
aadd( txt_, ' oSome := QDoubleSpinBox():new() ' )
|
||||
aadd( txt_, ' oSome := QErrorMessage():new() ' )
|
||||
aadd( txt_, ' oSome := QFileDialog():new() ' )
|
||||
aadd( txt_, ' oSome := QFocusFrame():new() ' )
|
||||
aadd( txt_, ' oSome := QFontComboBox():new() ' )
|
||||
aadd( txt_, ' oSome := QFontDialog():new() ' )
|
||||
aadd( txt_, ' oSome := QFormLayout():new() ' )
|
||||
aadd( txt_, ' oSome := QFrame():new() ' )
|
||||
aadd( txt_, ' oSome := QGroupBox():new() ' )
|
||||
aadd( txt_, ' oSome := QHBoxLayout():new() ' )
|
||||
aadd( txt_, ' oSome := QInputDialog():new() ' )
|
||||
aadd( txt_, ' oSome := QLabel():new() ' )
|
||||
aadd( txt_, ' oSome := QLayout():new() ' )
|
||||
aadd( txt_, ' oSome := QLayoutItem():new() ' )
|
||||
aadd( txt_, ' oSome := QLCDNumber():new() ' )
|
||||
aadd( txt_, ' oSome := QLineEdit():new() ' )
|
||||
aadd( txt_, ' oSome := QListView():new() ' )
|
||||
aadd( txt_, ' oSome := QMainWindow():new() ' )
|
||||
aadd( txt_, ' oSome := QMenu():new() ' )
|
||||
aadd( txt_, ' oSome := QMenuBar():new() ' )
|
||||
aadd( txt_, ' oSome := QMessageBox():new() ' )
|
||||
aadd( txt_, ' oSome := QObject():new() ' )
|
||||
aadd( txt_, ' oSome := QPageSetupDialog():new() ' )
|
||||
aadd( txt_, ' oSome := QPaintDevice():new() ' )
|
||||
aadd( txt_, ' oSome := QPainter():new() ' )
|
||||
aadd( txt_, ' oSome := QPrintDialog():new() ' )
|
||||
aadd( txt_, ' oSome := QPrintPreviewDialog():new() ' )
|
||||
aadd( txt_, ' oSome := QProgressBar():new() ' )
|
||||
aadd( txt_, ' oSome := QProgressDialog():New() ' )
|
||||
aadd( txt_, ' oSome := QPushButton():new() ' )
|
||||
aadd( txt_, ' oSome := QRadioButton():new() ' )
|
||||
aadd( txt_, ' oSome := QScrollArea():new() ' )
|
||||
aadd( txt_, ' oSome := QScrollBar():new() ' )
|
||||
aadd( txt_, ' oSome := QSizeGrip():new() ' )
|
||||
aadd( txt_, ' oSome := QSlider():new() ' )
|
||||
aadd( txt_, ' oSome := QSpinBox():new() ' )
|
||||
aadd( txt_, ' oSome := QSplitter():new() ' )
|
||||
aadd( txt_, ' oSome := QTabBar():new() ' )
|
||||
aadd( txt_, ' oSome := QTableView():new() ' )
|
||||
aadd( txt_, ' oSome := QTableWidget():new() ' )
|
||||
aadd( txt_, ' oSome := QTableWidgetItem():new() ' )
|
||||
aadd( txt_, ' oSome := QTabWidget():new() ' )
|
||||
aadd( txt_, ' oSome := QTextEdit():new() ' )
|
||||
aadd( txt_, ' oSome := QTimeEdit():new() ' )
|
||||
aadd( txt_, ' oSome := QToolBar():new() ' )
|
||||
aadd( txt_, ' oSome := QToolBox():new() ' )
|
||||
aadd( txt_, ' oSome := QToolButton():new() ' )
|
||||
aadd( txt_, ' oSome := QTreeView():new() ' )
|
||||
aadd( txt_, ' oSome := QTreeWidget():new() ' )
|
||||
aadd( txt_, ' oSome := QTreeWidgetItem():new() ' )
|
||||
aadd( txt_, ' oSome := QVBoxLayout():new() ' )
|
||||
aadd( txt_, ' oSome := QWebPage():new() ' )
|
||||
aadd( txt_, ' oSome := QWebView():new() ' )
|
||||
aadd( txt_, ' oSome := QWidget():new() ' )
|
||||
aadd( txt_, ' oSome := QWizard():new() ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, ' RETURN nil ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, '/*----------------------------------------------------------------------*/ ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, '#define QT_PTROF( oObj ) ( oObj:pPtr ) ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, '#define QT_EVE_TRIGGERED "triggered(bool)" ' )
|
||||
aadd( txt_, '#define QT_EVE_TRIGGERED_B "triggered(bool)" ' )
|
||||
aadd( txt_, '#define QT_EVE_HOVERED "hovered()" ' )
|
||||
aadd( txt_, '#define QT_EVE_CLICKED "clicked()" ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, '/*----------------------------------------------------------------------*/ ' )
|
||||
aadd( txt_, '/* ' )
|
||||
aadd( txt_, ' * A NOTE ' )
|
||||
aadd( txt_, ' * ' )
|
||||
aadd( txt_, ' * This demo is built on auto generated classes by the engine. No attemp ' )
|
||||
aadd( txt_, ' * is exercised to refine the way the code must be written. At this moment ' )
|
||||
aadd( txt_, ' * my emphasis is on testing phase of QT wrapper functions and classes ' )
|
||||
aadd( txt_, ' * generated thereof. In near future the actual implementation will be ' )
|
||||
aadd( txt_, ' * based on the Xbase++ XBPParts compatible framework. You just are ' )
|
||||
aadd( txt_, ' * encouraged to sense the power of QT through this expression. ' )
|
||||
aadd( txt_, ' * ' )
|
||||
aadd( txt_, ' * Pritpal Bedi ' )
|
||||
aadd( txt_, ' */ ' )
|
||||
aadd( txt_, '/*----------------------------------------------------------------------*/ ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, 'INIT PROCEDURE Qt_Start() ' )
|
||||
aadd( txt_, ' qt_qapplication() ' )
|
||||
aadd( txt_, ' /*qt_qapplication_setstyle( QT_PTROF( QWindowsXPStyle():new() ) )*/ ' )
|
||||
aadd( txt_, ' RETURN ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, 'EXIT PROCEDURE Qt_End() ' )
|
||||
aadd( txt_, ' qt_qapplication_exec() ' )
|
||||
aadd( txt_, ' RETURN ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, '/*----------------------------------------------------------------------*/ ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, 'PROCEDURE Main() ' )
|
||||
aadd( txt_, ' Local oLabel ' )
|
||||
aadd( txt_, ' Local oWnd, oSize ' )
|
||||
aadd( txt_, ' Local oMenuBar, pIcon ' )
|
||||
aadd( txt_, ' Local oMenuA, pAction ' )
|
||||
aadd( txt_, ' LOCAL oPS, oPPrv, oMB, oWZ, oCD, oWP, oSBar, oStyle ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, ' oWnd := QMainWindow():new() ' )
|
||||
aadd( txt_, ' oWnd:setWindowTitle( "Testing - QMainWindow, QMenu, QMenuBar and QAction " ) ' )
|
||||
aadd( txt_, ' oWnd:setWindowIcon( "test" ) ' )
|
||||
aadd( txt_, ' pIcon := oWnd:windowIcon() ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, ' /* The method 2 */ ' )
|
||||
aadd( txt_, ' oWnd:resize( 640, 400 ) ' )
|
||||
aadd( txt_, ' #if 0 ' )
|
||||
aadd( txt_, ' /* The method 2 */ ' )
|
||||
aadd( txt_, ' oSize := QSize():new() ' )
|
||||
aadd( txt_, ' oSize:setWidth( 640 ) ' )
|
||||
aadd( txt_, ' oSize:setHeight( 400 ) ' )
|
||||
aadd( txt_, ' oWnd:resize_1( QT_PTROF( oSize ) ) ' )
|
||||
aadd( txt_, ' #endif ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, ' Build_MenuBar( oWnd ) ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, ' oSBar := QStatusBar():new( QT_PTROF( oWnd ) ) ' )
|
||||
aadd( txt_, ' oWnd:setStatusBar( QT_PTROF( oSBar ) ) ' )
|
||||
aadd( txt_, ' oSBar:showMessage( "Harbour-QT Statusbar Ready!" ) ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, ' oStyle := QWindowsXPStyle() ' )
|
||||
aadd( txt_, ' oStyle:standardIcon( 2 ) ' )
|
||||
aadd( txt_, ' oWnd:setStyle( QT_PTROF( oStyle ) ) ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, ' oLabel := QLabel():New( QT_PTROF( oWnd ) ) ' )
|
||||
aadd( txt_, ' oLabel:setText( "Testing Harbour + Qt" ) ' )
|
||||
aadd( txt_, ' oLabel:move( 200,100 ) ' )
|
||||
aadd( txt_, ' oLabel:show() ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, ' oWnd:Show() ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, ' RETURN ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, '/*----------------------------------------------------------------------*/ ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, 'STATIC FUNCTION Build_MenuBar( oWnd ) ' )
|
||||
aadd( txt_, ' LOCAL oMenuBar, oMenu ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, ' oMenuBar := QMenuBar():new( QT_PTROF( oWnd ) ) ' )
|
||||
aadd( txt_, ' oMenuBar:resize( oWnd:width(), 25 ) ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, ' oMenu := QMenu():new( QT_PTROF( oMenuBar ) ) ' )
|
||||
aadd( txt_, ' oMenu:setTitle( "&File" ) ' )
|
||||
aadd( txt_, ' Qt_Connect_Signal( oMenu:addAction_1( "new.png" , "&New" ), QT_EVE_TRIGGERED_B, {|w,l| FileDialog( "New" , w, l ) } ) ' )
|
||||
aadd( txt_, ' Qt_Connect_Signal( oMenu:addAction_1( "open.png", "&Open" ), QT_EVE_TRIGGERED_B, {|w,l| FileDialog( "Open", w, l ) } ) ' )
|
||||
aadd( txt_, ' oMenu:addSeparator() ' )
|
||||
aadd( txt_, ' Qt_Connect_Signal( oMenu:addAction_1( "save.png", "&Save" ), QT_EVE_TRIGGERED_B, {|w,l| FileDialog( "Save", w, l ) } ) ' )
|
||||
aadd( txt_, ' oMenu:addSeparator() ' )
|
||||
aadd( txt_, ' Qt_Connect_Signal( oMenu:addAction( "E&xit" ), QT_EVE_TRIGGERED_B, {|w,l| MsgInfo( "Exit ?" ) } ) ' )
|
||||
aadd( txt_, ' oMenuBar:addMenu( QT_PTROF( oMenu ) ) ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, ' oMenu := QMenu():new( QT_PTROF( oMenuBar ) ) ' )
|
||||
aadd( txt_, ' oMenu:setTitle( "&Dialogs" ) ' )
|
||||
aadd( txt_, ' Qt_Connect_Signal( oMenu:addAction( "&Colors" ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "Colors" , w, l ) } ) ' )
|
||||
aadd( txt_, ' Qt_Connect_Signal( oMenu:addAction( "&Fonts" ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "Fonts" , w, l ) } ) ' )
|
||||
aadd( txt_, ' oMenu:addSeparator() ' )
|
||||
aadd( txt_, ' Qt_Connect_Signal( oMenu:addAction( "&PageSetup" ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "PageSetup", w, l ) } ) ' )
|
||||
aadd( txt_, ' Qt_Connect_Signal( oMenu:addAction( "P&review" ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "Preview" , w, l ) } ) ' )
|
||||
aadd( txt_, ' oMenu:addSeparator() ' )
|
||||
aadd( txt_, ' Qt_Connect_Signal( oMenu:addAction( "&Wizard" ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "Wizard" , w, l ) } ) ' )
|
||||
aadd( txt_, ' Qt_Connect_Signal( oMenu:addAction( "W&ebPage" ), QT_EVE_TRIGGERED_B, {|w,l| Dialogs( "WebPage" , w, l ) } ) ' )
|
||||
aadd( txt_, ' oMenuBar:addMenu( QT_PTROF( oMenu ) ) ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, ' oMenuBar:show() ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, ' RETURN nil ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, '/*----------------------------------------------------------------------*/ ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, 'FUNCTION MsgInfo( cMsg ) ' )
|
||||
aadd( txt_, ' LOCAL oMB ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, ' oMB := QMessageBox():new() ' )
|
||||
aadd( txt_, ' oMB:setInformativeText( cMsg ) ' )
|
||||
aadd( txt_, ' oMB:setWindowTitle( "Harbour-QT" ) ' )
|
||||
aadd( txt_, ' oMB:show() ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, ' RETURN nil ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, '/*----------------------------------------------------------------------*/ ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, 'STATIC FUNCTION FileDialog( cType, w, l ) ' )
|
||||
aadd( txt_, ' LOCAL oFD := QFileDialog():new() ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, ' oFD:setWindowTitle( "Select a File" ) ' )
|
||||
aadd( txt_, ' oFD:show() ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, ' RETURN nil ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, '/*----------------------------------------------------------------------*/ ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, 'STATIC FUNCTION Dialogs( cType, w, l ) ' )
|
||||
aadd( txt_, ' LOCAL oDlg, oUrl ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, ' DO CASE ' )
|
||||
aadd( txt_, ' CASE cType == "PageSetup" ' )
|
||||
aadd( txt_, ' oDlg := QPageSetupDialog():new() ' )
|
||||
aadd( txt_, ' oDlg:setWindowTitle( "Harbour-QT PageSetup Dialog" ) ' )
|
||||
aadd( txt_, ' oDlg:show() ' )
|
||||
aadd( txt_, ' CASE cType == "Preview" ' )
|
||||
aadd( txt_, ' oDlg := QPrintPreviewDialog():new() ' )
|
||||
aadd( txt_, ' oDlg:setWindowTitle( "Harbour-QT Preview Dialog" ) ' )
|
||||
aadd( txt_, ' oDlg:show() ' )
|
||||
aadd( txt_, ' CASE cType == "Wizard" ' )
|
||||
aadd( txt_, ' oDlg := QWizard():new() ' )
|
||||
aadd( txt_, ' oDlg:setWindowTitle( "Harbour-QT Wizard to Show Slides etc." ) ' )
|
||||
aadd( txt_, ' oDlg:show() ' )
|
||||
aadd( txt_, ' CASE cType == "Colors" ' )
|
||||
aadd( txt_, ' oDlg := QColorDialog():new() ' )
|
||||
aadd( txt_, ' oDlg:setWindowTitle( "Harbour-QT Color Selection Dialog" ) ' )
|
||||
aadd( txt_, ' oDlg:show() ' )
|
||||
aadd( txt_, ' CASE cType == "WebPage" ' )
|
||||
aadd( txt_, ' oDlg := QWebView():new() ' )
|
||||
aadd( txt_, ' oUrl := QUrl():new() ' )
|
||||
aadd( txt_, ' oUrl:setUrl( "http://www.harbour.vouch.info" ) ' )
|
||||
aadd( txt_, ' QT_QWebView_SetUrl( QT_PTROF( oDlg ), QT_PTROF( oUrl ) ) ' )
|
||||
aadd( txt_, ' oDlg:setWindowTitle( "Harbour-QT Web Page Navigator" ) ' )
|
||||
aadd( txt_, ' oDlg:show() ' )
|
||||
aadd( txt_, ' CASE cType == "Fonts" ' )
|
||||
aadd( txt_, ' oDlg := QFontDialog():new() ' )
|
||||
aadd( txt_, ' oDlg:setWindowTitle( "Harbour-QT Font Selector" ) ' )
|
||||
aadd( txt_, ' oDlg:show() ' )
|
||||
aadd( txt_, ' ENDCASE ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, ' RETURN nil ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, '/*----------------------------------------------------------------------*/ ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, 'PROCEDURE hb_GtSys() ' )
|
||||
aadd( txt_, ' HB_GT_GUI_DEFAULT() ' )
|
||||
aadd( txt_, ' RETURN ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, '/*----------------------------------------------------------------------*/ ' )
|
||||
aadd( txt_, '/* ' )
|
||||
aadd( txt_, ' * Just to Link Every New Widget ' )
|
||||
aadd( txt_, ' */ ' )
|
||||
aadd( txt_, 'STATIC FUNCTION Dummies() ' )
|
||||
aadd( txt_, ' LOCAL oSome ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, ' oSome := QAction():new() ' )
|
||||
aadd( txt_, ' oSome := QBoxLayout():new() ' )
|
||||
aadd( txt_, ' oSome := QCalendarWidget():new() ' )
|
||||
aadd( txt_, ' oSome := QCheckBox():new() ' )
|
||||
aadd( txt_, ' oSome := QColorDialog():new() ' )
|
||||
aadd( txt_, ' oSome := QComboBox():new() ' )
|
||||
aadd( txt_, ' oSome := QCommandLinkButton():new() ' )
|
||||
aadd( txt_, ' oSome := QDateEdit():new() ' )
|
||||
aadd( txt_, ' oSome := QDateTimeEdit():new() ' )
|
||||
aadd( txt_, ' oSome := QDial():new() ' )
|
||||
aadd( txt_, ' oSome := QDialog():new() ' )
|
||||
aadd( txt_, ' oSome := QDoubleSpinBox():new() ' )
|
||||
aadd( txt_, ' oSome := QErrorMessage():new() ' )
|
||||
aadd( txt_, ' oSome := QFileDialog():new() ' )
|
||||
aadd( txt_, ' oSome := QFocusFrame():new() ' )
|
||||
aadd( txt_, ' oSome := QFontComboBox():new() ' )
|
||||
aadd( txt_, ' oSome := QFontDialog():new() ' )
|
||||
aadd( txt_, ' oSome := QFormLayout():new() ' )
|
||||
aadd( txt_, ' oSome := QFrame():new() ' )
|
||||
aadd( txt_, ' oSome := QGroupBox():new() ' )
|
||||
aadd( txt_, ' oSome := QHBoxLayout():new() ' )
|
||||
aadd( txt_, ' oSome := QInputDialog():new() ' )
|
||||
aadd( txt_, ' oSome := QLabel():new() ' )
|
||||
aadd( txt_, ' oSome := QLayout():new() ' )
|
||||
aadd( txt_, ' oSome := QLayoutItem():new() ' )
|
||||
aadd( txt_, ' oSome := QLCDNumber():new() ' )
|
||||
aadd( txt_, ' oSome := QLineEdit():new() ' )
|
||||
aadd( txt_, ' oSome := QListView():new() ' )
|
||||
aadd( txt_, ' oSome := QMainWindow():new() ' )
|
||||
aadd( txt_, ' oSome := QMenu():new() ' )
|
||||
aadd( txt_, ' oSome := QMenuBar():new() ' )
|
||||
aadd( txt_, ' oSome := QMessageBox():new() ' )
|
||||
aadd( txt_, ' oSome := QObject():new() ' )
|
||||
aadd( txt_, ' oSome := QPageSetupDialog():new() ' )
|
||||
aadd( txt_, ' oSome := QPaintDevice():new() ' )
|
||||
aadd( txt_, ' oSome := QPainter():new() ' )
|
||||
aadd( txt_, ' oSome := QPrintDialog():new() ' )
|
||||
aadd( txt_, ' oSome := QPrintPreviewDialog():new() ' )
|
||||
aadd( txt_, ' oSome := QProgressBar():new() ' )
|
||||
aadd( txt_, ' oSome := QProgressDialog():New() ' )
|
||||
aadd( txt_, ' oSome := QPushButton():new() ' )
|
||||
aadd( txt_, ' oSome := QRadioButton():new() ' )
|
||||
aadd( txt_, ' oSome := QScrollArea():new() ' )
|
||||
aadd( txt_, ' oSome := QScrollBar():new() ' )
|
||||
aadd( txt_, ' oSome := QSizeGrip():new() ' )
|
||||
aadd( txt_, ' oSome := QSlider():new() ' )
|
||||
aadd( txt_, ' oSome := QSpinBox():new() ' )
|
||||
aadd( txt_, ' oSome := QSplitter():new() ' )
|
||||
aadd( txt_, ' oSome := QTabBar():new() ' )
|
||||
aadd( txt_, ' oSome := QTableView():new() ' )
|
||||
aadd( txt_, ' oSome := QTableWidget():new() ' )
|
||||
aadd( txt_, ' oSome := QTableWidgetItem():new() ' )
|
||||
aadd( txt_, ' oSome := QTabWidget():new() ' )
|
||||
aadd( txt_, ' oSome := QTextEdit():new() ' )
|
||||
aadd( txt_, ' oSome := QTimeEdit():new() ' )
|
||||
aadd( txt_, ' oSome := QToolBar():new() ' )
|
||||
aadd( txt_, ' oSome := QToolBox():new() ' )
|
||||
aadd( txt_, ' oSome := QToolButton():new() ' )
|
||||
aadd( txt_, ' oSome := QTreeView():new() ' )
|
||||
aadd( txt_, ' oSome := QTreeWidget():new() ' )
|
||||
aadd( txt_, ' oSome := QTreeWidgetItem():new() ' )
|
||||
aadd( txt_, ' oSome := QVBoxLayout():new() ' )
|
||||
aadd( txt_, ' oSome := QWebPage():new() ' )
|
||||
aadd( txt_, ' oSome := QWebView():new() ' )
|
||||
aadd( txt_, ' oSome := QWidget():new() ' )
|
||||
aadd( txt_, ' oSome := QWizard():new() ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, ' RETURN nil ' )
|
||||
aadd( txt_, ' ' )
|
||||
aadd( txt_, '/*----------------------------------------------------------------------*/ ' )
|
||||
aadd( txt_, ' ' )
|
||||
|
||||
RETURN CreateTarget( cFile, txt_ )
|
||||
|
||||
|
||||
Reference in New Issue
Block a user