2011-05-04 18:40 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
* contrib/hbxbp/xbpappevent.prg
* contrib/hbxbp/xbpdialog.prg
* contrib/hbxbp/xbpgeneric.prg
* contrib/hbxbp/xbppushbutton.prg
* contrib/hbxbp/xbpsle.prg
+ Implemented: XbpPushButton() now understands <ENTER> pressed.
: XbpSLe() now responds to <ENTER> key which simulates
windows equivalent TAB key.
! Rationalized: event loop, now no delays in processing.
With this commit, you can experiment with real applications.
Angel, can you re-visit the application you had sent to the
list almost an year back ?
This commit is contained in:
@@ -16,6 +16,21 @@
|
||||
The license applies to all entries newer than 2009-04-28.
|
||||
*/
|
||||
|
||||
2011-05-04 18:40 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
|
||||
* contrib/hbxbp/xbpappevent.prg
|
||||
* contrib/hbxbp/xbpdialog.prg
|
||||
* contrib/hbxbp/xbpgeneric.prg
|
||||
* contrib/hbxbp/xbppushbutton.prg
|
||||
* contrib/hbxbp/xbpsle.prg
|
||||
+ Implemented: XbpPushButton() now understands <ENTER> pressed.
|
||||
: XbpSLe() now responds to <ENTER> key which simulates
|
||||
windows equivalent TAB key.
|
||||
! Rationalized: event loop, now no delays in processing.
|
||||
|
||||
With this commit, you can experiment with real applications.
|
||||
Angel, can you re-visit the application you had sent to the
|
||||
list almost an year back ?
|
||||
|
||||
2011-05-04 12:39 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
|
||||
* contrib/hbxbp/xbpdialog.prg
|
||||
* contrib/hbxbp/xbpwindow.prg
|
||||
|
||||
@@ -530,6 +530,7 @@ FUNCTION hbxbp_appEventToQKeyEvent( key )
|
||||
CASE xbeK_CTRL_ENTER
|
||||
RETURN Qt_Key_Enter
|
||||
CASE xbeK_TAB
|
||||
RETURN Qt_Key_Tab
|
||||
CASE xbeK_SH_TAB
|
||||
RETURN Qt_Key_Backtab
|
||||
CASE xbeK_CTRL_TAB
|
||||
|
||||
@@ -279,7 +279,6 @@ METHOD XbpDialog:destroy()
|
||||
|
||||
METHOD XbpDialog:execEvent( nEvent, pEvent )
|
||||
|
||||
HB_SYMBOL_UNUSED( pEvent )
|
||||
DO CASE
|
||||
|
||||
CASE nEvent == QEvent_WindowActivate
|
||||
|
||||
@@ -221,24 +221,26 @@ FUNCTION AppEvent( mp1, mp2, oXbp, nTimeout )
|
||||
|
||||
HB_SYMBOL_UNUSED( nTimeOut )
|
||||
|
||||
DO WHILE ! empty( t_oEventLoop )
|
||||
t_oEventLoop:processEvents( QEventLoop_AllEvents )
|
||||
t_oEventLoop:processEvents( QEventLoop_AllEvents )
|
||||
|
||||
IF ! empty( t_events )
|
||||
nEvent := t_events[ 1, 1 ]
|
||||
mp1 := t_events[ 1, 2 ]
|
||||
mp2 := t_events[ 1, 3 ]
|
||||
oXbp := t_events[ 1, 4 ]
|
||||
IF ! empty( t_events )
|
||||
nEvent := t_events[ 1, 1 ]
|
||||
mp1 := t_events[ 1, 2 ]
|
||||
mp2 := t_events[ 1, 3 ]
|
||||
oXbp := t_events[ 1, 4 ]
|
||||
|
||||
hb_adel( t_events, 1, .t. )
|
||||
hb_adel( t_events, 1, .t. )
|
||||
|
||||
EXIT
|
||||
ENDIF
|
||||
ELSE
|
||||
oXbp := SetAppWindow()
|
||||
|
||||
hb_releaseCPU()
|
||||
ENDDO
|
||||
ENDIF
|
||||
|
||||
s_hLastEvent[ hb_threadID() ] := { nEvent, mp1, mp2, oXbp }
|
||||
hb_releaseCPU()
|
||||
|
||||
IF nEvent != 0
|
||||
s_hLastEvent[ hb_threadID() ] := { nEvent, mp1, mp2, oXbp }
|
||||
ENDIF
|
||||
|
||||
RETURN nEvent
|
||||
|
||||
|
||||
@@ -143,9 +143,9 @@ METHOD XbpPushButton:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible
|
||||
METHOD XbpPushButton:execSlot( cSlot, p )
|
||||
|
||||
DO CASE
|
||||
CASE cSlot == "clicked()" // .OR. cSlot == "pressed()"
|
||||
CASE cSlot == "clicked()"
|
||||
::activate()
|
||||
CASE cSlot == "keyPressed()"
|
||||
CASE cSlot == "QEvent_KeyPress"
|
||||
IF hbxbp_QKeyEventToAppEvent( p ) == xbeK_ENTER
|
||||
::oWidget:click()
|
||||
ENDIF
|
||||
@@ -166,13 +166,15 @@ METHOD XbpPushButton:handleEvent( nEvent, mp1, mp2 )
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD XbpPushButton:connect()
|
||||
::oWidget:connect( "clicked()", {|| ::execSlot( "clicked()" ) } )
|
||||
::oWidget:connect( "clicked()" , {|| ::execSlot( "clicked()" ) } )
|
||||
::oWidget:connect( QEvent_KeyPress, {|e| ::execSlot( "QEvent_KeyPress", e ) } )
|
||||
RETURN Self
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
METHOD XbpPushButton:disconnect()
|
||||
::oWidget:disconnect( "clicked()" )
|
||||
::oWidget:disconnect( QEvent_KeyPress )
|
||||
RETURN Self
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
@@ -219,7 +219,7 @@ METHOD XbpSLE:execSlot( cSlot, p, p2 )
|
||||
|
||||
CASE cSlot == "returnPressed()"
|
||||
::sl_editBuffer := ::oWidget:text()
|
||||
::returnPressed()
|
||||
PostAppEvent( xbeP_Keyboard, xbeK_TAB, NIL, Self )
|
||||
|
||||
CASE cSlot == "selectionChanged()"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user