2012-10-05 02:40 UTC+0200 Viktor Szakats (harbour syenar.net)

* contrib/gtwvg/*.prg
    * formatted using hbformat, critical manual fixups
    ; TOFIX: hbformat breaks code like this:
         FUNCTION Hello( /* comment */ )

  * contrib/gtwvg/tests/*.prg
    * formatted using hbformat, manual fixups

  * extras/gtwvw/*.c
  * extras/gtwvw/*.h
    * formatted using uncrustify + hbc.cfg
This commit is contained in:
Viktor Szakats
2012-10-05 00:44:28 +00:00
parent 6494f1b54a
commit 4b69cde522
51 changed files with 14364 additions and 14364 deletions

View File

@@ -16,6 +16,19 @@
The license applies to all entries newer than 2009-04-28.
*/
2012-10-05 02:40 UTC+0200 Viktor Szakats (harbour syenar.net)
* contrib/gtwvg/*.prg
* formatted using hbformat, critical manual fixups
; TOFIX: hbformat breaks code like this:
FUNCTION Hello( /* comment */ )
* contrib/gtwvg/tests/*.prg
* formatted using hbformat, manual fixups
* extras/gtwvw/*.c
* extras/gtwvw/*.h
* formatted using uncrustify + hbc.cfg
2012-10-05 01:18 UTC+0200 Viktor Szakats (vszakats syenar.net)
- extras/gtwvw/readme.txt
- empty file deleted

View File

@@ -49,6 +49,7 @@
* If you do not wish that, delete this exception notice.
*
*/
//
//
//
@@ -101,7 +102,8 @@ CLASS Wvg3State INHERIT WvgWindow, WvgDataRef
METHOD handleEvent( nMessage, aNM )
ENDCLASS
ENDCLASS
//
METHOD Wvg3State:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
@@ -148,7 +150,7 @@ METHOD Wvg3State:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
METHOD Wvg3State:handleEvent( nMessage, aNM )
hb_traceLog( " %s:handleEvent( %i )", __ObjGetClsName( self ), nMessage )
hb_traceLog( " %s:handleEvent( %i )", __objGetClsName( self ), nMessage )
DO CASE
@@ -157,7 +159,7 @@ METHOD Wvg3State:handleEvent( nMessage, aNM )
::editBuffer := WVG_Button_GetCheck( ::hWnd )
IF HB_ISBLOCK( ::sl_lbClick )
eval( ::sl_lbClick, ::editBuffer, NIL, self )
Eval( ::sl_lbClick, ::editBuffer, NIL, self )
RETURN 0
ENDIF

View File

@@ -50,6 +50,7 @@
* If you do not wish that, delete this exception notice.
*
*/
//
//
//
@@ -90,7 +91,7 @@ CLASS WvgActiveXControl FROM WvgWindow
DATA server INIT NIL
DATA license INIT NIL
DATA controlFlags INIT 0
DATA default INIT .F.
DATA DEFAULT INIT .F.
DATA cancel INIT .F.
DATA interface
@@ -125,7 +126,7 @@ CLASS WvgActiveXControl FROM WvgWindow
ERROR HANDLER OnError
ENDCLASS
ENDCLASS
//
@@ -143,6 +144,7 @@ METHOD WvgActiveXControl:new( oParent, oOwner, aPos, aSize, aPresParams, lVisibl
//
METHOD WvgActiveXControl:Create( oParent, oOwner, aPos, aSize, aPresParams, lVisible, cCLSID, cLicense )
LOCAL hObj, hWnd
::WvgWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
@@ -165,15 +167,15 @@ METHOD WvgActiveXControl:Create( oParent, oOwner, aPos, aSize, aPresParams, lVis
Win_AxInit()
hWnd := WAPI_CreateWindowEX( ::exStyle, "AtlAxWin", ::CLSID, ::style, ::aPos[ 1 ], ::aPos[ 2 ], ;
::aSize[ 1 ], ::aSize[ 2 ], Win_N2P( ::hContainer ), 0 )
IF empty( hWnd )
::aSize[ 1 ], ::aSize[ 2 ], Win_N2P( ::hContainer ), 0 )
IF Empty( hWnd )
RETURN NIL
ENDIF
::hWnd := Win_P2N( hWnd )
::pWnd := hWnd
hObj := __AxGetControl( ::pWnd )
if empty( hObj )
IF Empty( hObj )
RETURN NIL
ENDIF
::oOLE:__hObj := hObj
@@ -203,16 +205,18 @@ METHOD WvgActiveXControl:Create( oParent, oOwner, aPos, aSize, aPresParams, lVis
//
PROCEDURE execEvent( nEvent, ... ) CLASS WvgActiveXControl
#if 0
LOCAL cEvents := HB_ValToStr( nEvent ) + ", "
LOCAL cEvents := hb_ValToStr( nEvent ) + ", "
LOCAL aEvents := { ... }
aEval( aEvents, {| xEvent | cEvents += HB_ValToStr( xEvent ) + ", " } )
hb_TraceLog( cEvents )
AEval( aEvents, {| xEvent | cEvents += hb_ValToStr( xEvent ) + ", " } )
hb_traceLog( cEvents )
#endif
IF hb_hHaskey( ::hEvents, nEvent )
eval( ::hEvents[ nEvent ], ... )
IF hb_HHasKey( ::hEvents, nEvent )
Eval( ::hEvents[ nEvent ], ... )
ENDIF
RETURN
@@ -220,6 +224,7 @@ PROCEDURE execEvent( nEvent, ... ) CLASS WvgActiveXControl
//
METHOD WvgActiveXControl:handleEvent( nEvent, aNM )
LOCAL nHandled := 0
HB_SYMBOL_UNUSED( aNM )
@@ -231,7 +236,7 @@ METHOD WvgActiveXControl:handleEvent( nEvent, aNM )
::rePosition()
ENDIF
IF HB_ISBLOCK( ::sl_resize )
eval( ::sl_resize, NIL, NIL, Self )
Eval( ::sl_resize, NIL, NIL, Self )
ENDIF
EXIT
@@ -245,16 +250,19 @@ METHOD WvgActiveXControl:handleEvent( nEvent, aNM )
//
METHOD WvgActiveXControl:OnError()
#if 0
hb_TraceLog( "HI: " + HB_ValToStr( __GetMessage() ) + " : " + str( len( HB_AParams() ) ) )
hb_traceLog( "HI: " + hb_ValToStr( __GetMessage() ) + " : " + Str( Len( hb_AParams() ) ) )
#endif
RETURN HB_ExecFromArray( ::oOLE, __GetMessage(), HB_AParams() )
RETURN hb_ExecFromArray( ::oOLE, __GetMessage(), hb_AParams() )
//
METHOD WvgActiveXControl:Destroy()
IF ! empty( ::oOLE:__hObj )
IF ! Empty( ::oOLE:__hObj )
IF WAPI_IsWindow( ::pWnd )
WAPI_DestroyWindow( ::pWnd )
ENDIF
@@ -277,63 +285,75 @@ METHOD WvgActiveXControl:mapEvent( nEvent, bBlock )
//
METHOD WvgActiveXControl:inheritPresParams()
Local lSuccess := .T.
LOCAL lSuccess := .T.
RETURN lSuccess
//
METHOD WvgActiveXControl:presParamsChanged()
RETURN Self
//
METHOD WvgActiveXControl:setInputFocus()
RETURN Self
//
METHOD WvgActiveXControl:subscribeStdEvents()
RETURN NIL
//
METHOD WvgActiveXControl:unsubscribeStdEvents()
RETURN Self
//
METHOD WvgActiveXControl:keyDown()
RETURN Self
//
METHOD WvgActiveXControl:click()
RETURN Self
//
METHOD WvgActiveXControl:dblClick()
RETURN Self
//
METHOD WvgActiveXControl:mouseDown()
RETURN Self
//
METHOD WvgActiveXControl:mouseUp()
RETURN Self
//
METHOD WvgActiveXControl:mouseMove()
RETURN Self
//
METHOD WvgActiveXControl:activate()
RETURN Self
//

View File

@@ -49,6 +49,7 @@
* If you do not wish that, delete this exception notice.
*
*/
//
//
//
@@ -112,7 +113,7 @@ CLASS WvgBitmap
METHOD getPicture() VIRTUAL
METHOD setPicture() VIRTUAL
ENDCLASS
ENDCLASS
//

View File

@@ -49,6 +49,7 @@
* If you do not wish that, delete this exception notice.
*
*/
//
//
//
@@ -89,17 +90,18 @@ CLASS WvgCheckBox INHERIT WvgWindow, WvgDataRef
METHOD destroy()
METHOD handleEvent( nMessage, aNM )
#if 0
#if 0
METHOD editBuffer() INLINE ( WVG_Button_GetCheck( ::hWnd ) == BST_CHECKED )
METHOD getData() INLINE ( WVG_Button_GetCheck( ::hWnd ) == BST_CHECKED )
METHOD setData( lCheck ) INLINE ::sendMessage( BM_SETCHECK, iif( lCheck, BST_CHECKED, BST_UNCHECKED ), 0 )
#endif
#endif
METHOD setCaption( xCaption )
ACCESS selected INLINE ::sl_lbClick
ASSIGN selected( bBlock ) INLINE ::sl_lbClick := bBlock
ENDCLASS
ENDCLASS
//
METHOD WvgCheckBox:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
@@ -158,7 +160,7 @@ METHOD WvgCheckBox:handleEvent( nMessage, aNM )
IF ::isParentCrt()
::oParent:setFocus()
ENDIF
eval( ::sl_lbClick, ::editBuffer, NIL, Self )
Eval( ::sl_lbClick, ::editBuffer, NIL, Self )
IF ::pointerFocus
::setFocus()
ENDIF
@@ -184,7 +186,7 @@ METHOD WvgCheckBox:handleEvent( nMessage, aNM )
::oParent:setFocus()
::sendMessage( BM_SETCHECK, iif( WVG_Button_GetCheck( ::hWnd ) == BST_CHECKED, BST_UNCHECKED, BST_CHECKED ), 0 )
::editBuffer := ( WVG_Button_GetCheck( ::hWnd ) == BST_CHECKED )
eval( ::sl_lbClick, NIL, NIL, Self )
Eval( ::sl_lbClick, NIL, NIL, Self )
ENDIF
ENDIF
ENDIF
@@ -197,13 +199,17 @@ METHOD WvgCheckBox:handleEvent( nMessage, aNM )
//
METHOD WvgCheckBox:destroy()
::wvgWindow:destroy()
RETURN NIL
//
METHOD WvgCheckBox:configure( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::Initialize( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
RETURN Self
//

File diff suppressed because it is too large Load Diff

View File

@@ -49,6 +49,7 @@
* If you do not wish that, delete this exception notice.
*
*/
//
//
//
@@ -78,7 +79,7 @@
CLASS WvgComboBox INHERIT WvgWindow, WvgDataRef
DATA type INIT WVGCOMBO_DROPDOWN
DATA TYPE INIT WVGCOMBO_DROPDOWN
DATA drawMode INIT WVG_DRAW_NORMAL
DATA nCurSelected INIT 0
@@ -96,10 +97,10 @@ CLASS WvgComboBox INHERIT WvgWindow, WvgDataRef
METHOD sleSize()
METHOD addItem( cItem )
METHOD clear() INLINE ::sendCBMessage( CB_RESETCONTENT )
METHOD delItem( nIndex ) INLINE ::sendCBMessage( CB_DELETESTRING, nIndex-1 )
METHOD getItem( nIndex ) INLINE ::sendCBMessage( CB_GETLBTEXT, nIndex-1 )
METHOD insItem( nIndex, cItem ) INLINE ::sendCBMessage( CB_INSERTSTRING, nIndex-1, cItem )
METHOD CLEAR() INLINE ::sendCBMessage( CB_RESETCONTENT )
METHOD delItem( nIndex ) INLINE ::sendCBMessage( CB_DELETESTRING, nIndex - 1 )
METHOD getItem( nIndex ) INLINE ::sendCBMessage( CB_GETLBTEXT, nIndex - 1 )
METHOD insItem( nIndex, cItem ) INLINE ::sendCBMessage( CB_INSERTSTRING, nIndex - 1, cItem )
METHOD setItem( nIndex, cItem ) VIRTUAL
METHOD setIcon( nItem, cIcon )
@@ -116,7 +117,7 @@ CLASS WvgComboBox INHERIT WvgWindow, WvgDataRef
METHOD itemSelected( ... ) SETGET
METHOD drawItem( ... ) SETGET
ENDCLASS
ENDCLASS
//
@@ -125,7 +126,7 @@ METHOD WvgComboBox:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::wvgWindow:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::style := WS_CHILD + WS_TABSTOP + WS_BORDER + WS_VSCROLL + CBS_NOINTEGRALHEIGHT + CBS_AUTOHSCROLL
//::exStyle := WS_EX_CLIENTEDGE
//::exStyle := WS_EX_CLIENTEDGE
::className := "COMBOBOX"
::objType := objTypeComboBox
@@ -160,7 +161,7 @@ METHOD WvgComboBox:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::setPosAndSize()
/* Build SLE and ListBox Part - May not be available for all Windows Versions - How to handle then ? */
IF ! empty( ::aInfo := ::sendCBMessage( CB_GETCOMBOBOXINFO ) )
IF ! Empty( ::aInfo := ::sendCBMessage( CB_GETCOMBOBOXINFO ) )
::oSLE := WvgSLE():new()
::oSLE:oParent := Self
::oSLE:hWnd := ::aInfo[ 5 ]
@@ -177,13 +178,17 @@ METHOD WvgComboBox:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
//
METHOD WvgComboBox:configure( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::Initialize( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
RETURN Self
//
METHOD WvgComboBox:destroy()
#if 0
IF HB_ISOBJECT( ::oSLE )
::oSLE:destroy()
ENDIF
@@ -192,6 +197,7 @@ METHOD WvgComboBox:destroy()
ENDIF
#endif
::wvgWindow:destroy()
RETURN NIL
//
@@ -208,7 +214,7 @@ METHOD WvgComboBox:handleEvent( nMessage, aNM )
CASE nMessage == HB_GTE_COMMAND
IF aNM[ 1 ] == CBN_SELCHANGE
::nCurSelected := ::editBuffer := WVG_LBGetCurSel( ::hWnd )+ 1
::nCurSelected := ::editBuffer := WVG_LBGetCurSel( ::hWnd ) + 1
IF ::isParentCrt()
::oParent:setFocus()
ENDIF
@@ -275,11 +281,12 @@ METHOD WvgComboBox:addItem( cItem )
RETURN ::sendCBMessage( CB_ADDSTRING, cItem )
ENDIF
RETURN -1
RETURN - 1
//
METHOD WvgComboBox:listBoxFocus( lFocus )
LOCAL lOldFocus := ::sendCBMessage( CB_GETDROPPEDSTATE )
IF HB_ISLOGICAL( lFocus )
@@ -296,7 +303,7 @@ METHOD WvgComboBox:sleSize()
RETURN ::oSLE:currentSize()
ENDIF
RETURN {0,0}
RETURN { 0, 0 }
//
@@ -306,44 +313,55 @@ METHOD WvgComboBox:listBoxSize()
RETURN ::oListBox:currentSize()
ENDIF
RETURN {0,0}
RETURN { 0, 0 }
//
METHOD WvgComboBox:setIcon( nItem, cIcon )
HB_SYMBOL_UNUSED( nItem )
HB_SYMBOL_UNUSED( cIcon )
RETURN Self
//
METHOD WvgComboBox:itemMarked( ... )
LOCAL a_:= hb_aParams()
IF len( a_ ) == 1 .AND. HB_ISBLOCK( a_[ 1 ] )
LOCAL a_ := hb_AParams()
IF Len( a_ ) == 1 .AND. HB_ISBLOCK( a_[ 1 ] )
::sl_itemMarked := a_[ 1 ]
ELSEIF len( a_ ) >= 0 .AND. HB_ISBLOCK( ::sl_itemMarked )
eval( ::sl_itemMarked, NIL, NIL, Self )
ELSEIF Len( a_ ) >= 0 .AND. HB_ISBLOCK( ::sl_itemMarked )
Eval( ::sl_itemMarked, NIL, NIL, Self )
ENDIF
RETURN Self
//
METHOD WvgComboBox:itemSelected( ... )
LOCAL a_:= hb_aParams()
IF len( a_ ) == 1 .AND. HB_ISBLOCK( a_[ 1 ] )
LOCAL a_ := hb_AParams()
IF Len( a_ ) == 1 .AND. HB_ISBLOCK( a_[ 1 ] )
::sl_itemSelected := a_[ 1 ]
ELSEIF len( a_ ) >= 0 .AND. HB_ISBLOCK( ::sl_itemSelected )
eval( ::sl_itemSelected, NIL, NIL, Self )
ELSEIF Len( a_ ) >= 0 .AND. HB_ISBLOCK( ::sl_itemSelected )
Eval( ::sl_itemSelected, NIL, NIL, Self )
ENDIF
RETURN Self
//
METHOD WvgComboBox:drawItem( ... )
LOCAL a_:= hb_aParams()
IF len( a_ ) == 1 .AND. HB_ISBLOCK( a_[ 1 ] )
LOCAL a_ := hb_AParams()
IF Len( a_ ) == 1 .AND. HB_ISBLOCK( a_[ 1 ] )
::sl_xbePDrawItem := a_[ 1 ]
ELSEIF len( a_ ) >= 2 .AND. HB_ISBLOCK( ::sl_xbePDrawItem )
eval( ::sl_xbePDrawItem, a_[ 1 ], a_[ 2 ], Self )
ELSEIF Len( a_ ) >= 2 .AND. HB_ISBLOCK( ::sl_xbePDrawItem )
Eval( ::sl_xbePDrawItem, a_[ 1 ], a_[ 2 ], Self )
ENDIF
RETURN Self

View File

@@ -49,18 +49,19 @@
* If you do not wish that, delete this exception notice.
*
*/
//
//
//
*
* EkOnkar
* ( The LORD is ONE )
*
* Xbase++ Compatible xbpCrt Class
*
* Pritpal Bedi <pritpal@vouchcac.com>
* 08Nov2008
*
//
// EkOnkar
// ( The LORD is ONE )
//
// Xbase++ Compatible xbpCrt Class
//
// Pritpal Bedi <pritpal@vouchcac.com>
// 08Nov2008
//
//
//
//
@@ -157,7 +158,7 @@ CLASS WvgCrt INHERIT WvgWindow, WvgPartHandler
/* HARBOUR implementation */
DATA resizable INIT .T.
DATA resizeMode INIT HB_GTI_RESIZEMODE_FONT
DATA style INIT (WS_OVERLAPPED + WS_CAPTION + WS_SYSMENU + WS_SIZEBOX + WS_MINIMIZEBOX + WS_MAXIMIZEBOX)
DATA style INIT ( WS_OVERLAPPED + WS_CAPTION + WS_SYSMENU + WS_SIZEBOX + WS_MINIMIZEBOX + WS_MAXIMIZEBOX )
DATA exStyle INIT 0
DATA lModal INIT .F.
DATA pGTp
@@ -166,8 +167,8 @@ CLASS WvgCrt INHERIT WvgWindow, WvgPartHandler
DATA ClassName INIT "WVGCRT"
DATA drawingArea
DATA hWnd
DATA aPos INIT { 0,0 }
DATA aSize INIT { 24,79 }
DATA aPos INIT { 0, 0 }
DATA aSize INIT { 24, 79 }
DATA aPresParams INIT {}
DATA lHasInputFocus INIT .F.
DATA nFrameState INIT 0 /* normal */
@@ -238,9 +239,9 @@ CLASS WvgCrt INHERIT WvgWindow, WvgPartHandler
METHOD rbDown( xParam ) SETGET
METHOD rbUp( xParam ) SETGET
METHOD wheel( xParam ) SETGET
METHOD close( xParam ) SETGET
METHOD CLOSE( xParam ) SETGET
METHOD helpRequest( xParam ) SETGET
METHOD keyboard( xParam ) SETGET
METHOD KEYBOARD( xParam ) SETGET
METHOD killDisplayFocus( xParam ) SETGET
METHOD killInputFocus( xParam ) SETGET
METHOD move( xParam ) SETGET
@@ -254,10 +255,10 @@ CLASS WvgCrt INHERIT WvgWindow, WvgPartHandler
METHOD dragLeave( xParam ) SETGET
METHOD dragDrop( xParam, xParam1 ) SETGET
ENDCLASS
ENDCLASS
//
* Instance Initiation
// Instance Initiation
//
METHOD WvgCrt:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
@@ -283,11 +284,12 @@ METHOD WvgCrt:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
RETURN Self
//
* Life Cycle
// Life Cycle
//
METHOD WvgCrt:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
Local lRowCol := .T.
LOCAL lRowCol := .T.
DEFAULT oParent TO ::oParent
DEFAULT oOwner TO ::oOwner
@@ -316,8 +318,8 @@ METHOD WvgCrt:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::pGT := hb_gtSelect()
ENDIF
HB_GtInfo( HB_GTI_NOTIFIERBLOCKGUI, {| nEvent, ... | ::notifier( nEvent, ... ) } )
HB_GtInfo( HB_GTI_NOTIFIERBLOCK , {| nEvent, ... | ::notifierBlock( nEvent, ... ) } )
hb_gtInfo( HB_GTI_NOTIFIERBLOCKGUI, {| nEvent, ... | ::notifier( nEvent, ... ) } )
hb_gtInfo( HB_GTI_NOTIFIERBLOCK , {| nEvent, ... | ::notifierBlock( nEvent, ... ) } )
IF ::lModal
::style := WS_POPUP + WS_CAPTION + WS_SYSMENU
@@ -328,13 +330,13 @@ METHOD WvgCrt:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
hb_gtInfo( HB_GTI_RESIZABLE, ::resizable )
hb_gtInfo( HB_GTI_PRESPARAMS, { ::exStyle, ::style, ::aPos[ 1 ], ::aPos[ 2 ], ;
::maxRow+1, ::maxCol+1, ::pGTp, .F., lRowCol, HB_WNDTYPE_CRT } )
::maxRow + 1, ::maxCol + 1, ::pGTp, .F. , lRowCol, HB_WNDTYPE_CRT } )
hb_gtInfo( HB_GTI_SETFONT, { ::fontName, ::fontHeight, ::fontWidth } )
IF HB_ISNUMERIC( ::icon )
hb_gtInfo( HB_GTI_ICONRES, ::icon )
ELSE
IF ( ".ico" $ lower( ::icon ) )
IF ( ".ico" $ Lower( ::icon ) )
hb_gtInfo( HB_GTI_ICONFILE, ::icon )
ELSE
hb_gtInfo( HB_GTI_ICONRES, ::icon )
@@ -346,7 +348,7 @@ METHOD WvgCrt:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::hWnd := hb_gtInfo( HB_GTI_SPEC, HB_GTS_WINDOWHANDLE )
::setFocus()
Hb_GtInfo( HB_GTI_CLOSABLE , ::closable )
hb_gtInfo( HB_GTI_CLOSABLE , ::closable )
hb_gtInfo( HB_GTI_WINTITLE , ::title )
hb_gtInfo( HB_GTI_RESIZEMODE, iif( ::resizeMode == HB_GTI_RESIZEMODE_ROWS, HB_GTI_RESIZEMODE_ROWS, HB_GTI_RESIZEMODE_FONT ) )
@@ -355,7 +357,7 @@ METHOD WvgCrt:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
ENDIF
IF ::visible
Hb_GtInfo( HB_GTI_SPEC, HB_GTS_SHOWWINDOW, SW_NORMAL )
hb_gtInfo( HB_GTI_SPEC, HB_GTS_SHOWWINDOW, SW_NORMAL )
::lHasInputFocus := .T.
ENDIF
@@ -390,7 +392,7 @@ METHOD WvgCrt:destroy()
ENDIF
IF Len( ::aChildren ) > 0
aeval( ::aChildren, {| o | o:destroy() } )
AEval( ::aChildren, {| o | o:destroy() } )
::aChildren := {}
ENDIF
@@ -409,7 +411,7 @@ METHOD WvgCrt:destroy()
RETURN Self
//
* Methods
// Methods
//
METHOD WvgCrt:currentPos()
@@ -489,8 +491,8 @@ METHOD WvgCrt:invalidateRect( nTop, nLeft, nBottom, nRight )
DEFAULT nTop TO 0
DEFAULT nLeft TO 0
DEFAULT nBottom TO maxrow()
DEFAULT nRight TO maxcol()
DEFAULT nBottom TO MaxRow()
DEFAULT nRight TO MaxCol()
Wvt_InvalidateRect( nTop, nLeft, nBottom, nRight )
@@ -557,7 +559,8 @@ METHOD WvgCrt:setFontCompoundName()
//
METHOD WvgCrt:setFrameState( nState )
Local lSuccess := .F.
LOCAL lSuccess := .F.
DO CASE
@@ -573,6 +576,7 @@ METHOD WvgCrt:setFrameState( nState )
ENDCASE
RETURN lSuccess
//
METHOD WvgCrt:setModalState()
@@ -613,12 +617,12 @@ METHOD WvgCrt:setPresParam()
METHOD WvgCrt:setSize( aSize, lPaint )
if HB_ISARRAY( aSize )
IF HB_ISARRAY( aSize )
DEFAULT lPaint TO .T.
hb_gtInfo( HB_GTI_SCREENHEIGHT, aSize[ 1 ] )
hb_gtInfo( HB_GTI_SCREENWIDTH , aSize[ 2 ] )
endif
ENDIF
RETURN Self
@@ -626,7 +630,7 @@ METHOD WvgCrt:setSize( aSize, lPaint )
METHOD WvgCrt:show()
Hb_GtInfo( HB_GTI_SPEC, HB_GTS_SHOWWINDOW, SW_NORMAL )
hb_gtInfo( HB_GTI_SPEC, HB_GTS_SHOWWINDOW, SW_NORMAL )
::lHasInputFocus := .T.
RETURN Self
@@ -646,6 +650,7 @@ METHOD WvgCrt:toBack()
//
METHOD WvgCrt:toFront()
RETURN WVG_SetWindowPosToTop( ::hWnd )
//
@@ -661,20 +666,20 @@ METHOD WvgCrt:winDevice()
RETURN Self
//
* Callback Methods
// Callback Methods
//
METHOD WvgCrt:enter( xParam )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_enter )
eval( ::sl_enter, xParam, NIL, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_enter )
Eval( ::sl_enter, xParam, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_enter := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -682,15 +687,15 @@ METHOD WvgCrt:enter( xParam )
METHOD WvgCrt:leave( xParam )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_leave )
eval( ::sl_leave, NIL, NIL, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_leave )
Eval( ::sl_leave, NIL, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_leave := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -698,15 +703,15 @@ METHOD WvgCrt:leave( xParam )
METHOD WvgCrt:lbClick( xParam )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_lbClick )
eval( ::sl_lbClick, xParam, NIL, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_lbClick )
Eval( ::sl_lbClick, xParam, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_lbClick := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -714,15 +719,15 @@ METHOD WvgCrt:lbClick( xParam )
METHOD WvgCrt:lbDblClick( xParam )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_lbDblClick )
eval( ::sl_lbDblClick, xParam, NIL, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_lbDblClick )
Eval( ::sl_lbDblClick, xParam, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_lbDblClick := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -730,15 +735,15 @@ METHOD WvgCrt:lbDblClick( xParam )
METHOD WvgCrt:lbDown( xParam )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_lbDown )
eval( ::sl_lbDown, xParam, NIL, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_lbDown )
Eval( ::sl_lbDown, xParam, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_lbDown := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -746,15 +751,15 @@ METHOD WvgCrt:lbDown( xParam )
METHOD WvgCrt:lbUp( xParam )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_lbUp )
eval( ::sl_lbUp, xParam, NIL, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_lbUp )
Eval( ::sl_lbUp, xParam, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_lbUp := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -762,15 +767,15 @@ METHOD WvgCrt:lbUp( xParam )
METHOD WvgCrt:mbClick( xParam )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_mbClick )
eval( ::sl_mbClick, xParam, NIL, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_mbClick )
Eval( ::sl_mbClick, xParam, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_mbClick := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -778,15 +783,15 @@ METHOD WvgCrt:mbClick( xParam )
METHOD WvgCrt:mbDblClick( xParam )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_mbDblClick )
eval( ::sl_mbDblClick, xParam, NIL, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_mbDblClick )
Eval( ::sl_mbDblClick, xParam, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_mbDblClick := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -794,15 +799,15 @@ METHOD WvgCrt:mbDblClick( xParam )
METHOD WvgCrt:mbDown( xParam )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_mbDown )
eval( ::sl_mbDown, xParam, NIL, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_mbDown )
Eval( ::sl_mbDown, xParam, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_mbDown := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -810,15 +815,15 @@ METHOD WvgCrt:mbDown( xParam )
METHOD WvgCrt:mbUp( xParam )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_mbUp )
eval( ::sl_mbUp, xParam, NIL, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_mbUp )
Eval( ::sl_mbUp, xParam, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_mbUp := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -826,15 +831,15 @@ METHOD WvgCrt:mbUp( xParam )
METHOD WvgCrt:motion( xParam )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_motion )
eval( ::sl_motion, xParam, NIL, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_motion )
Eval( ::sl_motion, xParam, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_motion := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -842,15 +847,15 @@ METHOD WvgCrt:motion( xParam )
METHOD WvgCrt:rbClick( xParam )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_rbClick )
eval( ::sl_rbClick, xParam, NIL, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_rbClick )
Eval( ::sl_rbClick, xParam, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_rbClick := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -858,15 +863,15 @@ METHOD WvgCrt:rbClick( xParam )
METHOD WvgCrt:rbDblClick( xParam )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_rbDblClick )
eval( ::sl_rbDblClick, xParam, NIL, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_rbDblClick )
Eval( ::sl_rbDblClick, xParam, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_rbDblClick := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -874,15 +879,15 @@ METHOD WvgCrt:rbDblClick( xParam )
METHOD WvgCrt:rbDown( xParam )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_rbDown )
eval( ::sl_rbDown, xParam, NIL, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_rbDown )
Eval( ::sl_rbDown, xParam, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_rbDown := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -890,15 +895,15 @@ METHOD WvgCrt:rbDown( xParam )
METHOD WvgCrt:rbUp( xParam )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_rbUp )
eval( ::sl_rbUp, xParam, NIL, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_rbUp )
Eval( ::sl_rbUp, xParam, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_rbUp := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -906,33 +911,33 @@ METHOD WvgCrt:rbUp( xParam )
METHOD WvgCrt:wheel( xParam )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_wheel )
eval( ::sl_wheel, xParam, NIL, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_wheel )
Eval( ::sl_wheel, xParam, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_wheel := xParam
RETURN NIL
endif
ENDIF
RETURN Self
//
* Other Messages
// Other Messages
//
METHOD WvgCrt:close( xParam )
if HB_ISNIL( xParam ) .and. HB_ISBLOCK( ::sl_close )
eval( ::sl_close, NIL, NIL, Self )
IF HB_ISNIL( xParam ) .AND. HB_ISBLOCK( ::sl_close )
Eval( ::sl_close, NIL, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_close := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -940,15 +945,15 @@ METHOD WvgCrt:close( xParam )
METHOD WvgCrt:helpRequest( xParam )
if HB_ISNIL( xParam ) .and. HB_ISBLOCK( ::sl_helpRequest )
eval( ::sl_helpRequest, NIL, NIL, Self )
IF HB_ISNIL( xParam ) .AND. HB_ISBLOCK( ::sl_helpRequest )
Eval( ::sl_helpRequest, NIL, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_helpRequest := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -956,15 +961,15 @@ METHOD WvgCrt:helpRequest( xParam )
METHOD WvgCrt:keyboard( xParam )
if HB_ISNUMERIC( xParam ) .and. HB_ISBLOCK( ::sl_keyboard )
eval( ::sl_keyboard, xParam, NIL, Self )
IF HB_ISNUMERIC( xParam ) .AND. HB_ISBLOCK( ::sl_keyboard )
Eval( ::sl_keyboard, xParam, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_keyboard := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -972,15 +977,15 @@ METHOD WvgCrt:keyboard( xParam )
METHOD WvgCrt:killDisplayFocus( xParam )
if HB_ISNIL( xParam ) .and. HB_ISBLOCK( ::sl_killDisplayFocus )
eval( ::sl_killDisplayFocus, NIL, NIL, Self )
IF HB_ISNIL( xParam ) .AND. HB_ISBLOCK( ::sl_killDisplayFocus )
Eval( ::sl_killDisplayFocus, NIL, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_killDisplayFocus := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -988,15 +993,15 @@ METHOD WvgCrt:killDisplayFocus( xParam )
METHOD WvgCrt:killInputFocus( xParam )
if HB_ISNIL( xParam ) .and. HB_ISBLOCK( ::sl_killInputFocus )
eval( ::sl_killInputFocus, NIL, NIL, Self )
IF HB_ISNIL( xParam ) .AND. HB_ISBLOCK( ::sl_killInputFocus )
Eval( ::sl_killInputFocus, NIL, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_killInputFocus := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -1004,15 +1009,15 @@ METHOD WvgCrt:killInputFocus( xParam )
METHOD WvgCrt:move( xParam )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_move )
eval( ::sl_move, xParam, NIL, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_move )
Eval( ::sl_move, xParam, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_move := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -1020,15 +1025,15 @@ METHOD WvgCrt:move( xParam )
METHOD WvgCrt:paint( xParam )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_paint )
eval( ::sl_paint, xParam, NIL, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_paint )
Eval( ::sl_paint, xParam, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_paint := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -1036,15 +1041,15 @@ METHOD WvgCrt:paint( xParam )
METHOD WvgCrt:quit( xParam, xParam1 )
if HB_ISNUMERIC( xParam ) .and. HB_ISBLOCK( ::sl_quit )
eval( ::sl_quit, xParam, xParam1, Self )
IF HB_ISNUMERIC( xParam ) .AND. HB_ISBLOCK( ::sl_quit )
Eval( ::sl_quit, xParam, xParam1, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_quit := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -1052,11 +1057,11 @@ METHOD WvgCrt:quit( xParam, xParam1 )
METHOD WvgCrt:resize( xParam )
if HB_ISBLOCK( xParam )/* .or. HB_ISNIL( xParam ) */
IF HB_ISBLOCK( xParam )/* .or. HB_ISNIL( xParam ) */
::sl_resize := xParam
RETURN NIL
endif
IF empty( xParam )
ENDIF
IF Empty( xParam )
::sendMessage( WM_SIZE, 0, 0 )
ENDIF
@@ -1066,15 +1071,15 @@ METHOD WvgCrt:resize( xParam )
METHOD WvgCrt:setDisplayFocus( xParam )
if HB_ISNIL( xParam ) .and. HB_ISBLOCK( ::setDisplayFocus )
eval( ::setDisplayFocus, NIL, NIL, Self )
IF HB_ISNIL( xParam ) .AND. HB_ISBLOCK( ::setDisplayFocus )
Eval( ::setDisplayFocus, NIL, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::setDisplayFocus := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -1082,15 +1087,15 @@ METHOD WvgCrt:setDisplayFocus( xParam )
METHOD WvgCrt:setInputFocus( xParam )
if HB_ISNIL( xParam ) .and. HB_ISBLOCK( ::sl_setInputFocus )
eval( ::sl_setInputFocus, NIL, NIL, Self )
IF HB_ISNIL( xParam ) .AND. HB_ISBLOCK( ::sl_setInputFocus )
Eval( ::sl_setInputFocus, NIL, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_setInputFocus := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -1098,15 +1103,15 @@ METHOD WvgCrt:setInputFocus( xParam )
METHOD WvgCrt:dragEnter( xParam, xParam1 )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_dragEnter )
eval( ::sl_dragEnter, xParam, xParam1, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_dragEnter )
Eval( ::sl_dragEnter, xParam, xParam1, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_dragEnter := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -1114,15 +1119,15 @@ METHOD WvgCrt:dragEnter( xParam, xParam1 )
METHOD WvgCrt:dragMotion( xParam )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_dragMotion )
eval( ::sl_dragMotion, xParam, NIL, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_dragMotion )
Eval( ::sl_dragMotion, xParam, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_dragMotion := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -1130,15 +1135,15 @@ METHOD WvgCrt:dragMotion( xParam )
METHOD WvgCrt:dragLeave( xParam )
if HB_ISNIL( xParam ) .and. HB_ISBLOCK( ::sl_dragLeave )
eval( ::sl_dragLeave, NIL, NIL, Self )
IF HB_ISNIL( xParam ) .AND. HB_ISBLOCK( ::sl_dragLeave )
Eval( ::sl_dragLeave, NIL, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_dragLeave := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -1146,15 +1151,15 @@ METHOD WvgCrt:dragLeave( xParam )
METHOD WvgCrt:dragDrop( xParam, xParam1 )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_dragDrop )
eval( ::sl_dragDrop, xParam, xParam1, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_dragDrop )
Eval( ::sl_dragDrop, xParam, xParam1, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_dragDrop := xParam
RETURN NIL
endif
ENDIF
RETURN Self

View File

@@ -49,6 +49,7 @@
* If you do not wish that, delete this exception notice.
*
*/
//
//
//
@@ -99,7 +100,7 @@ CLASS WvgDataRef
METHOD validate( xParam ) SETGET
ENDCLASS
ENDCLASS
//
@@ -125,22 +126,22 @@ METHOD WvgDataRef:getData()
::sl_editBuffer := WVG_GetMessageText( ::hWnd, WM_GETTEXT, ::bufferLength + 1 )
CASE ::className == "LISTBOX"
::sl_editBuffer := WVG_LBGetCurSel( ::hWnd )+ 1
::sl_editBuffer := WVG_LBGetCurSel( ::hWnd ) + 1
#if 0 /* This is contrary the documentation of Xbase++ */
IF ::oParent:className == "COMBOBOX"
::sl_editBuffer := {}
FOR i := 1 TO ::numItems()
aadd( ::sl_editBuffer, ::getItem( i ) )
AAdd( ::sl_editBuffer, ::getItem( i ) )
NEXT
ELSE
::sl_editBuffer := WVG_LBGetCurSel( ::hWnd )+ 1
::sl_editBuffer := WVG_LBGetCurSel( ::hWnd ) + 1
ENDIF
#endif
ENDCASE
IF HB_ISBLOCK( ::dataLink )
eval( ::dataLink, ::sl_editBuffer )
Eval( ::dataLink, ::sl_editBuffer )
ENDIF
RETURN ::sl_editBuffer
@@ -148,12 +149,13 @@ METHOD WvgDataRef:getData()
//
METHOD WvgDataRef:setData( xValue, mp2 )
LOCAL s
HB_SYMBOL_UNUSED( mp2 )
IF HB_ISBLOCK( ::dataLink )
::sl_editBuffer := eval( ::dataLink )
::sl_editBuffer := Eval( ::dataLink )
ELSEIF xValue != NIL
::sl_editBuffer := xValue
ENDIF
@@ -169,7 +171,7 @@ METHOD WvgDataRef:setData( xValue, mp2 )
ENDIF
CASE ::className == "SysTreeView32"
IF ::sl_editBuffer != NIL .and. ::sl_editBuffer:hItem != NIL
IF ::sl_editBuffer != NIL .AND. ::sl_editBuffer:hItem != NIL
WVG_TreeView_SelectItem( ::hWnd, ::sl_editBuffer:hItem )
ENDIF
@@ -206,8 +208,8 @@ METHOD WvgDataRef:undo()
METHOD WvgDataRef:validate( xParam )
IF PCount() == 0 .and. HB_ISBLOCK( ::sl_validate )
RETURN eval( ::sl_validate, self )
IF PCount() == 0 .AND. HB_ISBLOCK( ::sl_validate )
RETURN Eval( ::sl_validate, self )
ELSEIF HB_ISBLOCK( xParam )
::sl_validate := xParam
ENDIF

View File

@@ -49,6 +49,7 @@
* If you do not wish that, delete this exception notice.
*
*/
//
//
//
@@ -95,11 +96,12 @@ CLASS WvgDialog FROM WvgWindow
METHOD setTitle( cTitle ) INLINE ::title := cTitle, hb_gtInfo( HB_GTI_WINTITLE, cTitle )
METHOD getTitle() INLINE hb_gtInfo( HB_GTI_WINTITLE )
METHOD calcClientRect() INLINE ::aRect := WVG_GetClientRect( ::hWnd ), ;
{ 0, 0, ::aRect[ 3 ], ::aRect[ 4 ] }
METHOD calcFrameRect() INLINE ::aRect := WVG_GetWindowRect( ::hWnd ),;
{ ::aRect[ 1 ], ::aRect[ 2 ], ;
::aRect[ 3 ]-::aRect[ 1 ], ::aRect[ 4 ]-::aRect[ 2 ] }
ENDCLASS
{ 0, 0, ::aRect[ 3 ], ::aRect[ 4 ] }
METHOD calcFrameRect() INLINE ::aRect := WVG_GetWindowRect( ::hWnd ), ;
{ ::aRect[ 1 ], ::aRect[ 2 ], ;
::aRect[ 3 ] - ::aRect[ 1 ], ::aRect[ 4 ] - ::aRect[ 2 ] }
ENDCLASS
//
@@ -112,13 +114,14 @@ METHOD WvgDialog:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::mouseMode := 0
::objType := objTypeDialog
::style := WS_THICKFRAME+WS_OVERLAPPED+WS_CAPTION+WS_SYSMENU+WS_MINIMIZEBOX+WS_MAXIMIZEBOX
::style := WS_THICKFRAME + WS_OVERLAPPED + WS_CAPTION + WS_SYSMENU + WS_MINIMIZEBOX + WS_MAXIMIZEBOX
RETURN Self
//
METHOD WvgDialog:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
LOCAL oW
::WvgWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
@@ -126,19 +129,19 @@ METHOD WvgDialog:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
if ::lModal
::pGT := hb_gtCreate( "WGU" )
::pGTp := hb_gtSelect( ::pGT )
else
ELSE
hb_gtReload( "WGU" )
::pGT := hb_gtSelect()
endif
ENDIF
hb_gtInfo( HB_GTI_PRESPARAMS, { ::exStyle, ::style, ::aPos[ 1 ], ::aPos[ 2 ], ;
::aSize[ 1 ], ::aSize[ 2 ], ::pGTp, .F., .F., HB_WNDTYPE_DIALOG } )
::aSize[ 1 ], ::aSize[ 2 ], ::pGTp, .F. , .F. , HB_WNDTYPE_DIALOG } )
if ::visible
hb_gtInfo( HB_GTI_SPEC, HB_GTS_SHOWWINDOW, SW_NORMAL )
ELSE
hb_gtInfo( HB_GTI_SPEC, HB_GTS_SHOWWINDOW, SW_HIDE )
endif
ENDIF
::hWnd := hb_gtInfo( HB_GTI_SPEC, HB_GTS_WINDOWHANDLE )
@@ -146,26 +149,26 @@ METHOD WvgDialog:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
hb_gtInfo( HB_GTI_CLOSABLE , ::closable )
hb_gtInfo( HB_GTI_WINTITLE , ::title )
if !empty( ::icon )
if HB_ISNUMERIC( ::icon )
IF !Empty( ::icon )
IF HB_ISNUMERIC( ::icon )
hb_gtInfo( HB_GTI_ICONRES, ::icon )
elseif HB_ISSTRING( ::icon )
ELSEIF HB_ISSTRING( ::icon )
hb_gtInfo( HB_GTI_ICONFILE, ::icon )
endif
endif
ENDIF
ENDIF
if ::lModal
hb_gtInfo( HB_GTI_DISABLE, ::pGTp )
endif
ENDIF
if ::visible
::lHasInputFocus := .T.
ENDIF
oW := WvgDrawingArea():new( Self ):create( , , {0,0}, Self:currentSize(), , .F. )
IF ! empty( oW:hWnd )
oW := WvgDrawingArea():new( Self ):create( , , { 0, 0 }, Self:currentSize(), , .F. )
IF ! Empty( oW:hWnd )
::drawingArea := oW
ELSE
::drawingArea := Self
@@ -192,10 +195,10 @@ METHOD WvgDialog:destroy()
ENDIF
IF Len( ::aChildren ) > 0
aeval( ::aChildren, {| o | o:destroy() } )
AEval( ::aChildren, {| o | o:destroy() } )
ENDIF
IF !empty( ::hBrushBG )
IF !Empty( ::hBrushBG )
WVG_DeleteObject( ::hBrushBG )
ENDIF
@@ -207,6 +210,7 @@ METHOD WvgDialog:destroy()
//
METHOD WvgDialog:setFrameState( nState )
LOCAL lSuccess := .F.
DO CASE

View File

@@ -49,6 +49,7 @@
* If you do not wish that, delete this exception notice.
*
*/
//
//
//
@@ -87,7 +88,8 @@ CLASS WvgDrawingArea INHERIT WvgWindow
METHOD destroy()
METHOD handleEvent( nMessage, aNM )
ENDCLASS
ENDCLASS
//
METHOD WvgDrawingArea:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
@@ -128,9 +130,9 @@ METHOD WvgDrawingArea:handleEvent( nMessage, aNM )
DO CASE
CASE nMessage == HB_GTE_RESIZED
IF HB_ISBLOCK( ::sl_resize )
eval( ::sl_resize, NIL, NIL, self )
Eval( ::sl_resize, NIL, NIL, self )
ENDIF
aeval( ::aChildren, {| o | o:handleEvent( HB_GTE_RESIZED, { 0, 0, 0, 0, 0 } ) } )
AEval( ::aChildren, {| o | o:handleEvent( HB_GTE_RESIZED, { 0, 0, 0, 0, 0 } ) } )
RETURN EVENT_HANDELLED
CASE nMessage == HB_GTE_CTLCOLOR
@@ -139,7 +141,7 @@ METHOD WvgDrawingArea:handleEvent( nMessage, aNM )
ENDIF
IF HB_ISNUMERIC( ::hBrushBG )
WVG_SetBkMode( aNM[ 1 ], 1 )
WVG_FillRect( aNM[ 1 ], { 0,0,::currentSize()[1],::currentSize()[2]}, ::hBrushBG )
WVG_FillRect( aNM[ 1 ], { 0, 0, ::currentSize()[1], ::currentSize()[2] }, ::hBrushBG )
RETURN EVENT_HANDELLED
ENDIF

View File

@@ -49,18 +49,19 @@
* If you do not wish that, delete this exception notice.
*
*/
//
//
//
*
* EkOnkar
* ( The LORD is ONE )
*
* Xbase++ Parts Compatible functions
*
* Pritpal Bedi <bedipritpal@hotmail.com>
* 03Dec2011
*
//
// EkOnkar
// ( The LORD is ONE )
//
// Xbase++ Parts Compatible functions
//
// Pritpal Bedi <bedipritpal@hotmail.com>
// 03Dec2011
//
//
//
//
@@ -80,7 +81,7 @@
//
EXIT PROCEDURE KillGTChildren()
EXIT PROCEDURE KillGTChildren()
IF HB_ISOBJECT( s_oCrt ) .AND. __objGetClsName( s_oCrt ) == "WVGCRT" .AND. s_oCrt:isGT
s_oCrt:destroy()
@@ -92,14 +93,15 @@ EXIT PROCEDURE KillGTChildren()
//
FUNCTION WvgSetAppWindow( oCrt )
LOCAL ooCrt := s_oCrt
IF empty( oCrt )
IF empty( s_oCrt )
IF Empty( oCrt )
IF Empty( s_oCrt )
s_oCrt := WvgCrt():new()
s_oCrt:hWnd := Wvt_GetWindowHandle()
s_oCrt:pWnd := Win_N2P( s_oCrt:hWnd )
HB_GtInfo( HB_GTI_NOTIFIERBLOCKGUI, {| nEvent, ... | s_oCrt:notifier( nEvent, ... ) } )
hb_gtInfo( HB_GTI_NOTIFIERBLOCKGUI, {| nEvent, ... | s_oCrt:notifier( nEvent, ... ) } )
s_oCrt:isGT := .T.
RETURN s_oCrt
ENDIF

View File

@@ -50,6 +50,7 @@
* If you do not wish that, delete this exception notice.
*
*/
//
//
//
@@ -139,7 +140,7 @@ CLASS WvgHTMLViewer INHERIT WvgActiveXControl
DATA CLSID INIT "Shell.Explorer" PROTECTED
ENDCLASS
ENDCLASS
//
@@ -158,7 +159,7 @@ METHOD WvgHTMLViewer:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible
::wvgWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::mapEvent( evBeforeNavigate, {| cURL, Flags, TFName, PData, Headers | ;
::xBeforeNavigate( cURL, Flags, TFName, PData, Headers ) } )
::xBeforeNavigate( cURL, Flags, TFName, PData, Headers ) } )
::mapEvent( evStatusTextChange, {| cText| ::xStatusTextChange( cText ) } )
@@ -172,7 +173,6 @@ METHOD WvgHTMLViewer:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible
::WvgActiveXControl:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
RETURN Self
//
@@ -184,8 +184,8 @@ METHOD WvgHTMLViewer:xBeforeNavigate( cURL, Flags, TFName, PData, Headers )
HB_SYMBOL_UNUSED( PData )
HB_SYMBOL_UNUSED( Headers )
IF PCount() >= 1 .and. HB_ISBLOCK( ::sl_beforeNavigate )
eval( ::sl_beforeNavigate, cURL, NIL, Self )
IF PCount() >= 1 .AND. HB_ISBLOCK( ::sl_beforeNavigate )
Eval( ::sl_beforeNavigate, cURL, NIL, Self )
RETURN nil
ENDIF
@@ -196,7 +196,7 @@ METHOD WvgHTMLViewer:xBeforeNavigate( cURL, Flags, TFName, PData, Headers )
METHOD WvgHTMLViewer:xStatusTextChange( cText )
IF HB_ISBLOCK( ::sl_statusTextChange )
eval( ::sl_statusTextChange, cText, NIL, Self )
Eval( ::sl_statusTextChange, cText, NIL, Self )
ENDIF
RETURN Self
@@ -206,7 +206,7 @@ METHOD WvgHTMLViewer:xStatusTextChange( cText )
METHOD WvgHTMLViewer:xNavigateComplete( cURL )
IF HB_ISBLOCK( ::sl_navigateComplete )
eval( ::sl_navigateComplete, cURL, NIL, Self )
Eval( ::sl_navigateComplete, cURL, NIL, Self )
ENDIF
RETURN Self
@@ -216,7 +216,7 @@ METHOD WvgHTMLViewer:xNavigateComplete( cURL )
METHOD WvgHTMLViewer:xProgressChange( nProgress, nProgMax )
IF HB_ISBLOCK( ::sl_progressChange )
eval( ::sl_progressChange, nProgress, nProgMax, Self )
Eval( ::sl_progressChange, nProgress, nProgMax, Self )
ENDIF
RETURN Self
@@ -226,7 +226,7 @@ METHOD WvgHTMLViewer:xProgressChange( nProgress, nProgMax )
METHOD WvgHTMLViewer:xTitleChange( cTitle )
IF HB_ISBLOCK( ::sl_titleChange )
eval( ::sl_titleChange, cTitle, NIL, Self )
Eval( ::sl_titleChange, cTitle, NIL, Self )
ENDIF
RETURN Self
@@ -236,7 +236,7 @@ METHOD WvgHTMLViewer:xTitleChange( cTitle )
METHOD WvgHTMLViewer:xDocumentComplete( cURI )
IF HB_ISBLOCK( ::sl_documentComplete )
eval( ::sl_documentComplete, cURI, NIL, Self )
Eval( ::sl_documentComplete, cURI, NIL, Self )
ENDIF
RETURN Self
@@ -251,3 +251,4 @@ METHOD WvgHTMLViewer:setHTML( cHTML )
RETURN self
//

View File

@@ -49,6 +49,7 @@
* If you do not wish that, delete this exception notice.
*
*/
//
//
//
@@ -97,14 +98,14 @@ CLASS WvgListBox INHERIT WvgWindow, WvgDataRef
METHOD getVisibleItems() VIRTUAL
METHOD numItems() INLINE ::sendMessage( LB_GETCOUNT, 0, 0 )
METHOD setItemsHeight( nPixel ) INLINE ::sendMessage( LB_SETITEMHEIGHT, 0, nPixel )
METHOD setTopItem( nIndex ) INLINE ::sendMessage( LB_SETTOPINDEX, nIndex-1, 0 )
METHOD setTopItem( nIndex ) INLINE ::sendMessage( LB_SETTOPINDEX, nIndex - 1, 0 )
METHOD addItem( cItem ) INLINE WVG_SendMessageText( ::hWnd, LB_ADDSTRING, 0, cItem )
METHOD clear()
METHOD delItem( nIndex ) INLINE ::sendMessage( LB_DELETESTRING, nIndex-1, 0 )
METHOD getItem( nIndex ) INLINE WVG_LBGetText( ::hWnd, nIndex-1 )
METHOD CLEAR()
METHOD delItem( nIndex ) INLINE ::sendMessage( LB_DELETESTRING, nIndex - 1, 0 )
METHOD getItem( nIndex ) INLINE WVG_LBGetText( ::hWnd, nIndex - 1 )
METHOD getTabstops() VIRTUAL
METHOD insItem( nIndex, cItem ) INLINE WVG_SendMessageText( ::hWnd, LB_INSERTSTRING, nIndex-1, cItem )
METHOD insItem( nIndex, cItem ) INLINE WVG_SendMessageText( ::hWnd, LB_INSERTSTRING, nIndex - 1, cItem )
METHOD setColumnWidth() VIRTUAL
METHOD setItem( nIndex, cItem ) INLINE ::delItem( nIndex ), ::insItem( nIndex, cItem )
METHOD setTabstops() VIRTUAL
@@ -137,7 +138,7 @@ CLASS WvgListBox INHERIT WvgWindow, WvgDataRef
DATA nCurSelected INIT 0
METHOD getCurItem() INLINE ::getItem( ::nCurSelected )
ENDCLASS
ENDCLASS
//
@@ -196,12 +197,12 @@ METHOD WvgListBox:handleEvent( nMessage, aNM )
CASE nMessage == HB_GTE_COMMAND
IF aNM[ 1 ] == LBN_SELCHANGE
::nCurSelected := WVG_LBGetCurSel( ::hWnd )+ 1
::nCurSelected := WVG_LBGetCurSel( ::hWnd ) + 1
IF ::isParentCrt()
::oParent:setFocus()
ENDIF
IF HB_ISBLOCK( ::sl_itemMarked )
eval( ::sl_itemMarked, NIL, NIL, self )
Eval( ::sl_itemMarked, NIL, NIL, self )
ENDIF
IF ::isParentCrt()
IF ::pointerFocus
@@ -215,7 +216,7 @@ METHOD WvgListBox:handleEvent( nMessage, aNM )
::oParent:setFocus()
ENDIF
IF HB_ISBLOCK( ::sl_itemSelected )
eval( ::sl_itemSelected, NIL, NIL, self )
Eval( ::sl_itemSelected, NIL, NIL, self )
ENDIF
IF ::isParentCrt()
IF ::pointerFocus
@@ -237,7 +238,7 @@ METHOD WvgListBox:handleEvent( nMessage, aNM )
::oParent:setFocus()
ENDIF
IF HB_ISBLOCK( ::sl_itemSelected )
eval( ::sl_itemSelected, NIL, NIL, self )
Eval( ::sl_itemSelected, NIL, NIL, self )
ENDIF
IF ::isParentCrt()
IF ::pointerFocus
@@ -266,7 +267,7 @@ METHOD WvgListBox:handleEvent( nMessage, aNM )
IF ::isParentCrt()
::oParent:setFocus()
ENDIF
eval( ::sl_itemMarked, NIL, NIL, self )
Eval( ::sl_itemMarked, NIL, NIL, self )
IF ::isParentCrt()
::setFocus()
ENDIF
@@ -278,7 +279,7 @@ METHOD WvgListBox:handleEvent( nMessage, aNM )
IF ::isParentCrt()
::oParent:setFocus()
ENDIF
eval( ::sl_itemSelected, NIL, NIL, self )
Eval( ::sl_itemSelected, NIL, NIL, self )
IF ::isParentCrt()
::setFocus()
ENDIF
@@ -292,7 +293,7 @@ METHOD WvgListBox:handleEvent( nMessage, aNM )
IF ::isParentCrt()
::oParent:setFocus()
ENDIF
eval( ::sl_itemMarked, NIL, NIL, self )
Eval( ::sl_itemMarked, NIL, NIL, self )
IF ::isParentCrt()
::setFocus()
ENDIF
@@ -315,11 +316,15 @@ METHOD WvgListBox:clear()
//
METHOD WvgListBox:configure( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::Initialize( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
RETURN Self
//
METHOD WvgListBox:destroy()
::WvgWindow:destroy()
RETURN NIL

View File

@@ -49,6 +49,7 @@
* If you do not wish that, delete this exception notice.
*
*/
//
//
//
@@ -101,7 +102,7 @@ CLASS wvgMenuBar INHERIT wvgWindow
DATA className INIT "MENUBAR"
METHOD numItems() INLINE len( ::aMenuItems )
METHOD numItems() INLINE Len( ::aMenuItems )
METHOD new( oParent, aPresParams, lVisible )
METHOD create( oParent, aPresParams, lVisible )
@@ -135,7 +136,7 @@ CLASS wvgMenuBar INHERIT wvgWindow
PROTECTED:
METHOD putItem( aItem, nPos, lInsert )
ENDCLASS
ENDCLASS
//
@@ -175,16 +176,16 @@ METHOD WvgMenuBar:create( oParent, aPresParams, lVisible )
TO DO
*/
/* finally set the menu */
#if 0
#if 0
WVG_SetMenu( ::oParent:getHWND(), ::hMenu )
#endif
#endif
/* how to make menu invisible ? */
IF ( ::visible )
#if 0
#if 0
WVG_ShowWindow( ::oParent:getHWND(), SW_MINIMIZE )
WVG_ShowWindow( ::oParent:getHWND(), SW_NORMAL )
#endif
#endif
ENDIF
::oParent:oMenu := Self
@@ -212,13 +213,13 @@ METHOD WvgMenuBar:configure( oParent, aPresParams, lVisible )
METHOD WvgMenuBar:destroy()
IF !empty( ::hMenu )
IF !Empty( ::hMenu )
::DelAllItems()
IF !WVG_DestroyMenu( ::hMenu )
#if 0
#if 0
Throw( ErrorNew( "wvtMenu", 1000, "wvtMenu:Destroy()", "Destroy menu FAILED", {},"wvt.prg" ) )
#endif
#endif
ENDIF
::hMenu := 0
@@ -229,7 +230,8 @@ METHOD WvgMenuBar:destroy()
//
METHOD WvgMenuBar:delAllItems()
LOCAL lResult:= .T., nItems
LOCAL lResult := .T. , nItems
nItems := ::numItems()
DO WHILE nItems > 0 .AND. lResult
@@ -242,20 +244,21 @@ METHOD WvgMenuBar:delAllItems()
//
METHOD WvgMenuBar:delItem( nItemNum )
LOCAL lResult:= .F.
LOCAL lResult := .F.
IF nItemNum > 0 .AND. nItemNum <= ::numItems()
IF ::aMenuItems[ nItemNum, WVT_MENU_TYPE ] == MF_POPUP
::aMenuItems[ nItemNum, WVT_MENU_MENUOBJ ]:Destroy()
ENDIF
IF ( lResult := WVG_DeleteMenu( ::hMenu, nItemNum-1, MF_BYPOSITION ) ) /* Remember ZERO base */
ADEL( ::aMenuItems, nItemNum )
ASIZE( ::aMenuItems, LEN( ::aMenuItems ) - 1 )
IF ( lResult := WVG_DeleteMenu( ::hMenu, nItemNum - 1, MF_BYPOSITION ) ) /* Remember ZERO base */
ADel( ::aMenuItems, nItemNum )
ASize( ::aMenuItems, Len( ::aMenuItems ) - 1 )
ELSE
#if 0
#if 0
Throw( ErrorNew( "wvtMenu", 1000, "wvtMenu:DelItem()", "Delete menu item FAILED", { nItemNum },"wvt.prg" ) )
#endif
#endif
ENDIF
ENDIF
@@ -265,10 +268,12 @@ METHOD WvgMenuBar:delItem( nItemNum )
/*
* { xCaption, bAction, nStyle, nAttrb }
*/
METHOD WvgMenuBar:addItem( aItem, p2, p3, p4 )
LOCAL xCaption, bAction, nStyle, nAttrib
IF PCount() == 1 .AND. valtype( aItem ) == "A"
IF PCount() == 1 .AND. ValType( aItem ) == "A"
ASize( aItem, 4 )
xCaption := aItem[ 1 ]
bAction := aItem[ 2 ]
@@ -281,11 +286,12 @@ METHOD WvgMenuBar:addItem( aItem, p2, p3, p4 )
nAttrib := p4
ENDIF
RETURN ::putItem( { xCaption, bAction, nStyle, nAttrib }, -1, .T. )
RETURN ::putItem( { xCaption, bAction, nStyle, nAttrib }, - 1, .T. )
//
METHOD WvgMenuBar:putItem( aItem, nPos, lInsert )
LOCAL nItemIndex, cCaption
LOCAL xCaption, bAction, nStyle, nAttrib
@@ -300,13 +306,13 @@ METHOD WvgMenuBar:putItem( aItem, nPos, lInsert )
/* xCaption : NIL | cPrompt | ncResource | oMenu */
SWITCH valtype( xCaption )
SWITCH ValType( xCaption )
CASE "U" /* Separator */
aItem := { MF_SEPARATOR, 0, 0, NIL, nStyle, nAttrib }
EXIT
CASE "C"
IF left( xCaption,1 ) == "-"
IF Left( xCaption, 1 ) == "-"
aItem := { MF_SEPARATOR, 0, 0, NIL, nStyle, nAttrib }
ELSE
aItem := { MF_STRING, ++::nMenuItemID, xCaption, bAction, nStyle, nAttrib }
@@ -324,31 +330,31 @@ METHOD WvgMenuBar:putItem( aItem, nPos, lInsert )
ENDSWITCH
IF nPos <= 0
aadd( ::aMenuItems, aItem )
nItemIndex := len( ::aMenuItems )
AAdd( ::aMenuItems, aItem )
nItemIndex := Len( ::aMenuItems )
WVG_AppendMenu( ::hMenu, ;
aItem[ 1 ], ;
aItem[ 2 ], ;
iif( HB_ISSTRING( aItem[ 3 ] ), strtran( aItem[ 3 ], "~", "&" ), aItem[ 3 ] ) )
aItem[ 1 ], ;
aItem[ 2 ], ;
iif( HB_ISSTRING( aItem[ 3 ] ), StrTran( aItem[ 3 ], "~", "&" ), aItem[ 3 ] ) )
ELSE
nItemIndex := nPos
IF lInsert
::aMenuItems := hb_AIns( ::aMenuItems, nPos, aItem, .T. )
WVG_InsertMenu( ::hMenu, ;
nItemIndex - 1, ;
aItem[ 1 ] + MF_BYPOSITION, ;
aItem[ 2 ], ;
iif( HB_ISSTRING( aItem[ 3 ] ), strtran( aItem[ 3 ], "~", "&" ), aItem[ 3 ] ) )
nItemIndex - 1, ;
aItem[ 1 ] + MF_BYPOSITION, ;
aItem[ 2 ], ;
iif( HB_ISSTRING( aItem[ 3 ] ), StrTran( aItem[ 3 ], "~", "&" ), aItem[ 3 ] ) )
ELSE
IF valtype( xCaption ) == "C"
IF ValType( xCaption ) == "C"
aItem[ 2 ] := ::aMenuItems[ nItemIndex, 2 ]
ENDIF
::aMenuItems[ nItemIndex ] := aItem
WVG_SetMenuItem( ::hMenu, ;
nItemIndex - 1, ;
aItem[ 2 ], ;
iif( HB_ISSTRING( aItem[ 3 ] ), strtran( aItem[ 3 ], "~", "&" ), aItem[ 3 ] ),;
valtype( xCaption ) == "C" )
nItemIndex - 1, ;
aItem[ 2 ], ;
iif( HB_ISSTRING( aItem[ 3 ] ), StrTran( aItem[ 3 ], "~", "&" ), aItem[ 3 ] ), ;
ValType( xCaption ) == "C" )
ENDIF
ENDIF
@@ -367,14 +373,15 @@ METHOD WvgMenuBar:putItem( aItem, nPos, lInsert )
//
METHOD WvgMenuBar:findMenuItemById( nId )
LOCAL x, aResult :={}
IF !empty( nId )
LOCAL x, aResult := {}
IF !Empty( nId )
x := ::numItems()
DO WHILE x > 0 .AND. empty( aResult )
DO WHILE x > 0 .AND. Empty( aResult )
IF ::aMenuItems[ x, WVT_MENU_TYPE ] == MF_POPUP
aResult:= ::aMenuItems[ x,WVT_MENU_MENUOBJ ]:findMenuItemById( nId )
aResult := ::aMenuItems[ x,WVT_MENU_MENUOBJ ]:findMenuItemById( nId )
ELSEIF ::aMenuItems[ x, WVT_MENU_IDENTIFIER ] == nId
aResult := { x, ::aMenuItems[ x, WVT_MENU_ACTION ], ::sl_itemSelected, Self }
@@ -389,12 +396,13 @@ METHOD WvgMenuBar:findMenuItemById( nId )
//
METHOD WvgMenuBar:findMenuPosById( nId )
LOCAL x, nPos
IF !empty( nId )
IF !Empty( nId )
x := ::numItems()
DO WHILE x > 0 .AND. empty( nPos )
DO WHILE x > 0 .AND. Empty( nPos )
IF ::aMenuItems[ x,WVT_MENU_TYPE ] == MF_POPUP
nPos := ::aMenuItems[ x,WVT_MENU_MENUOBJ ]:findMenuPosById( nId )
@@ -411,23 +419,25 @@ METHOD WvgMenuBar:findMenuPosById( nId )
//
METHOD WvgMenuBar:checkItem( nItemNum, lCheck )
LOCAL nRet := -1
LOCAL nRet := - 1
DEFAULT lCheck TO .T.
IF !empty( ::hMenu ) .AND. HB_ISNUMERIC( nItemNum )
nRet := WVG_CheckMenuItem( ::hMenu, nItemNum-1, MF_BYPOSITION + iif( lCheck, MF_CHECKED, MF_UNCHECKED ) )
IF !Empty( ::hMenu ) .AND. HB_ISNUMERIC( nItemNum )
nRet := WVG_CheckMenuItem( ::hMenu, nItemNum - 1, MF_BYPOSITION + iif( lCheck, MF_CHECKED, MF_UNCHECKED ) )
ENDIF
RETURN iif( nRet == -1, .F., .T. )
RETURN iif( nRet == - 1, .F. , .T. )
//
METHOD WvgMenuBar:enableItem( nItemNum )
LOCAL lSuccess := .F.
IF !empty( ::hMenu ) .AND. HB_ISNUMERIC( nItemNum )
lSuccess := WVG_EnableMenuItem( ::hMenu, nItemNum-1, MF_BYPOSITION + MF_ENABLED )
IF !Empty( ::hMenu ) .AND. HB_ISNUMERIC( nItemNum )
lSuccess := WVG_EnableMenuItem( ::hMenu, nItemNum - 1, MF_BYPOSITION + MF_ENABLED )
ENDIF
RETURN lSuccess
@@ -435,10 +445,11 @@ METHOD WvgMenuBar:enableItem( nItemNum )
//
METHOD WvgMenuBar:disableItem( nItemNum )
LOCAL lSuccess := .F.
IF !empty( ::hMenu ) .AND. !empty( nItemNum )
lSuccess := WVG_EnableMenuItem( ::hMenu, nItemNum-1, MF_BYPOSITION + MF_GRAYED )
IF !Empty( ::hMenu ) .AND. !Empty( nItemNum )
lSuccess := WVG_EnableMenuItem( ::hMenu, nItemNum - 1, MF_BYPOSITION + MF_GRAYED )
ENDIF
RETURN lSuccess
@@ -447,7 +458,7 @@ METHOD WvgMenuBar:disableItem( nItemNum )
METHOD WvgMenuBar:getItem( nItemNum )
IF HB_ISNUMERIC( nItemNum ) .AND. nItemNum > 0 .AND. nItemNum <= len( ::aMenuItems )
IF HB_ISNUMERIC( nItemNum ) .AND. nItemNum > 0 .AND. nItemNum <= Len( ::aMenuItems )
RETURN { ::aMenuItems[ nItemNum, 3 ], ::aMenuItems[ nItemNum, 4 ], ::aMenuItems[ nItemNum, 5 ], ::aMenuItems[ nItemNum, 6 ] }
ENDIF
@@ -465,13 +476,13 @@ METHOD WvgMenuBar:insItem( nItemNum, aItem )
METHOD WvgMenuBar:isItemChecked( nItemNum )
RETURN WVG_IsMenuItemChecked( ::hMenu, nItemNum-1 )
RETURN WVG_IsMenuItemChecked( ::hMenu, nItemNum - 1 )
//
METHOD WvgMenuBar:isItemEnabled( nItemNum )
RETURN WVG_IsMenuItemEnabled( ::hMenu, nItemNum-1 )
RETURN WVG_IsMenuItemEnabled( ::hMenu, nItemNum - 1 )
//
@@ -490,12 +501,12 @@ METHOD WvgMenuBar:setItem( nItemNum, aItem )
RETURN ::putItem( aItem, nItemNum, .F. )
//
/* Callback Methods */
/* Callback Methods */
//
METHOD WvgMenuBar:beginMenu( xParam )
IF HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_beginMenu := xParam
RETURN NIL
ENDIF
@@ -506,7 +517,7 @@ METHOD WvgMenuBar:beginMenu( xParam )
METHOD WvgMenuBar:endMenu( xParam )
IF HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_endMenu := xParam
RETURN NIL
ENDIF
@@ -517,7 +528,7 @@ METHOD WvgMenuBar:endMenu( xParam )
METHOD WvgMenuBar:itemMarked( xParam )
IF HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_itemMarked := xParam
RETURN NIL
ENDIF
@@ -528,7 +539,7 @@ METHOD WvgMenuBar:itemMarked( xParam )
METHOD WvgMenuBar:itemSelected( xParam )
IF HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_itemSelected := xParam
RETURN NIL
ENDIF
@@ -539,7 +550,7 @@ METHOD WvgMenuBar:itemSelected( xParam )
METHOD WvgMenuBar:drawItem( xParam )
IF HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_drawItem := xParam
RETURN NIL
ENDIF
@@ -550,7 +561,7 @@ METHOD WvgMenuBar:drawItem( xParam )
METHOD WvgMenuBar:measureItem( xParam )
IF HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_measureItem := xParam
RETURN NIL
ENDIF
@@ -561,7 +572,7 @@ METHOD WvgMenuBar:measureItem( xParam )
METHOD WvgMenuBar:onMenuKey( xParam )
IF HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_onMenuKey := xParam
RETURN NIL
ENDIF
@@ -587,9 +598,9 @@ CLASS wvgMenu INHERIT wvgMenuBar
METHOD getTitle()
METHOD setTitle( cTitle )
METHOD popUp( oXbp, aPos, nDefaultItem, nControl )
METHOD Popup( oXbp, aPos, nDefaultItem, nControl )
ENDCLASS
ENDCLASS
//
@@ -637,7 +648,8 @@ METHOD WvgMenu:setTitle( cTitle )
//
METHOD WvgMenu:popUp( oXbp, aPos, nDefaultItem, nControl )
METHOD WvgMenu:Popup( oXbp, aPos, nDefaultItem, nControl )
LOCAL nCmd, aMenuItem
HB_SYMBOL_UNUSED( nDefaultItem )
@@ -646,7 +658,7 @@ METHOD WvgMenu:popUp( oXbp, aPos, nDefaultItem, nControl )
nCmd := WVG_TrackPopupMenu( ::hMenu, TPM_LEFTALIGN + TPM_TOPALIGN + TPM_RETURNCMD, aPos[ 1 ], aPos[ 2 ], oXbp:hWnd )
aMenuItem := ::findMenuItemById( nCmd )
IF HB_ISARRAY( aMenuItem ) .and. HB_ISBLOCK( aMenuItem[ 2 ] )
IF HB_ISARRAY( aMenuItem ) .AND. HB_ISBLOCK( aMenuItem[ 2 ] )
Eval( aMenuItem[ 2 ], aMenuItem[ 1 ], NIL, aMenuItem[ 4 ] )
ENDIF

View File

@@ -49,6 +49,7 @@
* If you do not wish that, delete this exception notice.
*
*/
//
//
//
@@ -99,11 +100,11 @@ CLASS WvgMLE INHERIT WvgWindow, WvgDataRef
METHOD destroy()
METHOD handleEvent( nMessage, aNM )
METHOD clear()
METHOD CLEAR()
METHOD copyMarked()
METHOD cutMarked()
METHOD deleteMarked() VIRTUAL
METHOD delete() VIRTUAL
METHOD DELETE() VIRTUAL
METHOD pasteMarked() VIRTUAL
METHOD queryFirstChar() VIRTUAL
METHOD queryMarked() VIRTUAL
@@ -131,7 +132,7 @@ CLASS WvgMLE INHERIT WvgWindow, WvgDataRef
METHOD changed( lChanged ) SETGET
ENDCLASS
ENDCLASS
//
@@ -199,22 +200,22 @@ METHOD WvgMLE:handleEvent( nMessage, aNM )
DO CASE
CASE aNM[ NMH_code ] == EN_KILLFOCUS
IF HB_ISBLOCK( ::sl_killInputFocus )
eval( ::sl_killInputFocus, NIL, NIL, Self )
Eval( ::sl_killInputFocus, NIL, NIL, Self )
ENDIF
CASE aNM[ NMH_code ] == EN_SETFOCUS
IF HB_ISBLOCK( ::sl_setInputFocus )
eval( ::sl_setInputFocus, NIL, NIL, Self )
Eval( ::sl_setInputFocus, NIL, NIL, Self )
ENDIF
CASE aNM[ NMH_code ] == EN_HSCROLL
IF HB_ISBLOCK( ::sl_hScroll )
eval( ::sl_hScroll, NIL, NIL, Self )
Eval( ::sl_hScroll, NIL, NIL, Self )
ENDIF
CASE aNM[ NMH_code ] == EN_VSCROLL
IF HB_ISBLOCK( ::sl_vScroll )
eval( ::sl_vScroll, NIL, NIL, Self )
Eval( ::sl_vScroll, NIL, NIL, Self )
ENDIF
CASE aNM[ NMH_code ] == EN_CHANGE
@@ -246,22 +247,22 @@ METHOD WvgMLE:handleEvent( nMessage, aNM )
CASE aNM[ NMH_code ] == WM_KILLFOCUS
IF HB_ISBLOCK( ::sl_killInputFocus )
eval( ::sl_killInputFocus, NIL, NIL, Self )
Eval( ::sl_killInputFocus, NIL, NIL, Self )
ENDIF
CASE aNM[ NMH_code ] == WM_SETFOCUS
IF HB_ISBLOCK( ::sl_setInputFocus )
eval( ::sl_setInputFocus, NIL, NIL, Self )
Eval( ::sl_setInputFocus, NIL, NIL, Self )
ENDIF
CASE aNM[ NMH_code ] == WM_HSCROLL
IF HB_ISBLOCK( ::sl_hScroll )
eval( ::sl_hScroll, NIL, NIL, Self )
Eval( ::sl_hScroll, NIL, NIL, Self )
ENDIF
CASE aNM[ NMH_code ] == WM_VSCROLL
IF HB_ISBLOCK( ::sl_vScroll )
eval( ::sl_vScroll, NIL, NIL, Self )
Eval( ::sl_vScroll, NIL, NIL, Self )
ENDIF
ENDCASE
@@ -284,6 +285,7 @@ METHOD WvgMLE:destroy()
//
METHOD WvgMLE:changed( lChanged )
LOCAL lChg := ::sendMessage( EM_GETMODIFY, 0, 0 )
IF HB_ISLOGICAL( lChanged )
@@ -295,15 +297,17 @@ METHOD WvgMLE:changed( lChanged )
//
METHOD WvgMLE:clear()
LOCAL cText := ::getData()
::setData( "" )
RETURN len( cText )
RETURN Len( cText )
//
METHOD WvgMLE:copyMarked()
LOCAL n, nB, nE
n := ::sendMessage( EM_GETSEL )
@@ -311,7 +315,7 @@ METHOD WvgMLE:copyMarked()
nE := WVG_HIWORD( n )
IF ( n := nE - nB ) > 0
Wvt_SetClipboard( substr( ::getData(), nB, n ) )
Wvt_SetClipboard( SubStr( ::getData(), nB, n ) )
ENDIF
RETURN n
@@ -319,6 +323,7 @@ METHOD WvgMLE:copyMarked()
//
METHOD WvgMLE:cutMarked()
LOCAL n, nB, nE, cText
n := ::sendMessage( EM_GETSEL )
@@ -327,7 +332,7 @@ METHOD WvgMLE:cutMarked()
IF ( n := nE - nB ) > 0
cText := ::getData()
::setData( substr( cText, 1, nB-1 ) + substr( cText, nE ) )
::setData( SubStr( cText, 1, nB - 1 ) + SubStr( cText, nE ) )
ENDIF
RETURN n

View File

@@ -47,6 +47,7 @@
* If you do not wish that, delete this exception notice.
*
*/
//
//
//
@@ -64,87 +65,93 @@
//
thread static t_paint_:= { { "", {} } }
THREAD STATIC t_paint_ := { { "", {} } }
//
/*
* This function must have to be defined in your appls
*/
#if 0
function Wvt_Paint()
FUNCTION Wvt_Paint()
/* Call this function from this funtion */
WvtPaintObjects()
return nil
RETURN nil
#endif
//
function WvtPaintObjects()
FUNCTION WvtPaintObjects()
LOCAL i, lExe, nLeft, nRight, b, tlbr_, aBlocks, nBlocks
aBlocks := WvtSetPaint()
if ( nBlocks := len( aBlocks ) ) > 0
tlbr_:= Wvt_GetPaintRect()
IF ( nBlocks := Len( aBlocks ) ) > 0
tlbr_ := Wvt_GetPaintRect()
for i := 1 to nBlocks
FOR i := 1 TO nBlocks
lExe := .T.
if aBlocks[ i,3 ] != nil .and. !empty( aBlocks[ i,3 ] )
IF aBlocks[ i,3 ] != nil .AND. !Empty( aBlocks[ i,3 ] )
/* Check parameters against tlbr_ depending upon the
* type of object and attributes contained in aAttr
*/
do case
case aBlocks[ i,3,1 ] == WVT_BLOCK_GRID_V
DO CASE
CASE aBlocks[ i,3,1 ] == WVT_BLOCK_GRID_V
b := aBlocks[ i,3,6 ]
if len( b:aColumnsSep ) == 0
IF Len( b:aColumnsSep ) == 0
lExe := .F.
else
ELSE
nLeft := b:aColumnsSep[ 1 ]
nRight := b:aColumnsSep[ len( b:aColumnsSep ) ]
if !( tlbr_[ 1 ] <= aBlocks[ i,3,4 ] .and. ; /* top < bottom */
tlbr_[ 3 ] >= aBlocks[ i,3,2 ] .and. ; /* bootm > top */
tlbr_[ 2 ] <= nRight + 1 .and. ; /* left < right */
tlbr_[ 4 ] >= nLeft - 2 ) /* right > left */
IF !( tlbr_[ 1 ] <= aBlocks[ i,3,4 ] .AND. ; /* top < bottom */
tlbr_[ 3 ] >= aBlocks[ i,3,2 ] .AND. ; /* bootm > top */
tlbr_[ 2 ] <= nRight + 1 .AND. ; /* left < right */
tlbr_[ 4 ] >= nLeft - 2 ) /* right > left */
lExe := .F.
endif
endif
ENDIF
ENDIF
case aBlocks[ i,3,1 ] == WVT_BLOCK_GETS
if !( tlbr_[ 1 ] <= aBlocks[ i,3,4 ] .and. ; /* top < bott */
tlbr_[ 3 ] >= aBlocks[ i,3,2 ] .and. ; /* bootm > top */
tlbr_[ 2 ] <= aBlocks[ i,3,5 ] .and. ; /* left < righ */
tlbr_[ 4 ] >= aBlocks[ i,3,3 ] ) /* right > left */
CASE aBlocks[ i,3,1 ] == WVT_BLOCK_GETS
IF !( tlbr_[ 1 ] <= aBlocks[ i,3,4 ] .AND. ; /* top < bott */
tlbr_[ 3 ] >= aBlocks[ i,3,2 ] .AND. ; /* bootm > top */
tlbr_[ 2 ] <= aBlocks[ i,3,5 ] .AND. ; /* left < righ */
tlbr_[ 4 ] >= aBlocks[ i,3,3 ] ) /* right > left */
lExe := .F.
endif
ENDIF
otherwise
OTHERWISE
/* If refreshing rectangle's top is less than objects' bottom */
/* and left is less than objects' right */
/* */
if !( tlbr_[ 1 ] <= aBlocks[ i,3,4 ] .and. ; /* top <= bottom */
tlbr_[ 3 ] >= aBlocks[ i,3,2 ] .and. ; /* bootm >= top */
tlbr_[ 2 ] <= aBlocks[ i,3,5 ] .and. ; /* left < right */
tlbr_[ 4 ] >= aBlocks[ i,3,3 ] ) /* right > left */
IF !( tlbr_[ 1 ] <= aBlocks[ i,3,4 ] .AND. ; /* top <= bottom */
tlbr_[ 3 ] >= aBlocks[ i,3,2 ] .AND. ; /* bootm >= top */
tlbr_[ 2 ] <= aBlocks[ i,3,5 ] .AND. ; /* left < right */
tlbr_[ 4 ] >= aBlocks[ i,3,3 ] ) /* right > left */
lExe := .F.
endif
endcase
endif
ENDIF
ENDCASE
ENDIF
if lExe
eval( aBlocks[ i,2 ] )
endif
next
endif
IF lExe
Eval( aBlocks[ i,2 ] )
ENDIF
NEXT
ENDIF
return 0
RETURN 0
//
function WvtSetPaint( a_ )
local o
thread static t
FUNCTION WvtSetPaint( a_ )
LOCAL o
THREAD STATIC t
IF t == nil
t := {}
@@ -152,97 +159,102 @@ function WvtSetPaint( a_ )
o := t
if a_ != nil
IF a_ != nil
t := a_
endif
ENDIF
return o
RETURN o
//
function wvg_SetPaint( cID, nAction, xData, aAttr )
local n, n1, oldData
FUNCTION wvg_SetPaint( cID, nAction, xData, aAttr )
if xData != nil
if ( n := ascan( t_paint_, {| e_ | e_[ 1 ] == cID } ) ) > 0
if ( n1 := ascan( t_paint_[ n, 2 ], {| e_ | e_[ 1 ] == nAction } ) ) > 0
LOCAL n, n1, oldData
IF xData != nil
IF ( n := AScan( t_paint_, {| e_ | e_[ 1 ] == cID } ) ) > 0
IF ( n1 := AScan( t_paint_[ n, 2 ], {| e_ | e_[ 1 ] == nAction } ) ) > 0
oldData := t_paint_[ n,2,n1,2 ]
t_paint_[ n,2,n1,2 ] := xData
t_paint_[ n,2,n1,3 ] := aAttr
else
aadd( t_paint_[ n,2 ], { nAction,xData,aAttr } )
endif
else
aadd( t_paint_, { cID, {} } )
n := len( t_paint_ )
aadd( t_paint_[ n,2 ], { nAction, xData, aAttr } )
endif
endif
ELSE
AAdd( t_paint_[ n,2 ], { nAction, xData, aAttr } )
ENDIF
ELSE
AAdd( t_paint_, { cID, {} } )
n := Len( t_paint_ )
AAdd( t_paint_[ n,2 ], { nAction, xData, aAttr } )
ENDIF
ENDIF
return oldData
RETURN oldData
//
function wvg_GetPaint( cID )
local n
FUNCTION wvg_GetPaint( cID )
if ( n := ascan( t_paint_, {| e_ | e_[ 1 ] == cID } ) ) > 0
return t_paint_[ n,2 ]
endif
LOCAL n
return {}
IF ( n := AScan( t_paint_, {| e_ | e_[ 1 ] == cID } ) ) > 0
RETURN t_paint_[ n,2 ]
ENDIF
RETURN {}
//
function wvg_DelPaint( cID, nAction )
local xData, n1, n
FUNCTION wvg_DelPaint( cID, nAction )
if ( n := ascan( t_paint_, {| e_ | e_[ 1 ] == cID } ) ) > 0
if ( n1 := ascan( t_paint_[ n, 2 ], {| e_ | e_[ 1 ] == nAction } ) ) > 0
LOCAL xData, n1, n
IF ( n := AScan( t_paint_, {| e_ | e_[ 1 ] == cID } ) ) > 0
IF ( n1 := AScan( t_paint_[ n, 2 ], {| e_ | e_[ 1 ] == nAction } ) ) > 0
xData := t_paint_[ n,2,n1,2 ]
t_paint_[ n,2,n1,2 ] := {|| .T. }
endif
endif
ENDIF
ENDIF
return xData
RETURN xData
//
function wvg_PurgePaint( cID,lDummy )
local n, aPaint
FUNCTION wvg_PurgePaint( cID, lDummy )
LOCAL n, aPaint
DEFAULT lDummy TO .F.
if ( n := ascan( t_paint_, {| e_ | e_[ 1 ] == cID } ) ) > 0
IF ( n := AScan( t_paint_, {| e_ | e_[ 1 ] == cID } ) ) > 0
aPaint := t_paint_[ n ]
ADel( t_paint_, n )
aSize( t_paint_, len( t_paint_ ) - 1 )
endif
ASize( t_paint_, Len( t_paint_ ) - 1 )
ENDIF
if lDummy
IF lDummy
WvtSetPaint( {} )
endif
ENDIF
return aPaint
RETURN aPaint
//
function wvg_InsertPaint( cID, aPaint, lSet )
local n
FUNCTION wvg_InsertPaint( cID, aPaint, lSet )
LOCAL n
DEFAULT lSet TO .F.
if ( n := ascan( t_paint_, {| e_ | e_[ 1 ] == cID } ) ) > 0
IF ( n := AScan( t_paint_, {| e_ | e_[ 1 ] == cID } ) ) > 0
t_paint_[ n ] := aPaint
else
aadd( t_paint_, aPaint )
endif
ELSE
AAdd( t_paint_, aPaint )
ENDIF
if lSet
IF lSet
WvtSetPaint( aPaint )
endif
ENDIF
return nil
RETURN nil
//
//
@@ -255,14 +267,16 @@ function wvg_InsertPaint( cID, aPaint, lSet )
//
//
//
/* nMode : 0 == Rows/cols - DEFAULT 1 == DlagUnits as from any standard dialog definition */
/* nMode : 0 == Rows/cols - DEFAULT 1 == DlagUnits as from any standard dialog definition */
FUNCTION Wvt_SetDlgCoMode( nMode )
LOCAL nOldMode
STATIC sMode := 0
nOldMode := sMode
IF HB_ISNUMERIC( nMode ) .and. nMode <= 1 .and. nMode >= 0
IF HB_ISNUMERIC( nMode ) .AND. nMode <= 1 .AND. nMode >= 0
sMode := nMode
ENDIF
@@ -270,9 +284,8 @@ FUNCTION Wvt_SetDlgCoMode( nMode )
//
FUNCTION Wvt_MakeDlgTemplate( nTop, nLeft, nRows, nCols, aOffSet, cTitle, nStyle, ;
cFaceName, nPointSize, nWeight, lItalic, nHelpId, nExStyle )
cFaceName, nPointSize, nWeight, lItalic, nHelpId, nExStyle )
LOCAL aDlg := { {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {} }
LOCAL aXY, nX, nY, nW, nH, nXM, nYM
@@ -284,7 +297,7 @@ FUNCTION Wvt_MakeDlgTemplate( nTop, nLeft, nRows, nCols, aOffSet, cTitle, nStyle
IF nMode == 0
DEFAULT aOffSet TO {}
aSize( aOffSet,4 )
ASize( aOffSet, 4 )
DEFAULT aOffSet[ 1 ] TO 0
DEFAULT aOffSet[ 2 ] TO 0
DEFAULT aOffSet[ 3 ] TO 0
@@ -299,7 +312,7 @@ FUNCTION Wvt_MakeDlgTemplate( nTop, nLeft, nRows, nCols, aOffSet, cTitle, nStyle
/* Position it exactly where user has requested */
aXY := Wvt_ClientToScreen( nTop,nLeft )
aXY := Wvt_ClientToScreen( nTop, nLeft )
nX := aXY[ 1 ] + aOffSet[ 2 ]
nY := aXY[ 2 ] + aOffSet[ 1 ]
@@ -322,38 +335,39 @@ FUNCTION Wvt_MakeDlgTemplate( nTop, nLeft, nRows, nCols, aOffSet, cTitle, nStyle
nH := nRows
ENDIF
If !HB_ISNUMERIC( nStyle )
IF !HB_ISNUMERIC( nStyle )
nStyle := + WS_CAPTION + WS_SYSMENU ;
+ WS_GROUP + WS_TABSTOP + DS_SETFONT ;
+ WS_THICKFRAME + WS_VISIBLE + WS_POPUP ;
+ DS_3DLOOK
EndIf
+ WS_GROUP + WS_TABSTOP + DS_SETFONT ;
+ WS_THICKFRAME + WS_VISIBLE + WS_POPUP ;
+ DS_3DLOOK
ENDIF
aAdd( aDlg[ 1 ] , iif( Empty( nHelpId ), 0, nHelpId ) )
aAdd( aDlg[ 1 ] , iif( Empty( nExStyle ), 0, nExStyle ) )
aAdd( aDlg[ 1 ] , nStyle )
aAdd( aDlg[ 1 ] , 0 )
aAdd( aDlg[ 1 ] , nX )
aAdd( aDlg[ 1 ] , nY )
aAdd( aDlg[ 1 ] , nW )
aAdd( aDlg[ 1 ] , nH )
aAdd( aDlg[ 1 ] , 0 )
aAdd( aDlg[ 1 ] , 0 )
aAdd( aDlg[ 1 ] , iif( ValType( cTitle ) == "C", cTitle, "" ) )
AAdd( aDlg[ 1 ] , iif( Empty( nHelpId ), 0, nHelpId ) )
AAdd( aDlg[ 1 ] , iif( Empty( nExStyle ), 0, nExStyle ) )
AAdd( aDlg[ 1 ] , nStyle )
AAdd( aDlg[ 1 ] , 0 )
AAdd( aDlg[ 1 ] , nX )
AAdd( aDlg[ 1 ] , nY )
AAdd( aDlg[ 1 ] , nW )
AAdd( aDlg[ 1 ] , nH )
AAdd( aDlg[ 1 ] , 0 )
AAdd( aDlg[ 1 ] , 0 )
AAdd( aDlg[ 1 ] , iif( ValType( cTitle ) == "C", cTitle, "" ) )
if hb_bitAnd( nStyle, DS_SETFONT ) == DS_SETFONT
aAdd( aDlg[ 1 ], iif( ValType( nPointSize ) == "N", nPointSize, 8 ) )
aAdd( aDlg[ 1 ], iif( ValType( nWeight ) == "N", nWeight , 400 ) )
aAdd( aDlg[ 1 ], iif( ValType( lItalic ) == "L", lItalic , .F. ) )
aAdd( aDlg[ 1 ], iif( ValType( cFaceName ) == "C", cFaceName , "MS Sans Serif" ) )
EndIf
IF hb_bitAnd( nStyle, DS_SETFONT ) == DS_SETFONT
AAdd( aDlg[ 1 ], iif( ValType( nPointSize ) == "N", nPointSize, 8 ) )
AAdd( aDlg[ 1 ], iif( ValType( nWeight ) == "N", nWeight , 400 ) )
AAdd( aDlg[ 1 ], iif( ValType( lItalic ) == "L", lItalic , .F. ) )
AAdd( aDlg[ 1 ], iif( ValType( cFaceName ) == "C", cFaceName , "MS Sans Serif" ) )
ENDIF
Return aDlg
RETURN aDlg
//
Function Wvt_AddDlgItem( aDlg, nTop, nLeft, nRows, nCols, aOffSet,;
cnId, cnDlgClass, nStyle, cText, nHelpId, nExStyle )
FUNCTION Wvt_AddDlgItem( aDlg, nTop, nLeft, nRows, nCols, aOffSet, ;
cnId, cnDlgClass, nStyle, cText, nHelpId, nExStyle )
LOCAL aXY, nX, nY, nW, nH, nXM, nYM
LOCAL nBaseUnits, nBaseUnitsX, nBaseUnitsY
LOCAL nBottom, nRight
@@ -365,7 +379,7 @@ Function Wvt_AddDlgItem( aDlg, nTop, nLeft, nRows, nCols, aOffSet,;
DEFAULT aOffSet TO {}
aSize( aOffSet,4 )
ASize( aOffSet, 4 )
DEFAULT aOffSet[ 1 ] TO 0
DEFAULT aOffSet[ 2 ] TO 0
@@ -380,7 +394,7 @@ Function Wvt_AddDlgItem( aDlg, nTop, nLeft, nRows, nCols, aOffSet,;
nX := aXY[ 1 ] + aOffSet[ 2 ]
nY := aXY[ 2 ] + aOffSet[ 1 ]
aXY := Wvt_GetXYFromRowCol( nBottom+1, nRight+1 )
aXY := Wvt_GetXYFromRowCol( nBottom + 1, nRight + 1 )
nW := aXY[ 1 ] + aOffSet[ 4 ] - nX
nH := aXY[ 2 ] + aOffSet[ 3 ] - nY
@@ -400,87 +414,89 @@ Function Wvt_AddDlgItem( aDlg, nTop, nLeft, nRows, nCols, aOffSet,;
aDlg[ 1,4 ]++ /* item count */
aAdd( aDlg[ 2 ] , iif( ValType( nHelpId ) == "N", nHelpId , 0 ) )
aAdd( aDlg[ 3 ] , iif( ValType( nExStyle ) == "N", nExStyle, 0 ) )
aAdd( aDlg[ 4 ] , iif( ValType( nStyle ) == "N", nStyle , WS_CHILD + WS_VISIBLE ) )
aAdd( aDlg[ 5 ] , nX )
aAdd( aDlg[ 6 ] , nY )
aAdd( aDlg[ 7 ] , nW )
aAdd( aDlg[ 8 ] , nH )
aAdd( aDlg[ 9 ] , cnId )
aAdd( aDlg[ 10 ] , cnDlgClass )
aAdd( aDlg[ 11 ] , iif( HB_ISSTRING( cText ), cText, iif( HB_ISNUMERIC( cText ), cText, "" ) ) )
aAdd( aDlg[ 12 ] , 0 )
AAdd( aDlg[ 2 ] , iif( ValType( nHelpId ) == "N", nHelpId , 0 ) )
AAdd( aDlg[ 3 ] , iif( ValType( nExStyle ) == "N", nExStyle, 0 ) )
AAdd( aDlg[ 4 ] , iif( ValType( nStyle ) == "N", nStyle , WS_CHILD + WS_VISIBLE ) )
AAdd( aDlg[ 5 ] , nX )
AAdd( aDlg[ 6 ] , nY )
AAdd( aDlg[ 7 ] , nW )
AAdd( aDlg[ 8 ] , nH )
AAdd( aDlg[ 9 ] , cnId )
AAdd( aDlg[ 10 ] , cnDlgClass )
AAdd( aDlg[ 11 ] , iif( HB_ISSTRING( cText ), cText, iif( HB_ISNUMERIC( cText ), cText, "" ) ) )
AAdd( aDlg[ 12 ] , 0 )
Return aDlg
RETURN aDlg
//
Function Wvt_CreateDialog( acnDlg, lOnTop, cbDlgProc, ncIcon, nTimerTicks, hMenu )
FUNCTION Wvt_CreateDialog( acnDlg, lOnTop, cbDlgProc, ncIcon, nTimerTicks, hMenu )
LOCAL hDlg, cType, xTemplate, nDlgMode
if valtype( cbDlgProc ) == "C"
cbDlgProc := upper( cbDlgProc )
endif
IF ValType( cbDlgProc ) == "C"
cbDlgProc := Upper( cbDlgProc )
ENDIF
cType := Valtype( acnDlg )
cType := ValType( acnDlg )
nDlgMode := iif( cType == "C", 0, iif( cType == "N", 1, 2 ) )
if cType == "A"
IF cType == "A"
xTemplate := Wvt__MakeDlgTemplate( acnDlg[ 1 ] , acnDlg[ 2 ] , acnDlg[ 3 ] , acnDlg[ 4 ] , ;
acnDlg[ 5 ] , acnDlg[ 6 ] , acnDlg[ 7 ] , acnDlg[ 8 ] , ;
acnDlg[ 9 ] , acnDlg[ 10 ] , acnDlg[ 11 ] , acnDlg[ 12 ] )
else
acnDlg[ 5 ] , acnDlg[ 6 ] , acnDlg[ 7 ] , acnDlg[ 8 ] , ;
acnDlg[ 9 ] , acnDlg[ 10 ] , acnDlg[ 11 ] , acnDlg[ 12 ] )
ELSE
xTemplate := acnDlg
endif
ENDIF
hDlg := Wvt_CreateDialogDynamic( xTemplate, lOnTop, cbDlgProc, nDlgMode )
if hDlg != 0
if ncIcon != nil
IF hDlg != 0
IF ncIcon != nil
Wvt_DlgSetIcon( hDlg, ncIcon )
endif
ENDIF
if valtype( nTimerTicks ) == "N"
IF ValType( nTimerTicks ) == "N"
WVG_SetTimer( hDlg, 1001, nTimerTicks )
endif
ENDIF
if hMenu != nil
IF hMenu != nil
WVG_SetMenu( hDlg, hMenu )
endif
ENDIF
endif
ENDIF
Return hDlg
RETURN hDlg
//
Function Wvt_DialogBox( acnDlg, cbDlgProc, hWndParent )
FUNCTION Wvt_DialogBox( acnDlg, cbDlgProc, hWndParent )
LOCAL nResult, cType, xTemplate, nDlgMode
if valtype( cbDlgProc ) == "C"
cbDlgProc := upper( cbDlgProc )
endif
IF ValType( cbDlgProc ) == "C"
cbDlgProc := Upper( cbDlgProc )
ENDIF
cType := Valtype( acnDlg )
cType := ValType( acnDlg )
nDlgMode := iif( cType == "C", 0, iif( cType == "N", 1, 2 ) )
if cType == "A"
IF cType == "A"
xTemplate := Wvt__MakeDlgTemplate( acnDlg[ 1 ] , acnDlg[ 2 ] , acnDlg[ 3 ] , acnDlg[ 4 ] , ;
acnDlg[ 5 ] , acnDlg[ 6 ] , acnDlg[ 7 ] , acnDlg[ 8 ] , ;
acnDlg[ 9 ] , acnDlg[ 10 ] , acnDlg[ 11 ] , acnDlg[ 12 ] )
else
acnDlg[ 5 ] , acnDlg[ 6 ] , acnDlg[ 7 ] , acnDlg[ 8 ] , ;
acnDlg[ 9 ] , acnDlg[ 10 ] , acnDlg[ 11 ] , acnDlg[ 12 ] )
ELSE
xTemplate := acnDlg
endif
ENDIF
nResult := Wvt_CreateDialogModal( xTemplate, .F., cbDlgProc, nDlgMode, hWndParent )
nResult := Wvt_CreateDialogModal( xTemplate, .F. , cbDlgProc, nDlgMode, hWndParent )
Wvg_SetFocus( hWndParent )
Return nResult
RETURN nResult
//
/*
@@ -498,7 +514,9 @@ cDefName: DEFAULT file name
Returns: If OFN_ALLOWMULTISELECT ? Array of files selected : FileName.
*/
FUNCTION WVT_GetOpenFileName( hWnd, cPath, cTitle, acFilter, nFlags, cInitDir, cDefExt, nFilterIndex, cDefName )
LOCAL cRet, aTmp, xRet, i
HB_SYMBOL_UNUSED( hWnd )
@@ -514,10 +532,10 @@ FUNCTION WVT_GetOpenFileName( hWnd, cPath, cTitle, acFilter, nFlags, cInitDir, c
IF WVG_And( nFlags, OFN_ALLOWMULTISELECT ) > 0
xRet := {}
IF ! empty( aTmp := hb_aTokens( cRet, chr( 0 ) ) )
IF ! Empty( aTmp := hb_ATokens( cRet, Chr( 0 ) ) )
cPath := aTmp[ 1 ]
FOR i := 2 TO len( aTmp )
aadd( xRet, cPath + "\" + aTmp[ i ] )
FOR i := 2 TO Len( aTmp )
AAdd( xRet, cPath + "\" + aTmp[ i ] )
NEXT
ENDIF
ELSE
@@ -543,6 +561,7 @@ Returns: FileName.
*/
FUNCTION WVT_GetSaveFileName( hWnd, cDefName, cTitle, acFilter, nFlags, cInitDir, cDefExt, nFilterIndex )
LOCAL cRet, aTmp, xRet, i, cPath
HB_SYMBOL_UNUSED( hWnd )
@@ -557,10 +576,10 @@ FUNCTION WVT_GetSaveFileName( hWnd, cDefName, cTitle, acFilter, nFlags, cInitDir
IF WVG_And( nFlags, OFN_ALLOWMULTISELECT ) > 0
xRet := {}
IF ! empty( aTmp := hb_aTokens( cRet, chr( 0 ) ) )
IF ! Empty( aTmp := hb_ATokens( cRet, Chr( 0 ) ) )
cPath := aTmp[ 1 ]
FOR i := 2 TO len( aTmp )
aadd( xRet, cPath + "\" + aTmp[ i ] )
FOR i := 2 TO Len( aTmp )
AAdd( xRet, cPath + "\" + aTmp[ i ] )
NEXT
ENDIF
ELSE
@@ -586,28 +605,28 @@ FUNCTION WVT_GetSaveFileName( hWnd, cDefName, cTitle, acFilter, nFlags, cInitDir
FUNCTION Wvt_SetTitle( cTitle )
RETURN Hb_GtInfo( HB_GTI_WINTITLE, cTitle )
RETURN hb_gtInfo( HB_GTI_WINTITLE, cTitle )
//
FUNCTION Wvt_GetTitle()
RETURN Hb_GtInfo( HB_GTI_WINTITLE )
RETURN hb_gtInfo( HB_GTI_WINTITLE )
//
FUNCTION Wvt_SetIcon( ncIconRes, cIconName )
if valtype( ncIconRes ) == "N"
Hb_GtInfo( HB_GTI_ICONRES, ncIconRes )
IF ValType( ncIconRes ) == "N"
hb_gtInfo( HB_GTI_ICONRES, ncIconRes )
elseif valtype( cIconName ) == "C"
Hb_GtInfo( HB_GTI_ICONRES, cIconName )
ELSEIF ValType( cIconName ) == "C"
hb_gtInfo( HB_GTI_ICONRES, cIconName )
elseif valtype( ncIconRes ) == "C"
Hb_GtInfo( HB_GTI_ICONFILE, ncIconRes )
ELSEIF ValType( ncIconRes ) == "C"
hb_gtInfo( HB_GTI_ICONFILE, ncIconRes )
endif
ENDIF
RETURN NIL
@@ -615,37 +634,37 @@ FUNCTION Wvt_SetIcon( ncIconRes, cIconName )
FUNCTION Wvt_SetFont( cFontName, nSize, nWidth, nWeight, nQuality )
DEFAULT cFontName TO Hb_GtInfo( HB_GTI_FONTNAME )
DEFAULT nWidth TO Hb_GtInfo( HB_GTI_FONTWIDTH )
DEFAULT nWeight TO Hb_GtInfo( HB_GTI_FONTWEIGHT )
DEFAULT nQuality TO Hb_GtInfo( HB_GTI_FONTQUALITY )
DEFAULT nSize TO Hb_GtInfo( HB_GTI_FONTSIZE )
DEFAULT cFontName TO hb_gtInfo( HB_GTI_FONTNAME )
DEFAULT nWidth TO hb_gtInfo( HB_GTI_FONTWIDTH )
DEFAULT nWeight TO hb_gtInfo( HB_GTI_FONTWEIGHT )
DEFAULT nQuality TO hb_gtInfo( HB_GTI_FONTQUALITY )
DEFAULT nSize TO hb_gtInfo( HB_GTI_FONTSIZE )
RETURN Hb_GtInfo( HB_GTI_SETFONT, { cFontName, nSize, nWidth, nWeight, nQuality } )
RETURN hb_gtInfo( HB_GTI_SETFONT, { cFontName, nSize, nWidth, nWeight, nQuality } )
//
FUNCTION Wvt_SetCodePage( nCodePage )
RETURN Hb_GtInfo( HB_GTI_CODEPAGE, nCodePage )
RETURN hb_gtInfo( HB_GTI_CODEPAGE, nCodePage )
//
FUNCTION Wvt_GetPalette()
RETURN Hb_GtInfo( HB_GTI_PALETTE )
RETURN hb_gtInfo( HB_GTI_PALETTE )
//
FUNCTION Wvt_SetPalette( aRGB )
RETURN Hb_GtInfo( HB_GTI_PALETTE, aRGB )
RETURN hb_gtInfo( HB_GTI_PALETTE, aRGB )
//
FUNCTION Wvt_GetRGBColor( nIndex )
RETURN Hb_GtInfo( HB_GTI_PALETTE, nIndex )
RETURN hb_gtInfo( HB_GTI_PALETTE, nIndex )
//
#define BLACK RGB( 0x0 ,0x0 ,0x0 )
@@ -666,29 +685,30 @@ FUNCTION Wvt_GetRGBColor( nIndex )
#define WHITE RGB( 0xFF,0xFF,0xFF )
FUNCTION Wvt_GetRGBColorByString( cColor, nForeBack )
LOCAL s, n, lEnh
LOCAL nIndex := 0
LOCAL a_:= { "N", "B", "G", "BG", "R", "RB", "GR", "W" }
LOCAL a_ := { "N", "B", "G", "BG", "R", "RB", "GR", "W" }
nForeBack := iif( HB_ISNUMERIC( nForeBack ), nForeBack, 0 )
IF HB_ISSTRING( cColor )
IF ( n := at( "/", cColor ) ) > 0
IF ( n := At( "/", cColor ) ) > 0
IF nForeBack == 0
s := substr( cColor, 1, n-1 )
s := SubStr( cColor, 1, n - 1 )
ELSE
s := substr( cColor, n+1 )
s := SubStr( cColor, n + 1 )
ENDIF
ELSE
s := cColor
ENDIF
s := upper( s )
s := Upper( s )
lEnh := ( "*" $ s ) .OR. ( "+" $ s )
IF lEnh
s := strtran( s, "*" )
s := strtran( s, "+" )
s := StrTran( s, "*" )
s := StrTran( s, "+" )
ENDIF
nIndex := ascan( a_, {| e | e == s } )
nIndex := AScan( a_, {| e | e == s } )
IF nIndex > 0
IF lEnh
nIndex += 8
@@ -697,31 +717,31 @@ FUNCTION Wvt_GetRGBColorByString( cColor, nForeBack )
ENDIF
ENDIF
RETURN Hb_GtInfo( HB_GTI_PALETTE, nIndex )
RETURN hb_gtInfo( HB_GTI_PALETTE, nIndex )
//
FUNCTION Wvt_SetAltF4Close( lSetClose )
RETURN Hb_GtInfo( HB_GTI_CLOSABLE, lSetClose )
RETURN hb_gtInfo( HB_GTI_CLOSABLE, lSetClose )
//
FUNCTION Wvt_GetScreenWidth()
RETURN Hb_GtInfo( HB_GTI_DESKTOPWIDTH )
RETURN hb_gtInfo( HB_GTI_DESKTOPWIDTH )
//
FUNCTION Wvt_GetScreenHeight()
RETURN Hb_GtInfo( HB_GTI_DESKTOPHEIGHT )
RETURN hb_gtInfo( HB_GTI_DESKTOPHEIGHT )
//
FUNCTION Wvt_GetWindowHandle()
RETURN Hb_GtInfo( HB_GTI_SPEC, HB_GTS_WINDOWHANDLE )
RETURN hb_gtInfo( HB_GTI_SPEC, HB_GTS_WINDOWHANDLE )
//
@@ -730,7 +750,7 @@ FUNCTION Wvt_CenterWindow( lCenter, lRePaint )
DEFAULT lCenter TO .T.
DEFAULT lRePaint TO .F.
RETURN Hb_GtInfo( HB_GTI_SPEC, HB_GTS_CENTERWINDOW, { lCenter, lRePaint } )
RETURN hb_gtInfo( HB_GTI_SPEC, HB_GTS_CENTERWINDOW, { lCenter, lRePaint } )
//
@@ -739,13 +759,13 @@ FUNCTION Wvt_WindowCentre( lCenter, lRePaint )
DEFAULT lCenter TO .T.
DEFAULT lRePaint TO .F.
RETURN Hb_GtInfo( HB_GTI_SPEC, HB_GTS_CENTERWINDOW, { lCenter, lRePaint } )
RETURN hb_gtInfo( HB_GTI_SPEC, HB_GTS_CENTERWINDOW, { lCenter, lRePaint } )
//
FUNCTION Wvt_ProcessMessages()
Hb_GtInfo( HB_GTI_SPEC, HB_GTS_PROCESSMESSAGES )
hb_gtInfo( HB_GTI_SPEC, HB_GTS_PROCESSMESSAGES )
RETURN .T.
@@ -753,7 +773,7 @@ FUNCTION Wvt_ProcessMessages()
FUNCTION Wvt_KeyBoard( nKey )
Hb_GtInfo( HB_GTI_SPEC, HB_GTS_KEYBOARD, nKey )
hb_gtInfo( HB_GTI_SPEC, HB_GTS_KEYBOARD, nKey )
RETURN NIL
@@ -761,25 +781,26 @@ FUNCTION Wvt_KeyBoard( nKey )
FUNCTION Wvt_GetClipboard()
RETURN Hb_GtInfo( HB_GTI_CLIPBOARDDATA )
RETURN hb_gtInfo( HB_GTI_CLIPBOARDDATA )
//
FUNCTION Wvt_SetClipboard( cText )
RETURN Hb_GtInfo( HB_GTI_CLIPBOARDDATA, cText )
RETURN hb_gtInfo( HB_GTI_CLIPBOARDDATA, cText )
//
FUNCTION Wvt_PasteFromClipboard()
Local cText, nLen, i
cText := Hb_GtInfo( HB_GTI_CLIPBOARDDATA )
if ( nLen := Len( cText ) ) > 0
for i := 1 to nLen
Wvt_KeyBoard( asc( substr( cText, i, 1 ) ) )
next
endif
LOCAL cText, nLen, i
cText := hb_gtInfo( HB_GTI_CLIPBOARDDATA )
IF ( nLen := Len( cText ) ) > 0
FOR i := 1 TO nLen
Wvt_KeyBoard( Asc( SubStr( cText, i, 1 ) ) )
NEXT
ENDIF
RETURN NIL
@@ -787,72 +808,72 @@ FUNCTION Wvt_PasteFromClipboard()
FUNCTION Wvt_ResetWindow()
RETURN Hb_GtInfo( HB_GTI_SPEC, HB_GTS_RESETWINDOW )
RETURN hb_gtInfo( HB_GTI_SPEC, HB_GTS_RESETWINDOW )
//
FUNCTION Wvt_SetTimer( nTimerID, nMiliSeconds )
RETURN Hb_GtInfo( HB_GTI_SPEC, HB_GTS_SETTIMER, { nTimerID, nMiliSeconds } )
RETURN hb_gtInfo( HB_GTI_SPEC, HB_GTS_SETTIMER, { nTimerID, nMiliSeconds } )
//
FUNCTION Wvt_KillTimer( nTimerID )
RETURN Hb_GtInfo( HB_GTI_SPEC, HB_GTS_KILLTIMER, nTimerID )
RETURN hb_gtInfo( HB_GTI_SPEC, HB_GTS_KILLTIMER, nTimerID )
//
FUNCTION Wvt_SetOnTop()
RETURN Hb_GtInfo( HB_GTI_SPEC, HB_GTS_WNDSTATE, HB_GTS_WS_SETONTOP )
RETURN hb_gtInfo( HB_GTI_SPEC, HB_GTS_WNDSTATE, HB_GTS_WS_SETONTOP )
//
FUNCTION Wvt_SetAsNormal()
RETURN Hb_GtInfo( HB_GTI_SPEC, HB_GTS_WNDSTATE, HB_GTS_WS_SETASNORMAL )
RETURN hb_gtInfo( HB_GTI_SPEC, HB_GTS_WNDSTATE, HB_GTS_WS_SETASNORMAL )
//
FUNCTION Wvt_Minimize()
RETURN Hb_GtInfo( HB_GTI_SPEC, HB_GTS_WNDSTATE, HB_GTS_WS_MINIMIZED )
RETURN hb_gtInfo( HB_GTI_SPEC, HB_GTS_WNDSTATE, HB_GTS_WS_MINIMIZED )
//
FUNCTION Wvt_Maximize()
RETURN Hb_GtInfo( HB_GTI_SPEC, HB_GTS_WNDSTATE, HB_GTS_WS_MAXIMIZED )
RETURN hb_gtInfo( HB_GTI_SPEC, HB_GTS_WNDSTATE, HB_GTS_WS_MAXIMIZED )
//
FUNCTION Wvt_Hide()
RETURN Hb_GtInfo( HB_GTI_SPEC, HB_GTS_WNDSTATE, HB_GTS_WS_HIDDEN )
RETURN hb_gtInfo( HB_GTI_SPEC, HB_GTS_WNDSTATE, HB_GTS_WS_HIDDEN )
//
FUNCTION Wvt_Show()
RETURN Hb_GtInfo( HB_GTI_SPEC, HB_GTS_WNDSTATE, HB_GTS_WS_NORMAL )
RETURN hb_gtInfo( HB_GTI_SPEC, HB_GTS_WNDSTATE, HB_GTS_WS_NORMAL )
//
FUNCTION Wvt_SetWindowPos( nX, nY )
RETURN Hb_GtInfo( HB_GTI_SPEC, HB_GTS_SETPOSITION, { nX, nY } )
RETURN hb_gtInfo( HB_GTI_SPEC, HB_GTS_SETPOSITION, { nX, nY } )
//
FUNCTION Wvt_ShowWindow( nState )
RETURN Hb_GtInfo( HB_GTI_SPEC, HB_GTS_SHOWWINDOW, nState )
RETURN hb_gtInfo( HB_GTI_SPEC, HB_GTS_SHOWWINDOW, nState )
//
FUNCTION Wvt_Update()
RETURN Hb_GtInfo( HB_GTI_SPEC, HB_GTS_UPDATEWINDOW )
RETURN hb_gtInfo( HB_GTI_SPEC, HB_GTS_UPDATEWINDOW )
//

View File

@@ -49,6 +49,7 @@
* If you do not wish that, delete this exception notice.
*
*/
//
//
//
@@ -109,7 +110,7 @@ CLASS WvgPartHandler
DATA sb_notifier
METHOD notifierBlock( ... ) SETGET
ENDCLASS
ENDCLASS
//
@@ -176,17 +177,18 @@ METHOD WvgPartHandler:status()
METHOD WvgPartHandler:addChild( oWvg )
oWvg:nNameID := oWvg:nID
aadd( ::aChildren, oWvg )
AAdd( ::aChildren, oWvg )
RETURN Self
//
METHOD WvgPartHandler:childFromName( nNameId )
LOCAL i, oWvg
FOR i := 1 TO len( ::aChildren )
IF ::aChildren[ i ]:nNameID != NIL .and. ::aChildren[ i ]:nNameID == nNameID
FOR i := 1 TO Len( ::aChildren )
IF ::aChildren[ i ]:nNameID != NIL .AND. ::aChildren[ i ]:nNameID == nNameID
oWvg := ::aChildren[ i ]
ENDIF
NEXT
@@ -202,10 +204,11 @@ METHOD WvgPartHandler:childList()
//
METHOD WvgPartHandler:removeChild( oChild )
LOCAL n
IF ( n := ascan( ::aChildren, {| o | o == oChild } ) ) > 0
hb_aDel( ::aChildren, n, .T. )
IF ( n := AScan( ::aChildren, {| o | o == oChild } ) ) > 0
hb_ADel( ::aChildren, n, .T. )
ENDIF
RETURN Self
@@ -213,23 +216,25 @@ METHOD WvgPartHandler:removeChild( oChild )
//
METHOD WvgPartHandler:delChild( oWvg )
LOCAL n
n := ascan( ::aChildren, {| o | o == oWvg } )
n := AScan( ::aChildren, {| o | o == oWvg } )
IF n > 0
oWvg:destroy()
adel( ::aChildren, n )
asize( ::aChildren, len( ::aChildren )-1 )
endif
ADel( ::aChildren, n )
ASize( ::aChildren, Len( ::aChildren ) - 1 )
ENDIF
RETURN Self
//
METHOD WvgPartHandler:setName( nNameId )
LOCAL nOldNameId := ::nNameId
IF Valtype( nNameId ) == "N"
IF ValType( nNameId ) == "N"
::nNameID := nNameId
ENDIF
@@ -238,9 +243,10 @@ METHOD WvgPartHandler:setName( nNameId )
//
METHOD WvgPartHandler:setOwner( oWvg )
LOCAL oOldXbp := ::oOwner
IF valtype( oWvg ) == "O"
IF ValType( oWvg ) == "O"
::oOwner := oWvg
ENDIF
@@ -249,9 +255,10 @@ METHOD WvgPartHandler:setOwner( oWvg )
//
METHOD WvgPartHandler:setParent( oWvg )
LOCAL oOldXbp := ::oParent
IF valtype( oWvg ) == "O"
IF ValType( oWvg ) == "O"
::oParent := oWvg
ENDIF
@@ -260,7 +267,8 @@ METHOD WvgPartHandler:setParent( oWvg )
//
METHOD WvgPartHandler:notifierBlock( ... )
LOCAL a_:= hb_AParams()
LOCAL a_ := hb_AParams()
IF ! Empty( a_ ) .AND. HB_ISBLOCK( a_[ 1 ] )
::sb_notifier := a_[ 1 ]
@@ -277,8 +285,10 @@ METHOD WvgPartHandler:notifierBlock( ... )
/*
This will be called by the WvgCRT() console FOR various events TO be propogated TO child controls
*/
METHOD WvgPartHandler:notifier( nEvent, xParams )
Local aPos, aMenuItem, nIndex, nCtrlID, oObj
LOCAL aPos, aMenuItem, nIndex, nCtrlID, oObj
LOCAL nReturn := 0
DO CASE
@@ -286,9 +296,9 @@ METHOD WvgPartHandler:notifier( nEvent, xParams )
CASE nEvent == HB_GTE_MOUSE
IF xParams[ 1 ] == WM_MOUSEHOVER
aPos := { xParams[ 3 ], xParams[ 4 ] }
elseif xParams[ 1 ] == WM_MOUSELEAVE
ELSEIF xParams[ 1 ] == WM_MOUSELEAVE
/* Nothing */
else
ELSE
aPos := iif( ::mouseMode == 2, { xParams[ 3 ], xParams[ 4 ] }, { xParams[ 5 ], xParams[ 6 ] } )
ENDIF
@@ -296,67 +306,67 @@ METHOD WvgPartHandler:notifier( nEvent, xParams )
CASE WM_MOUSEHOVER
IF HB_ISBLOCK( ::sl_enter )
eval( ::sl_enter, aPos, NIL, Self )
Eval( ::sl_enter, aPos, NIL, Self )
ENDIF
EXIT
CASE WM_MOUSELEAVE
IF HB_ISBLOCK( ::sl_leave )
eval( ::sl_leave, aPos, NIL, Self )
Eval( ::sl_leave, aPos, NIL, Self )
ENDIF
EXIT
CASE WM_RBUTTONDOWN
IF HB_ISBLOCK( ::sl_rbDown )
eval( ::sl_rbDown, aPos, NIL, Self )
Eval( ::sl_rbDown, aPos, NIL, Self )
ENDIF
EXIT
CASE WM_LBUTTONDOWN
IF HB_ISBLOCK( ::sl_lbDown )
eval( ::sl_lbDown, aPos, NIL, Self )
Eval( ::sl_lbDown, aPos, NIL, Self )
ENDIF
EXIT
CASE WM_RBUTTONUP
IF HB_ISBLOCK( ::sl_rbUp )
eval( ::sl_rbUp, aPos, NIL, Self )
Eval( ::sl_rbUp, aPos, NIL, Self )
ENDIF
EXIT
CASE WM_LBUTTONUP
IF HB_ISBLOCK( ::sl_lbUp )
eval( ::sl_lbUp, aPos, NIL, Self )
Eval( ::sl_lbUp, aPos, NIL, Self )
ENDIF
EXIT
CASE WM_RBUTTONDBLCLK
IF HB_ISBLOCK( ::sl_rbDblClick )
eval( ::sl_rbDblClick, aPos, NIL, Self )
Eval( ::sl_rbDblClick, aPos, NIL, Self )
ENDIF
EXIT
CASE WM_LBUTTONDBLCLK
IF HB_ISBLOCK( ::sl_lbDblClick )
eval( ::sl_lbDblClick, aPos, NIL, Self )
Eval( ::sl_lbDblClick, aPos, NIL, Self )
ENDIF
EXIT
CASE WM_MBUTTONDOWN
IF HB_ISBLOCK( ::sl_mbDown )
eval( ::sl_mbDown, aPos, NIL, Self )
Eval( ::sl_mbDown, aPos, NIL, Self )
ENDIF
EXIT
CASE WM_MBUTTONUP
IF HB_ISBLOCK( ::sl_mbClick )
eval( ::sl_mbClick, aPos, NIL, Self )
Eval( ::sl_mbClick, aPos, NIL, Self )
ENDIF
EXIT
CASE WM_MBUTTONDBLCLK
IF HB_ISBLOCK( ::sl_mbDblClick )
eval( ::sl_mbDblClick, aPos, NIL, Self )
Eval( ::sl_mbDblClick, aPos, NIL, Self )
ENDIF
EXIT
CASE WM_MOUSEMOVE
IF HB_ISBLOCK( ::sl_motion )
eval( ::sl_motion, aPos, NIL, Self )
Eval( ::sl_motion, aPos, NIL, Self )
ENDIF
EXIT
CASE WM_MOUSEWHEEL
IF HB_ISBLOCK( ::sl_wheel )
eval( ::sl_wheel, aPos, NIL, Self )
Eval( ::sl_wheel, aPos, NIL, Self )
ENDIF
EXIT
CASE WM_NCMOUSEMOVE
@@ -365,20 +375,20 @@ METHOD WvgPartHandler:notifier( nEvent, xParams )
CASE nEvent == HB_GTE_KEYBOARD
IF HB_ISBLOCK( ::keyboard )
eval( ::keyboard, xParams, NIL, Self )
Eval( ::keyboard, xParams, NIL, Self )
ENDIF
CASE nEvent == HB_GTE_SETFOCUS
/* aeval( ::aChildren, {| o | WVG_InvalidateRect( o:hWnd ) } ) */
IF HB_ISBLOCK( ::sl_setInputFocus )
eval( ::sl_setInputFocus, NIL, NIL, Self )
Eval( ::sl_setInputFocus, NIL, NIL, Self )
ENDIF
::lHasInputFocus := .T.
CASE nEvent == HB_GTE_KILLFOCUS
IF HB_ISBLOCK( ::sl_killInputFocus )
eval( ::sl_killInputFocus, NIL, NIL, Self )
Eval( ::sl_killInputFocus, NIL, NIL, Self )
ENDIF
::lHasInputFocus := .F.
@@ -389,18 +399,18 @@ METHOD WvgPartHandler:notifier( nEvent, xParams )
/* Eventally every window be checked if it falls within returned rectangle or not
* then it will avoid a lot of flickering
*/
aeval( ::aChildren, {| o | WVG_InvalidateRect( o:hWnd ) } )
AEval( ::aChildren, {| o | WVG_InvalidateRect( o:hWnd ) } )
CASE nEvent == HB_GTE_CLOSE
IF HB_ISBLOCK( ::close )
nReturn := eval( ::close, NIL, NIL, Self )
nReturn := Eval( ::close, NIL, NIL, Self )
ENDIF
CASE nEvent == HB_GTE_MENU
DO CASE
CASE xParams[ 1 ] == 0 /* menu selected */
IF HB_ISOBJECT( ::oMenu )
IF !empty( aMenuItem := ::oMenu:FindMenuItemById( xParams[ 2 ] ) )
IF !Empty( aMenuItem := ::oMenu:FindMenuItemById( xParams[ 2 ] ) )
IF HB_ISBLOCK( aMenuItem[ 2 ] )
Eval( aMenuItem[ 2 ], aMenuItem[ 1 ], NIL, aMenuItem[ 4 ] )
@@ -411,12 +421,12 @@ METHOD WvgPartHandler:notifier( nEvent, xParams )
ENDIF
ENDIF
CASE xParams[ 1 ] == 1 .and. HB_ISOBJECT( ::oMenu ) /* enter menu loop */
CASE xParams[ 1 ] == 1 .AND. HB_ISOBJECT( ::oMenu ) /* enter menu loop */
IF HB_ISBLOCK( ::oMenu:sl_beginMenu )
Eval( ::oMenu:sl_beginMenu, NIL, NIL, Self )
ENDIF
CASE xParams[ 1 ] == 2 .and. HB_ISOBJECT( ::oMenu ) /* exit menu loop */
CASE xParams[ 1 ] == 2 .AND. HB_ISOBJECT( ::oMenu ) /* exit menu loop */
IF HB_ISBLOCK( ::oMenu:sl_endMenu )
Eval( ::oMenu:sl_endMenu, NIL, NIL, Self )
ENDIF
@@ -425,13 +435,13 @@ METHOD WvgPartHandler:notifier( nEvent, xParams )
CASE nEvent == HB_GTE_NOTIFY
nCtrlID := xParams[ 1 ]
IF ( nIndex := ascan( ::aChildren, {| o | o:nID == nCtrlID } ) ) > 0
IF ( nIndex := AScan( ::aChildren, {| o | o:nID == nCtrlID } ) ) > 0
RETURN ::aChildren[ nIndex ]:handleEvent( HB_GTE_NOTIFY, xParams )
ENDIF
CASE nEvent == HB_GTE_COMMAND
nCtrlID := xParams[ 2 ]
IF ( nIndex := ascan( ::aChildren, {| o | o:nID == nCtrlID } ) ) > 0
IF ( nIndex := AScan( ::aChildren, {| o | o:nID == nCtrlID } ) ) > 0
RETURN ::aChildren[ nIndex ]:handleEvent( HB_GTE_COMMAND, xParams )
ENDIF
@@ -464,13 +474,13 @@ METHOD WvgPartHandler:notifier( nEvent, xParams )
CASE nEvent == HB_GTE_RESIZED
IF ::objType == objTypeDialog
IF ::drawingArea:objType == objTypeDA
::drawingArea:setPosAndSize( {0,0}, ::currentSize(), .F. )
::drawingArea:setPosAndSize( { 0, 0 }, ::currentSize(), .F. )
ENDIF
ENDIF
IF HB_ISBLOCK( ::sl_resize )
eval( ::sl_resize, { xParams[ 1 ], xParams[ 2 ] }, { xParams[ 3 ], xParams[ 4 ] }, Self )
Eval( ::sl_resize, { xParams[ 1 ], xParams[ 2 ] }, { xParams[ 3 ], xParams[ 4 ] }, Self )
ENDIF
aeval( ::aChildren, {| o | o:handleEvent( HB_GTE_RESIZED, { 0, 0, 0, 0, 0 } ) } )
AEval( ::aChildren, {| o | o:handleEvent( HB_GTE_RESIZED, { 0, 0, 0, 0, 0 } ) } )
CASE nEvent == HB_GTE_KEYTOITEM
IF xParams[ 3 ] == ::hWnd
@@ -490,13 +500,15 @@ METHOD WvgPartHandler:notifier( nEvent, xParams )
/*
This will be called if a control is assigned its own WndProc via ::SetWindowProcCallback()
*/
METHOD WvgPartHandler:controlWndProc( hWnd, nMessage, nwParam, nlParam )
LOCAL nCtrlID, nNotifctn, hWndCtrl, nObj, aMenuItem, oObj, nReturn
SWITCH nMessage
CASE WM_ERASEBKGND
IF ::objType == objTypeDA .AND. ! empty( ::hBrushBG )
IF ::objType == objTypeDA .AND. ! Empty( ::hBrushBG )
::handleEvent( HB_GTE_CTLCOLOR, { nwParam, nlParam } )
ENDIF
EXIT
@@ -508,7 +520,7 @@ METHOD WvgPartHandler:controlWndProc( hWnd, nMessage, nwParam, nlParam )
IF hWndCtrl == 0 /* It is menu */
IF HB_ISOBJECT( ::oMenu )
IF !empty( aMenuItem := ::oMenu:FindMenuItemById( nCtrlID ) )
IF !Empty( aMenuItem := ::oMenu:FindMenuItemById( nCtrlID ) )
IF HB_ISBLOCK( aMenuItem[ 2 ] )
Eval( aMenuItem[ 2 ], aMenuItem[ 1 ], NIL, aMenuItem[ 4 ] )
@@ -520,7 +532,7 @@ METHOD WvgPartHandler:controlWndProc( hWnd, nMessage, nwParam, nlParam )
ENDIF
RETURN 0
ELSE
IF ( nObj := ascan( ::aChildren, {| o | o:nID == nCtrlID } ) ) > 0
IF ( nObj := AScan( ::aChildren, {| o | o:nID == nCtrlID } ) ) > 0
nReturn := ::aChildren[ nObj ]:handleEvent( HB_GTE_COMMAND, { nNotifctn, nCtrlID, hWndCtrl } )
IF HB_ISNUMERIC( nReturn ) .AND. nReturn == 0
RETURN 0
@@ -530,7 +542,7 @@ METHOD WvgPartHandler:controlWndProc( hWnd, nMessage, nwParam, nlParam )
EXIT
CASE WM_NOTIFY
IF ( nObj := ascan( ::aChildren, {| o | o:nID == nwParam } ) ) > 0
IF ( nObj := AScan( ::aChildren, {| o | o:nID == nwParam } ) ) > 0
nReturn := ::aChildren[ nObj ]:handleEvent( HB_GTE_NOTIFY, { nwParam, nlParam } )
IF HB_ISNUMERIC( nReturn ) .AND. nReturn == EVENT_HANDELLED
RETURN 0

View File

@@ -49,6 +49,7 @@
* If you do not wish that, delete this exception notice.
*
*/
//
//
//
@@ -84,7 +85,7 @@ CLASS WvgPushButton INHERIT WvgWindow
DATA pointerFocus INIT .T.
DATA preSelect INIT .F.
DATA drawMode INIT WVG_DRAW_NORMAL
DATA default INIT .F.
DATA DEFAULT INIT .F.
DATA cancel INIT .F.
METHOD new( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
@@ -100,7 +101,7 @@ CLASS WvgPushButton INHERIT WvgWindow
METHOD setColorFG() INLINE NIL
METHOD setColorBG() INLINE NIL
ENDCLASS
ENDCLASS
//
@@ -123,9 +124,9 @@ METHOD WvgPushButton:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible
IF HB_ISNUMERIC( ::caption )
::style += BS_BITMAP
ELSEIF HB_ISSTRING( ::caption )
IF ".ICO" == upper( right( ::caption, 4 ) )
IF ".ICO" == Upper( Right( ::caption, 4 ) )
::style += BS_ICON
ELSEIF ".BMP" == upper( right( ::caption, 4 ) )
ELSEIF ".BMP" == Upper( Right( ::caption, 4 ) )
::style += BS_BITMAP
ENDIF
ENDIF
@@ -160,7 +161,7 @@ METHOD WvgPushButton:handleEvent( nMessage, aNM )
ENDIF
::sendMessage( WM_SIZE, 0, 0 )
IF HB_ISBLOCK( ::sl_resize )
eval( ::sl_resize, NIL, NIL, self )
Eval( ::sl_resize, NIL, NIL, self )
ENDIF
CASE nMessage == HB_GTE_COMMAND
@@ -169,7 +170,7 @@ METHOD WvgPushButton:handleEvent( nMessage, aNM )
IF ::isParentCrt()
::oParent:setFocus()
ENDIF
eval( ::sl_lbClick, NIL, NIL, self )
Eval( ::sl_lbClick, NIL, NIL, self )
IF ::pointerFocus
::setFocus()
ENDIF
@@ -196,7 +197,7 @@ METHOD WvgPushButton:handleEvent( nMessage, aNM )
IF ::isParentCrt()
::oParent:setFocus()
ENDIF
eval( ::sl_lbClick, NIL, NIL, Self )
Eval( ::sl_lbClick, NIL, NIL, Self )
ENDIF
ENDIF
#endif
@@ -207,13 +208,17 @@ METHOD WvgPushButton:handleEvent( nMessage, aNM )
//
METHOD WvgPushButton:destroy()
::wvgWindow:destroy()
RETURN NIL
//
METHOD WvgPushButton:configure( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::Initialize( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
RETURN Self
//
@@ -225,9 +230,9 @@ METHOD WvgPushButton:setCaption( xCaption, cDll )
IF HB_ISSTRING( xCaption )
::caption := xCaption
IF ".ico" == lower( right( ::caption, 4 ) )
IF ".ico" == Lower( Right( ::caption, 4 ) )
WVG_SendMessage( ::hWnd, BM_SETIMAGE, IMAGE_ICON, WVG_LoadImage( ::caption, 2, IMAGE_ICON ) )
ELSEIF ".BMP" == upper( right( ::caption, 4 ) )
ELSEIF ".BMP" == Upper( Right( ::caption, 4 ) )
WVG_SendMessage( ::hWnd, BM_SETIMAGE, IMAGE_BITMAP, WVG_LoadImage( ::caption, 2, IMAGE_BITMAP ) )
ELSE
WVG_SendMessageText( ::hWnd, WM_SETTEXT, 0, ::caption )
@@ -245,7 +250,7 @@ METHOD WvgPushButton:setCaption( xCaption, cDll )
METHOD WvgPushButton:activate( xParam )
IF HB_ISBLOCK( xParam ) .OR. ( xParam == NIL )
IF HB_ISBLOCK( xParam ) .OR. xParam == NIL
::sl_lbClick := xParam
ENDIF
@@ -255,7 +260,7 @@ METHOD WvgPushButton:activate( xParam )
METHOD WvgPushButton:draw( xParam )
IF HB_ISBLOCK( xParam ) .or. ( xParam == NIL )
IF HB_ISBLOCK( xParam ) .OR. xParam == NIL
::sl_paint := xParam
ENDIF

View File

@@ -49,6 +49,7 @@
* If you do not wish that, delete this exception notice.
*
*/
//
//
//
@@ -100,7 +101,7 @@ CLASS WvgRadioButton INHERIT WvgWindow, WvgDataRef
ACCESS selected INLINE ::sl_lbClick
ASSIGN selected( bBlock ) INLINE ::sl_lbClick := bBlock
ENDCLASS
ENDCLASS
//
@@ -151,7 +152,7 @@ METHOD handleEvent( nMessage, aNM ) CLASS WvgRadioButton
::editBuffer := ( WVG_Button_GetCheck( ::hWnd ) == BST_CHECKED )
IF HB_ISBLOCK( ::sl_lbClick )
eval( ::sl_lbClick, ::editBuffer, NIL, self )
Eval( ::sl_lbClick, ::editBuffer, NIL, self )
RETURN 0
ENDIF
ENDIF

View File

@@ -49,6 +49,7 @@
* If you do not wish that, delete this exception notice.
*
*/
//
//
//
@@ -74,54 +75,14 @@
#include "wvtwin.ch"
#include "wvgparts.ch"
//
#if 0
#include "xhb.ch"
#include "cstruct.ch"
#include "wintypes.ch"
typedef struct tagSCROLLBARINFO {;
DWORD cbSize;
RECT rcScrollBar;
int dxyLineButton;
int xyThumbTop;
int xyThumbBottom;
int reserved;
DWORD x; /* rgstate[CCHILDREN_SCROLLBAR+1]; */
} SCROLLBARINFO
typedef struct tagSCROLLINFO {;
UINT cbSize;
UINT fMask;
int nMin;
int nMax;
UINT nPage;
int nPos;
int nTrackPos;
} SCROLLINFO
typedef struct tagPOINT {;
LONG x;
LONG y;
} POINT
typedef struct tagRECT { ;
LONG left;
LONG top;
LONG right;
LONG bottom;
} RECT
#endif
//
CLASS WvgScrollBar INHERIT WvgWindow, WvgDataRef
DATA autoTrack INIT .T.
DATA range INIT {0,1}
DATA scrollBoxSize INIT -1
DATA type INIT WVGSCROLL_HORIZONTAL
DATA RANGE INIT { 0, 1 }
DATA scrollBoxSize INIT - 1
DATA TYPE INIT WVGSCROLL_HORIZONTAL
DATA excludeScrollBox INIT .F.
DATA sl_xbeSB_Scroll
@@ -134,12 +95,12 @@ CLASS WvgScrollBar INHERIT WvgWindow, WvgDataRef
METHOD destroy()
METHOD handleEvent( nMessage, aNM )
METHOD scroll( xParam ) SETGET
METHOD Scroll( xParam ) SETGET
METHOD setRange( aRange )
METHOD setScrollBoxSize( nUnits )
ENDCLASS
ENDCLASS
//
@@ -194,6 +155,7 @@ METHOD create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) CLASS WvgSc
//
METHOD handleEvent( nMessage, aNM ) CLASS WvgScrollBar
LOCAL nScrMsg, nScrPos, nCommand
DO CASE
@@ -219,7 +181,7 @@ METHOD handleEvent( nMessage, aNM ) CLASS WvgScrollBar
ENDIF
nScrMsg := aNM[ 1 ]
IF nScrMsg == SB_THUMBPOSITION .or. nScrMsg == SB_THUMBTRACK
IF nScrMsg == SB_THUMBPOSITION .OR. nScrMsg == SB_THUMBTRACK
nScrPos := aNM[ 2 ]
ELSE
nScrPos := WAPI_GetScrollPos( ::pWnd, SB_CTL )
@@ -277,7 +239,7 @@ METHOD handleEvent( nMessage, aNM ) CLASS WvgScrollBar
ENDCASE
::sl_editBuffer := nScrPos
eval( ::sl_xbeSB_Scroll, { nScrPos, nCommand }, NIL, Self )
Eval( ::sl_xbeSB_Scroll, { nScrPos, nCommand }, NIL, Self )
RETURN EVENT_HANDELLED
@@ -287,7 +249,7 @@ METHOD handleEvent( nMessage, aNM ) CLASS WvgScrollBar
ENDIF
nScrMsg := aNM[ 1 ]
IF nScrMsg == SB_THUMBPOSITION .or. nScrMsg == SB_THUMBTRACK
IF nScrMsg == SB_THUMBPOSITION .OR. nScrMsg == SB_THUMBTRACK
nScrPos := aNM[ 2 ]
ELSE
nScrPos := WAPI_GetScrollPos( ::pWnd, SB_CTL )
@@ -349,7 +311,7 @@ METHOD handleEvent( nMessage, aNM ) CLASS WvgScrollBar
ENDCASE
::sl_editBuffer := nScrPos
eval( ::sl_xbeSB_Scroll, { nScrPos, nCommand }, NIL, self )
Eval( ::sl_xbeSB_Scroll, { nScrPos, nCommand }, NIL, self )
RETURN EVENT_HANDELLED
ENDCASE
@@ -368,7 +330,7 @@ METHOD destroy() CLASS WvgScrollBar
//
METHOD scroll( xParam ) CLASS WvgScrollBar
METHOD Scroll( xParam ) CLASS WvgScrollBar
IF HB_ISBLOCK( xParam )
::sl_xbeSB_Scroll := xParam
@@ -379,6 +341,7 @@ METHOD scroll( xParam ) CLASS WvgScrollBar
//
METHOD setRange( aRange ) CLASS WvgScrollBar
LOCAL aOldRange, nMin, nMax
IF WAPI_GetScrollRange( ::pWnd, SB_CTL, @nMin, @nMax )
@@ -396,276 +359,7 @@ METHOD setRange( aRange ) CLASS WvgScrollBar
//
METHOD setScrollBoxSize( nUnits ) CLASS WvgScrollBar
LOCAL nOldUnits := nUnits
RETURN nOldUnits
//
#if 0
Scroll Bar
This section contains information about the programming elements used with scroll bars.
A window can display a data object, such as a document or a bitmap, that is larger than
the windows client area. When provided with a scroll bar, the user can scroll a data
object in the client area to bring into view the portions of the object that extend beyond
the borders of the window.
Overviews
About Scroll Bars
A scroll bar consists of a shaded shaft with an arrow button at each end and a scroll
box (sometimes called a thumb) between the arrow buttons.
Using Scroll Bars
When creating an overlapped, pop-up, or child window, you can add standard scroll bars
by using the CreateWindowEx function and specifying WS_HSCROLL, WS_VSCROLL, or both styles.
Functions
EnableScrollBar
The EnableScrollBar function enables or disables one or both scroll bar arrows.
GetScrollBarInfo
The GetScrollBarInfo function retrieves information about the specified scroll bar.
GetScrollInfo
The GetScrollInfo function retrieves the parameters of a scroll bar, including
the minimum and maximum scrolling positions, the page size, and the position of the
scroll box (thumb).
GetScrollPos
The GetScrollPos function retrieves the current position of the scroll box (thumb)
in the specified scroll bar. The current position is a relative value that depends on
the current scrolling range. For example, if the scrolling range is 0 through 100 and the
scroll box is in the middle of the bar, the current position is 50.
Note The GetScrollPos function is provided for backward compatibility. New applications
should use the GetScrollInfo function.
GetScrollRange
The GetScrollRange function retrieves the current minimum and maximum scroll box
(thumb) positions for the specified scroll bar.
Note The GetScrollRange function is provided for compatibility only. New applications
should use the GetScrollInfo function.
ScrollDC
The ScrollDC function scrolls a rectangle of bits horizontally and vertically.
ScrollWindow
The ScrollWindow function scrolls the contents of the specified windows client area.
Note The ScrollWindow function is provided for backward compatibility.
New applications should use the ScrollWindowEx function.
ScrollWindowEx
The ScrollWindowEx function scrolls the contents of the specified windows client area.
SetScrollInfo
The SetScrollInfo function sets the parameters of a scroll bar, including the
minimum and maximum scrolling positions, the page size, and the position of the
scroll box (thumb). The function also redraws the scroll bar, if requested.
SetScrollPos
The SetScrollPos function sets the position of the scroll box (thumb) in the specified
scroll bar and, if requested, redraws the scroll bar to reflect the new position of
the scroll box.
Note The SetScrollPos function is provided for backward compatibility.
New applications should use the SetScrollInfo function.
SetScrollRange
The SetScrollRange function sets the minimum and maximum scroll box positions for
the specified scroll bar.
Note The SetScrollRange function is provided for backward compatibility.
New applications should use the SetScrollInfo function.
ShowScrollBar
The ShowScrollBar function shows or hides the specified scroll bar.
Messages
========
SBM_ENABLE_ARROWS
An application sends the SBM_ENABLE_ARROWS message to enable or disable one or
both arrows of a scroll bar control.
SBM_GETPOS
The SBM_GETPOS message is sent to retrieve the current position of the scroll box
of a scroll bar control. The current position is a relative value that depends on the
current scrolling range. For example, if the scrolling range is 0 through 100 and the
scroll box is in the middle of the bar, the current position is 50.
Applications should not send this message directly. Instead, they should use the
GetScrollPos function. A window receives this message through its WindowProc function.
Applications which implement a custom scroll bar control must respond to these messages
for the GetScrollPos function to function properly.
SBM_GETRANGE
The SBM_GETRANGE message is sent to retrieve the minimum and maximum position values
for the scroll bar control.
Applications should not send this message directly. Instead, they should use the
GetScrollRange function. A window receives this message through its WindowProc function.
Applications which implement a custom scroll bar control must respond to these
messages for the GetScrollRange function to work properly.
SBM_GETSCROLLBARINFO
Sent by an application to retrieve information about the specified scroll bar.
SBM_GETSCROLLINFO
The SBM_GETSCROLLINFO message is sent to retrieve the parameters of a scroll bar.
Applications should not send this message directly. Instead, they should use
the GetScrollInfo function. A window receives this message through its WindowProc function.
Applications which implement a custom scroll bar control must respond to these
messages for the GetScrollInfo function to work properly.
SBM_SETPOS
The SBM_SETPOS message is sent to set the position of the scroll box (thumb) and,
if requested, redraw the scroll bar to reflect the new position of the scroll box.
Applications should not send this message directly. Instead, they should use the
SetScrollPos function. A window receives this message through its WindowProc function.
Applications which implement a custom scroll bar control must respond to
these messages for the SetScrollPos function to work properly.
SBM_SETRANGE
The SBM_SETRANGE message is sent to set the minimum and maximum position values
for the scroll bar control.
Applications should not send this message directly. Instead, they should use the
SetScrollRange function. A window receives this message through its WindowProc function.
Applications which implement a custom scroll bar control must respond to these
messages for the SetScrollRange function to work properly.
SBM_SETRANGEREDRAW
An application sends the SBM_SETRANGEREDRAW message to a scroll bar control to
set the minimum and maximum position values and to redraw the control.
SBM_SETSCROLLINFO
The SBM_SETSCROLLINFO message is sent to set the parameters of a scroll bar.
Applications should not send this message directly. Instead, they should use
the SetScrollInfo function. A window receives this message through its WindowProc function.
Applications which implement a custom scroll bar control must respond to
these messages for the SetScrollInfo function to function properly.
Notifications
WM_CTLCOLORSCROLLBAR
The WM_CTLCOLORSCROLLBAR message is sent to the parent window of a
scroll bar control when the control is about to be drawn. By responding to this
message, the parent window can use the display context handle to set the background
color of the scroll bar control.
A window receives this message through its WindowProc function.
WM_HSCROLL
The WM_HSCROLL message is sent to a window when a scroll event occurs in the
windows standard horizontal scroll bar. This message is also sent to the owner
of a horizontal scroll bar control when a scroll event occurs in the control.
A window receives this message through its WindowProc function.
WM_VSCROLL
The WM_VSCROLL message is sent to a window when a scroll event occurs in the windows
standard vertical scroll bar. This message is also sent to the owner of a vertical
scroll bar control when a scroll event occurs in the control.
A window receives this message through its WindowProc function.
Structures
==========
SCROLLBARINFO
The SCROLLBARINFO structure contains scroll bar information.
SCROLLINFO
The SCROLLINFO structure contains scroll bar parameters to be set by the SetScrollInfo function (or SBM_SETSCROLLINFO message), or retrieved by the GetScrollInfo function (or SBM_GETSCROLLINFO message).
Constants
=========
Scroll Bar Control Styles
To create a scroll bar control using the CreateWindow or CreateWindowEx
function specify the SCROLLBAR class, appropriate window style constants,
and a combination of the following scroll bar control styles. Some of the styles
create a scroll bar control that uses a default width or height. However,
you must always specify the x- and y-coordinates and the other dimensions of the
scroll bar when you call CreateWindow or CreateWindowEx.
SBS_BOTTOMALIGN
Aligns the bottom edge of the scroll bar with the bottom edge of the rectangle
defined by the x, y, nWidth, and nHeight parameters of CreateWindowEx function.
The scroll bar has the default height for system scroll bars. Use this style with
the SBS_HORZ style.
SBS_HORZ
Designates a horizontal scroll bar. If neither the SBS_BOTTOMALIGN nor SBS_TOPALIGN
style is specified, the scroll bar has the height, width, and position specified by the
x, y, nWidth, and nHeight parameters of CreateWindowEx.
SBS_LEFTALIGN
Aligns the left edge of the scroll bar with the left edge of the rectangle defined
by the x, y, nWidth, and nHeight parameters of CreateWindowEx. The scroll bar has
the default width for system scroll bars. Use this style with the SBS_VERT style.
SBS_RIGHTALIGN
Aligns the right edge of the scroll bar with the right edge of the rectangle defined
by the x, y, nWidth, and nHeight parameters of CreateWindowEx. The scroll bar has the
default width for system scroll bars. Use this style with the SBS_VERT style.
SBS_SIZEBOX
Designates a size box. If you specify neither the SBS_SIZEBOXBOTTOMRIGHTALIGN nor the
SBS_SIZEBOXTOPLEFTALIGN style, the size box has the height, width, and position
specified by the x, y, nWidth, and nHeight parameters of CreateWindowEx.
SBS_SIZEBOXBOTTOMRIGHTALIGN
Aligns the lower right corner of the size box with the lower right corner of the
rectangle specified by the x, y, nWidth, and nHeight parameters of CreateWindowEx.
The size box has the default size for system size boxes. Use this style with the
SBS_SIZEBOX style.
SBS_SIZEBOXTOPLEFTALIGN
Aligns the upper left corner of the size box with the upper left corner of the
rectangle specified by the x, y, nWidth, and nHeight parameters of CreateWindowEx.
The size box has the default size for system size boxes. Use this style with the
SBS_SIZEBOX style.
SBS_SIZEGRIP
Same as SBS_SIZEBOX, but with a raised edge.
SBS_TOPALIGN
Aligns the top edge of the scroll bar with the top edge of the rectangle defined
by the x, y, nWidth, and nHeight parameters of CreateWindowEx. The scroll bar has
the default height for system scroll bars. Use this style with the SBS_HORZ style.
SBS_VERT
Designates a vertical scroll bar. If you specify neither the SBS_RIGHTALIGN nor
the SBS_LEFTALIGN style, the scroll bar has the height, width, and position specified
by the x, y, nWidth, and nHeight parameters of CreateWindowEx.
#endif
//

View File

@@ -49,6 +49,7 @@
* If you do not wish that, delete this exception notice.
*
*/
//
//
//
@@ -93,7 +94,7 @@ CLASS WvgSLE INHERIT WvgWindow, WvgDataRef
METHOD destroy()
METHOD handleEvent( nMessage, aNM )
METHOD clear()
METHOD CLEAR()
METHOD copyMarked()
METHOD cutMarked()
METHOD delMarked() VIRTUAL
@@ -119,7 +120,7 @@ CLASS WvgSLE INHERIT WvgWindow, WvgDataRef
DATA sl_returnPressed
METHOD returnPressed( ... ) SETGET
ENDCLASS
ENDCLASS
//
@@ -136,7 +137,8 @@ METHOD new( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) CLASS WvgSLE
//
METHOD create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) CLASS WvgSLE
LOCAL es_:= { ES_LEFT, ES_RIGHT, ES_CENTER }
LOCAL es_ := { ES_LEFT, ES_RIGHT, ES_CENTER }
::wvgWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
@@ -171,7 +173,7 @@ METHOD create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) CLASS WvgSL
::setPosAndSize()
IF HB_ISOBJECT( ::datalink )
eval( ::datalink )
Eval( ::datalink )
ENDIF
::sendMessage( EM_SETLIMITTEXT, ::bufferLength )
@@ -200,12 +202,12 @@ METHOD handleEvent( nMessage, aNM ) CLASS WvgSLE
CASE aNM[ NMH_code ] == EN_KILLFOCUS
IF HB_ISBLOCK( ::sl_killInputFocus )
eval( ::sl_killInputFocus, NIL, NIL, Self )
Eval( ::sl_killInputFocus, NIL, NIL, Self )
ENDIF
CASE aNM[ NMH_code ] == EN_SETFOCUS
IF HB_ISBLOCK( ::sl_setInputFocus )
eval( ::sl_setInputFocus, NIL, NIL, Self )
Eval( ::sl_setInputFocus, NIL, NIL, Self )
ENDIF
ENDCASE
@@ -225,12 +227,12 @@ METHOD handleEvent( nMessage, aNM ) CLASS WvgSLE
DO CASE
CASE aNM[ NMH_code ] == WM_KILLFOCUS
IF HB_ISBLOCK( ::sl_killInputFocus )
eval( ::sl_killInputFocus, NIL, NIL, Self )
Eval( ::sl_killInputFocus, NIL, NIL, Self )
ENDIF
CASE aNM[ NMH_code ] == WM_SETFOCUS
IF HB_ISBLOCK( ::sl_setInputFocus )
eval( ::sl_setInputFocus, NIL, NIL, Self )
Eval( ::sl_setInputFocus, NIL, NIL, Self )
ENDIF
CASE aNM[ NMH_code ] == WM_KEYDOWN
@@ -239,7 +241,7 @@ METHOD handleEvent( nMessage, aNM ) CLASS WvgSLE
::oParent:setFocus()
ENDIF
IF HB_ISBLOCK( ::sl_returnPressed )
eval( ::sl_returnPressed, NIL, NIL, Self )
Eval( ::sl_returnPressed, NIL, NIL, Self )
ENDIF
ELSEIF aNM[ 2 ] == VK_TAB
IF ::isParentCrt()
@@ -269,6 +271,7 @@ METHOD destroy() CLASS WvgSLE
//
METHOD WvgSLE:changed( lChanged )
LOCAL lChg := ::sendMessage( EM_GETMODIFY, 0, 0 )
IF HB_ISLOGICAL( lChanged )
@@ -280,15 +283,17 @@ METHOD WvgSLE:changed( lChanged )
//
METHOD WvgSLE:clear()
LOCAL cText := ::getData()
::setData( "" )
RETURN len( cText )
RETURN Len( cText )
//
METHOD WvgSLE:copyMarked()
LOCAL n, nB, nE
n := ::sendMessage( EM_GETSEL )
@@ -296,7 +301,7 @@ METHOD WvgSLE:copyMarked()
nE := WVG_HIWORD( n )
IF ( n := nE - nB ) > 0
Wvt_SetClipboard( substr( ::getData(), nB, n ) )
Wvt_SetClipboard( SubStr( ::getData(), nB, n ) )
ENDIF
RETURN n
@@ -304,6 +309,7 @@ METHOD WvgSLE:copyMarked()
//
METHOD WvgSLE:cutMarked()
LOCAL n, nB, nE, cText
n := ::sendMessage( EM_GETSEL )
@@ -312,7 +318,7 @@ METHOD WvgSLE:cutMarked()
IF ( n := nE - nB ) > 0
cText := ::getData()
::setData( substr( cText, 1, nB-1 ) + substr( cText, nE ) )
::setData( SubStr( cText, 1, nB - 1 ) + SubStr( cText, nE ) )
ENDIF
RETURN n
@@ -320,12 +326,15 @@ METHOD WvgSLE:cutMarked()
//
METHOD WvgSLE:returnPressed( ... )
LOCAL a_:= hb_aParams()
IF len( a_ ) == 1 .AND. HB_ISBLOCK( a_[ 1 ] )
LOCAL a_ := hb_AParams()
IF Len( a_ ) == 1 .AND. HB_ISBLOCK( a_[ 1 ] )
::sl_returnPressed := a_[ 1 ]
ELSEIF len( a_ ) >= 0 .AND. HB_ISBLOCK( ::sl_returnPressed )
eval( ::sl_returnPressed, NIL, NIL, Self )
ELSEIF Len( a_ ) >= 0 .AND. HB_ISBLOCK( ::sl_returnPressed )
Eval( ::sl_returnPressed, NIL, NIL, Self )
ENDIF
RETURN Self
//

View File

@@ -49,6 +49,7 @@
* If you do not wish that, delete this exception notice.
*
*/
//
//
//
@@ -100,11 +101,11 @@ CLASS WvgStatusBar INHERIT WvgWindow /* WvgActiveXControl */
METHOD addItem( cCaption, xImage, cDLL, nStyle, cKey, nMode )
METHOD delItem( nItemORcKey )
METHOD getItem( nItemORcKey )
METHOD clear()
METHOD CLEAR()
METHOD panelClick( xParam ) SETGET
METHOD panelDblClick( xParam ) SETGET
ENDCLASS
ENDCLASS
//
@@ -138,17 +139,18 @@ METHOD WvgStatusBar:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible
::show()
ENDIF
::addItem( , , , , , -1 )
::addItem( , , , , , - 1 )
RETURN Self
//
METHOD WvgStatusBar:handleEvent( nMessage, aNM )
LOCAL nHandled := 1
LOCAL nObj, aNMH
hb_traceLog( " %s:handleEvent( %i )", __ObjGetClsName( self ), nMessage )
hb_traceLog( " %s:handleEvent( %i )", __objGetClsName( self ), nMessage )
DO CASE
@@ -158,7 +160,7 @@ METHOD WvgStatusBar:handleEvent( nMessage, aNM )
CASE nMessage == HB_GTE_COMMAND
IF HB_ISBLOCK( ::sl_lbClick )
eval( ::sl_lbClick, NIL, NIL, self )
Eval( ::sl_lbClick, NIL, NIL, self )
RETURN 0
ENDIF
@@ -200,6 +202,7 @@ METHOD WvgStatusBar:handleEvent( nMessage, aNM )
//
METHOD WvgStatusBar:destroy()
LOCAL i, nItems
hb_traceLog( " %s:destroy()", __objGetClsName() )
@@ -225,6 +228,7 @@ METHOD WvgStatusBar:configure( oParent, oOwner, aPos, aSize, aPresParams, lVisib
//
METHOD WvgStatusBar:addItem( cCaption, xImage, cDLL, nStyle, cKey, nMode )
LOCAL oPanel, lSuccess
DEFAULT nMode TO 0
@@ -240,28 +244,29 @@ METHOD WvgStatusBar:addItem( cCaption, xImage, cDLL, nStyle, cKey, nMode )
lSuccess := Wvg_StatusBarCreatePanel( ::hWnd, nMode )
IF lSuccess
aadd( ::aItems, oPanel )
AAdd( ::aItems, oPanel )
ELSE
RETURN nil
endif
ENDIF
RETURN oPanel
//
METHOD WvgStatusBar:delItem( nItemORcKey )
LOCAL nIndex := 0
IF HB_ISNUMERIC( nItemORcKey )
nIndex := ascan( ::aItems, {| o | o:key == nItemORcKey } )
nIndex := AScan( ::aItems, {| o | o:key == nItemORcKey } )
ELSEIF HB_ISNUMERIC( nItemORcKey )
nIndex := nItemORcKey
ENDIF
IF nIndex > 0
/* Delete panel by window */
adel( ::aItems, nIndex )
asize( ::aItems, len( ::aItems ) - 1 )
ADel( ::aItems, nIndex )
ASize( ::aItems, Len( ::aItems ) - 1 )
ENDIF
RETURN Self
@@ -269,10 +274,11 @@ METHOD WvgStatusBar:delItem( nItemORcKey )
//
METHOD WvgStatusBar:getItem( nItemORcKey )
LOCAL nIndex := 0, oPanel
IF HB_ISSTRING( nItemORcKey )
nIndex := ascan( ::aItems, {| o | o:key == nItemORcKey } )
nIndex := AScan( ::aItems, {| o | o:key == nItemORcKey } )
ELSEIF HB_ISNUMERIC( nItemORcKey )
nIndex := nItemORcKey
@@ -286,7 +292,9 @@ METHOD WvgStatusBar:getItem( nItemORcKey )
RETURN oPanel
//
METHOD WvgStatusBar:clear()
LOCAL i
FOR i := 1 TO ::numItems
@@ -302,7 +310,7 @@ METHOD WvgStatusBar:clear()
METHOD WvgStatusBar:panelClick( xParam )
IF HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_lbClick := xParam
ENDIF
@@ -312,7 +320,7 @@ METHOD WvgStatusBar:panelClick( xParam )
METHOD WvgStatusBar:panelDblClick( xParam )
IF HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_lbDblClick := xParam
ENDIF
@@ -334,8 +342,8 @@ CLASS WvgStatusBarPanel
DATA autosize INIT WVGSTATUSBAR_AUTOSIZE_NONE
DATA bevel INIT WVGSTATUSBAR_BEVEL_INSET
DATA enabled INIT .T.
DATA index INIT 0
DATA key INIT ""
DATA INDEX INIT 0
DATA KEY INIT ""
DATA style INIT WVGSTATUSBAR_PANEL_TEXT
DATA sl_caption INIT ""
DATA image INIT NIL
@@ -350,8 +358,10 @@ CLASS WvgStatusBarPanel
DATA oParent
ENDCLASS
ENDCLASS
//
METHOD WvgStatusBarPanel:new( cCaption, nStyle, cKey )
DEFAULT cCaption TO ::sl_caption
@@ -363,7 +373,9 @@ METHOD WvgStatusBarPanel:new( cCaption, nStyle, cKey )
::key := cKey
RETURN Self
//
METHOD WvgStatusBarPanel:caption( cCaption )
IF cCaption == NIL

View File

@@ -49,6 +49,7 @@
* If you do not wish that, delete this exception notice.
*
*/
//
//
//
@@ -82,8 +83,8 @@ CLASS WvgStatic INHERIT WvgWindow
DATA caption INIT ""
DATA clipParent INIT .T.
DATA clipSiblings INIT .F.
DATA options INIT -1 /* WVGSTATIC_TEXT_LEFT */
DATA type INIT -1 /* WVGSTATIC_TYPE_TEXT */
DATA options INIT - 1 /* WVGSTATIC_TEXT_LEFT */
DATA TYPE INIT - 1 /* WVGSTATIC_TYPE_TEXT */
DATA hBitmap
@@ -95,7 +96,7 @@ CLASS WvgStatic INHERIT WvgWindow
METHOD setCaption( xCaption, cDll )
ENDCLASS
ENDCLASS
//
@@ -117,7 +118,7 @@ METHOD WvgStatic:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::wvgWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
#if 0
#if 0
SS_ETCHEDFRAME
SS_SUNKEN
SS_LEFTNOWORDWRAP
@@ -128,7 +129,7 @@ METHOD WvgStatic:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
SS_ETCHEDHORZ
SS_ETCHEDVERT
SS_RIGHTJUST
#endif
#endif
SWITCH ::type
@@ -200,9 +201,9 @@ METHOD WvgStatic:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
EXIT
ENDSWITCH /* ::type */
#if 1
#if 1
/* Options */
IF ( ascan( { WVGSTATIC_TYPE_FGNDFRAME, WVGSTATIC_TYPE_BGNDFRAME, WVGSTATIC_TYPE_HALFTONEFRAME }, ::type ) > 0 )
IF ( AScan( { WVGSTATIC_TYPE_FGNDFRAME, WVGSTATIC_TYPE_BGNDFRAME, WVGSTATIC_TYPE_HALFTONEFRAME }, ::type ) > 0 )
IF ( hb_bitAnd( ::options, WVGSTATIC_FRAMETHIN ) == WVGSTATIC_FRAMETHIN )
::style += WS_BORDER
@@ -211,8 +212,8 @@ METHOD WvgStatic:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
ENDIF
ENDIF
#endif
#if 0
#endif
#if 0
IF ::type == WVGSTATIC_TYPE_TEXT
IF ::options == WVGSTATIC_FRAMETHIN
::style += WS_BORDER
@@ -220,7 +221,7 @@ METHOD WvgStatic:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::style += WS_DLGFRAME
ENDIF
ENDIF
#endif
#endif
::oParent:addChild( SELF )
@@ -248,9 +249,9 @@ METHOD WvgStatic:handleEvent( nMessage, aNM )
::rePosition()
ENDIF
IF HB_ISBLOCK( ::sl_resize )
eval( ::sl_resize, NIL, NIL, self )
Eval( ::sl_resize, NIL, NIL, self )
ENDIF
aeval( ::aChildren, {|o| o:handleEvent( HB_GTE_RESIZED, { 0, 0, 0, 0, 0 } ) } )
AEval( ::aChildren, {|o| o:handleEvent( HB_GTE_RESIZED, { 0, 0, 0, 0, 0 } ) } )
RETURN EVENT_HANDELLED
CASE nMessage == HB_GTE_CTLCOLOR
@@ -288,7 +289,9 @@ METHOD WvgStatic:destroy()
//
METHOD WvgStatic:configure( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::Initialize( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
RETURN Self
//

View File

@@ -49,6 +49,7 @@
* If you do not wish that, delete this exception notice.
*
*/
//
//
//
@@ -78,7 +79,6 @@
CLASS WvgSysWindow INHERIT WvgPartHandler
METHOD new( oParent, oOwner, aPos )
METHOD create( oParent, oOwner, aPos )
METHOD configure()
@@ -109,10 +109,10 @@ CLASS WvgSysWindow INHERIT WvgPartHandler
ASSIGN move( bBlock ) INLINE ::sl_move := bBlock
DATA sl_quit
ACCESS quit INLINE ::sl_quit
ACCESS QUIT INLINE ::sl_quit
ASSIGN quit( bBlock ) INLINE ::sl_quit := bBlock
ENDCLASS
ENDCLASS
//
@@ -193,6 +193,7 @@ METHOD WvgSysWindow:setPos( aPos )
//
METHOD WvgSysWindow:currentPos()
LOCAL aRect
aRect := WVG_GetWindowRect( ::hWnd )
@@ -202,6 +203,7 @@ METHOD WvgSysWindow:currentPos()
//
METHOD WvgSysWindow:currentSize()
LOCAL aRect
aRect := WVG_GetClientRect( ::hWnd )
@@ -246,8 +248,8 @@ CLASS WvgFontDialog INHERIT WvgSysWindow
DATA outLine INIT .T.
DATA previewBGClr INIT RGB( 255,255,255 )
DATA previewFGClr INIT RGB( 0,0,0 )
DATA previewBGClr INIT RGB( 255, 255, 255 )
DATA previewFGClr INIT RGB( 0, 0, 0 )
DATA previewString INIT " "
DATA printerPS INIT NIL
DATA screenPS INIT NIL
@@ -289,7 +291,7 @@ CLASS WvgFontDialog INHERIT WvgSysWindow
METHOD wndProc( hWnd, nMessage, nwParam, nlParam )
METHOD GetWvgFont( aFont ) PROTECTED
ENDCLASS
ENDCLASS
//
@@ -327,10 +329,10 @@ METHOD create( oParent, oOwner, oScreenPS, oPrinterPS, aPos ) CLASS WvgFontDialo
::oPrinterPS := oPrinterPS
::aPos := aPos
IF ::viewPrinterFonts .and. ::oPrinterPS == NIL
IF ::viewPrinterFonts .AND. ::oPrinterPS == NIL
::viewPrinterFonts := .F.
ENDIF
IF ( ! ::viewScreenFonts .and. ! ::viewPrinterFonts )
IF ( ! ::viewScreenFonts .AND. ! ::viewPrinterFonts )
::viewScreenFonts := .T.
ENDIF
@@ -343,6 +345,7 @@ METHOD create( oParent, oOwner, oScreenPS, oPrinterPS, aPos ) CLASS WvgFontDialo
//
METHOD wndProc( hWnd, nMessage, nwParam, nlParam ) CLASS WvgFontDialog
LOCAL aRect, nL, nH
HB_SYMBOL_UNUSED( nlParam )
@@ -352,7 +355,7 @@ METHOD wndProc( hWnd, nMessage, nwParam, nlParam ) CLASS WvgFontDialog
CASE nMessage == WM_INITDIALOG
::hWnd := hWnd
IF !empty( ::title )
IF !Empty( ::title )
WVG_SetWindowText( ::hWnd, ::title )
ENDIF
IF !( ::buttonCancel )
@@ -382,7 +385,7 @@ METHOD wndProc( hWnd, nMessage, nwParam, nlParam ) CLASS WvgFontDialog
IF ::aPos[ 1 ] > 0 .OR. ::aPos[ 2 ] > 0
aRect := WVG_GetWindowRect( ::hWnd )
WVG_MoveWindow( ::hWnd, ::aPos[ 1 ], ::aPos[ 2 ], aRect[3]-aRect[1], aRect[4]-aRect[2], .F. )
WVG_MoveWindow( ::hWnd, ::aPos[ 1 ], ::aPos[ 2 ], aRect[3] - aRect[1], aRect[4] - aRect[2], .F. )
ENDIF
RETURN 1
@@ -398,17 +401,17 @@ METHOD wndProc( hWnd, nMessage, nwParam, nlParam ) CLASS WvgFontDialog
CASE nL == IDOK
::ok := .T.
IF HB_ISBLOCK( ::sl_activateOk )
eval( ::sl_activateOk, ::GetWvgFont(), NIL, Self )
Eval( ::sl_activateOk, ::GetWvgFont(), NIL, Self )
ENDIF
CASE nL == IDCANCEL
IF HB_ISBLOCK( ::sl_activateCancel )
eval( ::sl_activateCancel, NIL, NIL, Self )
Eval( ::sl_activateCancel, NIL, NIL, Self )
ENDIF
CASE nL == 1026
IF HB_ISBLOCK( ::sl_activateApply )
eval( ::sl_activateApply, ::GetWvgFont(), NIL, Self )
Eval( ::sl_activateApply, ::GetWvgFont(), NIL, Self )
ENDIF
CASE nL == 1038 /* Help */
@@ -422,6 +425,7 @@ METHOD wndProc( hWnd, nMessage, nwParam, nlParam ) CLASS WvgFontDialog
//
METHOD display( nMode ) CLASS WvgFontDialog
LOCAL hWnd, aInfo
IF nMode == 0
@@ -432,8 +436,8 @@ METHOD display( nMode ) CLASS WvgFontDialog
::ok := .F.
aInfo := Wvg_ChooseFont( hWnd, {| h, m, w, l | ::wndProc( h, m, w, l ) }, ::familyName, ;
::nominalPointSize, ::viewScreenFonts, ::viewPrinterFonts )
IF !( ::ok )
::nominalPointSize, ::viewScreenFonts, ::viewPrinterFonts )
IF ! ::ok
RETURN NIL
ENDIF
@@ -451,7 +455,9 @@ METHOD destroy() CLASS WvgFontDialog
/*
* Only callable from ::activateOK and ::activateApply
*/
METHOD GetWvgFont( aFont ) CLASS WvgFontDialog
LOCAL oWvgFont
DEFAULT aFont TO Wvg_ChooseFont_GetLogFont( ::hWnd )
@@ -467,8 +473,8 @@ METHOD GetWvgFont( aFont ) CLASS WvgFontDialog
oWvgFont:underscore := aFont[ 6 ]
oWvgFont:strikeOut := aFont[ 7 ]
oWvgFont:codePage := aFont[ 8 ]
oWvgFont:setCompoundName( trim( aFont[ 1 ] +" "+ iif( oWvgFont:bold, "Bold ", "" ) + ;
iif( oWvgFont:italic, "Italic", "" ) ) )
oWvgFont:setCompoundName( Trim( aFont[ 1 ] + " " + iif( oWvgFont:bold, "Bold ", "" ) + ;
iif( oWvgFont:italic, "Italic", "" ) ) )
oWvgFont:create()
RETURN oWvgFont
@@ -504,7 +510,7 @@ CLASS WvgFont
DATA underscore INIT .F.
DATA codePage INIT DEFAULT_CHARSET
DATA fixed INIT .F.
DATA FIXED INIT .F.
DATA antiAliased INIT .F.
DATA compoundName INIT ""
@@ -529,7 +535,7 @@ CLASS WvgFont
DESTRUCTOR destroy()
ENDCLASS
ENDCLASS
//
@@ -578,6 +584,7 @@ METHOD destroy() CLASS WvgFont
//
METHOD list() CLASS WvgFont
LOCAL aList := {}
RETURN aList
@@ -585,6 +592,7 @@ METHOD list() CLASS WvgFont
//
METHOD createFont() CLASS WvgFont
LOCAL aFont
IF ::hFont != NIL
@@ -596,7 +604,7 @@ METHOD createFont() CLASS WvgFont
::height := Wvg_PointSizeToHeight( ::oPS:hdc, ::nominalPointSize )
ENDIF
::aFontInfo := array( 15 )
::aFontInfo := Array( 15 )
::aFontInfo[ 1 ] := ::familyName
::aFontInfo[ 2 ] := ::height
@@ -615,7 +623,7 @@ METHOD createFont() CLASS WvgFont
aFont := Wvg_FontCreate( ::aFontInfo )
IF empty( aFont[ 1 ] )
IF Empty( aFont[ 1 ] )
RETURN nil
ENDIF

View File

@@ -49,6 +49,7 @@
* If you do not wish that, delete this exception notice.
*
*/
//
//
//
@@ -89,8 +90,8 @@ CLASS WvgTabPage INHERIT WvgWindow
DATA minimized INIT .T. /* Determines whether the XbpTabPage is minimized after it is created (the page is not visible). */
DATA postOffset INIT 80 /* Determines the distance between the end of the tab and the end of the page as a percentage of the page width. */
DATA preOffset INIT 0 /* Determines the distance between the start of the tab and the start of the page as a percentage of the page width.*/
DATA tabHeight INIT -1 /* Determines the height of the tab. */
DATA type INIT WVGTABPAGE_TAB_TOP /* Determines the position of the tab. */
DATA tabHeight INIT - 1 /* Determines the height of the tab. */
DATA TYPE INIT WVGTABPAGE_TAB_TOP /* Determines the position of the tab. */
METHOD new( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
METHOD create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
@@ -104,7 +105,7 @@ CLASS WvgTabPage INHERIT WvgWindow
DATA sl_tabActivate
METHOD tabActivate( xParam ) SETGET
ENDCLASS
ENDCLASS
//
@@ -157,9 +158,10 @@ METHOD create( oParent, oOwner, aPos, aSize, aPresParams, lVisible ) CLASS WvgTa
//
METHOD handleEvent( nMessage, aNM ) CLASS WvgTabPage
LOCAL aHdr
hb_traceLog( " %s:handleEvent( %i )", __ObjGetClsName( self ), nMessage )
hb_traceLog( " %s:handleEvent( %i )", __objGetClsName( self ), nMessage )
DO CASE
@@ -180,7 +182,7 @@ METHOD handleEvent( nMessage, aNM ) CLASS WvgTabPage
aHdr := Wvg_GetNMHdrInfo( aNM[ 2 ] )
DO CASE
CASE aHdr[ NMH_code ] == -551 /* TCN_SELCHANGE */
CASE aHdr[ NMH_code ] == - 551 /* TCN_SELCHANGE */
ENDCASE

View File

@@ -5,6 +5,7 @@
/*
* Pritpal Bedi <bedipritpal@hotmail.com>
*/
//
#include "inkey.ch"
@@ -17,10 +18,13 @@
//
// The function has to be called via hb_threadStart( {|| ExecuteActiveX( nActiveX ) } )
//
FUNCTION ExecuteActiveX( nActiveX, xParam )
Local oCrt, oTBar, oSBar, oStatic, oCom, oXbp, oTree, oItem1, oItem2
LOCAL oCrt, oTBar, oSBar, oStatic, oCom, oXbp, oTree, oItem1, oItem2
LOCAL oListBox, oStatic2, oDA
LOCAL oPanel, oPanel1, oPanel2
// LOCAL cVarA := "Test A", cVarB := "Test B"
// LOCAL aState := {"not selected", "selected", "undefined"}
LOCAL aParts := {}
@@ -29,18 +33,18 @@ FUNCTION ExecuteActiveX( nActiveX, xParam )
HB_SYMBOL_UNUSED( xParam )
HB_SYMBOL_UNUSED( oCom )
//--------------------------- Dialog -------------------------------\\
#if 1
oCrt := WvgDialog():new( , , { 30,30 }, { 800,600 }, , .T. )
//--------------------------- Dialog -------------------------------\\
#if 1
oCrt := WvgDialog():new( , , { 30, 30 }, { 800, 600 }, , .T. )
oCrt:closable := .T.
oCrt:create()
#else
oCrt := WvgCrt():new( , , { 5,5 }, { 30,60 }, , .T. )
#else
oCrt := WvgCrt():new( , , { 5, 5 }, { 30, 60 }, , .T. )
oCrt:resizeMode := HB_GTI_RESIZEMODE_ROWS
oCrt:closable := .T.
oCrt:create()
SetCursor( .F. )
#endif
#endif
oDA := oCrt:drawingArea
@@ -64,53 +68,53 @@ FUNCTION ExecuteActiveX( nActiveX, xParam )
oStatic := WvgStatic():new( oDA )
oStatic:type := WVGSTATIC_TYPE_TEXT
oStatic:options := WVGSTATIC_TEXT_CENTER
oStatic:caption := chr(13)+'Implemented Xbase++ Parts'
oStatic:create( , , { 0, oTBar:currentSize()[2]+3 }, { 120, oCrt:currentSize()[2]-;
oTBar:currentSize()[2]-oSBar:currentSize()[2]-4 }, , .T. )
oStatic:caption := Chr( 13 ) + 'Implemented Xbase++ Parts'
oStatic:create( , , { 0, oTBar:currentSize()[2] + 3 }, { 120, oCrt:currentSize()[2] - ;
oTBar:currentSize()[2] - oSBar:currentSize()[2] - 4 }, , .T. )
oStatic:setColorBG( RGB( 198,198,198 ) )
#if 0 // panel
//--------------------------- Static + Radio + Checkbox ----------\\
oStatic2:= WvgStatic():New( oCrt, , { 150, 150 }, { 500,310 }, , .F. )
//oStatic2:type := WVGSTATIC_TYPE_RAISEDBOX //BGNDFRAME
oStatic2 := WvgStatic():New( oCrt, , { 150, 150 }, { 500, 310 }, , .F. )
// oStatic2:type := WVGSTATIC_TYPE_RAISEDBOX //BGNDFRAME
oStatic2:exStyle += WS_EX_WINDOWEDGE
//oStatic2:options := WVGSTATIC_FRAMETHICK
// oStatic2:options := WVGSTATIC_FRAMETHICK
oStatic2:create()
//oStatic2:setColorBG( RGB( 198,198,198 ) )
// oStatic2:setColorBG( RGB( 198,198,198 ) )
oXbp := WvgPushButton():new( oStatic2 )
oXbp:caption := "Hide"
oXbp:create( , , { 430,275 }, { 60,25 } )
oXbp:create( , , { 430, 275 }, { 60, 25 } )
oXbp:activate := {|| oStatic2:hide(), oCrt:sendMessage( WM_SIZE, 0, 0 ) }
oRadio := WvgRadioButton():new( oStatic2,, { 10,10 }, { 100,15 } )
oRadio := WvgRadioButton():new( oStatic2, , { 10, 10 }, { 100, 15 } )
oRadio:caption := "Com 1"
oRadio:selection := .T.
oRadio:selected := {| m1, m2, obj | m1:=m1, m2:=m2, WVG_MessageBox( , obj:caption + iif( obj:selection, '< S >', '< N >' ) ) }
oRadio:selected := {| m1, m2, obj | m1 := m1, m2 := m2, WVG_MessageBox( , obj:caption + iif( obj:selection, '< S >', '< N >' ) ) }
oRadio:create()
oRadio := WvgRadioButton():new( oStatic2,, { 10,35 }, { 100,15 } )
oRadio := WvgRadioButton():new( oStatic2, , { 10, 35 }, { 100, 15 } )
oRadio:caption := "Com 2"
oRadio:create()
oCheck := WvgCheckBox():New( oStatic2, , { 10,70 }, { 100,15 }, , .T. )
oCheck := WvgCheckBox():New( oStatic2, , { 10, 70 }, { 100, 15 }, , .T. )
oCheck:caption := 'Checkbox A'
oCheck:create()
oCheck:selected := {| m1, m2, o | m1:=m1,m2:=m2, WVG_MessageBox( , iif( o:getData(), 'I am selected','I am not selected' ) ) }
oCheck:selected := {| m1, m2, o | m1 := m1, m2 := m2, WVG_MessageBox( , iif( o:getData(), 'I am selected','I am not selected' ) ) }
// Create first 3State button, passing the position to :create()
oXbp := Wvg3State():new( oStatic2 )
oXbp:caption := "3 State A"
oXbp:create( , , { 10,100 }, { 100,15 } )
oXbp:create( , , { 10, 100 }, { 100, 15 } )
// Determine current state using mp1
oXbp:selected := {| m1, m2, oBtn | m2:=m2, oBtn:=oBtn, oPanel1:caption := "3State A ["+aState[ m1+1 ]+"]" }
oXbp:selected := {| m1, m2, oBtn | m2 := m2, oBtn := oBtn, oPanel1:caption := "3State A [" + aState[ m1+1 ] + "]" }
// Create second 3State Button, passing the position to :new()
oXbp := Wvg3State():new( oStatic2, , { 10,125 }, { 100,15 } )
oXbp := Wvg3State():new( oStatic2, , { 10, 125 }, { 100, 15 } )
oXbp:caption := "3 State B"
oXbp:create( oStatic2 )
// Determine current state using :getData()
oXbp:selected := {| m1, m2, oBtn | m1:=m1,m2:=m2, WVG_MessageBox( , "3State B", aState[ oBtn:getData()+1 ] ) }
oXbp:selected := {| m1, m2, oBtn | m1 := m1, m2 := m2, WVG_MessageBox( , "3State B", aState[ oBtn:getData()+1 ] ) }
// Create first SLE, specify position using :create()
// On :typeOut set the focus to the second SLE
@@ -119,19 +123,19 @@ FUNCTION ExecuteActiveX( nActiveX, xParam )
oXbp:bufferLength := 20
// Data code block containing assignment to LOCAL variable
oXbp:dataLink := {| x | iif( x == NIL, cVarA, cVarA := x ) }
oXbp:create( , , { 10,170 }, { 150,20 } )
oXbp:create( , , { 10, 170 }, { 150, 20 } )
oXbp:setData()
// Assign the value of the edit buffer to a LOCAL variable when the input focus is lost
oXbp:killInputFocus := {| x, y, oSLE | x:=x,y:=y, oSLE:getData(), oPanel:caption := "cVarA =" + cVarA }
oXbp:killInputFocus := {| x, y, oSLE | x := x, y := y, oSLE:getData(), oPanel:caption := "cVarA =" + cVarA }
// Create second SLE, specify position using :new()
oXbp := WvgSLE():new( oStatic2, , { 10,200 }, { 150,20 } )
oXbp := WvgSLE():new( oStatic2, , { 10, 200 }, { 150, 20 } )
oXbp:tabStop := .T.
oXbp:bufferLength := 15
oXbp:dataLink := {| x | iif( x == NIL, cVarB, cVarB := x ) }
oXbp:create( )
oXbp:setData()
oXbp:killInputFocus := {| x, y, oSLE | x:=x,y:=y, oSLE:getData(), oPanel:caption := "cVarB =" + cVarB }
oXbp:killInputFocus := {| x, y, oSLE | x := x, y := y, oSLE:getData(), oPanel:caption := "cVarB =" + cVarB }
// Read file into LOCAL variable
cText := MemoRead( "hbmk.hbm" )
@@ -141,7 +145,7 @@ FUNCTION ExecuteActiveX( nActiveX, xParam )
oMLE:wordWrap := .F.
oMLE:border := .T.
oMLE:dataLink := {| x | iif( x == NIL, cText, cText := x ) }
oMLE:create( oStatic2, , { 180,10 }, { 310,250 } )
oMLE:create( oStatic2, , { 180, 10 }, { 310, 250 } )
// Copy text from LOCAL variable into edit buffer via :dataLink
oMLE:setData()
#endif
@@ -152,36 +156,36 @@ FUNCTION ExecuteActiveX( nActiveX, xParam )
oListBox:setColorFG( RGB( 218,61,34 ) )
aadd( aParts, 'XbpDialog' )
aadd( aParts, 'XbpMenuBar' )
aadd( aParts, 'XbpToolBar' )
aadd( aParts, 'XbpStatusBar' )
aadd( aParts, 'XbpStatic' )
aadd( aParts, 'XbpTreeView' )
aadd( aParts, 'XbpActiveX' )
aadd( aParts, 'XbpListBox' )
aadd( aParts, 'XbpPushButton' )
aadd( aParts, 'XbpCheckBox' )
aadd( aParts, 'XbpRadioButton')
aadd( aParts, 'Xbp3State' )
aadd( aParts, 'XbpSLE' )
aadd( aParts, 'XbpMLE' )
aadd( aParts, 'DataRef' )
AAdd( aParts, 'XbpDialog' )
AAdd( aParts, 'XbpMenuBar' )
AAdd( aParts, 'XbpToolBar' )
AAdd( aParts, 'XbpStatusBar' )
AAdd( aParts, 'XbpStatic' )
AAdd( aParts, 'XbpTreeView' )
AAdd( aParts, 'XbpActiveX' )
AAdd( aParts, 'XbpListBox' )
AAdd( aParts, 'XbpPushButton' )
AAdd( aParts, 'XbpCheckBox' )
AAdd( aParts, 'XbpRadioButton' )
AAdd( aParts, 'Xbp3State' )
AAdd( aParts, 'XbpSLE' )
AAdd( aParts, 'XbpMLE' )
AAdd( aParts, 'DataRef' )
aeval( aParts, {| e | oListBox:addItem( e ) } )
AEval( aParts, {| e | oListBox:addItem( e ) } )
oListBox:itemSelected := {|| WVG_MessageBox( , oListBox:getCurItem() ) }
oListBox:setData( 3 )
//--------------------------- PushButton --------------------------\\
oXbp := WvgPushButton():new( oStatic )
oXbp:caption := "Hide"
oXbp:create( , , { 20,440 }, {80,30} )
oXbp:activate:= {|| oStatic:hide(), oCrt:sendMessage( WM_SIZE, 0, 0 ) }
oXbp:create( , , { 20, 440 }, { 80, 30 } )
oXbp:activate := {|| oStatic:hide(), oCrt:sendMessage( WM_SIZE, 0, 0 ) }
//--------------------------- TreeView ---------------------------\\
oTree := WvgTreeView():new( oDA, , { oCrt:currentSize()[1]-160,oTBar:currentSize()[2]+3 }, ;
{ 160, oCrt:currentSize()[2]-;
oTBar:currentSize()[2]-oSBar:currentSize()[2]-4 }, , .T. )
oTree := WvgTreeView():new( oDA, , { oCrt:currentSize()[1] - 160, oTBar:currentSize()[2] + 3 }, ;
{ 160, oCrt:currentSize()[2] - ;
oTBar:currentSize()[2] - oSBar:currentSize()[2] - 4 }, , .T. )
oTree:hasLines := .T.
oTree:hasButtons := .T.
oTree:alwaysShowSelection := .T.
@@ -201,47 +205,50 @@ FUNCTION ExecuteActiveX( nActiveX, xParam )
oItem2:addItem( "Third level B" )
oItem2:addItem( "Third level C" )
#if 0
#if 0
oItem1:expand( .T. )
#else
oTree:showExpanded( .T., 2 )
#endif
#else
oTree:showExpanded( .T. , 2 )
#endif
oTree:setData( oItem2 )
//--------------------------- Misc Config ------------------------\\
oTBar:buttonClick := {| oBtn | iif( oBtn:caption == 'Hide' , oStatic:hide(), nil ),;
iif( oBtn:caption == 'Show' , oStatic:show(), nil ),;
iif( oBtn:caption == 'Tools', oStatic2:show():toFront(), nil ),;
iif( oBtn:caption $ 'Hide,Show', oCrt:sendMessage( WM_SIZE, 0, 0 ), NIL ),;
oPanel2:caption := "Button [ " + oBtn:caption + " ] clicked!" }
oTBar:buttonClick := {| oBtn | iif( oBtn:caption == 'Hide' , oStatic:hide(), NIL ), ;
iif( oBtn:caption == 'Show' , oStatic:show(), NIL ), ;
iif( oBtn:caption == 'Tools', oStatic2:show():toFront(), NIL ), ;
iif( oBtn:caption $ 'Hide,Show', oCrt:sendMessage( WM_SIZE, 0, 0 ), NIL ), ;
oPanel2:caption := "Button [ " + oBtn:caption + " ] clicked!" }
oDA:resize := {|| ResizeDialog( oCrt, oTBar, oSBar, oStatic, oCom, oTree ) }
#if 1
#if 1
//--------------------------- Active-X ---------------------------\\
oCom := BuildActiveXControl( nActiveX, oDA )
if HB_ISOBJECT( oCom )
IF HB_ISOBJECT( oCom )
oCrt:sendMessage( WM_SIZE, 0, 0 )
oCrt:show()
ExeActiveX( nActiveX, oCom, xParam )
ENDIF
#else
#else
oCrt:show()
DO WHILE .T.
IF inkey() == K_ESC
IF Inkey() == K_ESC
EXIT
ENDIF
ENDDO
#endif
#endif
oCrt:Destroy()
Return NIL
RETURN NIL
//
STATIC FUNCTION ResizeDialog( oCrt, oTBar, oSBar, oStatic, oCom, oTree )
LOCAL aCrt, aTBar, aSBar
LOCAL nH, nT
// LOCAL aStatic, aCom, aTree
aCrt := oCrt:currentSize()
@@ -252,23 +259,24 @@ STATIC FUNCTION ResizeDialog( oCrt, oTBar, oSBar, oStatic, oCom, oTree )
// aCom := oCom:currentSize()
nT := aTBar[2]
nH := aCrt[2]-aTBar[2]-aSBar[2]
nH := aCrt[2] - aTBar[2] - aSBar[2]
IF oStatic:isVisible
oStatic:setPosAndSize( { 0, nT+3 }, { 120, nH-4 }, .T. )
oCom:setPosAndSize( { 120, nT }, { aCrt[1]-120-150, nH }, .T. )
oTree:setPosAndSize( { aCrt[1]-150, nT }, { 150, nH }, .T. )
oStatic:setPosAndSize( { 0, nT + 3 }, { 120, nH - 4 }, .T. )
oCom:setPosAndSize( { 120, nT }, { aCrt[1] - 120 - 150, nH }, .T. )
oTree:setPosAndSize( { aCrt[1] - 150, nT }, { 150, nH }, .T. )
ELSE
oCom:setPosAndSize( { 0, nT }, { aCrt[1]-150, nH }, .T. )
oTree:setPosAndSize( { aCrt[1]-150, nT }, { 150, nH }, .T. )
oCom:setPosAndSize( { 0, nT }, { aCrt[1] - 150, nH }, .T. )
oTree:setPosAndSize( { aCrt[1] - 150, nT }, { 150, nH }, .T. )
ENDIF
RETURN 1
//
Static Function ActiveXBuildMenu( oCrt, oStatic, oStatic2 )
Local oMenuBar, oSubMenu
STATIC FUNCTION ActiveXBuildMenu( oCrt, oStatic, oStatic2 )
LOCAL oMenuBar, oSubMenu
oMenuBar := WvgMenuBar():new( oCrt ):create()
@@ -280,7 +288,7 @@ Static Function ActiveXBuildMenu( oCrt, oStatic, oStatic2 )
oSubMenu:title := "~Procedural"
oSubMenu:addItem( { "Play Charge ~1", } )
oSubMenu:addItem( { "Play Nannyboo ~2", } )
oSubMenu:itemSelected := {| mp1 | MyFunction( 100+mp1 ) }
oSubMenu:itemSelected := {| mp1 | MyFunction( 100 + mp1 ) }
oMenuBar:addItem( { oSubMenu, NIL } )
// Define submenu in the functional style:
@@ -297,61 +305,62 @@ Static Function ActiveXBuildMenu( oCrt, oStatic, oStatic2 )
oSubMenu := WvgMenu():new( oMenuBar ):create()
oSubMenu:title := "F~eatures"
oSubMenu:addItem( { "~Hide or Show Left Panel" , {|| iif( oStatic:isVisible, ;
oStatic:hide(), oStatic:show() ), oCrt:sendMessage( WM_SIZE,0,0 ) } } )
oStatic:hide(), oStatic:show() ), oCrt:sendMessage( WM_SIZE, 0, 0 ) } } )
oSubMenu:addItem( { "~Show My Panel" , {|| oStatic2:show() } } )
oMenuBar:addItem( { oSubMenu, NIL } )
Return NIL
RETURN NIL
//
STATIC FUNCTION BuildActiveXControl( nActiveX, oDA )
LOCAL oCom
DEFAULT nActiveX TO 2
oCom := WvgActiveXControl():New( oDA, , { 0, 0 }, { 100, 100 }, , .T. )
do case
case nActiveX == 1
hb_gtInfo( HB_GTI_WINTITLE, 'Shell.Explorer.2'+' [ '+'http://harbour.vouch.info'+' ]' )
DO CASE
CASE nActiveX == 1
hb_gtInfo( HB_GTI_WINTITLE, 'Shell.Explorer.2' + ' [ ' + 'http://harbour.vouch.info' + ' ]' )
oCom:CLSID := 'Shell.Explorer.2'
oCom:mapEvent( 269, {|| WAPI_OutputDebugString( ' E X P L O R E R - 2 6 9' ) } )
oCom:mapEvent( 105, {|| WAPI_OutputDebugString( ' E X P L O R E R - 105' ) } )
case nActiveX == 11
hb_gtInfo( HB_GTI_WINTITLE, 'Shell.Explorer.2'+' [ '+'MSHTML Demo'+' ]' )
CASE nActiveX == 11
hb_gtInfo( HB_GTI_WINTITLE, 'Shell.Explorer.2' + ' [ ' + 'MSHTML Demo' + ' ]' )
oCom:CLSID := "MSHTML:" + "<html><h1>Stream Test</h1><p>This HTML content is being loaded from a stream.</html>"
oCom:mapEvent( 269, {|| QOut( ' E X P L O R E R - 2 6 9' ) } )
case nActiveX == 2
#define evClick 1
#define evDblClk 2
#define evBtnDown 3
#define evMouseMove 4
#define evBtnUp 5
CASE nActiveX == 2
#define evClick 1
#define evDblClk 2
#define evBtnDown 3
#define evMouseMove 4
#define evBtnUp 5
hb_gtInfo( HB_GTI_WINTITLE, 'AnalogClockControl.AnalogClock' )
oCom:CLSID := 'AnalogClockControl.AnalogClock'
oCom:Id := 5
oCom:mapEvent( evDblClk, {|| oCom:Value := seconds()/86400 ,;
oCom:BackColor := RGB( 0,140,210 ),;
oCom:Refresh() ,;
oCom:ShowSecondsHand := .T. ,;
oCom:Hands3D := .T. ,;
oCom:Refresh() ,;
oCom:showAboutBox() ;
} )
oCom:mapEvent( evDblClk, {|| oCom:Value := Seconds()/86400 , ;
oCom:BackColor := RGB( 0, 140, 210 ), ;
oCom:Refresh() , ;
oCom:ShowSecondsHand := .T. , ;
oCom:Hands3D := .T. , ;
oCom:Refresh() , ;
oCom:showAboutBox() ;
} )
oCom:mapEvent( evBtnUp, {| nBtn | iif( nBtn == 2, oCom:oParent:sendMessage( WM_CLOSE,0,0 ), NIL ) } )
case nActiveX == 3
CASE nActiveX == 3
hb_gtInfo( HB_GTI_WINTITLE, 'file://' + hb_DirBase() + 'myharu.pdf' )
oCom:CLSID := 'file://' + hb_DirBase() + 'myharu.pdf'
oCom:mapEvent( 269, {|| QOut( ' E X P L O R E R - 2 6 9' ) } )
case nActiveX == 4
CASE nActiveX == 4
hb_gtInfo( HB_GTI_WINTITLE, 'RM Chart [ <F12> Attributes <F11> Next Charts ]' )
oCom:CLSID := 'RMChart.RMChartX'
@@ -359,11 +368,11 @@ STATIC FUNCTION BuildActiveXControl( nActiveX, oDA )
// Trying to set it generates GPF.
// Please download RMChart.ocx from http://www.rmchart.com/ . It is free in everysense.
case nActiveX == 5
CASE nActiveX == 5
hb_gtInfo( HB_GTI_WINTITLE, 'Image Viewer' )
oCom:CLSID := 'SCRIBBLE.ScribbleCtrl.1'
endcase
ENDCASE
oCom:create()
@@ -372,70 +381,71 @@ STATIC FUNCTION BuildActiveXControl( nActiveX, oDA )
//
STATIC FUNCTION ExeActiveX( nActiveX, oCom, xParam )
Local nKey, sData
static nTurn := 0
LOCAL nKey, sData
STATIC nTurn := 0
// After :CREATE() Messages
//
if nActiveX == 1
hb_gtInfo( HB_GTI_WINTITLE, iif( empty( xParam ), 'http://hbide.vouch.info', xParam ) )
IF nActiveX == 1
hb_gtInfo( HB_GTI_WINTITLE, iif( Empty( xParam ), 'http://hbide.vouch.info', xParam ) )
oCom:AddressBar := .T.
oCom:Navigate( iif( empty( xParam ), 'http://hbide.vouch.info', xParam ) )
oCom:Navigate( iif( Empty( xParam ), 'http://hbide.vouch.info', xParam ) )
elseif nActiveX == 4
ELSEIF nActiveX == 4
ConfigureRMChart( oCom )
oCom:Draw( .T. )
oCom:Draw2Clipboard()
elseif nActiveX == 5
ELSEIF nActiveX == 5
oCom:loadMultiPage( hb_DirBase() + 'myharu.pdf', 2 )
oCom:addGradientBorder( 10, RGB( 12,20,233 ), RGB( 100,255,20 ), 0 )
oCom:drawText( 10,10,'Vouch' )
oCom:drawText( 10, 10, 'Vouch' )
//oCom:emboss( 3,0 )
oCom:copy2ClipBoard()
oCom:view := 11
oCom:setBackGroundColor( rgb( 225,225,225 ) )
//oCom:rotate90()
endif
ENDIF
do while .T.
nKey := inkey()
DO WHILE .T.
nKey := Inkey()
IF nActiveX == 2
oCom:Value := seconds()/86400
oCom:Value := Seconds()/86400
ENDIF
if nKey == K_F12
if nActiveX == 1
IF nKey == K_F12
IF nActiveX == 1
oCom:Navigate( 'www.vouch.info' )
elseif nActiveX == 11
ELSEIF nActiveX == 11
//oCom:document( 0 ):InnerHTML := "<html><h1>Stream Test</h1><p>This HTML content in a document.</html>"
elseif nActiveX == 4
ELSEIF nActiveX == 4
oCom:RMCBackColor := 23456142
oCom:RMCStyle := 2
oCom:RMCUserWatermark := 'Vouch'
oCom:Region(1):SetProperties( 5.0,5.0,-5.0,-5.0 )
oCom:Region( 1 ):SetProperties( 5.0, 5.0, -5.0, -5.0 )
oCom:Draw( .T. )
endif
ENDIF
elseif nKey == K_F11
if nActiveX == 4
ELSEIF nKey == K_F11
IF nActiveX == 4
nTurn++
if nTurn > 6
IF nTurn > 6
nTurn := 1
endif
ENDIF
sData := NIL
sData := ''
do case
case nTurn == 1
hb_gtInfo( HB_GTI_WINTITLE,'RMChart [ Next:F11 ] ' + 'Stacked Bars' )
DO CASE
CASE nTurn == 1
hb_gtInfo( HB_GTI_WINTITLE, 'RMChart [ Next:F11 ] ' + 'Stacked Bars' )
//SetMode( 30,100 )
sData += "00003600|00004450|000051|000061|000073|00008-6972|00009412|00011Tahoma|100011|10"
@@ -455,8 +465,8 @@ STATIC FUNCTION ExeActiveX( nActiveX, oCom, xParam )
sData += "140033|140045|140055|14006-1|1400925|140131|14014-1|140171|14019-4684277|1402111"
sData += "|140221|140236|140535000*9000*12000*6000*10000*5000"
case nTurn == 2
hb_gtInfo( HB_GTI_WINTITLE,'RMChart [ Next:F11 ] '+'Floating Bars' )
CASE nTurn == 2
hb_gtInfo( HB_GTI_WINTITLE, 'RMChart [ Next:F11 ] ' + 'Floating Bars' )
//SetMode( 20,90 )
sData += "00003550|00004300|000051|000073|00008-2894893|00009412|00011Tahoma|100011|100035"
@@ -470,8 +480,8 @@ STATIC FUNCTION ExeActiveX( nActiveX, oCom, xParam )
sData += "531*3*4*6*6*4*7*4*9*3*10*3|120011|120026|120044|120101|120132|12019-47872|120211"
sData += "1|120221|1202312|120531*.5*1.5*10.5*12*1*12*1*12.5*.5*2*11"
case nTurn == 3
hb_gtInfo( HB_GTI_WINTITLE,'RMChart [ Next:F11 ] '+'Four Regions' )
CASE nTurn == 3
hb_gtInfo( HB_GTI_WINTITLE, 'RMChart [ Next:F11 ] ' + 'Four Regions' )
//SetMode( 40,120 )
sData += "00003700|00004500|000054|000061|000071|00008-984833|00009412|00011Tahoma|100011|"
@@ -503,8 +513,8 @@ STATIC FUNCTION ExeActiveX( nActiveX, oCom, xParam )
sData += "171|42019-16744448|4202115|420221|4202310|420261|420538.1*6.2*4.3*2.2*1.2*3.1*5."
sData += "2*11.4*7.3*4.2"
case nTurn == 4
hb_gtInfo( HB_GTI_WINTITLE,'RMChart [ Next:F11 ] '+'10 Biggest Companies' )
CASE nTurn == 4
hb_gtInfo( HB_GTI_WINTITLE, 'RMChart [ Next:F11 ] ' + '10 Biggest Companies' )
//SetMode( 25,90 )
sData += "00003670|00004450|000051|000061|000071|00008-10185235|00009412|00011Tahoma|10001"
@@ -521,8 +531,8 @@ STATIC FUNCTION ExeActiveX( nActiveX, oCom, xParam )
sData += "0052|120061|120071|1200970|120111|120121|120131|1201421|120171|12019-16744448|12"
sData += "02115|120221|1202310|120261|120538.9*4.1*4.4*2.1*.3*.3*5.9*11.3*6.7*6"
case nTurn == 5
hb_gtInfo( HB_GTI_WINTITLE,'RMChart [ Next:F11 ] '+'Grouped Bars' )
CASE nTurn == 5
hb_gtInfo( HB_GTI_WINTITLE, 'RMChart [ Next:F11 ] ' + 'Grouped Bars' )
//SetMode( 25,80 )
sData += "00003600|00004450|000051|000061|000075|00008-2|00009412|00010paper.jpg|00011Taho"
@@ -534,8 +544,8 @@ STATIC FUNCTION ExeActiveX( nActiveX, oCom, xParam )
sData += "0*50*70*60|130011|130022|130044|130131|1302111|130221|130235|1305340*10*30*20*80"
sData += "|140011|140022|140044|140131|1402111|140221|140235|1405370*50*80*40*30"
case nTurn == 6
hb_gtInfo( HB_GTI_WINTITLE,'RMChart [ Next:F11 ] '+'Flow Chart' )
CASE nTurn == 6
hb_gtInfo( HB_GTI_WINTITLE, 'RMChart [ Next:F11 ] ' + 'Flow Chart' )
//SetMode( 30,50 )
sData += "00003305|00004400|000051|00008-984833|00009412|00011Tahoma|100011|100035|100045|"
@@ -570,35 +580,36 @@ STATIC FUNCTION ExeActiveX( nActiveX, oCom, xParam )
sData += "20|01013100|01015-39322|010191|010209|01026RMChart is not a flowchart tool. This"
sData += " is just an example for the use of CustomObjects!|01030-256"
endcase
ENDCASE
oCom:Reset()
oCom:RMCFile := sData
oCom:Draw( .T. )
endif
ENDIF
endif
ENDIF
if nKey == K_ESC
exit
endif
enddo
IF nKey == K_ESC
EXIT
ENDIF
ENDDO
RETURN NIL
//
STATIC FUNCTION ConfigureRMChart( RMChart )
LOCAL oRegion
LOCAL oCaption
LOCAL oChart
#define RMC_CTRLSTYLEFLAT 0
#define RMC_PIE_GRADIENT 52
#define RMC_FULL 1
#define RMC_EXPLODE_NONE 0
#define RMC_VLABEL_ABSOLUTE 6
#define RMC_HATCHBRUSH_OFF 0
#define RMC_CTRLSTYLEFLAT 0
#define RMC_PIE_GRADIENT 52
#define RMC_FULL 1
#define RMC_EXPLODE_NONE 0
#define RMC_VLABEL_ABSOLUTE 6
#define RMC_HATCHBRUSH_OFF 0
/* The code pulled from freewin sources */
RMChart:Font := "Tahoma"
@@ -634,31 +645,31 @@ STATIC FUNCTION ConfigureRMChart( RMChart )
STATIC FUNCTION MyFunction( nMode )
#define MUSIC_WAITON {800, 1600}
#define MUSIC_WAITON { 800, 1600 }
do case
case nMode == 1
tone( MUSIC_WAITON[1], 1 )
tone( MUSIC_WAITON[2], 1 )
DO CASE
CASE nMode == 1
Tone( MUSIC_WAITON[ 1 ], 1 )
Tone( MUSIC_WAITON[ 2 ], 1 )
case nMode == 2
tone( MUSIC_WAITON[2], 1 )
tone( MUSIC_WAITON[1], 1 )
CASE nMode == 2
Tone( MUSIC_WAITON[ 2 ], 1 )
Tone( MUSIC_WAITON[ 1 ], 1 )
case nMode == 3
CASE nMode == 3
WVG_MessageBox( , "Button clicked!" )
case nMode == 101 // Charge
Eval( {|| tone(523,2),tone(698,2),tone(880,2),tone(1046,4),tone(880,2),tone(1046,8) } )
CASE nMode == 101 // Charge
Eval( {|| Tone( 523,2 ), Tone( 698,2 ), Tone( 880,2 ), Tone( 1046,4 ), Tone( 880,2 ), Tone( 1046,8 ) } )
case nMode == 102 // NannyBoo
AEval( {{196,2},{196,2},{164,2},{220,2},{196,4},{164,4}}, {| a | tone( a[ 1 ], a[ 2 ] ) } )
CASE nMode == 102 // NannyBoo
AEval( { { 196,2 }, { 196,2 }, { 164,2 }, { 220,2 }, { 196,4 }, { 164,4 } }, {| a | Tone( a[ 1 ], a[ 2 ] ) } )
case nMode == 103 // BADKEY
tone( 480,0.25 )
tone( 240,0.25 )
CASE nMode == 103 // BADKEY
Tone( 480, 0.25 )
Tone( 240, 0.25 )
endcase
ENDCASE
RETURN NIL

View File

@@ -24,24 +24,26 @@
PROCEDURE ExecGCUI()
IF hb_mtvm()
Hb_ThreadStart( {| oCrt | oCrt := WvgCrt():New( , , { 2,4 }, { 20,81 }, , .T. ) , ;
oCrt:icon := GetResource( "dia_excl.ico" ),;
oCrt:create(), ;
GCUIConsole( oCrt ) , ;
oCrt:destroy() } )
hb_threadStart( {| oCrt | oCrt := WvgCrt():New( , , { 2,4 }, { 20,81 }, , .T. ) , ;
oCrt:icon := GetResource( "dia_excl.ico" ), ;
oCrt:create(), ;
GCUIConsole( oCrt ) , ;
oCrt:destroy() } )
ENDIF
RETURN
//
#xTranslate Alert( => MyAlert(
#xtranslate Alert( => MyAlert(
PROCEDURE GCUIConsole( oCrt )
LOCAL dDate := date()
LOCAL cName := pad( 'Some Usefule Name' , 35 )
LOCAL cAdd1 := pad( 'Linda Goldman Avenue', 35 )
LOCAL cAdd2 := pad( 'Excellent Street' , 35 )
LOCAL cAdd3 := pad( 'Suit #415' , 35 )
LOCAL dDate := Date()
LOCAL cName := Pad( 'Some Usefule Name' , 35 )
LOCAL cAdd1 := Pad( 'Linda Goldman Avenue', 35 )
LOCAL cAdd2 := Pad( 'Excellent Street' , 35 )
LOCAL cAdd3 := Pad( 'Suit #415' , 35 )
LOCAL nSlry := 9000
LOCAL nColGet := 8
LOCAL GetList := {}
@@ -53,7 +55,7 @@ PROCEDURE GCUIConsole( oCrt )
CLS
hb_gtInfo( HB_GTI_WINTITLE, "WVG Simplified yet Powerful CUI-GUI Console!" )
@ MaxRow(), 0 SAY PadC( "Navigate the Gets", maxcol()+1 ) COLOR "W+/B"
@ MaxRow(), 0 SAY PadC( "Navigate the Gets", MaxCol() + 1 ) COLOR "W+/B"
@ 2, nColGet SAY "< Date >"
@ 5, nColGet SAY "<" + PadC( "Name" , 33 ) + ">"
@@ -61,45 +63,45 @@ PROCEDURE GCUIConsole( oCrt )
@ 15, nColGet SAY "< Salary >"
@ 3, nColGet GET dDate ;
WHEN {|| Wvg_SetGObjData( hTxt, 1, FetchText( 1 ) ) } ;
Valid {|| Wvg_SetGObjData( hTxt, 6, RGB( 255,0,0 ) ), .T. }
WHEN {|| Wvg_SetGObjData( hTxt, 1, FetchText( 1 ) ) } ;
Valid {|| Wvg_SetGObjData( hTxt, 6, RGB( 255,0,0 ) ), .T. }
@ 6, nColGet GET cName ;
WHEN {|| Wvg_SetGObjData( hTxt, 1, FetchText( 2 ) ) } ;
Valid {|| Wvg_SetGObjData( hTxt, 6, RGB( 255,255,0 ) ), ;
Wvg_SetGObjState( hBoxR, 3 ), .T. }
WHEN {|| Wvg_SetGObjData( hTxt, 1, FetchText( 2 ) ) } ;
Valid {|| Wvg_SetGObjData( hTxt, 6, RGB( 255,255,0 ) ), ;
Wvg_SetGObjState( hBoxR, 3 ), .T. }
@ 9, nColGet GET cAdd1 ;
WHEN {|| Wvg_SetGObjData( hTxt, 1, FetchText( 3 ) ) } ;
Valid {|| Wvg_SetGObjData( hTxt, 6, RGB( 255,0,255 ) ), .T. }
WHEN {|| Wvg_SetGObjData( hTxt, 1, FetchText( 3 ) ) } ;
Valid {|| Wvg_SetGObjData( hTxt, 6, RGB( 255,0,255 ) ), .T. }
@ 11, nColGet GET cAdd2 ;
WHEN {|| Wvg_SetGObjData( hTxt, 1, FetchText( 4 ) ) } ;
Valid {|| Wvg_SetGObjData( hTxt, 6, RGB( 255,255,255 ) ), ;
Wvg_SetGObjState( hBoxR, 1 ), .T. }
WHEN {|| Wvg_SetGObjData( hTxt, 1, FetchText( 4 ) ) } ;
Valid {|| Wvg_SetGObjData( hTxt, 6, RGB( 255,255,255 ) ), ;
Wvg_SetGObjState( hBoxR, 1 ), .T. }
@ 13, nColGet GET cAdd3 ;
WHEN {|| Wvg_SetGObjData( hTxt, 6, RGB( 198,21,140 ) ), .T. }
WHEN {|| Wvg_SetGObjData( hTxt, 6, RGB( 198,21,140 ) ), .T. }
@ 16, nColGet GET nSlry PICTURE "@Z 9999999.99" ;
WHEN {|| Wvg_SetGObjData( hTxt, 6, RGB( 0,0,0 ) ), .T. }
WHEN {|| Wvg_SetGObjData( hTxt, 6, RGB( 0,0,0 ) ), .T. }
// The only additional calls to render your console GUI
//
// The GETLIST : This can be embedded via @ GET preprocessor command
aEval( GetList, {| oGet | Wvg_BoxGet( oGet:Row, oGet:Col, Len( Transform( oGet:VarGet(), oGet:Picture ) ) ) } )
AEval( GetList, {| oGet | Wvg_BoxGet( oGet:Row, oGet:Col, Len( Transform( oGet:VarGet(), oGet:Picture ) ) ) } )
//
hBoxR := Wvg_BoxRaised( 1,2,18,49, {-5,-5,5,5} )
hBoxR := Wvg_BoxRaised( 1, 2, 18, 49, { -5, -5, 5, 5 } )
//
Wvg_BoxRecessed( 1,2,18,49 )
Wvg_BoxRecessed( 1, 2, 18, 49 )
//
// Wvg_BoxGroup( 2,4,17,47 )
// Wvg_BoxGroup( 2, 4, 17, 47 )
//
Wvg_BoxGroupRaised( 2,4,17,47, {-7,-7,7,7} )
Wvg_BoxGroupRaised( 2, 4, 17, 47, { -7, -7, 7, 7 } )
//
hTxt := Wvg_TextBox( 3,57,16,75, {10,10,-10,-10}, 'This is first TextBox Line!', 2, 2 )
hTxt := Wvg_TextBox( 3, 57, 16, 75, { 10, 10, -10, -10 }, 'This is first TextBox Line!', 2, 2 )
//
Wvg_Image( 15,36,16,42, {-3,-3,3,3}, GOBJ_IMAGESOURCE_FILE, GetResource( 'Vouch1.bmp' ) )
Wvg_BoxRaised( 15,36,16,42,{-2,-2,2,2} )
Wvg_Image( 15, 36, 16, 42, { -3, -3, 3, 3 }, GOBJ_IMAGESOURCE_FILE, GetResource( 'Vouch1.bmp' ) )
Wvg_BoxRaised( 15, 36, 16, 42, { -2, -2, 2, 2 } )
//
Wvg_ShadedRect( 1,54,18,79, { -5,-5,5,5 }, 0, {65000,21000,7000,56000}, {255,32255,16000,32500} )
Wvg_ShadedRect( 1, 54, 18, 79, { -5, -5, 5, 5 }, 0, { 65000, 21000, 7000, 56000 }, { 255, 32255, 16000, 32500 } )
//
Wvg_BoxRaised( 1,54,18,79, {-5,-5,5,5} )
Wvg_BoxRaised( 1, 54, 18, 79, { -5, -5, 5, 5 } )
// Instruct GT to Repaint the Screen with GUI elements.
oCrt:refresh()
@@ -107,14 +109,15 @@ PROCEDURE GCUIConsole( oCrt )
// Issue the read
READ
// Alert( 'How did you like the "Alert" replacement?', { 'WOW','OK','OOps'} )
My_Alert( 'How did you like the "Alert" replacement?', { 'WOW','OK','OOps'} )
// Alert( 'How did you like the "Alert" replacement?', { 'WOW','OK','OOps'} )
My_Alert( 'How did you like the "Alert" replacement?', { 'WOW', 'OK', 'OOps' } )
RETURN
//
STATIC FUNCTION FetchText( nMode )
LOCAL cText
DO CASE

View File

@@ -51,7 +51,7 @@ REQUEST DbfNtx
//
#ifndef __SQL__
ANNOUNCE Hb_NoStartUpWindow
ANNOUNCE Hb_NoStartUpWindow
#endif
//
@@ -60,10 +60,10 @@ MEMVAR cCdxExp, First, Last, City
//
THREAD STATIC t_wvtScreen := {}
THREAD STATIC t_wvtScreen := {}
#ifdef __XCC__
STATIC s_paint_:= { { "", {} } }
STATIC s_paint_ := { { "", {} } }
#endif
//
@@ -85,9 +85,10 @@ EXIT PROCEDURE CleanHandles()
//
PROCEDURE Main()
LOCAL aLastPaint, clr, scr, pGT
LOCAL hPopup
LOCAL dDate := stod()
LOCAL dDate := SToD()
LOCAL cName := Pad( "Pritpal Bedi", 35 )
LOCAL cAdd1 := Pad( "60, New Professor Colony", 35 )
LOCAL cAdd2 := Pad( "Ludhiana, INDIA", 35 )
@@ -107,7 +108,7 @@ PROCEDURE Main()
SET DATE ANSI
SET( _SET_EVENTMASK, INKEY_ALL + HB_INKEY_GTEVENT )
Set( _SET_EVENTMASK, INKEY_ALL + HB_INKEY_GTEVENT )
Wvt_SetGui( .T. )
WvtSetKeys( .T. )
@@ -123,45 +124,45 @@ PROCEDURE Main()
oLastMenu:disableItem( 11 )
oLastMenu:checkItem( 1 )
oLastMenu:insItem( 11, { "I am inserted later !", ;
{|| Wvg_MessageBox( , "Hi " + iif( oLastMenu:isItemChecked( 1 ), "Yes", "No" ) + ;
iif( oLastMenu:isItemEnabled( 12 ), " Yes", " No" ) ) } } )
{|| Wvg_MessageBox( , "Hi " + iif( oLastMenu:isItemChecked( 1 ), "Yes", "No" ) + ;
iif( oLastMenu:isItemEnabled( 12 ), " Yes", " No" ) ) } } )
oLastMenu:setItem( 14, { "This is Set Against Prev Menu", {|| Wvg_MessageBox( , "Hi" ) } } )
SetMode( maxrow()+1, maxcol()+1 ) /* Needed to accomodate attached menu */
SetMode( MaxRow() + 1, MaxCol() + 1 ) /* Needed to accomodate attached menu */
SetKey( K_F12 , {|| hb_gtInfo( HB_GTI_ACTIVATESELECTCOPY ) } )
SetKey( K_CTRL_V , {|| __KeyBoard( hb_gtInfo( HB_GTI_CLIPBOARDDATA ) ) } )
SetKey( K_RBUTTONDOWN, {|| __KeyBoard( hb_gtInfo( HB_GTI_CLIPBOARDDATA ) ) } )
SetKey( K_CTRL_V , {|| __Keyboard( hb_gtInfo( HB_GTI_CLIPBOARDDATA ) ) } )
SetKey( K_RBUTTONDOWN, {|| __Keyboard( hb_gtInfo( HB_GTI_CLIPBOARDDATA ) ) } )
hPopup := Wvt_SetPopupMenu()
pGT := SetGT( 1, hb_gtSelect() )
/* Force mouse pointer right below the Harbour label */
Wvt_SetMousePos( 2,40 )
Wvt_SetMousePos( 2, 40 )
aAdd( aBlocks, {|| Wvt_SetIcon( GetResource( "vr_1.ico" ) ) } )
aAdd( aBlocks, {|| Wvt_SetTitle( "Vouch" ) } )
aAdd( aBlocks, {|| Wvt_DrawLabel( 1,40, cLabel,6,, rgb(255,255,255), rgb(198,198,198), "Arial", 26, , , , , .T., .T. ) } )
aAdd( aBlocks, {|| Wvt_DrawBoxRaised( nTop, nLft, nBtm, nRgt ) } )
aAdd( aBlocks, {|| Wvt_DrawBoxRecessed( 7, 61, 13, 70 ) } )
aAdd( aBlocks, {|| Wvt_DrawBoxGroup( 15, 59, 18, 72 ) } )
aAdd( aBlocks, {|| Wvt_DrawBoxGroup( 5, 6, 19, 44 ) } )
aAdd( aBlocks, {|| Wvt_DrawImage( 8,62,12,69, IMAGE_VOUCH ) } )
aAdd( aBlocks, {|| Wvt_DrawBoxRecessed( 7, 48, 13, 55 ) } )
aAdd( aBlocks, {|| Wvt_DrawLine( maxrow()-2,0,maxrow()-2,maxcol(),WVT_LINE_HORZ,WVT_LINE_RECESSED,WVT_LINE_BOTTOM ) } )
aAdd( aBlocks, {|| Wvt_DrawLine( maxrow()-1,41,maxrow(),41,WVT_LINE_VERT,WVT_LINE_RECESSED,WVT_LINE_CENTER ) } )
aAdd( aBlocks, {|| aEval( GetList, {| oGet | Wvt_DrawBoxGet( oGet:Row, oGet:Col, Len( Transform( oGet:VarGet(), oGet:Picture ) ) ) } ) } )
AAdd( aBlocks, {|| Wvt_SetIcon( GetResource( "vr_1.ico" ) ) } )
AAdd( aBlocks, {|| Wvt_SetTitle( "Vouch" ) } )
AAdd( aBlocks, {|| Wvt_DrawLabel( 1,40, cLabel,6,, rgb(255,255,255 ), rgb(198,198,198 ), "Arial", 26, , , , , .T. , .T. ) } )
AAdd( aBlocks, {|| Wvt_DrawBoxRaised( nTop, nLft, nBtm, nRgt ) } )
AAdd( aBlocks, {|| Wvt_DrawBoxRecessed( 7, 61, 13, 70 ) } )
AAdd( aBlocks, {|| Wvt_DrawBoxGroup( 15, 59, 18, 72 ) } )
AAdd( aBlocks, {|| Wvt_DrawBoxGroup( 5, 6, 19, 44 ) } )
AAdd( aBlocks, {|| Wvt_DrawImage( 8,62,12,69, IMAGE_VOUCH ) } )
AAdd( aBlocks, {|| Wvt_DrawBoxRecessed( 7, 48, 13, 55 ) } )
AAdd( aBlocks, {|| Wvt_DrawLine( MaxRow() - 2,0,MaxRow() - 2,MaxCol(),WVT_LINE_HORZ,WVT_LINE_RECESSED,WVT_LINE_BOTTOM ) } )
AAdd( aBlocks, {|| Wvt_DrawLine( MaxRow() - 1,41,MaxRow(),41,WVT_LINE_VERT,WVT_LINE_RECESSED,WVT_LINE_CENTER ) } )
AAdd( aBlocks, {|| AEval( GetList, {| oGet | Wvt_DrawBoxGet( oGet:Row, oGet:Col, Len( Transform( oGet:VarGet(), oGet:Picture ) ) ) } ) } )
aAdd( aBlocks, {|| Wvt_Mouse( -1000001 ) } )
AAdd( aBlocks, {|| Wvt_Mouse( -1000001 ) } )
aLastPaint := WvtSetBlocks( aBlocks )
/* XBase++ compatible pure GUI controls onto CUI console */
BuildButtons()
scr := SaveScreen( 0,0,maxrow(),maxcol() )
scr := SaveScreen( 0, 0, MaxRow(), MaxCol() )
clr := SetColor( "N/W" )
CLS
SetColor( "N/W,N/GR*,,,N/W*" )
@@ -171,10 +172,10 @@ PROCEDURE Main()
@ 12, nColGet SAY "<" + PadC( "Address", 33 ) + ">"
@ 16, 61 SAY "< Salary >"
dDate := stod( "20040401" )
dDate := SToD( "20040401" )
@ 7, nColGet GET dDate WHEN DispStatusMsg( "Date must be valid" ) VALID ClearStatusMsg()
@ 10, nColGet GET cName WHEN DispStatusMsg( "Must be one of the list!" ) VALID ( VouChoice() < 7 .and. ClearStatusMsg() )
@ 10, nColGet GET cName WHEN DispStatusMsg( "Must be one of the list!" ) VALID ( VouChoice() < 7 .AND. ClearStatusMsg() )
@ 13, nColGet GET cAdd1
@ 15, nColGet GET cAdd2
@ 17, nColGet GET cAdd3
@@ -189,7 +190,7 @@ PROCEDURE Main()
WvtSetBlocks( aLastPaint )
WvtSetObjects( aObjects )
SetColor( clr )
RestScreen( 0,0,maxrow(),maxcol(), scr )
RestScreen( 0, 0, MaxRow(), MaxCol(), scr )
WvtSetKeys( .F. )
Wvt_SetPopupMenu( hPopup )
@@ -202,10 +203,12 @@ PROCEDURE Main()
//
FUNCTION HB_GTSYS()
FUNCTION hb_GTSYS()
REQUEST HB_GT_WVG_DEFAULT
REQUEST HB_GT_WVT
REQUEST HB_GT_WGU
RETURN NIL
//
@@ -215,10 +218,10 @@ PROCEDURE WvtConsoleGets( nMode )
DEFAULT nMode TO 0
IF hb_mtvm()
Hb_ThreadStart( {| oCrt | hb_gtReload( 'WVT' ) , ;
oCrt := hb_gtSelect(), ;
iif( nMode == 0, WvtNextGetsConsole(), GoogleMap() ) , ;
oCrt := NIL } )
hb_threadStart( {| oCrt | hb_gtReload( 'WVT' ) , ;
oCrt := hb_gtSelect(), ;
iif( nMode == 0, WvtNextGetsConsole(), GoogleMap() ) , ;
oCrt := NIL } )
ENDIF
RETURN
@@ -226,7 +229,8 @@ PROCEDURE WvtConsoleGets( nMode )
//
PROCEDURE WvtNextGetsConsole()
LOCAL dDate := stod()
LOCAL dDate := SToD()
LOCAL cName := Space( 35 )
LOCAL cAdd1 := Space( 35 )
LOCAL cAdd2 := Space( 35 )
@@ -235,16 +239,16 @@ PROCEDURE WvtNextGetsConsole()
LOCAL nColGet := 8
LOCAL GetList := {}
SetMode( 20,51 )
SetMode( 20, 51 )
SetColor( "N/W,N/GR*,,,N/W*" )
CLS
hb_gtInfo( HB_GTI_WINTITLE, "WVT Console in WVG Application" )
@ MaxRow(), 0 SAY PadC( "GTWVT in GTWVG Console Gets", maxcol()+1 ) COLOR "W+/B*"
@ MaxRow(), 0 SAY PadC( "GTWVT in GTWVG Console Gets", MaxCol() + 1 ) COLOR "W+/B*"
@ 2, nColGet SAY "< Date >"
@ 5, nColGet SAY "<" + PadC( "Name", 33 ) + ">"
@ 8, nColGet SAY "<" + PadC( "Address", 33) + ">"
@ 8, nColGet SAY "<" + PadC( "Address", 33 ) + ">"
@ 15, nColGet SAY "< Salary >"
@ 3, nColGet GET dDate
@@ -263,8 +267,8 @@ PROCEDURE WvtNextGetsConsole()
PROCEDURE WvtNextGets()
IF hb_mtvm()
Hb_ThreadStart( {|| Hb_gtReload( 'WVG' ), Wvt_setFont( 'Terminal',20 ), ;
hb_clear(), Wvt_ShowWindow( SW_RESTORE ), WvtNextGets_X() } )
hb_threadStart( {|| hb_gtReload( 'WVG' ), Wvt_setFont( 'Terminal',20 ), ;
hb_clear(), Wvt_ShowWindow( SW_RESTORE ), WvtNextGets_X() } )
ELSE
WvtNextGets_X()
ENDIF
@@ -274,8 +278,9 @@ PROCEDURE WvtNextGets()
//
PROCEDURE WvtNextGets_X()
LOCAL aLastPaint, clr
LOCAL dDate := stod()
LOCAL dDate := SToD()
LOCAL cName := Space( 35 )
LOCAL cAdd1 := Space( 35 )
LOCAL cAdd2 := Space( 35 )
@@ -285,12 +290,12 @@ PROCEDURE WvtNextGets_X()
LOCAL nColGet := 8
LOCAL GetList := {}
LOCAL aPalette := Wvt_GetPalette()
LOCAL aNewPalette:= aclone( aPalette )
LOCAL aNewPalette := AClone( aPalette )
LOCAL aObjects := WvtSetObjects( {} )
LOCAL nRow := Row()
LOCAL nCol := Col()
LOCAL scr := SaveScreen( 0,0,maxrow(),maxcol() )
LOCAL wvtScr := Wvt_SaveScreen( 0,0,maxrow(),maxcol() )
LOCAL scr := SaveScreen( 0, 0, MaxRow(), MaxCol() )
LOCAL wvtScr := Wvt_SaveScreen( 0, 0, MaxRow(), MaxCol() )
STATIC nPalletMultiplier := 0
@@ -301,33 +306,33 @@ PROCEDURE WvtNextGets_X()
Wvt_SetPalette( aNewPalette )
aAdd( aBlocks, {|| Wvt_SetTitle( "Wvt Gets 2nd Window with Different Palette" ) } )
aAdd( aBlocks, {|| Wvt_DrawLine( maxrow()-1,0,maxrow()-1,maxcol() ) } )
aAdd( aBlocks, {|| Wvt_SetBrush( 0, rgb( 32,255,100 ) ) } )
aAdd( aBlocks, {|| Wvt_DrawEllipse( 6,50,10,58 ) } )
aAdd( aBlocks, {|| Wvt_SetBrush( 2, rgb( 255,255,100 ),1 ) } )
aAdd( aBlocks, {|| Wvt_DrawRectangle( 11, 50, 13, 58 ) } )
aAdd( aBlocks, {|| Wvt_DrawBoxGroupRaised( 5, 6, 19, 72 ) } )
aAdd( aBlocks, {|| aEval( GetList, {| oGet | Wvt_DrawBoxGet( oGet:Row, oGet:Col, Len( Transform( oGet:VarGet(), oGet:Picture ) ) ) } ) } )
AAdd( aBlocks, {|| Wvt_SetTitle( "Wvt Gets 2nd Window with Different Palette" ) } )
AAdd( aBlocks, {|| Wvt_DrawLine( MaxRow() - 1,0,MaxRow() - 1,MaxCol() ) } )
AAdd( aBlocks, {|| Wvt_SetBrush( 0, rgb( 32,255,100 ) ) } )
AAdd( aBlocks, {|| Wvt_DrawEllipse( 6,50,10,58 ) } )
AAdd( aBlocks, {|| Wvt_SetBrush( 2, rgb( 255,255,100 ),1 ) } )
AAdd( aBlocks, {|| Wvt_DrawRectangle( 11, 50, 13, 58 ) } )
AAdd( aBlocks, {|| Wvt_DrawBoxGroupRaised( 5, 6, 19, 72 ) } )
AAdd( aBlocks, {|| AEval( GetList, {| oGet | Wvt_DrawBoxGet( oGet:Row, oGet:Col, Len( Transform( oGet:VarGet(), oGet:Picture ) ) ) } ) } )
aAdd( aBlocks, {|| Wvt_DrawButton( 21, 6,22, 9,"New" ,"vouch1.bmp" ) } )
aAdd( aBlocks, {|| Wvt_DrawButton( 21,11,22,14,"Browse","vouch1.bmp", 1, rgb( 255,255,255 ) ) } )
aAdd( aBlocks, {|| Wvt_DrawButton( 21,16,22,19, ,"vouch1.bmp" ) } )
aAdd( aBlocks, {|| Wvt_DrawButton( 21,21,22,24,"Data",, 0, rgb( 100,22,241 ), rgb( 198,198,198 ) ) } )
aAdd( aBlocks, {|| Wvt_DrawButton( 21,26,22,29,"Flat",IMAGE_VR,2 ) } )
aAdd( aBlocks, {|| Wvt_DrawButton( 21,31,22,34,"Outline",IMAGE_VR,3 ) } )
aAdd( aBlocks, {|| Wvt_DrawButton( 22,36,22,41,"Data",, 0, rgb( 100,22,241 ), rgb( 198,198,198 ) ) } )
AAdd( aBlocks, {|| Wvt_DrawButton( 21, 6,22, 9,"New" ,"vouch1.bmp" ) } )
AAdd( aBlocks, {|| Wvt_DrawButton( 21,11,22,14,"Browse","vouch1.bmp", 1, rgb( 255,255,255 ) ) } )
AAdd( aBlocks, {|| Wvt_DrawButton( 21,16,22,19, ,"vouch1.bmp" ) } )
AAdd( aBlocks, {|| Wvt_DrawButton( 21,21,22,24,"Data",, 0, rgb( 100,22,241 ), rgb( 198,198,198 ) ) } )
AAdd( aBlocks, {|| Wvt_DrawButton( 21,26,22,29,"Flat",IMAGE_VR,2 ) } )
AAdd( aBlocks, {|| Wvt_DrawButton( 21,31,22,34,"Outline",IMAGE_VR,3 ) } )
AAdd( aBlocks, {|| Wvt_DrawButton( 22,36,22,41,"Data",, 0, rgb( 100,22,241 ), rgb( 198,198,198 ) ) } )
aLastPaint := WvtSetBlocks( aBlocks )
clr := SetColor( "N/W,N/GR*,,,N/W*" )
CLS
@ MaxRow(), 0 SAY PadC( "Harbour + WVT Console GUI Screen",80 ) COLOR "R+/W"
@ MaxRow(), 0 SAY PadC( "Harbour + WVT Console GUI Screen", 80 ) COLOR "R+/W"
@ 6, nColGet SAY "< Date >"
@ 9, nColGet SAY "<" + PadC( "Name", 33 ) + ">"
@ 12, nColGet SAY "<" + PadC( "Address", 33) + ">"
@ 12, nColGet SAY "<" + PadC( "Address", 33 ) + ">"
@ 16, 61 SAY "< Salary >"
@ 7, nColGet GET dDate
@@ -346,15 +351,17 @@ PROCEDURE WvtNextGets_X()
WvtSetBlocks( aLastPaint )
SetColor( clr )
RestScreen( 0, 0,maxrow(), maxcol(), scr )
RestScreen( 0, 0, MaxRow(), MaxCol(), scr )
Wvt_RestScreen( wvtScr )
SetPos( nRow, nCol )
RETURN
//
FUNCTION WvtPartialScreen()
LOCAL scr := SaveScreen( 7,20,15,60 )
LOCAL scr := SaveScreen( 7, 20, 15, 60 )
LOCAL wvtScr := Wvt_SaveScreen( 0, 0, MaxRow(), MaxCol() )
LOCAL wvtScr1
LOCAL aLastPaint
@@ -363,31 +370,31 @@ FUNCTION WvtPartialScreen()
aLastPaint := WvtSetBlocks( {} )
DispBox( 7, 20, 15, 60, " ", "W/GR*" )
@ 10,25 SAY "Wvt_SaveScreen()" COLOR "N/GR*"
@ 11,25 SAY "Wvt_RestScreen()" COLOR "N/GR*"
@ 13,25 SAY "Press Esc " COLOR "N/GR*"
Wvt_DrawBoxRecessed( 8,22,14,58 )
@ 10, 25 SAY "Wvt_SaveScreen()" COLOR "N/GR*"
@ 11, 25 SAY "Wvt_RestScreen()" COLOR "N/GR*"
@ 13, 25 SAY "Press Esc " COLOR "N/GR*"
Wvt_DrawBoxRecessed( 8, 22, 14, 58 )
wvtScr1 := Wvt_SaveScreen( 7,20,15,60 )
wvtScr1 := Wvt_SaveScreen( 7, 20, 15, 60 )
DO WHILE inkey( 0 ) != K_ESC
DO WHILE Inkey( 0 ) != K_ESC
ENDDO
DispBox( 7, 20, 15, 60, " ", "W/B*" )
@ 10,25 SAY "Wvt_SaveScreen()" COLOR "N/B*"
@ 11,25 SAY "Wvt_RestScreen()" COLOR "N/B*"
@ 13,25 SAY "Press Esc " COLOR "N/B*"
Wvt_DrawBoxRecessed( 8,22,14,58 )
@ 10, 25 SAY "Wvt_SaveScreen()" COLOR "N/B*"
@ 11, 25 SAY "Wvt_RestScreen()" COLOR "N/B*"
@ 13, 25 SAY "Press Esc " COLOR "N/B*"
Wvt_DrawBoxRecessed( 8, 22, 14, 58 )
DO WHILE inkey( 0 ) != K_ESC
DO WHILE Inkey( 0 ) != K_ESC
ENDDO
Wvt_RestScreen( 7,20,15,60, wvtScr1 )
Wvt_RestScreen( 7, 20, 15, 60, wvtScr1 )
DO WHILE inkey( 0 ) != K_ESC
DO WHILE Inkey( 0 ) != K_ESC
ENDDO
RestScreen( 7,20,15,60,scr )
RestScreen( 7, 20, 15, 60, scr )
Wvt_RestScreen( 0, 0, MaxRow(), MaxCol(), wvtScr )
WvtSetBlocks( aLastPaint )
Wvt_SetPopupMenu( hPopup )
@@ -397,10 +404,11 @@ FUNCTION WvtPartialScreen()
//
FUNCTION WvtLines()
LOCAL scr := SaveScreen( 0,0,maxrow(),maxcol() )
LOCAL scr := SaveScreen( 0, 0, MaxRow(), MaxCol() )
LOCAL clr := SetColor( "N/W" )
LOCAL nRows := maxrow()
LOCAL nCols := maxcol()
LOCAL nRows := MaxRow()
LOCAL nCols := MaxCol()
LOCAL aLastPaint := WvtSetBlocks( {} )
LOCAL aObjects := WvtSetObjects( {} )
LOCAL hPopup := Wvt_SetPopupMenu()
@@ -408,39 +416,39 @@ FUNCTION WvtLines()
CLS
aAdd( aBlocks, {|| Wvt_DrawLine( 0, 0, 0, nCols, WVT_LINE_HORZ, WVT_LINE_RAISED , WVT_LINE_CENTER ) } )
aAdd( aBlocks, {|| Wvt_DrawLine( 1, 0, 1, nCols, WVT_LINE_HORZ, WVT_LINE_RECESSED, WVT_LINE_TOP ) } )
aAdd( aBlocks, {|| Wvt_DrawLine( 2, 0, 2, nCols, WVT_LINE_HORZ, WVT_LINE_PLAIN , WVT_LINE_CENTER, WVT_LINE_SOLID, 4, Rgb( 255,255,255 ) ) } )
aAdd( aBlocks, {|| Wvt_DrawLine( 3, 0, 3, nCols, WVT_LINE_HORZ, WVT_LINE_RAISED , WVT_LINE_CENTER, WVT_LINE_DASH , 0, Rgb( 255,0,0 ) ) } )
aAdd( aBlocks, {|| Wvt_DrawLine( 4, 0, 4, nCols, WVT_LINE_HORZ, WVT_LINE_RECESSED, WVT_LINE_BOTTOM ) } )
AAdd( aBlocks, {|| Wvt_DrawLine( 0, 0, 0, nCols, WVT_LINE_HORZ, WVT_LINE_RAISED , WVT_LINE_CENTER ) } )
AAdd( aBlocks, {|| Wvt_DrawLine( 1, 0, 1, nCols, WVT_LINE_HORZ, WVT_LINE_RECESSED, WVT_LINE_TOP ) } )
AAdd( aBlocks, {|| Wvt_DrawLine( 2, 0, 2, nCols, WVT_LINE_HORZ, WVT_LINE_PLAIN , WVT_LINE_CENTER, WVT_LINE_SOLID, 4, Rgb( 255,255,255 ) ) } )
AAdd( aBlocks, {|| Wvt_DrawLine( 3, 0, 3, nCols, WVT_LINE_HORZ, WVT_LINE_RAISED , WVT_LINE_CENTER, WVT_LINE_DASH , 0, Rgb( 255,0,0 ) ) } )
AAdd( aBlocks, {|| Wvt_DrawLine( 4, 0, 4, nCols, WVT_LINE_HORZ, WVT_LINE_RECESSED, WVT_LINE_BOTTOM ) } )
@ 0, 1 SAY "Center Raised"
@ 1,11 say "Top Recessed"
@ 2,21 say "Center Plain White 3 Pixels"
@ 3,31 say "Center Raised Dotted"
@ 4,41 SAY "Bottom Recessed"
@ 1, 11 SAY "Top Recessed"
@ 2, 21 SAY "Center Plain White 3 Pixels"
@ 3, 31 SAY "Center Raised Dotted"
@ 4, 41 SAY "Bottom Recessed"
@ 5, 1 SAY "Bottom Checked"
@ nRows, 0 Say PadC( "Press ESC to Quit", nCols+1 ) COLOR "GR+/W"
@ nRows, 0 SAY PadC( "Press ESC to Quit", nCols + 1 ) COLOR "GR+/W"
aAdd( aBlocks, {|| Wvt_DrawLine( 11, 5,nRows-2, 5, WVT_LINE_VERT, WVT_LINE_RAISED , WVT_LINE_CENTER ) } )
aAdd( aBlocks, {|| Wvt_DrawLine( 11, 6,nRows-2, 6, WVT_LINE_VERT, WVT_LINE_RECESSED, WVT_LINE_CENTER ) } )
aAdd( aBlocks, {|| Wvt_DrawLine( 11, 7,nRows-2, 7, WVT_LINE_VERT, WVT_LINE_PLAIN , WVT_LINE_LEFT ) } )
aAdd( aBlocks, {|| Wvt_DrawLine( 11, 8,nRows-2, 8, WVT_LINE_VERT, WVT_LINE_PLAIN , WVT_LINE_CENTER ) } )
aAdd( aBlocks, {|| Wvt_DrawLine( 11, 9,nRows-2, 9, WVT_LINE_VERT, WVT_LINE_PLAIN , WVT_LINE_RIGHT ) } )
aAdd( aBlocks, {|| Wvt_DrawLine( 11,10,nRows-2,10, WVT_LINE_VERT, WVT_LINE_PLAIN , WVT_LINE_CENTER, WVT_LINE_DOT, 0, RGB( 0,0,255 ) ) } )
aAdd( aBlocks, {|| Wvt_DrawLine( 11,11,nRows-2,11, WVT_LINE_VERT, WVT_LINE_PLAIN , WVT_LINE_CENTER, WVT_LINE_DASH, 0, RGB( 255,0,0 ) ) } )
aAdd( aBlocks, {|| Wvt_DrawLine( 11,12,nRows-2,12, WVT_LINE_VERT, WVT_LINE_PLAIN , WVT_LINE_CENTER, WVT_LINE_DASHDOT, 0, RGB( 0,255,0 ) ) } )
AAdd( aBlocks, {|| Wvt_DrawLine( 11, 5,nRows - 2, 5, WVT_LINE_VERT, WVT_LINE_RAISED , WVT_LINE_CENTER ) } )
AAdd( aBlocks, {|| Wvt_DrawLine( 11, 6,nRows - 2, 6, WVT_LINE_VERT, WVT_LINE_RECESSED, WVT_LINE_CENTER ) } )
AAdd( aBlocks, {|| Wvt_DrawLine( 11, 7,nRows - 2, 7, WVT_LINE_VERT, WVT_LINE_PLAIN , WVT_LINE_LEFT ) } )
AAdd( aBlocks, {|| Wvt_DrawLine( 11, 8,nRows - 2, 8, WVT_LINE_VERT, WVT_LINE_PLAIN , WVT_LINE_CENTER ) } )
AAdd( aBlocks, {|| Wvt_DrawLine( 11, 9,nRows - 2, 9, WVT_LINE_VERT, WVT_LINE_PLAIN , WVT_LINE_RIGHT ) } )
AAdd( aBlocks, {|| Wvt_DrawLine( 11,10,nRows - 2,10, WVT_LINE_VERT, WVT_LINE_PLAIN , WVT_LINE_CENTER, WVT_LINE_DOT, 0, RGB( 0,0,255 ) ) } )
AAdd( aBlocks, {|| Wvt_DrawLine( 11,11,nRows - 2,11, WVT_LINE_VERT, WVT_LINE_PLAIN , WVT_LINE_CENTER, WVT_LINE_DASH, 0, RGB( 255,0,0 ) ) } )
AAdd( aBlocks, {|| Wvt_DrawLine( 11,12,nRows - 2,12, WVT_LINE_VERT, WVT_LINE_PLAIN , WVT_LINE_CENTER, WVT_LINE_DASHDOT, 0, RGB( 0,255,0 ) ) } )
WvtSetBlocks( aBlocks )
@ 12,5 Say "A"
@ 13,6 Say "B"
@ 14,7 Say "C"
@ 15,8 Say "D"
@ 16,9 Say "E"
@ 12, 5 SAY "A"
@ 13, 6 SAY "B"
@ 14, 7 SAY "C"
@ 15, 8 SAY "D"
@ 16, 9 SAY "E"
DO WHILE ( inkey(0) != K_ESC )
DO WHILE ( Inkey( 0 ) != K_ESC )
ENDDO
// Restore Environments
@@ -451,84 +459,85 @@ FUNCTION WvtLines()
WvtSetObjects( aObjects )
Wvt_SetPopupMenu( hPopup )
RestScreen( 0,0,maxrow(),maxcol(), scr )
RestScreen( 0, 0, MaxRow(), MaxCol(), scr )
RETURN NIL
//
FUNCTION BuildMainMenu()
LOCAL oMenu
LOCAL g_oMenuBar := WvgSetAppWindow():menuBar()
oMenu := WvgMenu():new( g_oMenuBar, , .T. ):create()
oMenu:Caption:= "Wvt*Classes"
oMenu:Caption := "Wvt*Classes"
oMenu:AddItem( "Dialog One . New Window . Threaded" , {|| DialogWvgClassesOne( 1 ) } )
oMenu:AddItem( "Dialog One . Main Window . Primary Thread", {|| DialogWvgClassesOne( 2 ) } )
oMenu:AddItem( "-" )
oMenu:AddItem( "Dialog Two" , {|| DialogWvgClassesTwo() } )
oMenu:AddItem( "-" )
oMenu:AddItem( "Exit" , {|| __keyboard( K_ESC ) } )
oMenu:AddItem( "Exit" , {|| __Keyboard( K_ESC ) } )
g_oMenuBar:addItem( { oMenu, "Wvt*Classes" } )
oMenu := WvgMenu():new( g_oMenuBar, , .T. ):create()
oMenu:caption := "Traditional"
oMenu:AddItem( "Gets . GTWVG . Threaded" , {|| WvtNextGets() } )
oMenu:AddItem( "-")
oMenu:AddItem( "-" )
oMenu:AddItem( "Gets . GTWVT . Threaded" , {|| WvtConsoleGets( 0 ) } )
oMenu:AddItem( "-")
oMenu:AddItem( "-" )
oMenu:AddItem( "Browser . GTWVG . Threaded " , {|| WvtMyBrowse() } )
oMenu:AddItem( "-")
oMenu:AddItem( "-" )
oMenu:AddItem( "Partial Screen . Main Window", {|| WvtPartialScreen() } )
oMenu:AddItem( "-")
oMenu:AddItem( "-" )
oMenu:AddItem( "Wvt Lines . Main Window" , {|| WvtLines() } )
oMenu:AddItem( "-")
oMenu:AddItem( "-" )
oMenu:AddItem( "Google Maps" , {|| WvtConsoleGets( 1 ) } )
oMenu:AddItem( "-")
oMenu:AddItem( "-" )
oMenu:AddItem( "Wvg Console with GCUI" , {|| ExecGCUI() } )
oMenu:AddItem( "-")
oMenu:AddItem( "-" )
oMenu:AddItem( "Modal Window" , {|| DoModalWindow() } )
g_oMenuBar:addItem( { oMenu, "Traditional" } )
oMenu := WvgMenu():new( g_oMenuBar, , .T. ):create()
oMenu:Caption:= "Common Dialogs"
oMenu:Caption := "Common Dialogs"
oMenu:AddItem( "Fonts" , {|| Wvt_ChooseFont() } )
oMenu:AddItem( "-")
oMenu:AddItem( "-" )
oMenu:AddItem( "Colors" , {|| Wvt_ChooseColor() } )
g_oMenuBar:addItem( { oMenu, "Common Dialogs" } )
oMenu := WvgMenu():new( g_oMenuBar, , .T. ):create()
oMenu:Caption:= "Functionality"
oMenu:Caption := "Functionality"
oMenu:AddItem( "Expand" , {|| WvtWindowExpand( 1 ) } )
oMenu:AddItem( "Shrink" , {|| WvtWindowExpand( -1 ) } )
oMenu:AddItem( "-")
oMenu:AddItem( "-" )
oMenu:AddItem( "Minimize" , {|| Wvt_Minimize() } )
oMenu:AddItem( "Maximize" , {|| hb_gtInfo( HB_GTI_SPEC, HB_GTS_WNDSTATE, HB_GTS_WS_MAXIMIZED ) } )
g_oMenuBar:addItem( { oMenu, "Functionality" } )
oMenu := WvgMenu():new( g_oMenuBar, , .T. ):create()
oMenu:Caption:= "Modeless Dialogs"
oMenu:Caption := "Modeless Dialogs"
oMenu:AddItem( "Dynamic Dialog . Modeless" , {|| DynWinDialog( 1 ) } )
oMenu:AddItem( "Dynamic Dialog . Modal " , {|| DynWinDialog( 2 ) } )
oMenu:AddItem( "-")
oMenu:AddItem( "-" )
oMenu:AddItem( "Slide Show . Modeless" , {|| DlgSlideShow() } )
g_oMenuBar:addItem( { oMenu, "Modeless Dialogs" } )
oMenu := WvgMenu():new( g_oMenuBar, , .T. ):create()
oMenu:Caption := "~XbpDialog()s"
oMenu:AddItem( "Pure Xbase++" , {|| Hb_ThreadStart( {|| demoXbp() } ) } )
oMenu:AddItem( "-")
oMenu:AddItem( "ActiveX - Internet Explorer" , {|| Hb_ThreadStart( {|| ExecuteActiveX( 1 ) } ) } )
oMenu:AddItem( "-")
oMenu:AddItem( "ActiveX - Visualize a PDF" , {|| Hb_ThreadStart( {|| ExecuteActiveX( 3 ) } ) } )
oMenu:AddItem( "-")
oMenu:AddItem( "ActiveX - Explorer . DHTML" , {|| Hb_ThreadStart( {|| ExecuteActiveX( 11 ) } ) } )
oMenu:AddItem( "-")
oMenu:AddItem( "ActiveX - RMChart" , {|| Hb_ThreadStart( {|| ExecuteActiveX( 4 ) } ) } )
oMenu:AddItem( "-")
oMenu:AddItem( "ActiveX - Analog Clock" , {|| Hb_ThreadStart( {|| ExecuteActiveX( 2 ) } ) } )
oMenu:AddItem( "-")
oMenu:AddItem( "ActiveX - Image Viewer" , {|| Hb_ThreadStart( {|| ExecuteActiveX( 5 ) } ) } )
oMenu:AddItem( "Pure Xbase++" , {|| hb_threadStart( {|| demoXbp() } ) } )
oMenu:AddItem( "-" )
oMenu:AddItem( "ActiveX - Internet Explorer" , {|| hb_threadStart( {|| ExecuteActiveX( 1 ) } ) } )
oMenu:AddItem( "-" )
oMenu:AddItem( "ActiveX - Visualize a PDF" , {|| hb_threadStart( {|| ExecuteActiveX( 3 ) } ) } )
oMenu:AddItem( "-" )
oMenu:AddItem( "ActiveX - Explorer . DHTML" , {|| hb_threadStart( {|| ExecuteActiveX( 11 ) } ) } )
oMenu:AddItem( "-" )
oMenu:AddItem( "ActiveX - RMChart" , {|| hb_threadStart( {|| ExecuteActiveX( 4 ) } ) } )
oMenu:AddItem( "-" )
oMenu:AddItem( "ActiveX - Analog Clock" , {|| hb_threadStart( {|| ExecuteActiveX( 2 ) } ) } )
oMenu:AddItem( "-" )
oMenu:AddItem( "ActiveX - Image Viewer" , {|| hb_threadStart( {|| ExecuteActiveX( 5 ) } ) } )
g_oMenuBar:addItem( { oMenu, "~XbpDialog()s" } )
RETURN oMenu /* The last submenu item */
@@ -536,40 +545,41 @@ FUNCTION BuildMainMenu()
//
STATIC FUNCTION GoogleMap()
LOCAL mfrom1, mto1, mfrom2, mto2, mfrom3, mto3, mweb
LOCAL nCursor := setcursor()
LOCAL nCursor := SetCursor()
LOCAL getlist := {}
SetMode( 22,65 )
setcolor( 'N/W,N/GR*,,,N/W*' )
SetMode( 22, 65 )
SetColor( 'N/W,N/GR*,,,N/W*' )
cls
hb_gtInfo( HB_GTI_WINTITLE, 'Google Maps' )
mfrom1 := mto1 := space(20)
mfrom2 := mto2 := space(40)
mfrom3 := mto3 := space(50)
mfrom1 := mto1 := Space( 20 )
mfrom2 := mto2 := Space( 40 )
mfrom3 := mto3 := Space( 50 )
WHILE .T.
@ 05, 01 say "FROM :"
@ 07, 01 say "State ...:" get mfrom1 picture "@!"
@ 08, 01 say "City ....:" get mfrom2 picture "@!"
@ 09, 01 say "Street ..:" get mfrom3 picture "@!"
@ 11, 01 say "TO :"
@ 13, 01 say "State ...:" get mto1 picture "@!"
@ 14, 01 say "City ....:" get mto2 picture "@!"
@ 15, 01 say "Street ..:" get mto3 picture "@!"
@ 05, 01 SAY "FROM :"
@ 07, 01 SAY "State ...:" GET mfrom1 PICTURE "@!"
@ 08, 01 SAY "City ....:" GET mfrom2 PICTURE "@!"
@ 09, 01 SAY "Street ..:" GET mfrom3 PICTURE "@!"
@ 11, 01 SAY "TO :"
@ 13, 01 SAY "State ...:" GET mto1 PICTURE "@!"
@ 14, 01 SAY "City ....:" GET mto2 PICTURE "@!"
@ 15, 01 SAY "Street ..:" GET mto3 PICTURE "@!"
setcursor(1); read; setcursor(nCursor)
SetCursor( 1 ); read; SetCursor( nCursor )
IF lastkey() == K_ESC
IF LastKey() == K_ESC
EXIT
ENDIF
mweb := "http://maps.google.com/maps?q=from " +;
alltrim( mfrom3 ) +" "+ alltrim( mfrom2 ) +" "+ alltrim( mfrom1 ) + " to " +;
alltrim( mto3 ) +" "+ alltrim( mto2 ) +" "+ alltrim( mto1 )
mweb := "http://maps.google.com/maps?q=from " + ;
AllTrim( mfrom3 ) + " " + AllTrim( mfrom2 ) + " " + AllTrim( mfrom1 ) + " to " + ;
AllTrim( mto3 ) + " " + AllTrim( mto2 ) + " " + AllTrim( mto1 )
Hb_ThreadStart( {|| ExecuteActiveX( 1, mweb ) } )
hb_threadStart( {|| ExecuteActiveX( 1, mweb ) } )
ENDDO
RETURN NIL
@@ -577,53 +587,54 @@ STATIC FUNCTION GoogleMap()
//
FUNCTION BuildButtons()
LOCAL oXbp
oXbp := WvgPushButton():new()
oXbp:pointerFocus := .F.
oXbp:caption := "Hi"
oXbp:create( , , { {|| -( maxrow()-1 ) }, -1 }, { -2, -4 } )
oXbp:create( , , { {|| -( MaxRow() - 1 ) }, -1 }, { -2, -4 } )
oXbp:activate := {|| Wvg_MessageBox( , "Harbour!" ) }
oXbp:toolTipText := "Harbour CUI/GUI Console"
oXbp := WvgPushButton():new()
oXbp:pointerFocus := .F.
oXbp:caption := IMAGE_VOUCH
oXbp:create( , , { {|| -( maxrow()-1 ) }, -6 }, { -2, -4 } )
oXbp:create( , , { {|| -( MaxRow() - 1 ) }, -6 }, { -2, -4 } )
oXbp:activate := {|| Wvt_Keyboard( K_F2 ) }
oXbp:toolTipText := "Open Another GET Screen"
oXbp := WvgPushButton():new()
oXbp:pointerFocus := .F.
oXbp:caption := IMAGE_BROWSE
oXbp:create( , , { {|| -( maxrow()-1 ) }, -11 }, { -2, -4 } )
oXbp:create( , , { {|| -( MaxRow() - 1 ) }, -11 }, { -2, -4 } )
oXbp:activate := {|| Wvt_Keyboard( K_F5 ) }
oXbp:toolTipText := "TBrowse + GUI Controls"
oXbp := WvgPushButton():new()
oXbp:pointerFocus := .F.
oXbp:caption := IMAGE_NOTES
oXbp:create( , , { {|| -( maxrow()-1 ) }, -16 }, { -2, -4 } )
oXbp:create( , , { {|| -( MaxRow() - 1 ) }, -16 }, { -2, -4 } )
oXbp:activate := {|| Wvt_Keyboard( K_F3 ) }
oXbp := WvgPushButton():new()
oXbp:pointerFocus := .F.
oXbp:caption := IMAGE_TOOLS
oXbp:create( , , { {|| -( maxrow()-1 ) }, -21 }, { -2, -4 } )
oXbp:create( , , { {|| -( MaxRow() - 1 ) }, -21 }, { -2, -4 } )
oXbp:activate := {|| Wvt_Keyboard( K_F6 ) }
oXbp := WvgPushButton():new()
oXbp:pointerFocus := .F.
oXbp:caption := IMAGE_HELP
oXbp:create( , , { {|| -( maxrow()-1 ) }, -26 }, { -2, -4 } )
oXbp:create( , , { {|| -( MaxRow() - 1 ) }, -26 }, { -2, -4 } )
oXbp:activate := {|| Wvt_Keyboard( K_F7 ) }
oXbp := WvgPushButton():new()
oXbp:pointerFocus := .F.
oXbp:caption := IMAGE_VR
oXbp:border := .F.
oXbp:create( , , { {|| -( maxrow()-1 ) }, -31 }, { -2, -4 } )
oXbp:activate := {|| Hb_ThreadStart( {|| demoXbp() } ) } // {|| Wvt_Keyboard( K_F8 ) }
oXbp:create( , , { {|| -( MaxRow() - 1 ) }, -31 }, { -2, -4 } )
oXbp:activate := {|| hb_threadStart( {|| demoXbp() } ) } // {|| Wvt_Keyboard( K_F8 ) }
oXbp:toolTipText := "Flat Button . Lines: press ESC when finished."
RETURN NIL

View File

@@ -33,10 +33,11 @@ MEMVAR GetList
//
PROCEDURE Main()
LOCAL aPaint
SET DATE ANSI
SET( _SET_EVENTMASK, INKEY_ALL + HB_INKEY_GTEVENT )
Set( _SET_EVENTMASK, INKEY_ALL + HB_INKEY_GTEVENT )
Wvt_SetGui( .T. )
Wvt_SetFont( "Courier New", 18, 0, 0 )
@@ -46,21 +47,21 @@ PROCEDURE Main()
CLS
Wvt_ShowWindow( SW_RESTORE )
Wvt_SetTitle( "Harbour's GTWVG Demo ( Simplified )" )
Wvt_SetIcon( hb_dirBase() + "vr_1.ico" )
Wvt_SetIcon( hb_DirBase() + "vr_1.ico" )
SetGT( 1, hb_gtSelect() )
aPaint := {}
aAdd( aPaint, { "Label" , {|| Wvt_DrawLabel( 1, 40, "Harbour Console GUI Demo", 6, , rgb( 255,255,255 ), rgb( 198,198,198 ), "Arial", 26, , , , , .T., .T. ) } , { WVT_BLOCK_LABEL, 1, 10, 3, 50 } } )
aAdd( aPaint, { "Box_1" , {|| Wvt_DrawBoxRaised( 4, 4, 20, 75 ) } , { WVT_BLOCK_BOX , 4, 4, 20, 75 } } )
aAdd( aPaint, { "Box_2" , {|| Wvt_DrawBoxRecessed( 7, 61, 13, 70 ) } , { WVT_BLOCK_BOX , 7, 61, 13, 70 } } )
aAdd( aPaint, { "Box_3" , {|| Wvt_DrawBoxGroup( 15, 59, 18, 72 ) } , { WVT_BLOCK_BOX , 15, 59, 18, 72 } } )
aAdd( aPaint, { "Box_4" , {|| Wvt_DrawBoxGroup( 5, 6, 19, 44 ) } , { WVT_BLOCK_BOX , 5, 6, 19, 44 } } )
aAdd( aPaint, { "Image" , {|| Wvt_DrawImage( 8,62,12,69, IMAGE_VOUCH ) } , { WVT_BLOCK_IMAGE, 8, 62, 12, 69 } } )
aAdd( aPaint, { "Box_5" , {|| Wvt_DrawBoxRecessed( 7, 48, 13, 55 ) } , { WVT_BLOCK_BOX , 7, 48, 13, 55 } } )
aAdd( aPaint, { "Line_1", {|| Wvt_DrawLine( maxrow()-2, 0, maxrow()-2, maxcol(), WVT_LINE_HORZ, WVT_LINE_RECESSED, WVT_LINE_BOTTOM ) } , NIL } )
aAdd( aPaint, { "Gets" , {|| aEval( GetList, {| oGet | Wvt_DrawBoxGet( oGet:Row, oGet:Col, Len( Transform( oGet:VarGet(), oGet:Picture ) ) ) } ) }, NIL } )
AAdd( aPaint, { "Label" , {|| Wvt_DrawLabel( 1, 40, "Harbour Console GUI Demo", 6, , rgb( 255,255,255 ), rgb( 198,198,198 ), "Arial", 26, , , , , .T. , .T. ) } , { WVT_BLOCK_LABEL, 1, 10, 3, 50 } } )
AAdd( aPaint, { "Box_1" , {|| Wvt_DrawBoxRaised( 4, 4, 20, 75 ) } , { WVT_BLOCK_BOX , 4, 4, 20, 75 } } )
AAdd( aPaint, { "Box_2" , {|| Wvt_DrawBoxRecessed( 7, 61, 13, 70 ) } , { WVT_BLOCK_BOX , 7, 61, 13, 70 } } )
AAdd( aPaint, { "Box_3" , {|| Wvt_DrawBoxGroup( 15, 59, 18, 72 ) } , { WVT_BLOCK_BOX , 15, 59, 18, 72 } } )
AAdd( aPaint, { "Box_4" , {|| Wvt_DrawBoxGroup( 5, 6, 19, 44 ) } , { WVT_BLOCK_BOX , 5, 6, 19, 44 } } )
AAdd( aPaint, { "Image" , {|| Wvt_DrawImage( 8,62,12,69, IMAGE_VOUCH ) } , { WVT_BLOCK_IMAGE, 8, 62, 12, 69 } } )
AAdd( aPaint, { "Box_5" , {|| Wvt_DrawBoxRecessed( 7, 48, 13, 55 ) } , { WVT_BLOCK_BOX , 7, 48, 13, 55 } } )
AAdd( aPaint, { "Line_1", {|| Wvt_DrawLine( MaxRow() - 2, 0, MaxRow() - 2, MaxCol(), WVT_LINE_HORZ, WVT_LINE_RECESSED, WVT_LINE_BOTTOM ) } , NIL } )
AAdd( aPaint, { "Gets" , {|| AEval( GetList, {| oGet | Wvt_DrawBoxGet( oGet:Row, oGet:Col, Len( Transform( oGet:VarGet(), oGet:Picture ) ) ) } ) }, NIL } )
ExecForm( aPaint )
@@ -70,15 +71,18 @@ PROCEDURE Main()
/* This function must be linked with the application */
FUNCTION Wvt_Paint()
WvtPaintObjects()
RETURN NIL
//
STATIC FUNCTION ExecForm( aPaint )
LOCAL cColor := SetColor()
LOCAL aPnt
LOCAL dDate := date()
LOCAL dDate := Date()
LOCAL cName := Pad( "Pritpal Bedi", 35 )
LOCAL cAdd1 := Pad( "60, New Professor Colony", 35 )
LOCAL cAdd2 := Pad( "Ludhiana, INDIA", 35 )
@@ -115,31 +119,39 @@ STATIC FUNCTION ExecForm( aPaint )
//
FUNCTION HB_GTSYS()
REQUEST HB_GT_WVG_DEFAULT
REQUEST HB_GT_WVT
REQUEST HB_GT_WGU
FUNCTION hb_GTSYS()
REQUEST HB_GT_WVG_DEFAULT
REQUEST HB_GT_WVT
REQUEST HB_GT_WGU
RETURN NIL
//
FUNCTION SetGT( nIndex, pGT )
LOCAL oldGT
STATIC pGT_:= { NIL, NIL, NIL }
STATIC pGT_ := { NIL, NIL, NIL }
oldGT := pGT_[ nIndex ]
IF PCount() == 2
pGT_[ nIndex ] := pGT
ENDIF
RETURN oldGT
//
STATIC FUNCTION MyChoice( aChoices )
LOCAL scr, clr, nChoice
DEFAULT aChoices TO { "One","Two","Three","Four","Five","Six","Seven" }
DEFAULT aChoices TO { "One", "Two", "Three", "Four", "Five", "Six", "Seven" }
scr := SaveScreen( 7,48,13,55 )
scr := SaveScreen( 7, 48, 13, 55 )
clr := SetColor( "N/W*,GR+/B*,,,GR+/B" )
nChoice := AChoice( 7, 48, 13, 55, aChoices )
@@ -151,7 +163,8 @@ STATIC FUNCTION MyChoice( aChoices )
//
FUNCTION rgb( r,g,b )
FUNCTION rgb( r, g, b )
RETURN r + ( g * 256 ) + ( b * 256 * 256 )
//
@@ -169,10 +182,11 @@ FUNCTION DispStatusMsg( cMsg )
//
FUNCTION ClearStatusMsg()
LOCAL nRow := Row()
LOCAL nCol := Col()
DispOutAt( MaxRow(), 42, space( 37 ), "W/W" )
DispOutAt( MaxRow(), 42, Space( 37 ), "W/W" )
SetPos( nRow, nCol )
RETURN .T.
@@ -180,22 +194,23 @@ FUNCTION ClearStatusMsg()
//
FUNCTION DoModalDialog()
LOCAL oCrt, nSel
LOCAL aPnt := WvtSetPaint( {} )
LOCAL aPaint := {}
oCrt := WvgCrt():New( , , { 4,8 }, { 12,49 }, , .T. )
oCrt := WvgCrt():New( , , { 4, 8 }, { 12, 49 }, , .T. )
oCrt:lModal := .T.
oCrt:resizable := .F.
oCrt:closable := .F.
oCrt:title := 'Modal Dialog!'
oCrt:icon := hb_dirBase() + "vr_1.ico"
oCrt:icon := hb_DirBase() + "vr_1.ico"
oCrt:Create()
oCrt:show()
aAdd( aPaint, { "Box_V" , {|| Wvt_DrawBoxRaised( 1, 2, 11, 47 ) }, NIL, { WVT_BLOCK_BOX, 0, 0, MaxRow(), MaxCol() } } )
AAdd( aPaint, { "Box_V" , {|| Wvt_DrawBoxRaised( 1, 2, 11, 47 ) }, NIL, { WVT_BLOCK_BOX, 0, 0, MaxRow(), MaxCol() } } )
WvtSetPaint( aPaint )
SetColor( 'N/W' )
@@ -210,6 +225,7 @@ FUNCTION DoModalDialog()
oCrt:Destroy()
WvtSetPaint( aPnt )
Return NIL
RETURN NIL
//

View File

@@ -28,15 +28,16 @@
//
PROCEDURE Main()
Local oCrt, oTBar, oSBar, oStatic, oCom, oXbp, oTree, oItem1, oItem2
LOCAL oCrt, oTBar, oSBar, oStatic, oCom, oXbp, oTree, oItem1, oItem2
LOCAL oListBox, oCheck, oRadio, oStatic2, oMLE, oAddr
LOCAL oPanel, oPanel1, oPanel2, cText, cNavigate, oDA
LOCAL cVarA := "Test A", cVarB := "Test B"
LOCAL aState := {"not selected", "selected", "undefined"}
LOCAL aState := { "not selected", "selected", "undefined" }
LOCAL aParts := {}
//--------------------------- Dialog -------------------------------\\
oCrt := WvgDialog():new( , , { 30,30 }, { 900,600 }, , .T. )
oCrt := WvgDialog():new( , , { 30, 30 }, { 900, 600 }, , .T. )
oCrt:closable := .T.
oCrt:icon := "vr_1.ico"
oCrt:create()
@@ -65,10 +66,10 @@ PROCEDURE Main()
oStatic := WvgStatic():new( oDA )
oStatic:type := WVGSTATIC_TYPE_TEXT
oStatic:options := WVGSTATIC_TEXT_CENTER
oStatic:caption := chr(13)+'Implemented Xbase++ Parts'
oStatic:caption := Chr( 13 ) + 'Implemented Xbase++ Parts'
oStatic:create( , , { 0, oTBar:currentSize()[2]+3 }, { 120, oCrt:currentSize()[2]-;
oTBar:currentSize()[2]-oSBar:currentSize()[2]-4 }, , .T. )
oStatic:create( , , { 0, oTBar:currentSize()[2] + 3 }, { 120, oCrt:currentSize()[2] - ;
oTBar:currentSize()[2] - oSBar:currentSize()[2] - 4 }, , .T. )
oStatic:setColorBG( RGB( 200,200,200 ) )
//--------------------------- ListBox -----------------------------\\
@@ -76,46 +77,46 @@ PROCEDURE Main()
oListBox:create( oStatic, , { 5, 55 }, { 107, 380 } )
oListBox:setColorFG( RGB( 218,61,34 ) )
//oListBox:setColorBG( RGB( 250,244,182 ) )
// oListBox:setColorBG( RGB( 250,244,182 ) )
aadd( aParts, 'XbpDialog' )
aadd( aParts, 'XbpMenuBar' )
aadd( aParts, 'XbpToolBar' )
aadd( aParts, 'XbpToolBarButton' )
aadd( aParts, 'XbpStatusBar' )
aadd( aParts, 'XbpStatic' )
aadd( aParts, 'XbpTreeView' )
aadd( aParts, 'XbpTreeViewItem' )
aadd( aParts, 'XbpActiveXControl')
aadd( aParts, 'XbpListBox' )
aadd( aParts, 'XbpPushButton' )
aadd( aParts, 'XbpCheckBox' )
aadd( aParts, 'XbpRadioButton' )
aadd( aParts, 'Xbp3State' )
aadd( aParts, 'XbpSLE' )
aadd( aParts, 'XbpMLE' )
aadd( aParts, 'XbpHTMLViewer' )
aadd( aParts, 'XbpSysWindow' )
aadd( aParts, 'XbpFontDialog' )
aadd( aParts, 'XbpFont' )
aadd( aParts, '-------------' )
aadd( aParts, 'DataRef' )
AAdd( aParts, 'XbpDialog' )
AAdd( aParts, 'XbpMenuBar' )
AAdd( aParts, 'XbpToolBar' )
AAdd( aParts, 'XbpToolBarButton' )
AAdd( aParts, 'XbpStatusBar' )
AAdd( aParts, 'XbpStatic' )
AAdd( aParts, 'XbpTreeView' )
AAdd( aParts, 'XbpTreeViewItem' )
AAdd( aParts, 'XbpActiveXControl' )
AAdd( aParts, 'XbpListBox' )
AAdd( aParts, 'XbpPushButton' )
AAdd( aParts, 'XbpCheckBox' )
AAdd( aParts, 'XbpRadioButton' )
AAdd( aParts, 'Xbp3State' )
AAdd( aParts, 'XbpSLE' )
AAdd( aParts, 'XbpMLE' )
AAdd( aParts, 'XbpHTMLViewer' )
AAdd( aParts, 'XbpSysWindow' )
AAdd( aParts, 'XbpFontDialog' )
AAdd( aParts, 'XbpFont' )
AAdd( aParts, '-------------' )
AAdd( aParts, 'DataRef' )
aeval( aParts, {| e | oListBox:addItem( e ) } )
AEval( aParts, {| e | oListBox:addItem( e ) } )
oListBox:itemSelected := {|| WVG_MessageBox( , oListBox:getCurItem() ) }
oListBox:setData( 3 ) // show selected 'XbpToolBar'
//--------------------------- PushButton --------------------------\\
oXbp := WvgPushButton():new( oStatic )
oXbp:caption := "Hide"
oXbp:create( , , { 20,440 }, {80,30} )
oXbp:activate:= {|| oStatic:hide(), oCrt:sendMessage( WM_SIZE, 0, 0 ) }
oXbp:create( , , { 20, 440 }, { 80, 30 } )
oXbp:activate := {|| oStatic:hide(), oCrt:sendMessage( WM_SIZE, 0, 0 ) }
//--------------------------- TreeView ---------------------------\\
oTree := WvgTreeView():new( oDA, , { oCrt:currentSize()[1]-160,oTBar:currentSize()[2]+3 }, ;
{ 160, oCrt:currentSize()[2]-;
oTBar:currentSize()[2]-oSBar:currentSize()[2]-4 }, , .T. )
oTree := WvgTreeView():new( oDA, , { oCrt:currentSize()[1] - 160, oTBar:currentSize()[2] + 3 }, ;
{ 160, oCrt:currentSize()[2] - ;
oTBar:currentSize()[2] - oSBar:currentSize()[2] - 4 }, , .T. )
oTree:hasLines := .T.
oTree:hasButtons := .T.
oTree:alwaysShowSelection := .T.
@@ -135,25 +136,25 @@ PROCEDURE Main()
oItem2:addItem( "Third level B" )
oItem2:addItem( "Third level C" )
#if 0
#if 0
oItem1:expand( .T. )
#else
oTree:showExpanded( .T., 2 )
#endif
#else
oTree:showExpanded( .T. , 2 )
#endif
oTree:setData( oItem2 )
//--------------------------- Active-X ---------------------------\\
hb_gtInfo( HB_GTI_WINTITLE, 'http://www.harbour.vouch.info' )
#if 0
#if 0
oCom := WvgActiveXControl():New( oDA, , { 0, 0 }, { 100, 100 }, , .T. )
oCom:CLSID := 'Shell.Explorer.2'
oCom:mapEvent( 269, {|| QOut( ' E X P L O R E R - 2 6 9' ) } )
#else
#else
oCom := WvgHTMLViewer():New( oDA, , { 0, 0 }, { 100, 100 }, , .T. )
oCom:beforeNavigate := {| cURL, x, oHTML | x := x, oHTML := oHTML, oPanel:caption := cURL }
oCom:statusTextChange := {| cText | oPanel:caption := cText }
#endif
#endif
oCom:create()
oCom:Navigate( 'http://www.harbour.vouch.info' )
@@ -164,52 +165,52 @@ PROCEDURE Main()
oAddr:dataLink := {| x | iif( x == NIL, cNavigate, cNavigate := x ) }
oAddr:setColorFG( RGB( 0,0,255 ) )
oAddr:setColorBG( RGB( 0,255,255 ) )
oAddr:create( oDA, , { 120, oTBar:currentSize()[2] }, { 500,20 }, , .T. )
oAddr:create( oDA, , { 120, oTBar:currentSize()[2] }, { 500, 20 }, , .T. )
oAddr:setData()
oAddr:killInputFocus := {| m1, m2, oS | m1:=m1, m2:=m2, oS:getData(), oCom:navigate( cNavigate ) }
oAddr:killInputFocus := {| m1, m2, oS | m1 := m1, m2 := m2, oS:getData(), oCom:navigate( cNavigate ) }
//----------------- Panel : Static + Radio + Checkbox ----------\\
oStatic2:= WvgStatic():New( oDA, , { 150, 150 }, { 500,310 }, , .F. )
//oStatic2:type := WVGSTATIC_TYPE_RAISEDBOX //BGNDFRAME
oStatic2 := WvgStatic():New( oDA, , { 150, 150 }, { 500, 310 }, , .F. )
// oStatic2:type := WVGSTATIC_TYPE_RAISEDBOX //BGNDFRAME
oStatic2:exStyle += WS_EX_WINDOWEDGE
//oStatic2:options := WVGSTATIC_FRAMETHICK
// oStatic2:options := WVGSTATIC_FRAMETHICK
oStatic2:create()
oStatic2:setColorBG( RGB( 175,175,175 ) )
oXbp := WvgPushButton():new( oStatic2 )
oXbp:caption := "Hide"
oXbp:caption := "Hide"
oXbp:create( , , { 430,275 }, { 60,25 } )
oXbp:create( , , { 430, 275 }, { 60, 25 } )
oXbp:activate := {|| oStatic2:hide(), oCrt:sendMessage( WM_SIZE, 0, 0 ) }
oRadio := WvgRadioButton():new( oStatic2,, { 10,10 }, { 100,15 } )
oRadio := WvgRadioButton():new( oStatic2, , { 10, 10 }, { 100, 15 } )
oRadio:caption := "Com 1"
oRadio:selection := .T.
oRadio:selected := {| m1, m2, obj | m1:=m1, m2:=m2, WVG_MessageBox( , obj:caption + iif( obj:selection, '< S >', '< N >' ) ) }
oRadio:selected := {| m1, m2, obj | m1 := m1, m2 := m2, WVG_MessageBox( , obj:caption + iif( obj:selection, '< S >', '< N >' ) ) }
oRadio:create()
oRadio := WvgRadioButton():new( oStatic2,, { 10,35 }, { 100,15 } )
oRadio := WvgRadioButton():new( oStatic2, , { 10, 35 }, { 100, 15 } )
oRadio:caption := "Com 2"
oRadio:create()
oCheck := WvgCheckBox():New( oStatic2, , { 10,70 }, { 100,15 }, , .T. )
oCheck := WvgCheckBox():New( oStatic2, , { 10, 70 }, { 100, 15 }, , .T. )
oCheck:caption := 'Checkbox A'
oCheck:create()
oCheck:selected := {| m1, m2, o | m1:=m1,m2:=m2, WVG_MessageBox( , iif( o:getData(), 'I am selected','I am not selected' ) ) }
oCheck:selected := {| m1, m2, o | m1 := m1, m2 := m2, WVG_MessageBox( , iif( o:getData(), 'I am selected','I am not selected' ) ) }
// Create first 3State button, passing the position to :create()
oXbp := Wvg3State():new()
oXbp:caption := "3 State A"
oXbp:create( oStatic2, , { 10,100 }, { 100,15 } )
oXbp:create( oStatic2, , { 10, 100 }, { 100, 15 } )
// Determine current state using mp1
oXbp:selected := {| m1, m2, oBtn | m2:=m2, oBtn:=oBtn, oPanel1:caption := "3State A ["+aState[ m1+1 ]+"]" }
oXbp:selected := {| m1, m2, oBtn | m2 := m2, oBtn := oBtn, oPanel1:caption := "3State A [" + aState[ m1+1 ] + "]" }
// Create second 3State Button, passing the position to :new()
oXbp := Wvg3State():new( oStatic2, , { 10,125 }, { 100,15 } )
oXbp := Wvg3State():new( oStatic2, , { 10, 125 }, { 100, 15 } )
oXbp:caption := "3 State B"
oXbp:create( oStatic2 )
// Determine current state using :getData()
oXbp:selected := {| m1, m2, oBtn | m1:=m1,m2:=m2, WVG_MessageBox( , "3State B", aState[ oBtn:getData()+1 ] ) }
oXbp:selected := {| m1, m2, oBtn | m1 := m1, m2 := m2, WVG_MessageBox( , "3State B", aState[ oBtn:getData()+1 ] ) }
// Create first SLE, specify position using :create()
// On :typeOut set the focus to the second SLE
@@ -218,19 +219,19 @@ PROCEDURE Main()
oXbp:bufferLength := 20
// Data code block containing assignment to LOCAL variable
oXbp:dataLink := {| x | iif( x == NIL, cVarA, cVarA := x ) }
oXbp:create( oStatic2, , { 10,170 }, { 150,20 } )
oXbp:create( oStatic2, , { 10, 170 }, { 150, 20 } )
oXbp:setData()
// Assign the value of the edit buffer to a LOCAL variable when the input focus is lost
oXbp:killInputFocus := {| x, y, oSLE | x:=x,y:=y, oSLE:getData(), oPanel:caption := "cVarA =" + cVarA }
oXbp:killInputFocus := {| x, y, oSLE | x := x, y := y, oSLE:getData(), oPanel:caption := "cVarA =" + cVarA }
// Create second SLE, specify position using :new()
oXbp := WvgSLE():new( , , { 10,200 }, { 150,20 } )
oXbp := WvgSLE():new( , , { 10, 200 }, { 150, 20 } )
oXbp:tabStop := .T.
oXbp:bufferLength := 15
oXbp:dataLink := {| x | iif( x == NIL, cVarB, cVarB := x ) }
oXbp:create( oStatic2 )
oXbp:setData()
oXbp:killInputFocus := {| x, y, oSLE | x:=x,y:=y, oSLE:getData(), oPanel:caption := "cVarB =" + cVarB }
oXbp:killInputFocus := {| x, y, oSLE | x := x, y := y, oSLE:getData(), oPanel:caption := "cVarB =" + cVarB }
// Read file into LOCAL variable
cText := MemoRead( 'gtwvg.hbc' )
@@ -240,17 +241,17 @@ PROCEDURE Main()
oMLE:wordWrap := .F.
oMLE:border := .T.
oMLE:dataLink := {| x | iif( x == NIL, cText, cText := x ) }
oMLE:create( oStatic2, , { 180,10 }, { 310,250 } )
oMLE:create( oStatic2, , { 180, 10 }, { 310, 250 } )
// Copy text from LOCAL variable into edit buffer via :dataLink
oMLE:setData()
//--------------------------- Misc Config ------------------------\\
oTBar:buttonClick := {| oBtn | iif( oBtn:caption == 'Hide' , oStatic:hide(), nil ),;
iif( oBtn:caption == 'Show' , oStatic:show(), nil ),;
iif( oBtn:caption == 'Tools' , oStatic2:show():toFront(), nil ),;
iif( oBtn:caption == 'FontDlg', ExeFontDialog( oCrt ), nil ),;
iif( oBtn:caption $ 'Hide,Show', oCrt:sendMessage( WM_SIZE, 0, 0 ), NIL ),;
oPanel2:caption := "Button [ " + oBtn:caption + " ] clicked!" }
oTBar:buttonClick := {| oBtn | iif( oBtn:caption == 'Hide' , oStatic:hide(), NIL ), ;
iif( oBtn:caption == 'Show' , oStatic:show(), NIL ), ;
iif( oBtn:caption == 'Tools' , oStatic2:show():toFront(), NIL ), ;
iif( oBtn:caption == 'FontDlg', ExeFontDialog( oCrt ), NIL ), ;
iif( oBtn:caption $ 'Hide,Show', oCrt:sendMessage( WM_SIZE, 0, 0 ), NIL ), ;
oPanel2:caption := "Button [ " + oBtn:caption + " ] clicked!" }
oCrt:resize := {|| ResizeDialogXbp( oCrt, oTBar, oSBar, oStatic, oCom, oTree, oAddr ) }
@@ -258,7 +259,7 @@ PROCEDURE Main()
oCrt:show()
DO WHILE .T.
IF inkey() == K_ESC
IF Inkey() == K_ESC
EXIT
ENDIF
ENDDO
@@ -270,6 +271,7 @@ PROCEDURE Main()
//
STATIC FUNCTION ResizeDialogXbp( oCrt, oTBar, oSBar, oStatic, oCom, oTree, oAddr )
LOCAL aCrt, aTBar, aSBar
LOCAL nH, nT
@@ -281,15 +283,15 @@ STATIC FUNCTION ResizeDialogXbp( oCrt, oTBar, oSBar, oStatic, oCom, oTree, oAddr
nH := aCrt[2] - aTBar[2] - aSBar[2]
IF oStatic:isVisible
oStatic:setPosAndSize( { 0, nT+3 }, { 120, nH-4 }, .T. )
oAddr:setPosAndSize( { 120, nT+2 }, { aCrt[1]-120-150, 20 }, .T. )
oCom:setPosAndSize( { 120, nT+2+20 }, { aCrt[1]-120-150, nH-20 }, .T. )
oTree:setPosAndSize( { aCrt[1]-150, nT }, { 150, nH }, .T. )
oStatic:setPosAndSize( { 0, nT + 3 }, { 120, nH - 4 }, .T. )
oAddr:setPosAndSize( { 120, nT + 2 }, { aCrt[1] - 120 - 150, 20 }, .T. )
oCom:setPosAndSize( { 120, nT + 2 + 20 }, { aCrt[1] - 120 - 150, nH - 20 }, .T. )
oTree:setPosAndSize( { aCrt[1] - 150, nT }, { 150, nH }, .T. )
ELSE
oAddr:setPosAndSize( { 0, nT+2 }, { aCrt[1]-150, 20 }, .T. )
oCom:setPosAndSize( { 0, nT+2+20 }, { aCrt[1]-150, nH-20 }, .T. )
oTree:setPosAndSize( { aCrt[1]-150, nT }, { 150, nH }, .T. )
oAddr:setPosAndSize( { 0, nT + 2 }, { aCrt[1] - 150, 20 }, .T. )
oCom:setPosAndSize( { 0, nT + 2 + 20 }, { aCrt[1] - 150, nH - 20 }, .T. )
oTree:setPosAndSize( { aCrt[1] - 150, nT }, { 150, nH }, .T. )
ENDIF
@@ -297,8 +299,9 @@ STATIC FUNCTION ResizeDialogXbp( oCrt, oTBar, oSBar, oStatic, oCom, oTree, oAddr
//
Static Function ActiveXBuildMenuXbp( oCrt, oStatic, oStatic2 )
Local oMenuBar, oSubMenu
STATIC FUNCTION ActiveXBuildMenuXbp( oCrt, oStatic, oStatic2 )
LOCAL oMenuBar, oSubMenu
oMenuBar := WvgMenuBar():new( oCrt ):create()
@@ -310,7 +313,7 @@ Static Function ActiveXBuildMenuXbp( oCrt, oStatic, oStatic2 )
oSubMenu:title := "~Procedural"
oSubMenu:addItem( { "Play Charge ~1", } )
oSubMenu:addItem( { "Play Nannyboo ~2", } )
oSubMenu:itemSelected := {| mp1 | MyFunctionXbp( 100+mp1 ) }
oSubMenu:itemSelected := {| mp1 | MyFunctionXbp( 100 + mp1 ) }
oMenuBar:addItem( { oSubMenu, NIL } )
// Define submenu in the functional style:
@@ -327,20 +330,22 @@ Static Function ActiveXBuildMenuXbp( oCrt, oStatic, oStatic2 )
oSubMenu := WvgMenu():new( oMenuBar ):create()
oSubMenu:title := "F~eatures"
oSubMenu:addItem( { "~Hide or Show Left Panel" , {|| iif( oStatic:isVisible, ;
oStatic:hide(), oStatic:show() ), oCrt:sendMessage( WM_SIZE,0,0 ) } } )
oStatic:hide(), oStatic:show() ), oCrt:sendMessage( WM_SIZE, 0, 0 ) } } )
oSubMenu:addItem( { "~Show My Panel" , {|| oStatic2:show():toFront() } } )
oSubMenu:addItem()
oSubMenu:addItem( { "~Font Dialog" , {|| ExeFontDialog( oCrt ) } } )
oMenuBar:addItem( { oSubMenu, NIL } )
Return nil
RETURN NIL
//
STATIC FUNCTION ActiveXBuildToolBarXbp( oCrt )
LOCAL oTBar
oTBar := WvgToolBar():new( oCrt , , { 0,0 }, { 0,0 }, , .T. )
oTBar := WvgToolBar():new( oCrt , , { 0, 0 }, { 0, 0 }, , .T. )
oTBar:style := WVGTOOLBAR_STYLE_FLAT
@@ -370,39 +375,40 @@ STATIC FUNCTION ActiveXBuildToolBarXbp( oCrt )
//
Static Function MyFunctionXbp( nMode )
STATIC FUNCTION MyFunctionXbp( nMode )
#define MUSIC_WAITON {800, 1600}
#define MUSIC_WAITON {800, 1600}
do case
case nMode == 1
tone( MUSIC_WAITON[1], 1 )
tone( MUSIC_WAITON[2], 1 )
DO CASE
CASE nMode == 1
Tone( MUSIC_WAITON[1], 1 )
Tone( MUSIC_WAITON[2], 1 )
case nMode == 2
tone( MUSIC_WAITON[2], 1 )
tone( MUSIC_WAITON[1], 1 )
CASE nMode == 2
Tone( MUSIC_WAITON[2], 1 )
Tone( MUSIC_WAITON[1], 1 )
case nMode == 3
CASE nMode == 3
WVG_MessageBox( , "Button clicked!" )
case nMode == 101 // Charge
Eval( {|| tone(523,2),tone(698,2),tone(880,2),tone(1046,4),tone(880,2),tone(1046,8) } )
CASE nMode == 101 // Charge
Eval( {|| Tone( 523,2 ), Tone( 698,2 ), Tone( 880,2 ), Tone( 1046,4 ), Tone( 880,2 ), Tone( 1046,8 ) } )
case nMode == 102 // NannyBoo
AEval( {{196,2},{196,2},{164,2},{220,2},{196,4},{164,4}}, {| a | tone(a[1],a[2]) } )
CASE nMode == 102 // NannyBoo
AEval( { { 196,2 }, { 196,2 }, { 164,2 }, { 220,2 }, { 196,4 }, { 164,4 } }, {| a | Tone( a[1],a[2] ) } )
case nMode == 103 // BADKEY
tone( 480,0.25 )
tone( 240,0.25 )
CASE nMode == 103 // BADKEY
Tone( 480, 0.25 )
Tone( 240, 0.25 )
endcase
ENDCASE
Return nil
RETURN NIL
//
STATIC FUNCTION ExeFontDialog( oCrt )
LOCAL oFontDlg, oWvgFont
STATIC nMode := 0
@@ -410,32 +416,32 @@ STATIC FUNCTION ExeFontDialog( oCrt )
oFontDlg := WvgFontDialog():new( oCrt )
oFontDlg:title := 'Select a Screen Font'
oFontDlg:aPos := { 150,150 }
oFontDlg:aPos := { 150, 150 }
oFontDlg:buttonApply := .T.
oFontDlg:activateApply := {|| NIL }
oFontDlg:familyName := "Courier New"
oFontDlg:strikeout := .T.
oFontDlg:underscore := .F.
//oFontDlg:activateOk := {|| WVG_MessageBox( , 'activateOK Event Handelled in Windows!' ) }
// oFontDlg:activateOk := {|| WVG_MessageBox( , 'activateOK Event Handelled in Windows!' ) }
oFontDlg:nominalPointSize := 12
//oFontDlg:size := .F.
//oFontDlg:style := .F.
// oFontDlg:size := .F.
// oFontDlg:style := .F.
oFontDlg:create()
// Every 2nd FontDialog will be MODAL
// Every 2nd FontDialog will be MODAL
oWvgFont := oFontDlg:display( ++nMode % 2 )
HB_SYMBOL_UNUSED( oWvgFont )
oFontDlg:destroy()
RETURN nil
RETURN NIL
//
STATIC FUNCTION HB_GTSYS()
FUNCTION hb_GTSYS()
REQUEST HB_GT_GUI_DEFAULT
REQUEST HB_GT_WVG

View File

@@ -44,20 +44,22 @@ THREAD STATIC t_aSlides := {}
//
FUNCTION DynWinDialog( nInfo )
Local hDlg, aDlg, nStyle, cDlgIcon, cDlgProc, lOnTop, hMenu
// Local bDlgProc
// Local nTimerTicks
LOCAL hDlg, aDlg, nStyle, cDlgIcon, cDlgProc, lOnTop, hMenu
// LOCAL bDlgProc
// LOCAL nTimerTicks
nStyle := DS_SETFONT + WS_VISIBLE + WS_POPUP + WS_CAPTION + WS_SYSMENU + WS_THICKFRAME + WS_MINIMIZEBOX
aDlg := Wvt_MakeDlgTemplate( 1, 4, 21, 60, {0,0,0,0}, ;
"Dialog First [ " + ltrim( str( nInfo,10,0 ) ) + " ] "+;
iif( nInfo%2==0, "Modeless", "Modal" )," Dialog !", nStyle )
aDlg := Wvt_MakeDlgTemplate( 1, 4, 21, 60, { 0, 0, 0, 0 }, ;
"Dialog First [ " + LTrim( Str( nInfo,10,0 ) ) + " ] " + ;
iif( nInfo % 2 == 0, "Modeless", "Modal" ), " Dialog !", nStyle )
// Multi line edit control
//
nStyle := WS_CHILD + WS_VISIBLE + WS_TABSTOP + ES_AUTOVSCROLL + ES_MULTILINE + ;
ES_WANTRETURN + WS_BORDER + WS_VSCROLL
ES_WANTRETURN + WS_BORDER + WS_VSCROLL
aDlg := Wvt_AddDlgItem( aDlg, 1, 2, 15, 35, {}, ID_MLE , "EDIT" , nStyle, /* cText, nHelpId, nExStyle */ )
// Two Horz and Vert Lines
@@ -79,35 +81,35 @@ FUNCTION DynWinDialog( nInfo )
aDlg := Wvt_AddDlgItem( aDlg, 18, 15, 1, 10, {}, ID_CHK_SATIS , "BUTTON" , nStyle, "Satisfied?" )
nStyle := WS_CHILD + WS_VISIBLE + WS_TABSTOP + ES_RIGHT + ES_READONLY
aDlg := Wvt_AddDlgItem( aDlg, 18, 30, 1, 7, {3}, ID_EDT_TIME , "EDIT" , nStyle, "" )
aDlg := Wvt_AddDlgItem( aDlg, 18, 30, 1, 7, { 3 }, ID_EDT_TIME , "EDIT" , nStyle, "" )
nStyle := WS_CHILD + WS_VISIBLE + WS_TABSTOP + LBS_NOTIFY + WS_VSCROLL + WS_BORDER
aDlg := Wvt_AddDlgItem( aDlg, 1, 41, 4, 17, {}, ID_LST_LIST , "LISTBOX", nStyle, "ListBox" )
nStyle := WS_CHILD + WS_VISIBLE + SS_LEFT
aDlg := Wvt_AddDlgItem( aDlg, 4, 41, 1, 17, {3,0,0,0}, -1 , "STATIC" , nStyle, "Degree" )
aDlg := Wvt_AddDlgItem( aDlg, 4, 41, 1, 17, { 3, 0, 0, 0 }, -1 , "STATIC" , nStyle, "Degree" )
nStyle := WS_VISIBLE + WS_TABSTOP + CBS_DROPDOWNLIST + WS_BORDER + WS_VSCROLL
aDlg := Wvt_AddDlgItem( aDlg, 5, 41, 6, 17, {}, ID_CMB_COMBO , "COMBOBOX" , nStyle, "Combo" )
nStyle := WS_CHILD + WS_VISIBLE + WS_TABSTOP + BS_GROUPBOX
aDlg := Wvt_AddDlgItem( aDlg, 7, 41, 4, 17, {0,0,4,0},ID_GRP_COMP, "BUTTON" , nStyle, "Compiler" )
aDlg := Wvt_AddDlgItem( aDlg, 7, 41, 4, 17, { 0, 0, 4, 0 }, ID_GRP_COMP, "BUTTON" , nStyle, "Compiler" )
nStyle := WS_CHILD + WS_VISIBLE + WS_TABSTOP + BS_AUTORADIOBUTTON
aDlg := Wvt_AddDlgItem( aDlg, 8, 43, 1, 14, {}, ID_RDO_XH , "BUTTON" , nStyle, "Harbour" )
aDlg := Wvt_AddDlgItem( aDlg, 9, 43, 1, 14, {}, ID_RDO_CLIP , "BUTTON" , nStyle, "Clipper" )
aDlg := Wvt_AddDlgItem( aDlg,10, 43, 1, 14, {}, ID_RDO_XBASE , "BUTTON" , nStyle, "Xbase++" )
aDlg := Wvt_AddDlgItem( aDlg, 10, 43, 1, 14, {}, ID_RDO_XBASE , "BUTTON" , nStyle, "Xbase++" )
nStyle := WS_CHILD + WS_VISIBLE + SS_LEFT
aDlg := Wvt_AddDlgItem( aDlg, 12, 41, 1, 17, {3,0,0,0}, ID_STA_TEXT, "STATIC" , nStyle, "Scrollable Text" )
aDlg := Wvt_AddDlgItem( aDlg, 12, 41, 1, 17, { 3, 0, 0, 0 }, ID_STA_TEXT, "STATIC" , nStyle, "Scrollable Text" )
nStyle := WS_CHILD + WS_VISIBLE + WS_TABSTOP + ES_AUTOHSCROLL + WS_BORDER
aDlg := Wvt_AddDlgItem( aDlg, 13, 41, 1, 17, {}, ID_EDT_TEXT , "EDIT" , nStyle, "This is Text Field" )
nStyle := WS_CHILD + WS_VISIBLE + SS_LEFT
aDlg := Wvt_AddDlgItem( aDlg, 14, 41, 1, 17, {3,0,0,0}, -1, "STATIC" , nStyle, "Right Justified Numerics" )
aDlg := Wvt_AddDlgItem( aDlg, 14, 41, 1, 17, { 3, 0, 0, 0 }, -1, "STATIC" , nStyle, "Right Justified Numerics" )
nStyle := WS_CHILD + WS_VISIBLE + WS_TABSTOP + ES_AUTOHSCROLL + ES_NUMBER + ES_RIGHT + WS_BORDER
aDlg := Wvt_AddDlgItem( aDlg, 15, 41, 1, 17, {}, ID_EDT_NUMB , "EDIT" , nStyle, "1234567" )
nStyle := WS_CHILD + WS_VISIBLE + WS_TABSTOP + BS_PUSHBUTTON
aDlg := Wvt_AddDlgItem( aDlg, 18, 50, 1, 8, {-3,0,3,0}, ID_BTN_OK, "BUTTON" , nStyle, "OK" )
aDlg := Wvt_AddDlgItem( aDlg, 18, 50, 1, 8, { -3, 0, 3, 0 }, ID_BTN_OK, "BUTTON" , nStyle, "OK" )
hMenu := Wvt_CreateMenu()
Wvt_AppendMenu( hMenu, MF_STRING + MF_ENABLED, ID_MNU_FILE , "File" )
@@ -119,120 +121,121 @@ FUNCTION DynWinDialog( nInfo )
cDlgIcon := "v_notes.ico"
// nTimerTicks := 1000 // 1 second
if nInfo == 2
IF nInfo == 2
// Modal Dialog
//
//hDlg := Wvt_DialogBox( aDlg, bDlgProc, Wvt_GetWindowHandle() )
hDlg := Wvt_DialogBox( aDlg, cDlgProc, Wvt_GetWindowHandle() )
else
ELSE
// Modeless Dialog
//
hDlg := Wvt_CreateDialog( aDlg, lOnTop, cDlgProc, cDlgIcon, /*nTimerTicks*/, hMenu )
// Using Function name.
//hDlg := Wvt_CreateDialog( aDlg, lOnTop, cDlgProc, cDlgIcon, nTimerTicks, hMenu, lModal )
endif
ENDIF
RETURN hDlg
//
FUNCTION DynDlgProc( hDlg, nMsg, wParam, lParam )
Local lClicked, cPrompt, nIndex, hFont, aHFonts
LOCAL lClicked, cPrompt, nIndex, hFont, aHFonts
Switch ( nMsg )
case WM_TIMER
CASE WM_TIMER
WVG_SetDlgItemText( hDlg, ID_EDT_TIME, Time() )
exit
EXIT
case WM_COMMAND
do case
CASE WM_COMMAND
DO CASE
case wParam == ID_CHK_SATIS
CASE wParam == ID_CHK_SATIS
lClicked := ( WVG_IsDlgButtonChecked( hDlg,ID_CHK_SATIS ) == 1 )
WVG_MessageBox( hDlg, iif( lClicked, "Satisfied", "UnSatisfied" ), "CheckBoxStatus" )
case wParam == ID_RDO_XH
CASE wParam == ID_RDO_XH
WVG_MessageBox( hDlg, "Harbour", "Compiler" )
case wParam == ID_RDO_CLIP
CASE wParam == ID_RDO_CLIP
WVG_MessageBox( hDlg, "Clipper", "Compiler" )
case wParam == ID_RDO_XBASE
CASE wParam == ID_RDO_XBASE
WVG_MessageBox( hDlg, "Xbase++", "Compiler" )
case wParam == ID_MNU_FILE
CASE wParam == ID_MNU_FILE
WVG_MessageBox( hDlg, "Execute Menu Action!", "File" )
case wParam == ID_MNU_CONTROL
CASE wParam == ID_MNU_CONTROL
WVG_MessageBox( hDlg, "Controls are from Windows!", "Controls" )
case WVG_LOWORD( wParam ) == ID_LST_LIST
if WVG_HIWORD( wParam ) == LBN_SELCHANGE
CASE WVG_LOWORD( wParam ) == ID_LST_LIST
IF WVG_HIWORD( wParam ) == LBN_SELCHANGE
nIndex := WVG_SendMessage( WVG_GetDlgItem( hDlg, ID_LST_LIST ), LB_GETCURSEL, 0, 0 )
cPrompt := space( 20 )
cPrompt := Space( 20 )
WVG_SendMessage( WVG_GetDlgItem( hDlg, ID_LST_LIST ), LB_GETTEXT, nIndex, @cPrompt )
WVG_MessageBox( hDlg, cPrompt, "ListBox" )
endif
ENDIF
case WVG_LOWORD( wParam ) == ID_CMB_COMBO
if WVG_HIWORD( wParam ) == CBN_SELCHANGE
CASE WVG_LOWORD( wParam ) == ID_CMB_COMBO
IF WVG_HIWORD( wParam ) == CBN_SELCHANGE
nIndex := WVG_SendMessage( WVG_GetDlgItem( hDlg, ID_CMB_COMBO ), CB_GETCURSEL, 0, 0 )
cPrompt := space( 20 )
cPrompt := Space( 20 )
WVG_SendMessage( WVG_GetDlgItem( hDlg, ID_CMB_COMBO ), CB_GETLBTEXT, nIndex, @cPrompt )
WVG_MessageBox( hDlg, cPrompt, "Combo Box" )
endif
ENDIF
endcase
exit
ENDCASE
EXIT
CASE WM_CTLCOLOREDIT
IF ( WVG_GetDlgItem( hDlg,ID_MLE ) == lParam )
WVG_SetTextColor( wParam, RGB( 0,0,255 ) )
WVG_SetBkColor( wParam, RGB( 255,255,200 ) )
return 1
RETURN 1
ELSEIF ( WVG_GetDlgItem( hDlg,ID_EDT_TEXT ) == lParam )
WVG_SetTextColor( wParam, RGB( 255,255,255 ) )
WVG_SetBkColor( wParam, RGB( 10,200,45 ) )
Return 1
RETURN 1
ENDIF
EXIT
CASE WM_CTLCOLORSTATIC
IF ( WVG_GetDlgItem( hDlg,ID_STA_TEXT ) == lParam )
WVG_SetTextColor( wParam, RGB( 255,255,255 ) )
Return 1
RETURN 1
ENDIF
EXIT
CASE WM_INITDIALOG
WVG_SetTimer( hDlg, 5001, 1000 ) // 1 sec
IF empty( aHFonts := SetFonts() )
IF Empty( aHFonts := SetFonts() )
IF ( hFont := Wvt_CreateFont( "Times New Roman", 18 ) ) != 0
SetFonts( hFont )
ENDIF
ENDIF
IF len( aHFonts ) > 0
IF Len( aHFonts ) > 0
WVG_SendMessage( WVG_GetDlgItem( hDlg, ID_MLE ), WM_SETFONT, ahFonts[ 1 ], 0 )
ENDIF
IF empty( SetIcons() )
IF Empty( SetIcons() )
SetIcons( WVG_LoadIcon( "vr_1.ico" ) )
ENDIF
IF !empty( SetIcons() )
IF !Empty( SetIcons() )
WVG_SendMessage( WVG_GetDlgItem( hDlg, ID_ICO_VOUCH ), STM_SETIMAGE, IMAGE_ICON, SetIcons()[ 1 ] )
ENDIF
/*
if t_hImage == nil
IF t_hImage == NIL
t_hImage := WVG_LoadImage( "vouch1.bmp", 2 )
endif
if t_hImage != nil .and. t_hImage != 0
ENDIF
IF t_hImage != NIL .AND. t_hImage != 0
WVG_SendMessage( WVG_GetDlgItem( hDlg, ID_STA_IMAGE ), STM_SETIMAGE, IMAGE_BITMAP, t_hImage )
endif
ENDIF
*/
WVG_SetDlgItemText( hDlg, ID_MLE , GetEditText() )
WVG_CheckDlgButton( hDlg, ID_CHK_SATIS, .T. )
@@ -264,7 +267,8 @@ FUNCTION DynDlgProc( hDlg, nMsg, wParam, lParam )
// Do whatevert you want to do with cText
// Each box will retrieve its own text.
//
/* cText := */ WVG_GetDlgItemText( hDlg, ID_MLE )
/* cText := */
WVG_GetDlgItemText( hDlg, ID_MLE )
EXIT
END
@@ -273,6 +277,7 @@ FUNCTION DynDlgProc( hDlg, nMsg, wParam, lParam )
//
STATIC FUNCTION GetEditText()
LOCAL cText := ""
cText += "Welcome in the Wonderful World of Harbour!"
@@ -305,6 +310,7 @@ STATIC FUNCTION GetEditText()
//
FUNCTION DlgSlideShow()
LOCAL hDlg, aDlg, nStyle
t_aSlides := { "vouch1.bmp", "v_notes.ico", "2000.gif", "v_lock.bmp", "v_help.ico" }
@@ -313,7 +319,7 @@ FUNCTION DlgSlideShow()
aDlg := Wvt_MakeDlgTemplate( 0, 0, 20, 40, {}, "Slide Show", nStyle )
hDlg := Wvt_CreateDialog( aDlg, .F., "DlgSlideShowProc", "vr_1.ico", 5000 )
hDlg := Wvt_CreateDialog( aDlg, .F. , "DlgSlideShowProc", "vr_1.ico", 5000 )
RETURN hDlg
@@ -338,7 +344,7 @@ FUNCTION DlgSlideShowProc( hDlg, nMsg, wParam, lParam )
CASE WM_TIMER
nSlide++
IF nSlide > len( t_aSlides )
IF nSlide > Len( t_aSlides )
nSlide := 1
ENDIF
DrawSlide( hDlg, nSlide )
@@ -351,17 +357,18 @@ FUNCTION DlgSlideShowProc( hDlg, nMsg, wParam, lParam )
//
FUNCTION DrawSlide( hDlg, nSlide )
LOCAL hDC, aRect
hDC := WVG_GetDC( hDlg )
aRect := WVG_GetClientRect( hDlg )
Win_Rectangle( hDC, aRect[ 1 ]+10, aRect[ 2 ]+10, aRect[ 3 ]-10, aRect[ 4 ]-10 )
WVG_DrawImage( hDC, aRect[ 1 ]+10, aRect[ 2 ]+10, aRect[ 3 ] - aRect[ 1 ] -20, ;
aRect[ 4 ] - aRect[ 2 ] - 20, t_aSlides[ nSlide ] )
Win_Rectangle( hDC, aRect[ 1 ] + 10, aRect[ 2 ] + 10, aRect[ 3 ] - 10, aRect[ 4 ] - 10 )
WVG_DrawImage( hDC, aRect[ 1 ] + 10, aRect[ 2 ] + 10, aRect[ 3 ] - aRect[ 1 ] - 20, ;
aRect[ 4 ] - aRect[ 2 ] - 20, t_aSlides[ nSlide ] )
WVG_ReleaseDC( hDlg,hDC )
WVG_ReleaseDC( hDlg, hDC )
Return NIL
RETURN NIL
//

View File

@@ -4,6 +4,7 @@
/*
* Pritpal Bedi <bedipritpal@hotmail.com>
*/
//
#include "inkey.ch"
@@ -15,12 +16,13 @@
//
#xUntranslate alert( =>
#xuntranslate alert( =>
FUNCTION MyAlert( cMsg, aOpt )
LOCAL nSel, oCrt
oCrt := WvgCrt():New( , , { -1,-1 }, { 9, MaxCol()-6 }, , .T. )
oCrt := WvgCrt():New( , , { -1, -1 }, { 9, MaxCol() - 6 }, , .T. )
oCrt:lModal := .T.
oCrt:icon := "dia_excl.ico"
oCrt:create()
@@ -36,19 +38,23 @@ FUNCTION MyAlert( cMsg, aOpt )
RETURN nSel
#xTranslate Alert( => MyAlert(
#xtranslate Alert( => MyAlert(
//
FUNCTION My_Alert( cMessage, aOptions, cCaption, nInit, nTime )
RETURN DialogAlert( cCaption, cMessage, aOptions, nInit, , ,nTime )
RETURN DialogAlert( cCaption, cMessage, aOptions, nInit, , , nTime )
//
#xUntranslate alert( =>
#xuntranslate alert( =>
FUNCTION Just_Alert( cMsg, aOpt )
RETURN Alert( cMsg, aOpt )
#xTranslate Alert( => MyAlert(
#xtranslate Alert( => MyAlert(
//
@@ -70,96 +76,97 @@ FUNCTION Just_Alert( cMsg, aOpt )
#define K_RIGHT_UP 1005
#xtranslate B_CRT <nTop>,<nLeft>,<nBottom>,<nRight> ;
[ TITLE <ttl> ] ;
[ ICON <icon> ] ;
[ <lModal:MODAL> ] ;
[ <lRowCols:RESIZEROWCOLS> ] ;
[ <lHidden:HIDDEN> ] ;
[ <lCenter:CENTER> ] ;
[ AT <nRow>,<nCol> ] ;
[ <lNoTitleBar:NOTITLEBAR> ] ;
INTO <oCrt> ;
=> ;
<oCrt> := CreateOCrt( <nTop>, <nLeft>, <nBottom>, <nRight>, <ttl>, <icon>, ;
<.lModal.>, <.lRowCols.>, <.lHidden.>, <.lCenter.>, ;
<nRow>, <nCol>, <.lNoTitleBar.> )
[ TITLE <ttl> ] ;
[ ICON <icon> ] ;
[ <lModal:MODAL> ] ;
[ <lRowCols:RESIZEROWCOLS> ] ;
[ <lHidden:HIDDEN> ] ;
[ <lCenter:CENTER> ] ;
[ AT <nRow>,<nCol> ] ;
[ <lNoTitleBar:NOTITLEBAR> ] ;
INTO < oCrt > ;
=> ;
< oCrt > := CreateOCrt( < nTop > , < nLeft > , < nBottom > , < nRight > , < ttl > , < icon > , ;
< .lModal. > , < .lRowCols. > , < .lHidden. > , < .lCenter. > , ;
< nRow > , < nCol > , < .lNoTitleBar. > )
//
FUNCTION DialogAlert( cCaption, aText_, aButtons_, sel, aMessage_, nTop, nTime )
LOCAL nLinesRqd, nColRqd, nLeft, nBottom, nRight, oCrt
LOCAL nColTxt, nColCap, nColBut, nBtnRow
LOCAL i, nTopReq, lGo, nKey, nMCol, nMRow, nTrg
LOCAL maxCol := maxcol()
LOCAL maxRow := maxrow()
LOCAL maxCol := MaxCol()
LOCAL maxRow := MaxRow()
LOCAL nBtnCol_
LOCAL pal_ := {"w+/n","w/r","n/w","n/bg","r/bg","N/W","n/B","w+/B"}
LOCAL aTrg_ , x_:={}
LOCAL pal_ := { "w+/n", "w/r", "n/w", "n/bg", "r/bg", "N/W", "n/B", "w+/B" }
LOCAL aTrg_ , x_ := {}
DEFAULT cCaption TO "Your Attention Please!"
DEFAULT aButtons_ TO {"OK"}
DEFAULT aButtons_ TO { "OK" }
DEFAULT aText_ TO {}
DEFAULT aMessage_ TO {}
DEFAULT sel TO 1
DEFAULT nTime TO 10
if nTime == 0
IF nTime == 0
nTime := 10000 // Seconds
endif
ENDIF
if valtype( aText_ ) == "C"
aText_:= {aText_}
endif
IF ValType( aText_ ) == "C"
aText_ := { aText_ }
ENDIF
if valtype(aButtons_) == "C"
aButtons_:= {aButtons_}
endif
IF ValType( aButtons_ ) == "C"
aButtons_ := { aButtons_ }
ENDIF
nLinesRqd := len( aText_ )+ iif( len( aText_ )== 0, 4, 5 )
nTopReq := int( ( maxRow - nLinesRqd ) / 2 )
nTop := iif( nTop == nil, nTopReq, iif( nTop > nTopReq, nTop, nTopReq ) )
nLinesRqd := Len( aText_ ) + iif( Len( aText_ ) == 0, 4, 5 )
nTopReq := Int( ( maxRow - nLinesRqd ) / 2 )
nTop := iif( nTop == NIL, nTopReq, iif( nTop > nTopReq, nTop, nTopReq ) )
nBottom := nTop + nLinesRqd - 1 // 1 for shadow
// check for columns
// place 2 spaces before and after the buttons
nColCap := len( cCaption )+ 7 // " - "+" "+caption+" "
nColCap := Len( cCaption ) + 7 // " - "+" "+caption+" "
nColTxt := 0
if !empty(aText_)
aeval(aText_, {| e | nColTxt := max( nColTxt, len( e ) ) } )
endif
IF !Empty( aText_ )
AEval( aText_, {| e | nColTxt := Max( nColTxt, Len( e ) ) } )
ENDIF
nColTxt += 6 // for two spaces at both sides
nColBut := 0
aeval( aButtons_, {| e | nColBut += len( e ) + 7 } )
AEval( aButtons_, {| e | nColBut += Len( e ) + 7 } )
nColBut += 3
nColRqd := 0
aeval( { nColCap, nColTxt, nColBut }, {| e | nColRqd := max( nColRqd, e ) } )
AEval( { nColCap, nColTxt, nColBut }, {| e | nColRqd := Max( nColRqd, e ) } )
nLeft := iif( maxCol > nColRqd, int( ( maxCol - nColRqd ) / 2 ), 0 )
nRight := nLeft+nColRqd
nLeft := iif( maxCol > nColRqd, Int( ( maxCol - nColRqd ) / 2 ), 0 )
nRight := nLeft + nColRqd
aTrg_:= array( len( aButtons_ ) )
for i := 1 to len( aButtons_ )
aTrg_[i] := upper( substr( aButtons_[ i ], 1, 1 ) )
next
aTrg_ := Array( Len( aButtons_ ) )
FOR i := 1 TO Len( aButtons_ )
aTrg_[i] := Upper( SubStr( aButtons_[ i ], 1, 1 ) )
NEXT
// Create a new Window
//
B_CRT nTop, nLeft, nBottom-1, nRight MODAL ICON "dia_excl.ico" TITLE ' '+cCaption INTO oCrt
B_CRT nTop, nLeft, nBottom - 1, nRight MODAL ICON "dia_excl.ico" TITLE ' ' + cCaption INTO oCrt
nTop := -1
nLeft := 0
nBottom := nTop + nLinesRqd - 1
nRight := nLeft + nColRqd
nBtnRow := nTop + 1 + len( aText_ ) + iif( len( aText_ ) == 0, 1, 2 )
nBtnRow := nTop + 1 + Len( aText_ ) + iif( Len( aText_ ) == 0, 1, 2 )
nBtnCol_ := array( len( aButtons_ ) )
nBtnCol_ := Array( Len( aButtons_ ) )
nBtnCol_[ 1 ] := int( ( nColRqd - nColBut ) / 2 ) + 3
if len( aButtons_ ) > 1
for i := 2 to len( aButtons_ )
nBtnCol_[ i ] := nBtnCol_[ i-1 ] + len( aButtons_[ i-1 ] ) + 3 + 4
next
nBtnCol_[ 1 ] := Int( ( nColRqd - nColBut ) / 2 ) + 3
IF Len( aButtons_ ) > 1
FOR i := 2 TO Len( aButtons_ )
nBtnCol_[ i ] := nBtnCol_[ i-1 ] + Len( aButtons_[ i-1 ] ) + 3 + 4
NEXT
ENDIF
SetCursor( 0 )
@@ -172,113 +179,114 @@ FUNCTION DialogAlert( cCaption, aText_, aButtons_, sel, aMessage_, nTop, nTime )
Wvg_BoxRaised( nTop, nLeft, nBottom, nRight )
SetColor( pal_[ DLG_CLR_TEXT ] )
if !empty( aText_ )
FOR i := 1 to len( aText_ )
@ nTop+1+i, nLeft SAY padc( aText_[ i ], nRight-nLeft+1 )
IF !Empty( aText_ )
FOR i := 1 TO Len( aText_ )
@ nTop + 1 + i, nLeft SAY PadC( aText_[ i ], nRight - nLeft + 1 )
NEXT
ENDIF
// display buttons
//
for i := 1 to len( aButtons_ )
FOR i := 1 TO Len( aButtons_ )
SetColor( pal_[ DLG_CLR_BTN ] )
@ nBtnRow, nBtnCol_[ i ] SAY " "+aButtons_[ i ]+" "
@ nBtnRow, nBtnCol_[ i ] SAY " " + aButtons_[ i ] + " "
SetColor( pal_[ DLG_CLR_TRG ] )
@ nBtnRow, nBtnCol_[ i ]+2 say substr( aButtons_[ i ],1,1 )
@ nBtnRow, nBtnCol_[ i ] + 2 SAY SubStr( aButtons_[ i ], 1, 1 )
aadd( x_, { nBtnRow, nBtnCol_[ i ], nBtnRow, nBtnCol_[ i ] + len( aButtons_[ i ] ) + 3 } )
next
AAdd( x_, { nBtnRow, nBtnCol_[ i ], nBtnRow, nBtnCol_[ i ] + Len( aButtons_[ i ] ) + 3 } )
NEXT
setColor( pal_[ DLG_CLR_HILITE ] )
@ nBtnRow, nBtnCol_[ sel ] SAY " "+aButtons_[sel]+" "
SetColor( pal_[ DLG_CLR_HILITE ] )
@ nBtnRow, nBtnCol_[ sel ] SAY " " + aButtons_[sel] + " "
setColor( pal_[ DLG_CLR_HISEL ] )
@ nBtnRow, nBtnCol_[ sel ]+2 SAY substr( aButtons_[ sel ],1,1 )
SetColor( pal_[ DLG_CLR_HISEL ] )
@ nBtnRow, nBtnCol_[ sel ] + 2 SAY SubStr( aButtons_[ sel ], 1, 1 )
aeval( x_, {| e_ | Wvg_BoxRaised( e_[ 1 ], e_[ 2 ], e_[ 3 ], e_[ 4 ] ) } )
AEval( x_, {| e_ | Wvg_BoxRaised( e_[ 1 ], e_[ 2 ], e_[ 3 ], e_[ 4 ] ) } )
dispend()
DispEnd()
lGo := .T.
do while lGo
DO WHILE lGo
IF ( nKey := Inkey() ) == 0
LOOP
ENDIF
if nKey == K_ESC
IF nKey == K_ESC
sel := 0
exit
endif
EXIT
ENDIF
nMRow := MRow()
nMCol := MCol()
do case
case nKey == K_RIGHT_DOWN
DO CASE
CASE nKey == K_RIGHT_DOWN
sel := 0
lGo := .F.
case nKey == K_LEFT_DOWN
if nMRow == nTop
if nMCol >= nLeft .and. nMCol <= nLeft+3
CASE nKey == K_LEFT_DOWN
IF nMRow == nTop
IF nMCol >= nLeft .AND. nMCol <= nLeft + 3
sel := 0
lGo := .F.
endif
elseif nMRow == nBtnRow
for i := 1 to len( nBtnCol_ )
if nMCol >= nBtnCol_[ i ] .and. nMCol <= nBtnCol_[ i ] + len( aButtons_[ i ] )+4
ENDIF
ELSEIF nMRow == nBtnRow
FOR i := 1 TO Len( nBtnCol_ )
IF nMCol >= nBtnCol_[ i ] .AND. nMCol <= nBtnCol_[ i ] + Len( aButtons_[ i ] ) + 4
sel := i
lGo := .F.
endif
next
endif
case nKey == K_ESC
ENDIF
NEXT
ENDIF
CASE nKey == K_ESC
sel := 0
lGo := .F.
case nKey == K_ENTER
CASE nKey == K_ENTER
lGo := .F.
case nKey == K_LEFT .or. nKey == K_DOWN
CASE nKey == K_LEFT .OR. nKey == K_DOWN
sel--
case nKey == K_RIGHT .or. nKey == K_UP
CASE nKey == K_RIGHT .OR. nKey == K_UP
sel++
case ( nTrg := ascan( aTrg_, upper( chr( nKey ) ) ) ) > 0
CASE ( nTrg := AScan( aTrg_, Upper( Chr( nKey ) ) ) ) > 0
sel := nTrg
lGo := .F.
otherwise
if setkey( nKey ) != nil
eval( setKey( nKey ) )
endif
endcase
OTHERWISE
IF SetKey( nKey ) != NIL
Eval( SetKey( nKey ) )
ENDIF
ENDCASE
if sel > len( aButtons_ )
IF sel > Len( aButtons_ )
sel := 1
elseif sel < 1
sel := len( aButtons_ )
endif
ELSEIF sel < 1
sel := Len( aButtons_ )
ENDIF
dispbegin()
for i := 1 to len ( aButtons_ )
setColor( pal_[ DLG_CLR_BTN ] )
@ nBtnRow, nBtnCol_[ i ] SAY " "+aButtons_[i]+" "
setColor( pal_[ DLG_CLR_TRG])
@ nBtnRow, nBtnCol_[i]+2 say substr(aButtons_[i],1,1)
next
if sel > 0
setColor( pal_[ DLG_CLR_HILITE ] )
@ nBtnRow, nBtnCol_[sel] SAY " "+aButtons_[ sel ]+" "
setColor( pal_[ DLG_CLR_HISEL ] )
@ nBtnRow, nBtnCol_[ sel ]+2 SAY substr( aButtons_[ sel ], 1, 1 )
endif
DispBegin()
FOR i := 1 TO Len ( aButtons_ )
SetColor( pal_[ DLG_CLR_BTN ] )
@ nBtnRow, nBtnCol_[ i ] SAY " " + aButtons_[i] + " "
SetColor( pal_[ DLG_CLR_TRG] )
@ nBtnRow, nBtnCol_[i] + 2 SAY SubStr( aButtons_[i], 1, 1 )
NEXT
IF sel > 0
SetColor( pal_[ DLG_CLR_HILITE ] )
@ nBtnRow, nBtnCol_[sel] SAY " " + aButtons_[ sel ] + " "
SetColor( pal_[ DLG_CLR_HISEL ] )
@ nBtnRow, nBtnCol_[ sel ] + 2 SAY SubStr( aButtons_[ sel ], 1, 1 )
ENDIF
dispend()
enddo
DispEnd()
ENDDO
oCrt:destroy()
return sel
RETURN sel
//
FUNCTION CreateOCrt( nT, nL, nB, nR, cTitle, xIcon, lModal, lRowCols, lHidden, ;
lCenter, nRow, nCol, lNoTitleBar )
lCenter, nRow, nCol, lNoTitleBar )
LOCAL oCrt, aPos
DEFAULT cTitle TO 'Info'
@@ -288,7 +296,7 @@ FUNCTION CreateOCrt( nT, nL, nB, nR, cTitle, xIcon, lModal, lRowCols, lHidden, ;
DEFAULT lCenter TO .F.
DEFAULT lNoTitleBar TO .F.
aPos := iif( lCenter, {-1,-1}, iif( nRow == NIL, { nT, nL }, { nRow,nCol } ) )
aPos := iif( lCenter, { -1, -1 }, iif( nRow == NIL, { nT, nL }, { nRow,nCol } ) )
oCrt := WvgCrt():new( , , aPos, { nB - nT, nR - nL }, , !lHidden )
oCrt:lModal := lModal
@@ -301,10 +309,10 @@ FUNCTION CreateOCrt( nT, nL, nB, nR, cTitle, xIcon, lModal, lRowCols, lHidden, ;
IF HB_ISNUMERIC( xIcon )
hb_gtInfo( HB_GTI_ICONRES, xIcon )
ELSE
IF ( '.ico' $ lower( xIcon ) )
IF ( '.ico' $ Lower( xIcon ) )
hb_gtInfo( HB_GTI_ICONFILE, xIcon )
ELSE
IF '.bmp' $ lower( xIcon )
IF '.bmp' $ Lower( xIcon )
xIcon := 'VW_DFT'
ENDIF
hb_gtInfo( HB_GTI_ICONRES, xIcon )
@@ -321,23 +329,25 @@ FUNCTION CreateOCrt( nT, nL, nB, nR, cTitle, xIcon, lModal, lRowCols, lHidden, ;
//
FUNCTION DoModalWindow()
LOCAL oCrt, nSel, pGT
LOCAL aLastPaint := WvtSetBlocks( {} )
/* This part can be clubbed in a separate prg for different dialogs
* OR can be loaded from a data dictionary.
*/
oCrt := WvgCrt():New( , , { 4,8 }, { 12,49 }, , .T. )
oCrt := WvgCrt():New( , , { 4, 8 }, { 12, 49 }, , .T. )
oCrt:lModal := .T.
oCrt:resizable := .F.
oCrt:closable := .F.
oCrt:title := 'Information! [R:4 C:8]'
oCrt:rbUp := {|| DispOutAt( maxrow(), 0, padc( 'rbUp', maxcol()+1 ),'W+/R*' ) }
oCrt:lbUp := {|| DispOutAt( maxrow(), 0, padc( 'lbUp', maxcol()+1 ),'W+/B*' ) }
oCrt:leave := {|| DispOutAt( maxrow(), 0, padc( 'Leaving', maxcol()+1 ), 'W+/RB' ) }
oCrt:enter := {|| DispOutAt( maxrow(), 0, padc( 'Entering', maxcol()+1 ), 'W+/B' ) }
oCrt:rbUp := {|| DispOutAt( MaxRow(), 0, PadC( 'rbUp', MaxCol() + 1 ), 'W+/R*' ) }
oCrt:lbUp := {|| DispOutAt( MaxRow(), 0, PadC( 'lbUp', MaxCol() + 1 ), 'W+/B*' ) }
oCrt:leave := {|| DispOutAt( MaxRow(), 0, PadC( 'Leaving', MaxCol() + 1 ), 'W+/RB' ) }
oCrt:enter := {|| DispOutAt( MaxRow(), 0, PadC( 'Entering', MaxCol() + 1 ), 'W+/B' ) }
oCrt:Create()
oCrt:show()
@@ -348,19 +358,20 @@ FUNCTION DoModalWindow()
//
SetColor( 'N/W' )
CLS
do while .T.
DO WHILE .T.
nSel := Just_Alert( 'I am in modal window !;< Try: MMove LBUp RBUp >;Click Parent Window', { 'OK' } )
if nSel == 0 .or. nSel == 1
exit
IF nSel == 0 .OR. nSel == 1
EXIT
endif
enddo
ENDIF
ENDDO
SetGT( 3, pGT )
oCrt:Destroy()
WvtSetBlocks( aLastPaint )
Return NIL
RETURN NIL
//

View File

@@ -11,6 +11,7 @@
*
* Pritpal Bedi <bedipritpal@hotmail.com>
*/
//
#include "inkey.ch"
@@ -42,14 +43,14 @@
FUNCTION WvtMyBrowse()
IF hb_mtvm()
Hb_ThreadStart( {| oCrt | oCrt := WvgCrt():new( , , { -1,-2 }, { 34,69 }, , .T. ), ;
oCrt:resizeMode := HB_GTI_RESIZEMODE_ROWS,;
oCrt:icon := GetResource( "dia_excl.ico" ),;
oCrt:create(),;
Wvt_SetGui( .T. ),;
ExecBrowser( oCrt ),;
oCrt:destroy();
} )
hb_threadStart( {| oCrt | oCrt := WvgCrt():new( , , { -1, -2 }, { 34,69 }, , .T. ), ;
oCrt:resizeMode := HB_GTI_RESIZEMODE_ROWS, ;
oCrt:icon := GetResource( "dia_excl.ico" ), ;
oCrt:create(), ;
Wvt_SetGui( .T. ), ;
ExecBrowser( oCrt ), ;
oCrt:destroy();
} )
ELSE
ExecBrowser()
@@ -60,35 +61,37 @@ FUNCTION WvtMyBrowse()
//
FUNCTION ExecBrowser( oCrt )
LOCAL nKey, bBlock, oBrowse , aLastPaint, i, pGT
LOCAL cFileIndex, cFileDbf, cRDD, nIndex, oTBar, cScr, info_ //, oLB
LOCAL lEnd := .F.
LOCAL aBlocks := {}
LOCAL nTop := 4
LOCAL nLeft := 3
LOCAL nBottom := maxrow() - 2
LOCAL nRight := maxcol() - 3
LOCAL nCursor := setCursor( 0 )
LOCAL nRow := row()
LOCAL nCol := col()
LOCAL nBottom := MaxRow() - 2
LOCAL nRight := MaxCol() - 3
LOCAL nCursor := SetCursor( 0 )
LOCAL nRow := Row()
LOCAL nCol := Col()
LOCAL cColor := SetColor( "N/W*,N/GR*,,,N/W*" )
LOCAL aObjects := WvtSetObjects( {} )
LOCAL hPopup := Wvt_SetPopupMenu()
LOCAL oVBar, oHBar, oCom, oTre, oChk, oSLE, oLBx, aNvg, oIdx
STATIC nStyle := 0
THREAD STATIC nFactor := 200
THREAD STATIC lActiveX := .F.
IF oCrt == NIL
cScr := SaveScreen( 0,0,maxrow(),maxcol() )
cScr := SaveScreen( 0, 0, MaxRow(), MaxCol() )
ENDIF
BrwBuildMenu( oCrt )
oTBar := BrwBuildToolBar( oCrt )
oTBar:buttonClick := {| oBtn | Vou_ExecTBarAction( oBtn ) }
SetMode( maxrow()+1, maxCol()+1 ) /* Neccessary because adding menu has reduced the overall size of window */
SetMode( MaxRow() + 1, MaxCol() + 1 ) /* Neccessary because adding menu has reduced the overall size of window */
pGT := SetGT( 2, hb_gtSelect() )
@@ -100,7 +103,7 @@ FUNCTION ExecBrowser( oCrt )
IF NetErr()
RETURN NIL
ENDIF
IF fLock()
IF FLock()
INDEX ON Test->FIRST TAG "001" TO ( cFileIndex )
INDEX ON Test->LAST TAG "002" TO ( cFileIndex )
INDEX ON Test->CITY TAG "003" TO ( cFileIndex )
@@ -109,9 +112,9 @@ FUNCTION ExecBrowser( oCrt )
SET INDEX TO
SET INDEX TO ( cFileIndex )
SET ORDER TO 1
DbGoTo( 50 )
dbGoto( 50 )
info_:= DbStruct()
info_ := dbStruct()
Popups( 2 )
@@ -121,32 +124,32 @@ FUNCTION ExecBrowser( oCrt )
oBrowse:HeadSep := "__"
oBrowse:GoTopBlock := {|| dbGoTop() }
oBrowse:GoBottomBlock := {|| dbGoBottom() }
oBrowse:SkipBlock := {| nSkip | dbSkipBlock( nSkip,oBrowse ) }
oBrowse:SkipBlock := {| nSkip | dbSkipBlock( nSkip, oBrowse ) }
for i := 1 to len( info_ )
FOR i := 1 TO Len( info_ )
bBlock := VouBlockField( i )
oBrowse:AddColumn( TBColumnNew( info_[ i,1 ], bBlock ) )
next
NEXT
oBrowse:configure()
if nStyle > 5
IF nStyle > 5
nStyle := 0
endif
ENDIF
Wvt_SetPen( nStyle, 0, rgb( 210,1210,210 ) )
nStyle++
hb_gtInfo( HB_GTI_WINTITLE, "WVT Gui TBrowse()" )
aAdd( aBlocks, {|| Wvt_DrawBoxRaised( oBrowse:nTop-2, oBrowse:nLeft-2, oBrowse:nBottom+1, oBrowse:nRight+2 ) } )
aAdd( aBlocks, {|| Wvt_DrawBoxRecessed( oBrowse:nTop, oBrowse:nLeft, oBrowse:nBottom, oBrowse:nRight ) } )
aAdd( aBlocks, {|| Wvt_DrawGridHorz( oBrowse:nTop+3, oBrowse:nLeft, oBrowse:nRight, oBrowse:nBottom - oBrowse:nTop - 2 ) } )
aAdd( aBlocks, {|| Wvt_DrawGridVert( oBrowse:nTop, oBrowse:nBottom, oBrowse:aColumnsSep, len( oBrowse:aColumnsSep ) ) } )
AAdd( aBlocks, {|| Wvt_DrawBoxRaised( oBrowse:nTop - 2, oBrowse:nLeft - 2, oBrowse:nBottom + 1, oBrowse:nRight + 2 ) } )
AAdd( aBlocks, {|| Wvt_DrawBoxRecessed( oBrowse:nTop, oBrowse:nLeft, oBrowse:nBottom, oBrowse:nRight ) } )
AAdd( aBlocks, {|| Wvt_DrawGridHorz( oBrowse:nTop + 3, oBrowse:nLeft, oBrowse:nRight, oBrowse:nBottom - oBrowse:nTop - 2 ) } )
AAdd( aBlocks, {|| Wvt_DrawGridVert( oBrowse:nTop, oBrowse:nBottom, oBrowse:aColumnsSep, Len( oBrowse:aColumnsSep ) ) } )
Vou_BrwAddScrollBars( oCrt, oBrowse, @oVBar, @oHBar )
aLastPaint := WvtSetBlocks( aBlocks )
DispBox( 0, 0, maxrow(), maxcol(), " ", "N/W" )
DispOutAt( oBrowse:nTop-2, oBrowse:nleft-2, padc( cFileDbf, oBrowse:nRight-oBrowse:nLeft+5 ), "W+/B*" )
DispBox( 0, 0, MaxRow(), MaxCol(), " ", "N/W" )
DispOutAt( oBrowse:nTop - 2, oBrowse:nleft - 2, PadC( cFileDbf, oBrowse:nRight - oBrowse:nLeft + 5 ), "W+/B*" )
oCom := BrwBuildActiveX( oCrt, oBrowse )
oChk := BrwBuildCheckBox( oCrt, oBrowse, @lActiveX )
@@ -160,15 +163,15 @@ FUNCTION ExecBrowser( oCrt )
Wvt_Keyboard( HB_K_RESIZE ) /* Refresh All GUI Controls */
WHILE ! lEnd
dispbegin()
DO WHILE ( ( nKey := inkey( , INKEY_ALL + HB_INKEY_GTEVENT ) ) == 0 .or. nKey == K_MOVING ) .and. ! oBrowse:stabilize()
DispBegin()
DO WHILE ( ( nKey := Inkey( , INKEY_ALL + HB_INKEY_GTEVENT ) ) == 0 .OR. nKey == K_MOVING ) .AND. ! oBrowse:stabilize()
ENDDO
dispend()
DispEnd()
IF nKey == 0
oVBar:setData( OrdKeyNo() )
oVBar:setData( ordKeyNo() )
oHBar:setData( oBrowse:colPos )
DO WHILE ( ( nKey := inkey( , INKEY_ALL + HB_INKEY_GTEVENT ) ) == 0 .or. nKey == K_MOVING )
DO WHILE ( ( nKey := Inkey( , INKEY_ALL + HB_INKEY_GTEVENT ) ) == 0 .OR. nKey == K_MOVING )
ENDDO
ENDIF
@@ -219,9 +222,9 @@ FUNCTION ExecBrowser( oCrt )
SetColor( cColor )
SetCursor( nCursor )
DBCloseArea()
dbCloseArea()
IF oCrt == NIL
RestScreen( 0, 0, maxrow(), maxcol(), cScr )
RestScreen( 0, 0, MaxRow(), MaxCol(), cScr )
ENDIF
Wvt_setPopupMenu( hPopup )
SetGT( 2, pGT )
@@ -239,22 +242,22 @@ STATIC FUNCTION BrwHandleResize( oCrt, oBrw, oVBar, oHBar, oCom, oSLE, oLBx, oTr
oCrt:setFocus()
oBrw:nBottom := iif( lActiveX, 20, maxrow()-3 )
oBrw:nRight := maxcol()-4
oBrw:nBottom := iif( lActiveX, 20, MaxRow() - 3 )
oBrw:nRight := MaxCol() - 4
oBrw:configure()
DispBox( 0, 0, maxrow(), maxcol(), " ", "N/W" )
DispOutAt( oBrw:nTop-2, oBrw:nleft-2, padc( cFileDbf, oBrw:nRight - oBrw:nLeft + 5 ), "W+/B*" )
DispBox( 0, 0, MaxRow(), MaxCol(), " ", "N/W" )
DispOutAt( oBrw:nTop - 2, oBrw:nleft - 2, PadC( cFileDbf, oBrw:nRight - oBrw:nLeft + 5 ), "W+/B*" )
oVBar:setPosAndSize()
oHBar:setPosAndSize()
oCom:setPosAndSize()
// oSLE:setPosAndSize()
// oLBx:setPosAndSize()
// oIdx:setPosAndSize()
// oSLE:setPosAndSize()
// oLBx:setPosAndSize()
// oIdx:setPosAndSize()
oTre:setPosAndSize()
// oChk:setPosAndSize()
// oChk:setPosAndSize()
BrwReposButtons( oCrt ) /* Because we are repositioning at the center of console width */
@@ -277,6 +280,7 @@ STATIC FUNCTION BrwHandleResize( oCrt, oBrw, oVBar, oHBar, oCom, oSLE, oLBx, oTr
//
STATIC FUNCTION BrwShowColumn( oBrw, cHeading )
LOCAL i, j, nCur
nCur := oBrw:colPos
@@ -286,12 +290,12 @@ STATIC FUNCTION BrwShowColumn( oBrw, cHeading )
ENDIF
NEXT
IF i < nCur
FOR j := nCur-1 TO i STEP -1
oBrw:left()
FOR j := nCur - 1 TO i STEP -1
oBrw:Left()
NEXT
ELSEIF i > nCur
FOR j := nCur+1 TO i
oBrw:right()
FOR j := nCur + 1 TO i
oBrw:Right()
NEXT
ENDIF
oBrw:refreshCurrent()
@@ -302,13 +306,14 @@ STATIC FUNCTION BrwShowColumn( oBrw, cHeading )
//
STATIC FUNCTION BrwBuildTree( oCrt /*, oBrw*/ )
LOCAL oTree, oItem1, oItem2
oTree := WvgTreeView():new( oCrt )
oTree:hasLines := .T.
oTree:hasButtons := .T.
oTree:alwaysShowSelection := .T.
oTree:create( , , { -24, -1 }, { {|| -( maxrow()-1-24 ) }, -10 } )
oTree:create( , , { -24, -1 }, { {|| -( MaxRow() - 1 - 24 ) }, -10 } )
oTree:setColorFG( "W+" )
oTree:setColorBG( "R*" )
oTree:itemSelected := {| oItem | WVG_MessageBox( , iif( oItem != NIL, oItem:caption, "Some Problem" ) ) }
@@ -324,7 +329,7 @@ STATIC FUNCTION BrwBuildTree( oCrt /*, oBrw*/ )
oItem2:addItem( "Third level y" )
oItem2:addItem( "Third level z" )
oTree:showExpanded( .T., 2 )
oTree:showExpanded( .T. , 2 )
oTree:setData( oItem2 )
oTree:tooltipText := "Treeview embedded onto CUI window"
@@ -334,13 +339,14 @@ STATIC FUNCTION BrwBuildTree( oCrt /*, oBrw*/ )
//
STATIC FUNCTION BrwBuildActiveX( oCrt, oBrw )
LOCAL oCom
HB_SYMBOL_UNUSED( oBrw )
oCom := WvgActiveXControl():new( oCrt, , { -24, -13 }, { {|| -( maxrow()-1-24 ) }, {|| -( maxcol()-1-13 ) } }, , .F. )
oCom := WvgActiveXControl():new( oCrt, , { -24, -13 }, { {|| -( MaxRow() - 1 - 24 ) }, {|| -( MaxCol() - 1 - 13 ) } }, , .F. )
oCom:CLSID := 'Shell.Explorer.2'
//oCom:mapEvent( 269, {|| uiDebug( ' E X P L O R E R - 2 6 9' ) } )
// oCom:mapEvent( 269, {|| uiDebug( ' E X P L O R E R - 2 6 9' ) } )
oCom:create()
oCom:navigate( "http://hbide.vouch.info" )
@@ -349,10 +355,11 @@ STATIC FUNCTION BrwBuildActiveX( oCrt, oBrw )
//
STATIC FUNCTION BrwBuildListBox( oCrt, oBrw )
LOCAL oXbp, i
oXbp := WvgListBox():new( oCrt )
oXbp:create( , , { -4,-1 }, { -10, -10 }, , .T. )
oXbp:create( , , { -4, -1 }, { -10, -10 }, , .T. )
oXbp:setColorFG( "W+" )
oXbp:setColorBG( "B*" )
oXbp:itemMarked := {| m1, m2, o | m1 := m1, m2 := m2, BrwShowColumn( oBrw, o:getCurItem() ) }
@@ -367,31 +374,34 @@ STATIC FUNCTION BrwBuildListBox( oCrt, oBrw )
//
STATIC FUNCTION BrwSetThisOrder( oBrw, nOrd )
DbSetOrder( nOrd )
dbSetOrder( nOrd )
oBrw:refreshAll()
oBrw:forceStable()
RETURN NIL
//
STATIC FUNCTION BrwBuildListBoxIdx( oCrt, oBrw )
LOCAL oXbp, i, cKey, aIdx := {}
FOR i := 1 TO 10
IF ( cKey := IndexKey( i ) ) == ""
EXIT
ENDIF
aadd( aIdx, OrdName( i ) + ": " + cKey )
AAdd( aIdx, ordName( i ) + ": " + cKey )
NEXT
oXbp := WvgComboBox():new( oCrt )
oXbp:type := WVGCOMBO_DROPDOWN
oXbp:create( , , { -18,-1 }, { -5, -10 }, , .T. )
oXbp:create( , , { -18, -1 }, { -5, -10 }, , .T. )
oXbp:setColorFG( "W+" )
oXbp:setColorBG( "B*" )
oXbp:itemMarked := {| m1, m2, o | m1 := m2, BrwSetThisOrder( oBrw, o:XbpListBox:getData()-1 ) }
oXbp:itemMarked := {| m1, m2, o | m1 := m2, BrwSetThisOrder( oBrw, o:XbpListBox:getData() - 1 ) }
oXbp:addItem( "Natural Order" )
FOR i := 1 TO len( aIdx )
FOR i := 1 TO Len( aIdx )
oXbp:addItem( aIdx[ i ] )
NEXT
oXbp:tooltipText := "Click on an index to order database!"
@@ -401,6 +411,7 @@ STATIC FUNCTION BrwBuildListBoxIdx( oCrt, oBrw )
//
STATIC FUNCTION BrwBuildSLE( oCrt, oBrw )
LOCAL oXbp
oXbp := WvgStatic():new( oCrt )
@@ -415,7 +426,7 @@ STATIC FUNCTION BrwBuildSLE( oCrt, oBrw )
oXbp:create( , , { -16, -1 }, { -1, -10 } )
oXbp:setColorFG( "N" )
oXbp:setColorBG( "BG+" )
oXbp:returnPressed := {| m1, m2, o | m1:=m1, m2:=m2, BrwShowColumn( oBrw, upper( trim( o:getData() ) ) ) }
oXbp:returnPressed := {| m1, m2, o | m1 := m1, m2 := m2, BrwShowColumn( oBrw, Upper( Trim( o:getData() ) ) ) }
oXbp:tooltipText := "Type in a field name and press ENTER"
RETURN oXbp
@@ -423,6 +434,7 @@ STATIC FUNCTION BrwBuildSLE( oCrt, oBrw )
//
STATIC FUNCTION BrwBuildNvg( oCrt, oBrw, oCom )
LOCAL oLbl, oXbp
HB_SYMBOL_UNUSED( oBrw )
@@ -437,10 +449,10 @@ STATIC FUNCTION BrwBuildNvg( oCrt, oBrw, oCom )
oXbp := WvgSLE():new( oCrt )
oXbp:bufferLength := 300
oXbp:create( , , { -23, -19 }, { -1, {|| -( maxcol()-1-19 ) } }, , .F. )
oXbp:create( , , { -23, -19 }, { -1, {|| -( MaxCol() - 1 - 19 ) } }, , .F. )
oXbp:setColorFG( "N" )
oXbp:setColorBG( "BG+" )
oXbp:returnPressed := {| m1, m2, o | m1:=m2, oCom:navigate( trim( o:getData() ) ) }
oXbp:returnPressed := {| m1, m2, o | m1 := m2, oCom:navigate( Trim( o:getData() ) ) }
oXbp:tooltipText := "Type-in a http:// address and press ENTER"
oXbp:setData( "http://hbide.vouch.info/" )
@@ -449,6 +461,7 @@ STATIC FUNCTION BrwBuildNvg( oCrt, oBrw, oCom )
//
STATIC FUNCTION BrwBuildCheckBox( oCrt, oBrw, lActiveX )
LOCAL oXbp
HB_SYMBOL_UNUSED( oBrw )
@@ -458,7 +471,7 @@ STATIC FUNCTION BrwBuildCheckBox( oCrt, oBrw, lActiveX )
oXbp:caption := "ActiveX"
oXbp:selected := {| x, y, o | x := y, lActiveX := o:getData(), Wvt_Keyboard( HB_K_RESIZE ) }
oXbp:selection := .F.
oXbp:create( , , { -23,-1 }, { -1,-10 } )
oXbp:create( , , { -23, -1 }, { -1, -10 } )
oXbp:setColorFG( "R+" )
oXbp:setColorBG( "W" )
oXbp:tooltipText := "Naviagate: http://hbide.vouch.info"
@@ -468,20 +481,21 @@ STATIC FUNCTION BrwBuildCheckBox( oCrt, oBrw, lActiveX )
//
STATIC FUNCTION BrwReposButtons( oCrt )
LOCAL oXbp, nOff, nTtl, nG, i
LOCAL aW := { 10, 10, 10, 10, 10 }
nG := 2
nTtl := 0
aeval( aW, {| e | nTtl += e } )
nTtl += ( len( aW ) - 1 ) * nG
AEval( aW, {| e | nTtl += e } )
nTtl += ( Len( aW ) - 1 ) * nG
nOff := ( ( maxcol()+1 ) - nTtl ) / 2
nOff := ( ( MaxCol() + 1 ) - nTtl ) / 2
i := 0
FOR EACH oXbp IN oCrt:childList()
IF __ObjGetClsName( oXbp ) == "WVGPUSHBUTTON"
IF __objGetClsName( oXbp ) == "WVGPUSHBUTTON"
i++
oXbp:setPosAndSize( { -maxrow(), -nOff }, { -1, -aW[ i ] } )
oXbp:setPosAndSize( { -MaxRow(), -nOff }, { -1, -aW[ i ] } )
nOff += aW[ i ] + nG
ENDIF
NEXT
@@ -491,33 +505,34 @@ STATIC FUNCTION BrwReposButtons( oCrt )
//
STATIC FUNCTION BrwBuildButtons( oCrt, oBrw )
LOCAL oPB, nOff, nTtl, nG, i
LOCAL aPmt := { "Modal Window", "Maximize", "Go Top", "Go Bottom", "Right Most" }
LOCAL aAct := { {|| Wvt_Keyboard( K_F3 ) }, ;
{|| Wvt_Keyboard( K_F4 ) }, ;
{|| oBrw:goTop(), oBrw:forceStable() }, ;
{|| oBrw:goBottom(), oBrw:forceStable() }, ;
{|| oBrw:panEnd(), oBrw:forceStable() } }
{|| Wvt_Keyboard( K_F4 ) }, ;
{|| oBrw:goTop(), oBrw:forceStable() }, ;
{|| oBrw:goBottom(), oBrw:forceStable() }, ;
{|| oBrw:panEnd(), oBrw:forceStable() } }
LOCAL aW := { 10, 10, 10, 10, 10 }
nG := 2
nTtl := 0
aeval( aW, {| e | nTtl += e } )
nTtl += ( len( aW ) - 1 ) * nG
AEval( aW, {| e | nTtl += e } )
nTtl += ( Len( aW ) - 1 ) * nG
nOff := ( ( maxcol()+1 ) - nTtl ) / 2
nOff := ( ( MaxCol() + 1 ) - nTtl ) / 2
FOR i := 1 TO len( aPmt )
FOR i := 1 TO Len( aPmt )
oPB := WvgPushButton():new( oCrt )
IF i == 3 /* We do not want this button to gain focus anytime */
oPB:pointerFocus := .F.
ENDIF
IF i == len( aPmt )
oPB:caption := hb_dirBase() + "\" + "v_lock.bmp"
oPB:create( , , { {|| -maxrow() }, -nOff }, { -1,-aW[ i ] } )
IF i == Len( aPmt )
oPB:caption := hb_DirBase() + "\" + "v_lock.bmp"
oPB:create( , , { {|| -MaxRow() }, -nOff }, { -1, -aW[ i ] } )
ELSE
oPB:caption := aPmt[ i ]
oPB:create( , , { {|| -maxrow() }, -nOff }, { -1,-aW[ i ] } )
oPB:create( , , { {|| -MaxRow() }, -nOff }, { -1, -aW[ i ] } )
ENDIF
oPB:activate := aAct[ i ]
oPB:setColorFG( RGB( 0,255,0 ) )
@@ -532,15 +547,15 @@ STATIC FUNCTION BrwBuildButtons( oCrt, oBrw )
FUNCTION Vou_BrwAddScrollBars( oCrt, oBrw, oVBar, oHBar )
oHBar := WvgScrollBar():new( oCrt, , { {|| -( oBrw:nBottom+1 ) }, {|| -( oBrw:nLeft ) } }, ;
{ -1, {|| -( oBrw:nRight - oBrw:nLeft + 1 ) } } )
oHBar := WvgScrollBar():new( oCrt, , { {|| -( oBrw:nBottom + 1 ) }, {|| -( oBrw:nLeft ) } }, ;
{ -1, {|| -( oBrw:nRight - oBrw:nLeft + 1 ) } } )
oHBar:range := { 1, oBrw:colCount }
oHBar:type := WVGSCROLL_HORIZONTAL
oHBar:create()
oHBar:scroll := {| mp1 | oBrw:colPos := mp1[ 1 ], oBrw:refreshCurrent(), oBrw:forceStable() }
oVBar := WvgScrollBar():new( oCrt, , { {|| -( oBrw:nTop ) }, {|| -( oBrw:nRight+1 ) } }, ;
{ {|| -( oBrw:nBottom-oBrw:nTop+1 ) }, {|| -( 2 ) } } )
oVBar := WvgScrollBar():new( oCrt, , { {|| -( oBrw:nTop ) }, {|| -( oBrw:nRight + 1 ) } }, ;
{ {|| -( oBrw:nBottom - oBrw:nTop + 1 ) }, {|| -2 } } )
oVBar:range := { 1, LastRec() }
oVBar:type := WVGSCROLL_VERTICAL
oVBar:create()
@@ -551,29 +566,30 @@ FUNCTION Vou_BrwAddScrollBars( oCrt, oBrw, oVBar, oHBar )
//
STATIC FUNCTION BrwBuildMenu( oCrt )
LOCAL oMenu, oSMenu
oMenu := oCrt:menubar()
oSMenu := WvgMenu():new( oMenu ):create()
oSMenu:addItem( { '~First' , {|| alert( 'First' ) } } )
oSMenu:addItem( { '~Second', {|| alert( 'Second' ) } } )
oSMenu:addItem( { '~First' , {|| Alert( 'First' ) } } )
oSMenu:addItem( { '~Second', {|| Alert( 'Second' ) } } )
oSMenu:addItem()
oSMenu:addItem( { '~Third' , {|| alert( 'Third' ) } } )
oSMenu:addItem( { '~Third' , {|| Alert( 'Third' ) } } )
oMenu:addItem( { oSMenu, '~Hello' } )
oSMenu := WvgMenu():new( oMenu ):create()
oSMenu:addItem( { '~First' , {|| alert( 'First' ) } } )
oSMenu:addItem( { '~First' , {|| Alert( 'First' ) } } )
oSMenu:addItem( '-' )
oSMenu:addItem( { '~Second', {|| alert( 'Second' ) } } )
oSMenu:addItem( { '~Third' , {|| alert( 'Third' ) } } )
oSMenu:addItem( { '~Second', {|| Alert( 'Second' ) } } )
oSMenu:addItem( { '~Third' , {|| Alert( 'Third' ) } } )
oMenu:addItem( { oSMenu, '~MyFriends' } )
oSMenu := WvgMenu():new( oMenu ):create()
oSMenu:title := "~Procedural"
oSMenu:addItem( { "Procedure ~1", } )
oSMenu:addItem( { "Procedure ~2", } )
oSMenu:itemSelected := {| mp1 | MyMenuProcedure( 100+mp1 ) }
oSMenu:itemSelected := {| mp1 | MyMenuProcedure( 100 + mp1 ) }
oSMenu:checkItem( 2 )
oMenu:addItem( { oSMenu, NIL } )
@@ -582,9 +598,10 @@ STATIC FUNCTION BrwBuildMenu( oCrt )
//
STATIC FUNCTION BrwBuildToolBar( oCrt )
LOCAL oTBar, nRGB := RGB( 172,172,172 )
oTBar := WvgToolBar():new( oCrt, , { -0.1,-0.1 }, { -3, {|| -( maxcol()+1 ) } } )
LOCAL oTBar, nRGB := RGB( 172, 172, 172 )
oTBar := WvgToolBar():new( oCrt, , { -0.1, -0.1 }, { -3, {|| -( MaxCol() + 1 ) } } )
oTBar:style := WVGTOOLBAR_STYLE_FLAT
oTBar:borderStyle := WVGFRAME_RECT
@@ -615,6 +632,7 @@ STATIC FUNCTION BrwBuildToolBar( oCrt )
//
STATIC FUNCTION BrwHandleKey( oBrowse, nKey, lEnd )
LOCAL lVMove := .F.
LOCAL lHMove := .F.
LOCAL lRet := .T.
@@ -697,7 +715,7 @@ STATIC FUNCTION BrwHandleKey( oBrowse, nKey, lEnd )
ENDCASE
IF lHMove .or. lVMove
IF lHMove .OR. lVMove
oBrowse:forceStable()
ENDIF
@@ -706,10 +724,11 @@ STATIC FUNCTION BrwHandleKey( oBrowse, nKey, lEnd )
//
FUNCTION Vou_NavigateToCell( oBrowse )
LOCAL nCount
IF LastKey() == K_LBUTTONUP
IF oBrowse:hitTest( mrow(), mcol() ) == -5121 // on a cell
IF oBrowse:HitTest( MRow(), MCol() ) == -5121 // on a cell
oBrowse:deHilite()
oBrowse:refreshCurrent()
oBrowse:forceStable()
@@ -717,23 +736,23 @@ FUNCTION Vou_NavigateToCell( oBrowse )
nCount := oBrowse:mRowPos - oBrowse:RowPos
DispBegin()
WHILE ( nCount < 0 )
WHILE nCount < 0
nCount++
oBrowse:Up()
ENDDO
WHILE ( nCount > 0 )
WHILE nCount > 0
nCount --
oBrowse:Down()
ENDDO
nCount := oBrowse:mColPos - oBrowse:ColPos
WHILE ( nCount < 0 )
WHILE nCount < 0
nCount++
oBrowse:Left()
ENDDO
WHILE ( nCount > 0 )
WHILE nCount > 0
nCount--
oBrowse:Right()
ENDDO
@@ -750,16 +769,17 @@ FUNCTION Vou_NavigateToCell( oBrowse )
//
STATIC FUNCTION DbSkipBlock( n )
LOCAL nSkipped := 0
IF n == 0
DBSkip( 0 )
dbSkip( 0 )
ELSEIF n > 0
DO WHILE nSkipped != n .AND. TBNext()
nSkipped++
enddo
else
ENDDO
ELSE
DO WHILE nSkipped != n .AND. TBPrev()
nSkipped--
ENDDO
@@ -770,16 +790,17 @@ STATIC FUNCTION DbSkipBlock( n )
//
STATIC FUNCTION TBNext()
LOCAL nSaveRecNum := recno()
LOCAL nSaveRecNum := RecNo()
LOCAL lMoved := .T.
IF Eof()
IF EOF()
lMoved := .F.
ELSE
DBSkip( 1 )
IF Eof()
dbSkip( 1 )
IF EOF()
lMoved := .F.
DBGoTo( nSaveRecNum )
dbGoto( nSaveRecNum )
ENDIF
ENDIF
@@ -788,13 +809,14 @@ STATIC FUNCTION TBNext()
//
STATIC FUNCTION TBPrev()
LOCAL nSaveRecNum := Recno()
LOCAL nSaveRecNum := RecNo()
LOCAL lMoved := .T.
DBSkip( -1 )
dbSkip( -1 )
IF Bof()
DBGoTo( nSaveRecNum )
IF BOF()
dbGoto( nSaveRecNum )
lMoved := .F.
ENDIF
@@ -803,7 +825,8 @@ STATIC FUNCTION TBPrev()
//
STATIC FUNCTION VouBlockField( i )
RETURN {|| fieldget( i ) }
RETURN {|| FieldGet( i ) }
//
@@ -851,17 +874,17 @@ FUNCTION Vou_BrwSetVScroll( mp1, oBrowse )
EXIT
CASE WVGSB_NEXTPAGE
OrdKeyGoTo( mp1[ 1 ] )
ordKeyGoto( mp1[ 1 ] )
oBrowse:refreshAll()
EXIT
CASE WVGSB_PREVPAGE
OrdKeyGoTo( mp1[ 1 ] )
ordKeyGoto( mp1[ 1 ] )
oBrowse:refreshAll()
EXIT
CASE WVGSB_ENDTRACK
OrdKeyGoTo( mp1[ 1 ] )
ordKeyGoto( mp1[ 1 ] )
oBrowse:refreshAll()
EXIT
@@ -871,13 +894,13 @@ FUNCTION Vou_BrwSetVScroll( mp1, oBrowse )
RETURN NIL
//
/* For brosers inside WvtDialog() */
//
STATIC FUNCTION BrwOnEvent( oWvtBrw, cPaintID, oBrowse, nKey )
LOCAL lRet := .T., lRefAll := .F.
LOCAL lRet := .T. , lRefAll := .F.
HB_SYMBOL_UNUSED( cPaintID )
@@ -935,7 +958,7 @@ STATIC FUNCTION BrwOnEvent( oWvtBrw, cPaintID, oBrowse, nKey )
oBrowse:up()
CASE nKey == K_SBTHUMBTRACKVERT
OrdKeyGoTo( oWvtBrw:oVBar:GetPos() )
ordKeyGoto( oWvtBrw:oVBar:GetPos() )
lRefAll := .T.
CASE nKey == K_SBTHUMBTRACKHORZ
@@ -948,22 +971,22 @@ STATIC FUNCTION BrwOnEvent( oWvtBrw, cPaintID, oBrowse, nKey )
oBrowse:down()
CASE nKey == K_SBPAGEUP
oBrowse:pageUp()
oBrowse:pageUp()
CASE nKey == K_SBPAGEDOWN
oBrowse:pageDown()
CASE nKey == K_SBLINELEFT
oBrowse:left()
oBrowse:Left()
CASE nKey == K_SBLINERIGHT
oBrowse:right()
oBrowse:Right()
CASE nKey == K_SBPAGELEFT
oBrowse:left()
oBrowse:Left()
CASE nKey == K_SBPAGERIGHT
oBrowse:right()
oBrowse:Right()
OTHERWISE
lRet := .F.
@@ -976,8 +999,8 @@ STATIC FUNCTION BrwOnEvent( oWvtBrw, cPaintID, oBrowse, nKey )
ENDIF
oBrowse:forceStable()
oWvtBrw:oVBar:setPos( OrdKeyCount(),OrdKeyNo() )
oWvtBrw:oHBar:setPos( oBrowse:ColCount, oBrowse:ColPos )
oWvtBrw:oVBar:SetPos( ordKeyCount(), ordKeyNo() )
oWvtBrw:oHBar:SetPos( oBrowse:ColCount, oBrowse:ColPos )
ENDIF
RETURN lRet
@@ -985,18 +1008,19 @@ STATIC FUNCTION BrwOnEvent( oWvtBrw, cPaintID, oBrowse, nKey )
//
FUNCTION ConfigBrowser( aFields, cUseAlias, aTLBR, cDesc, oParent, cColorSpec, nID )
LOCAL info_, oWvtBrw, oBrowse, i, bBlock
LOCAL aPopup := {}
aadd( aPopup, { "Down" , {|| oBrowse:Down() , oBrowse:ForceStable() } } )
aadd( aPopup, { "Up" , {|| oBrowse:Up() , oBrowse:ForceStable() } } )
aadd( aPopup, { "Page Down", {|| oBrowse:PageDown(), oBrowse:ForceStable() } } )
aadd( aPopup, { "Page Up" , {|| oBrowse:PageUp() , oBrowse:ForceStable() } } )
aadd( aPopup, { "Top" , {|| oBrowse:GoTop() , oBrowse:ForceStable() } } )
aadd( aPopup, { "Bottom" , {|| oBrowse:GoBottom(), oBrowse:ForceStable() } } )
AAdd( aPopup, { "Down" , {|| oBrowse:Down() , oBrowse:ForceStable() } } )
AAdd( aPopup, { "Up" , {|| oBrowse:Up() , oBrowse:ForceStable() } } )
AAdd( aPopup, { "Page Down", {|| oBrowse:PageDown(), oBrowse:ForceStable() } } )
AAdd( aPopup, { "Page Up" , {|| oBrowse:PageUp() , oBrowse:ForceStable() } } )
AAdd( aPopup, { "Top" , {|| oBrowse:GoTop() , oBrowse:ForceStable() } } )
AAdd( aPopup, { "Bottom" , {|| oBrowse:GoBottom(), oBrowse:ForceStable() } } )
Select( cUseAlias )
info_:= DbStruct()
SELECT( cUseAlias )
info_ := dbStruct()
oBrowse := TBrowseWVG():New( aTLBR[ 1 ], aTLBR[ 2 ], aTLBR[ 3 ], aTLBR[ 4 ] )
@@ -1005,16 +1029,16 @@ FUNCTION ConfigBrowser( aFields, cUseAlias, aTLBR, cDesc, oParent, cColorSpec, n
oBrowse:ColorSpec := cColorSpec
oBrowse:GoTopBlock := {|| dbGoTop() }
oBrowse:GoBottomBlock := {|| dbGoBottom() }
oBrowse:SkipBlock := {| nSkip | dbSkipBlock( nSkip,oBrowse ) }
oBrowse:SkipBlock := {| nSkip | dbSkipBlock( nSkip, oBrowse ) }
FOR i := 1 TO len( aFields )
FOR i := 1 TO Len( aFields )
bBlock := VouBlockField( aFields[ i ] )
oBrowse:AddColumn( TBColumnNew( info_[ aFields[ i ],1 ], bBlock ) )
NEXT
oBrowse:configure()
oWvtBrw := WvtBrowse():New( oParent,nID )
oWvtBrw := WvtBrowse():New( oParent, nID )
oWvtBrw:nTop := aTLBR[ 1 ]
oWvtBrw:nLeft := aTLBR[ 2 ]
@@ -1028,7 +1052,7 @@ FUNCTION ConfigBrowser( aFields, cUseAlias, aTLBR, cDesc, oParent, cColorSpec, n
oWvtBrw:Tooltip := cDesc
oWvtBrw:aPopup := aPopup
oWvtBrw:bHandleEvent := {| oWvtBrw, cPaintID, oBrowse, nKey | BrwOnEvent( oWvtBrw,cPaintID,oBrowse,nKey ) }
oWvtBrw:bHandleEvent := {| oWvtBrw, cPaintID, oBrowse, nKey | BrwOnEvent( oWvtBrw, cPaintID, oBrowse, nKey ) }
RETURN oWvtBrw

View File

@@ -5,6 +5,7 @@
/*
* Pritpal Bedi <bedipritpal@hotmail.com>
*/
//
#include "inkey.ch"
@@ -48,7 +49,7 @@
//
THREAD STATIC t_keys_:= { , , , , , , , , , , , , , , , , , , , }
THREAD STATIC t_keys_ := { , , , , , , , , , , , , , , , , , , , }
THREAD STATIC t_pic_ := { , , , , , , , , , , , , , , , , , , , }
//
@@ -64,7 +65,7 @@ FUNCTION WvtSetKeys( lSet )
t_keys_[ 7 ] := SetKey( K_F7, {|| WvtPartialScreen() } )
t_keys_[ 8 ] := SetKey( K_F8, {|| WvtLines() } )
t_keys_[ 9 ] := SetKey( K_F9, {|| Wvt_ChooseFont() } )
t_keys_[ 10] := SetKey( K_F10,{|| Wvt_ChooseColor() } )
t_keys_[ 10] := SetKey( K_F10, {|| Wvt_ChooseColor() } )
ELSE
SetKey( K_F2, t_keys_[ 2 ] )
SetKey( K_F3, t_keys_[ 3 ] )
@@ -77,51 +78,61 @@ FUNCTION WvtSetKeys( lSet )
SetKey( K_F10, t_keys_[ 10] )
ENDIF
RETURN Nil
RETURN NIL
//
// Wvt_Paint() must be a FUNCTION in your application
// as it is called when Window gets WM_PAINT message.
//
FUNCTION Wvt_Paint()
LOCAL aBlocks := WvtSetBlocks()
aEval( aBlocks, {| e | eval( e ) } )
AEval( aBlocks, {| e | Eval( e ) } )
WvtPaintObjects()
RETURN 0
//
// Wvt_SetFocus() must be a FUNCTION in your application
// needs to process messages sent through WM_SETFOCUS message
// received by the window.
//
#if 0
FUNCTION Wvt_SetFocus()
LOCAL nRow := row()
LOCAL nCol := col()
LOCAL nRow := Row()
LOCAL nCol := Col()
DispOutAt( 1,3, "Focus Gained!", "R/W" )
DispOutAt( 1, 3, "Focus Gained!", "R/W" )
DevPos( nRow, nCol )
RETURN nil
RETURN NIL
#endif
//
// Wvt_KillFocus() must be a FUNCTION in your application
// needs to process messages sent through WM_KILLFOCUS message
// received by the window.
//
#if 0
FUNCTION Wvt_KillFocus()
LOCAL nRow := row()
LOCAL nCol := col()
DispOutAt( 1,3, "Focus Lost...", "B/W" )
FUNCTION Wvt_KillFocus()
LOCAL nRow := Row()
LOCAL nCol := Col()
DispOutAt( 1, 3, "Focus Lost...", "B/W" )
DevPos( nRow, nCol )
RETURN NIL
#endif
//
@@ -132,13 +143,14 @@ FUNCTION Wvt_KillFocus()
//
FUNCTION Wvt_Mouse( nKey, nRow, nCol )
LOCAL nLen, aObjects := WvtSetObjects()
LOCAL nObj
STATIC nLastObj := 0
STATIC nLastKey := 0
STATIC s_nLastObj := 0
STATIC s_nLastKey := 0
IF ( nLen := len( aObjects ) ) == 0
IF ( nLen := Len( aObjects ) ) == 0
RETURN NIL
ENDIF
@@ -150,13 +162,13 @@ FUNCTION Wvt_Mouse( nKey, nRow, nCol )
FOR nObj := 1 TO nLen
DO CASE
CASE aObjects[ nObj, WVT_OBJ_STATE ] == OBJ_STATE_DISP
eval( aObjects[ nObj, WVT_OBJ_ONDISP ] )
Eval( aObjects[ nObj, WVT_OBJ_ONDISP ] )
CASE aObjects[ nObj, WVT_OBJ_STATE ] == OBJ_STATE_MOUSEOVER
eval( aObjects[ nObj, WVT_OBJ_ONMOUSEOVER ] )
Eval( aObjects[ nObj, WVT_OBJ_ONMOUSEOVER ] )
CASE aObjects[ nObj, WVT_OBJ_STATE ] == OBJ_STATE_BUTTONDOWN
eval( aObjects[ nObj, WVT_OBJ_ONBUTTONDOWN ] )
Eval( aObjects[ nObj, WVT_OBJ_ONBUTTONDOWN ] )
CASE aObjects[ nObj, WVT_OBJ_STATE ] == OBJ_STATE_BUTTONUP
eval( aObjects[ nObj, WVT_OBJ_ONDISP ] )
Eval( aObjects[ nObj, WVT_OBJ_ONDISP ] )
CASE aObjects[ nObj, WVT_OBJ_STATE ] == OBJ_STATE_HIDE
ENDCASE
@@ -164,45 +176,45 @@ FUNCTION Wvt_Mouse( nKey, nRow, nCol )
RETURN NIL
ENDIF
nObj := ascan( aObjects, {| e_ | e_[ WVT_OBJ_ROW ] <= nRow .AND. ;
e_[ WVT_OBJ_ROWTO ] >= nRow .AND. ;
e_[ WVT_OBJ_COL ] <= nCol .AND. ;
e_[ WVT_OBJ_COLTO ] >= nCol } )
nObj := AScan( aObjects, {| e_ | e_[ WVT_OBJ_ROW ] <= nRow .AND. ;
e_[ WVT_OBJ_ROWTO ] >= nRow .AND. ;
e_[ WVT_OBJ_COL ] <= nCol .AND. ;
e_[ WVT_OBJ_COLTO ] >= nCol } )
IF nObj == 0
IF nLastObj > 0
aObjects[ nLastObj, WVT_OBJ_STATE ] := OBJ_STATE_DISP
eval( aObjects[ nLastObj, WVT_OBJ_ONDISP ] )
nLastObj := 0
IF s_nLastObj > 0
aObjects[ s_nLastObj, WVT_OBJ_STATE ] := OBJ_STATE_DISP
Eval( aObjects[ s_nLastObj, WVT_OBJ_ONDISP ] )
s_nLastObj := 0
ENDIF
RETURN NIL
ENDIF
IF nLastObj == nObj .and. nLastKey == nKey
IF s_nLastObj == nObj .AND. s_nLastKey == nKey
RETURN NIL
ENDIF
nLastObj := nObj
nLastKey := nKey
s_nLastObj := nObj
s_nLastKey := nKey
DO CASE
CASE nKey == K_MOUSEMOVE
IF aObjects[ nLastObj, WVT_OBJ_STATE ] != OBJ_STATE_MOUSEOVER
aObjects[ nLastObj, WVT_OBJ_STATE ] := OBJ_STATE_MOUSEOVER
IF aObjects[ nObj, WVT_OBJ_ONMOUSEOVER ] != nil
eval( aObjects[ nObj, WVT_OBJ_ONMOUSEOVER ] )
IF aObjects[ s_nLastObj, WVT_OBJ_STATE ] != OBJ_STATE_MOUSEOVER
aObjects[ s_nLastObj, WVT_OBJ_STATE ] := OBJ_STATE_MOUSEOVER
IF aObjects[ nObj, WVT_OBJ_ONMOUSEOVER ] != NIL
Eval( aObjects[ nObj, WVT_OBJ_ONMOUSEOVER ] )
ENDIF
ENDIF
CASE nKey == K_LBUTTONDOWN
aObjects[ nLastObj, WVT_OBJ_STATE ] := OBJ_STATE_BUTTONDOWN
IF aObjects[ nObj, WVT_OBJ_ONBUTTONDOWN ] != nil
eval( aObjects[ nObj, WVT_OBJ_ONBUTTONDOWN ] )
aObjects[ s_nLastObj, WVT_OBJ_STATE ] := OBJ_STATE_BUTTONDOWN
IF aObjects[ nObj, WVT_OBJ_ONBUTTONDOWN ] != NIL
Eval( aObjects[ nObj, WVT_OBJ_ONBUTTONDOWN ] )
ENDIF
CASE nKey == K_LBUTTONUP
aObjects[ nLastObj, WVT_OBJ_STATE ] := OBJ_STATE_DISP
IF aObjects[ nObj, WVT_OBJ_ONBUTTONUP ] != nil
eval( aObjects[ nObj, WVT_OBJ_ONBUTTONUP ] )
aObjects[ s_nLastObj, WVT_OBJ_STATE ] := OBJ_STATE_DISP
IF aObjects[ nObj, WVT_OBJ_ONBUTTONUP ] != NIL
Eval( aObjects[ nObj, WVT_OBJ_ONBUTTONUP ] )
ENDIF
ENDCASE
@@ -214,13 +226,15 @@ FUNCTION Wvt_Mouse( nKey, nRow, nCol )
//
FUNCTION WvtSetBlocks( a_ )
LOCAL o
THREAD STATIC t := {}
o := aclone( t )
o := AClone( t )
IF a_ != nil
t := aclone( a_ )
IF a_ != NIL
t := AClone( a_ )
ENDIF
RETURN o
@@ -230,24 +244,25 @@ FUNCTION WvtSetBlocks( a_ )
//
FUNCTION WvtSetObjects( aObject )
LOCAL oObjects
THREAD STATIC aObjects := {}
THREAD STATIC t_aObjects := {}
oObjects := aclone( aObjects )
oObjects := AClone( t_aObjects )
IF aObject != NIL
IF empty( aObject )
aObjects := {}
IF Empty( aObject )
t_aObjects := {}
ELSE
IF valtype( aObject[ 1 ] ) == "A"
aeval( aObject, {| e_ | aadd( aObjects, e_ ) } )
IF ValType( aObject[ 1 ] ) == "A"
AEval( aObject, {| e_ | AAdd( t_aObjects, e_ ) } )
ELSE
aSize( aObject, WVT_OBJ_VRBLS )
ASize( aObject, WVT_OBJ_VRBLS )
DEFAULT aObject[ WVT_OBJ_STATE ] TO OBJ_STATE_DISP
aadd( aObjects, aObject )
AAdd( t_aObjects, aObject )
ENDIF
ENDIF
ENDIF
@@ -257,44 +272,49 @@ FUNCTION WvtSetObjects( aObject )
//
FUNCTION SetMouseCheck( lYes )
LOCAL lOYes
STATIC lSYes := .T.
lOYes := lSYes
STATIC s_lSYes := .T.
lOYes := s_lSYes
IF lYes != NIL
lSYes := lYes
s_lSYes := lYes
ENDIF
RETURN lOYes
//
FUNCTION WvtWindowExpand( nUnits )
STATIC sUnits := 18
STATIC s_nUnits := 18
sUnits += nUnits
s_nUnits += nUnits
Wvt_setFont( "Courier New", sUnits )
Wvt_setFont( "Courier New", s_nUnits )
RETURN .T.
//
FUNCTION rgb( r,g,b )
FUNCTION rgb( r, g, b )
RETURN r + ( g * 256 ) + ( b * 256 * 256 )
//
FUNCTION VouChoice( aChoices )
LOCAL scr, clr, nChoice
DEFAULT aChoices TO { "One","Two","Three","Four","Five","Six","Seven" }
DEFAULT aChoices TO { "One", "Two", "Three", "Four", "Five", "Six", "Seven" }
scr := SaveScreen( 7,48,13,55 )
scr := SaveScreen( 7, 48, 13, 55 )
clr := SetColor( "N/W*,GR+/B*,,,GR+/B" )
nChoice := aChoice( 7, 48, 13, 55, aChoices )
nChoice := AChoice( 7, 48, 13, 55, aChoices )
setColor( clr )
SetColor( clr )
RestScreen( 7, 48, 13, 55, scr )
RETURN nChoice
@@ -302,28 +322,33 @@ FUNCTION VouChoice( aChoices )
//
FUNCTION Hb_Clear()
CLS
RETURN .F.
//
FUNCTION MyMenuProcedure( nID )
DO CASE
CASE nID == 101
alert( 'Procedure 101' )
Alert( 'Procedure 101' )
CASE nID == 102
alert( 'Procedure 102' )
Alert( 'Procedure 102' )
ENDCASE
RETURN .T.
//
FUNCTION BuildWvgToolBar( oDA, nActiveX )
LOCAL oTBar
DEFAULT nActiveX TO 0
oTBar := WvgToolBar():new( oDA, , { 0,0 }, { oDA:currentSize()[ 1 ], 30 }, , .T. )
oTBar := WvgToolBar():new( oDA, , { 0, 0 }, { oDA:currentSize()[ 1 ], 30 }, , .T. )
oTBar:style := WVGTOOLBAR_STYLE_FLAT
oTBar:borderStyle := WVGFRAME_RECT
@@ -352,43 +377,53 @@ FUNCTION BuildWvgToolBar( oDA, nActiveX )
//
FUNCTION SetGT( nIndex, pGT )
LOCAL oldGT
STATIC pGT_:= { NIL, NIL, NIL }
oldGT := pGT_[ nIndex ]
STATIC s_pGT_ := { NIL, NIL, NIL }
oldGT := s_pGT_[ nIndex ]
IF PCount() == 2
pGT_[ nIndex ] := pGT
s_pGT_[ nIndex ] := pGT
ENDIF
RETURN oldGT
//
FUNCTION SetFonts( hFont )
LOCAL oldFont
THREAD STATIC t_ahFonts := {}
oldFont := t_ahFonts
IF !empty( hFont )
aadd( t_ahFonts, hFont )
IF !Empty( hFont )
AAdd( t_ahFonts, hFont )
ENDIF
RETURN oldFont
//
FUNCTION SetIcons( hIcon )
LOCAL oldIcon
THREAD STATIC t_ahIcons := {}
oldIcon := t_ahIcons
IF !empty( hIcon )
aadd( t_ahIcons, hIcon )
IF !Empty( hIcon )
AAdd( t_ahIcons, hIcon )
ENDIF
RETURN oldIcon
//
FUNCTION Popups( nID, lDestroy )
LOCAL hPop, hPop1
LOCAL nPrompt := MF_ENABLED+MF_STRING
THREAD STATIC hPop_:= { , , , , , , , , }
LOCAL hPop, hPop1
LOCAL nPrompt := MF_ENABLED + MF_STRING
THREAD STATIC t_hPop_ := { , , , , , , , , }
IF nID == NIL
Wvt_SetPopupMenu()
@@ -396,16 +431,16 @@ FUNCTION Popups( nID, lDestroy )
ENDIF
IF lDestroy != NIL
Wvt_DestroyMenu( hPop_[ nID ] )
Wvt_DestroyMenu( t_hPop_[ nID ] )
RETURN NIL
ENDIF
hPop := hPop_[ nID ]
hPop := t_hPop_[ nID ]
DO CASE
CASE nID == 1 // Data Entry Module
IF hPop == nil
IF hPop == NIL
hPop := Wvt_CreatePopupMenu()
Wvt_AppendMenu( hPop, nPrompt, K_F2, "Second Get Screen" )
Wvt_AppendMenu( hPop, nPrompt, K_F3, "Expand Window" )
@@ -415,7 +450,7 @@ FUNCTION Popups( nID, lDestroy )
Wvt_AppendMenu( hPop, nPrompt, K_F7, "Partial Screen" )
Wvt_AppendMenu( hPop, nPrompt, K_F8, "Lines" )
Wvt_AppendMenu( hPop, nPrompt, K_F9, "Choose Font" )
Wvt_AppendMenu( hPop, nPrompt, K_F10,"Choose Color" )
Wvt_AppendMenu( hPop, nPrompt, K_F10, "Choose Color" )
Wvt_AppendMenu( hPop, MF_SEPARATOR )
@@ -442,31 +477,32 @@ FUNCTION Popups( nID, lDestroy )
Wvt_AppendMenu( hPop1, nPrompt, K_END , "End" )
Wvt_AppendMenu( hPop1, nPrompt, K_HOME , "Home" )
Wvt_AppendMenu( hPop, MF_ENABLED+MF_POPUP, hPop1, "Column Movement" )
Wvt_AppendMenu( hPop, MF_ENABLED + MF_POPUP, hPop1, "Column Movement" )
ENDIF
ENDCASE
hPop_[ nID ] := hPop
t_hPop_[ nID ] := hPop
RETURN Wvt_SetPopupMenu( hPop_[ nID ] )
RETURN Wvt_SetPopupMenu( t_hPop_[ nID ] )
//
FUNCTION DispStatusMsg( cMsg )
Wvt_DrawLabel( MaxRow(), 60, cMsg, 6, , 0, rgb(198,198,198), "Arial", 18, , 900 )
Wvt_DrawLabel( MaxRow(), 60, cMsg, 6, , 0, rgb( 198,198,198 ), "Arial", 18, , 900 )
RETURN .T.
//
FUNCTION ClearStatusMsg()
LOCAL nRow := Row()
LOCAL nCol := Col()
DispOutAt( MaxRow(), 42, space( 37 ), "W/W" )
DispOutAt( MaxRow(), 42, Space( 37 ), "W/W" )
SetPos( nRow, nCol )
@@ -474,9 +510,9 @@ FUNCTION ClearStatusMsg()
//
FUNCTION WvtPictures( nSlot,cFilePic )
FUNCTION WvtPictures( nSlot, cFilePic )
IF nSlot != NIL .AND. nSlot <= 20 .AND. file( cFilePic )
IF nSlot != NIL .AND. nSlot <= 20 .AND. File( cFilePic )
IF !( t_pic_[ nSlot ] == cFilePic )
IF Wvt_LoadPicture( cFilePic, nSlot )
t_pic_[ nSlot ] := cFilePic
@@ -499,15 +535,17 @@ FUNCTION WvtExePicture( nTop, nLeft, nBottom, nRight, nSlot, aOffset )
//
FUNCTION GetResource( cName )
RETURN hb_dirBase() + cName
RETURN hb_DirBase() + cName
//
FUNCTION uiDebug( ... )
LOCAL aP := hb_aParams()
LOCAL aP := hb_AParams()
LOCAL s := ""
aeval( aP, {| e | s += hb_valTOstr( e ) + " " } )
AEval( aP, {| e | s += hb_ValToStr( e ) + " " } )
WAPI_OutputDebugString( s )
@@ -520,11 +558,11 @@ FUNCTION MyError( oError )
? oError:description
? oError:operation
? procname( 1 ), procline( 1 )
? procname( 2 ), procline( 2 )
? procname( 3 ), procline( 3 )
? procname( 4 ), procline( 4 )
DO WHILE inkey() != K_ESC
? ProcName( 1 ), ProcLine( 1 )
? ProcName( 2 ), ProcLine( 2 )
? ProcName( 3 ), ProcLine( 3 )
? ProcName( 4 ), ProcLine( 4 )
DO WHILE Inkey() != K_ESC
ENDDO
RETURN NIL

View File

@@ -11,6 +11,7 @@
*
* Pritpal Bedi <bedipritpal@hotmail.com>
*/
//
#include "inkey.ch"
@@ -23,32 +24,35 @@
//
FUNCTION DialogWvgClassesOne( nMode )
Local bBlock
if hb_mtvm()
if nMode == 2
LOCAL bBlock
IF hb_mtvm()
IF nMode == 2
MyDialogOne()
else
ELSE
bBlock := {| oCrt | ;
oCrt := WvgCrt():New( , , { -1,-1 }, { 54,184 }, , .F. ), ;
oCrt:fontName := 'Courier',;
oCrt:fontHeight := 13 ,;
oCrt:fontWidth := 0 ,;
oCrt:Create() ,;
MyDialogOne( oCrt ) ,;
oCrt:destroy() ;
}
oCrt := WvgCrt():New( , , { -1, -1 }, { 54, 184 }, , .F. ), ;
oCrt:fontName := 'Courier', ;
oCrt:fontHeight := 13 , ;
oCrt:fontWidth := 0 , ;
oCrt:Create() , ;
MyDialogOne( oCrt ) , ;
oCrt:destroy() ;
}
hb_threadStart( bBlock )
endif
else
ENDIF
ELSE
MyDialogOne()
endif
ENDIF
RETURN NIL
//
STATIC FUNCTION MyDialogOne( oCrt )
LOCAL aObjects:= WvtSetBlocks( {} )
LOCAL aObjects := WvtSetBlocks( {} )
LOCAL nWinRows, nWinCols, cWinTitle, cFont, nHeight
LOCAL oDlg, oBar, cUseAlias
LOCAL oText, oTBar, aImg_, oImg, oLine, oBox, oBtn, oBtn2
@@ -56,7 +60,7 @@ STATIC FUNCTION MyDialogOne( oCrt )
LOCAL oBRsd, cTxt, oRct, nGetCol, nSayCol, bBlock, bBlock1
LOCAL oWvtBrw, oWvtBrw1, lOpen, lOpen1, cUseAlias1, oGetArea, oGet1
LOCAL hPopup, nGetRow, aGets_, lChkMouse
LOCAL g_oMenuBar, oPBar2,oPBar3, oMenu
LOCAL g_oMenuBar, oPBar2, oPBar3, oMenu
HB_SYMBOL_UNUSED( oCrt )
@@ -75,13 +79,13 @@ STATIC FUNCTION MyDialogOne( oCrt )
cTxt := cTxt + "Enjoy - Pritpal Bedi, INDIA"
aImg_ := {}
aadd( aImg_, GetResource( "v_lock.bmp" ) )
aadd( aImg_, GetResource( "v_new.bmp" ) )
aadd( aImg_, GetResource( "v_clclt.bmp" ) )
aadd( aImg_, GetResource( "v_calend.bmp" ) )
aadd( aImg_, GetResource( "v_index.bmp" ) )
aadd( aImg_, GetResource( "v_notes1.bmp" ) )
aadd( aImg_, GetResource( "v_selct1.bmp" ) )
AAdd( aImg_, GetResource( "v_lock.bmp" ) )
AAdd( aImg_, GetResource( "v_new.bmp" ) )
AAdd( aImg_, GetResource( "v_clclt.bmp" ) )
AAdd( aImg_, GetResource( "v_calend.bmp" ) )
AAdd( aImg_, GetResource( "v_index.bmp" ) )
AAdd( aImg_, GetResource( "v_notes1.bmp" ) )
AAdd( aImg_, GetResource( "v_selct1.bmp" ) )
? '.'
Wvt_ShowWindow( 1 )
nWinRows := 55
@@ -92,10 +96,10 @@ STATIC FUNCTION MyDialogOne( oCrt )
oDlg := WvtDialog():New( nWinRows, nWinCols, cWinTitle, cFont, nHeight )
oDlg:nTooltipWidth := 300
oDlg:nTooltipTextColor := RGB( 255,0,0 )
oDlg:nTooltipTextColor := RGB( 255, 0, 0 )
oBar := WvtStatusBar():New( oDlg,201 )
oBar:SetPanels( { 50,100 } )
oBar := WvtStatusBar():New( oDlg, 201 )
oBar:SetPanels( { 50, 100 } )
oBar:SetText( 1, "Tab.SH_Tab.Left_Click - Select a Browse" )
oBar:SetText( 2, "GtWvt is Fantastic", "w+/W" )
oBar:SetText( 3, "WOW" )
@@ -103,11 +107,11 @@ STATIC FUNCTION MyDialogOne( oCrt )
oBar:Tooltip := "GtWvt Statusbar with 3 panels"
oDlg:AddObject( oBar )
oBox := WvtStatic():New( oDlg,110,4,oDlg:MaxCol()-40,7,oDlg:MaxCol()-2 )
oBox := WvtStatic():New( oDlg, 110, 4, oDlg:MaxCol() - 40, 7, oDlg:MaxCol() - 2 )
oBox:nStatic := WVT_STATIC_BOXRECESSED
oDlg:AddObject( oBox )
oText := WvtLabel():New( oDlg, 101, 4, oDlg:MaxCol()-40, 7,oDlg:MaxCol()-2 )
oText := WvtLabel():New( oDlg, 101, 4, oDlg:MaxCol() - 40, 7, oDlg:MaxCol() - 2 )
oText:Text := "Harbour"
oText:nFontHeight := 36
oText:nAlignHorz := 2
@@ -122,12 +126,12 @@ STATIC FUNCTION MyDialogOne( oCrt )
oText:bOnSelect := {|| .T. }
oDlg:AddObject( oText )
oImg := WvtImage():New( oDlg,102,20,oDlg:MaxCol()-40,37,oDlg:MaxCol()-2 )
oImg := WvtImage():New( oDlg, 102, 20, oDlg:MaxCol() - 40, 37, oDlg:MaxCol() - 2 )
oImg:cImage := aImg_[ 5 ]
oImg:Tooltip := "WvtImage():New()"
oDlg:AddObject( oImg )
oTBar := WvtToolbar():New( oDlg,103, 0,0,2 )
oTBar := WvtToolbar():New( oDlg, 103, 0, 0, 2 )
oTBar:lFloating := .F.
oTBar:Tooltip := "Toolbar"
oTBar:AddButton( aImg_[ 1 ], {|| oImg:SetImage( aImg_[ 1 ] ) } , "Lock" )
@@ -145,11 +149,11 @@ STATIC FUNCTION MyDialogOne( oCrt )
oLine:nStatic := WVT_STATIC_LINE
oDlg:AddObject( oLine )
oBBox := WvtStatic():New( oDlg,125,4,127,37,139 )
oBBox := WvtStatic():New( oDlg, 125, 4, 127, 37, 139 )
oBBox:nStatic := WVT_STATIC_BOXGROUP
oDlg:AddObject( oBBox )
oBtn := WvtPushButton():New(oDlg, 124, 6, 129, 7, 137 )
oBtn := WvtPushButton():New( oDlg, 124, 6, 129, 7, 137 )
oBtn:cCaption := "Print"
oBtn:bOnLeftUp := {|| Wvt_Keyboard( 379 ) }
oBtn:Tooltip := "Open Printing Dialog for the Browser in Focus"
@@ -162,7 +166,7 @@ STATIC FUNCTION MyDialogOne( oCrt )
oDlg:AddObject( oBtn2 )
oPBar2 := WvtProgressBar():New( oDlg, , 14, 129, 25, 137 )
oPBar2:nBarColor := RGB( 240,240,0 )
oPBar2:nBarColor := RGB( 240, 240, 0 )
oPBar2:cBackColor := "W/N*"
oPBar2:lVertical := .T.
oPBar2:nDirection := 0
@@ -170,14 +174,14 @@ STATIC FUNCTION MyDialogOne( oCrt )
oDlg:AddObject( oPBar2 )
oPBar3 := WvtProgressBar():New( oDlg, , 26, 129, 36, 137 )
oPBar3:nBarColor := RGB( 240,240,0 )
oPBar3:nBarColor := RGB( 240, 240, 0 )
oPBar3:cBackColor := "W/N*"
oPBar3:lVertical := .T.
oPBar3:nDirection := 1
oPBar3:cImage := GetResource( "vouch1.bmp" )
oDlg:AddObject( oPBar3 )
oBBox2 := WvtStatic():New( oDlg, , 9, oDlg:MaxCol()-40, 18, oDlg:Maxcol()-2 )
oBBox2 := WvtStatic():New( oDlg, , 9, oDlg:MaxCol() - 40, 18, oDlg:MaxCol() - 2 )
oBBox2:nStatic := WVT_STATIC_BOXGROUP
oDlg:AddObject( oBBox2 )
@@ -185,55 +189,55 @@ STATIC FUNCTION MyDialogOne( oCrt )
oDlg:AddObject( oCon )
nGetCol := 158
bBlock := {|| oCon:Say( 12, 148, "Name" ,"N/W" ),;
oCon:Say( 14, 148, "Date" ,"N/W" ),;
oCon:Say( 16, 148, "Amount","N/W" ) }
bBlock := {|| oCon:Say( 12, 148, "Name" , "N/W" ), ;
oCon:Say( 14, 148, "Date" , "N/W" ), ;
oCon:Say( 16, 148, "Amount", "N/W" ) }
oGet := WvtGets():New( oDlg, 210, 9, oDlg:Maxcol()-40, 18, oDlg:Maxcol()-2 )
oGet:AddGets( 12, nGetCol, "GTWvt ", "@! ","W+/B*,N/W*" )
oGet:AddGets( 14, nGetCol, date() )
oGet:AddGets( 16, nGetCol, 2122.57, "@Z 99999999.99","w+/R,GR+/B" )
oGet := WvtGets():New( oDlg, 210, 9, oDlg:MaxCol() - 40, 18, oDlg:MaxCol() - 2 )
oGet:AddGets( 12, nGetCol, "GTWvt ", "@! ", "W+/B*,N/W*" )
oGet:AddGets( 14, nGetCol, Date() )
oGet:AddGets( 16, nGetCol, 2122.57, "@Z 99999999.99", "w+/R,GR+/B" )
oGet:Tooltip := "WvtGets():New() - ReadModal() like Clipper"
oGet:cDesc := "Normal Get Box"
oGet:bOnCreate := bBlock
oDlg:AddObject( oGet )
oBnr := WvtBanner():New( oDlg, 101, 0, 127, 1, oDlg:MaxCol()-2 )
oBnr := WvtBanner():New( oDlg, 101, 0, 127, 1, oDlg:MaxCol() - 2 )
oBnr:nTimeDelay := 0.25
oBnr:cText := "the compiler that EXTENDS with you"
oBnr:nFontHeight := 24
oBnr:nFontWeight := 0
oBnr:nDirection := 0
oBnr:nAlignVert := 2
oBnr:nTextColor := RGB( 253,251,170 )
oBnr:nBackColor := RGB( 128,227,142 )
oBnr:nTextColorHoverOn := RGB( 255,255, 0 )
oBnr:nBackColorHoverOn := RGB( 255,100, 12 )
oBnr:nTextColor := RGB( 253, 251, 170 )
oBnr:nBackColor := RGB( 128, 227, 142 )
oBnr:nTextColorHoverOn := RGB( 255, 255, 0 )
oBnr:nBackColorHoverOn := RGB( 255, 100, 12 )
oBnr:Tooltip := "WvtBanner():New()"
oDlg:AddObject( oBnr )
oBRsd := WvtStatic():New( oDlg, , 41,127,52,oDlg:MaxCol()-2 )
oBRsd := WvtStatic():New( oDlg, , 41, 127, 52, oDlg:MaxCol() - 2 )
oBRsd:nStatic := WVT_STATIC_BOXGROUPRAISED
oDlg:AddObject( oBRsd )
oRct := WvtStatic():New( oDlg, , 41,127,52,oDlg:MaxCol()-2 )
oRct := WvtStatic():New( oDlg, , 41, 127, 52, oDlg:MaxCol() - 2 )
oRct:nStatic := WVT_STATIC_SHADEDRECT
oRct:aRGBb := { 0xffff, 0x0000, 0x0000, 0x0000 }
oRct:aRGBe := { 0x0000, 0xffff, 0xffff, 0x0000 }
oDlg:AddObject( oRct )
oTBx := WvtTextBox():New( oDlg, , 42,129,51,oDlg:MaxCol()-4 )
oTBx := WvtTextBox():New( oDlg, , 42, 129, 51, oDlg:MaxCol() - 4 )
oTBx:cText := cTxt
oTBx:Tooltip := "WvtTextBox():New()"
oTBx:nFontHeight := 16
oTBx:lItalic := .T.
oTBx:lUnderline := .T.
oTBx:nAlignHorz := 2
oTBx:nTextColor := RGB( 255,255,255 )
oTBx:nTextColorHoverOn := RGB( 0,0,255 )
oTBx:nTextColor := RGB( 255, 255, 255 )
oTBx:nTextColorHoverOn := RGB( 0, 0, 255 )
oTBx:aPopup := {}
aadd( oTBx:aPopup, { "Getsome" , {|| .T. } } )
aadd( oTBx:aPopup, { "Getsome2", {|| .T. } } )
AAdd( oTBx:aPopup, { "Getsome" , {|| .T. } } )
AAdd( oTBx:aPopup, { "Getsome2", {|| .T. } } )
oDlg:AddObject( oTBx )
oGetArea := WvtStatic():New( oDlg, , 4, 2, 37, 62 )
@@ -243,36 +247,36 @@ STATIC FUNCTION MyDialogOne( oCrt )
nGetCol := 20
nSayCol := 7
nGetRow := 7
bBlock1 := {|| oCon:Say( nGetRow+00, nSayCol, "First Name" ,"N/W" ),;
oCon:Say( nGetRow+02, nSayCol, "Last Name " ,"N/W" ),;
oCon:Say( nGetRow+04, nSayCol, "Street" ,"N/W" ),;
oCon:Say( nGetRow+06, nSayCol, "City" ,"W+/W"),;
oCon:Say( nGetRow+08, nSayCol, "State" ,"N/W" ),;
oCon:Say( nGetRow+10, nSayCol, "Zip" ,"B+/W"),;
oCon:Say( nGetRow+12, nSayCol, "Date Hired" ,"B+/W"),;
oCon:Say( nGetRow+14, nSayCol, "Married" ,"B+/W"),;
oCon:Say( nGetRow+16, nSayCol, "Age" ,"B+/W"),;
oCon:Say( nGetRow+18, nSayCol, "Salary" ,"B+/W"),;
oCon:Say( nGetRow+20, nSayCol, "Notes", ,"B+/W") ;
}
bBlock1 := {|| oCon:Say( nGetRow + 00, nSayCol, "First Name" , "N/W" ), ;
oCon:Say( nGetRow + 02, nSayCol, "Last Name " , "N/W" ), ;
oCon:Say( nGetRow + 04, nSayCol, "Street" , "N/W" ), ;
oCon:Say( nGetRow + 06, nSayCol, "City" , "W+/W" ), ;
oCon:Say( nGetRow + 08, nSayCol, "State" , "N/W" ), ;
oCon:Say( nGetRow + 10, nSayCol, "Zip" , "B+/W" ), ;
oCon:Say( nGetRow + 12, nSayCol, "Date Hired" , "B+/W" ), ;
oCon:Say( nGetRow + 14, nSayCol, "Married" , "B+/W" ), ;
oCon:Say( nGetRow + 16, nSayCol, "Age" , "B+/W" ), ;
oCon:Say( nGetRow + 18, nSayCol, "Salary" , "B+/W" ), ;
oCon:Say( nGetRow + 20, nSayCol, "Notes", , "B+/W" ) ;
}
aGets_:= { pad("Pritpal",20 ), pad( "Bedi",20 ), pad( "60, New Professor Colony",30 ), ;
pad( "Ludhiana, INDIA",30 ),;
"PB", pad( "141004",10 ), stod( "20040622" ), .T., 48, 17000, ;
pad( "Wvtgui is a classical example of Harbour capabilities...",65 ) }
aGets_ := { Pad( "Pritpal", 20 ), Pad( "Bedi", 20 ), Pad( "60, New Professor Colony", 30 ), ;
Pad( "Ludhiana, INDIA", 30 ), ;
"PB", Pad( "141004", 10 ), SToD( "20040622" ), .T. , 48, 17000, ;
Pad( "Wvtgui is a classical example of Harbour capabilities...", 65 ) }
oGet1 := WvtGets():New( oDlg, , 4, 2, 37, 62 )
oGet1:AddGets( nGetRow+00, nGetCol, aGets_[ 1 ], "@ " , "N/W*,N/GR*" )
oGet1:AddGets( nGetRow+02, nGetCol, aGets_[ 2 ], "@ " , "N/W*,N/GR*" )
oGet1:AddGets( nGetRow+04, nGetCol, aGets_[ 3 ], "@ " , "N/W*,N/GR*" )
oGet1:AddGets( nGetRow+06, nGetCol, aGets_[ 4 ], "@ " , "N/W*,N/GR*" )
oGet1:AddGets( nGetRow+08, nGetCol, aGets_[ 5 ], "@ " , "N/W*,N/GR*" )
oGet1:AddGets( nGetRow+10, nGetCol, aGets_[ 6 ], "@ " , "N/W*,N/GR*" )
oGet1:AddGets( nGetRow+12, nGetCol, aGets_[ 7 ], "@ " , "N/W*,N/GR*" )
oGet1:AddGets( nGetRow+14, nGetCol, aGets_[ 8 ], "@Y" , "N/W*,N/GR*" )
oGet1:AddGets( nGetRow+16, nGetCol, aGets_[ 9 ], "@Z 99" , "N/W*,N/GR*" )
oGet1:AddGets( nGetRow+18, nGetCol, aGets_[ 10], "@Z 999999", "N/W*,N/GR*" )
oGet1:AddGets( nGetRow+20, nGetCol, aGets_[ 11], "@S35" , "N/W*,N/GR*" )
oGet1:AddGets( nGetRow + 00, nGetCol, aGets_[ 1 ], "@ " , "N/W*,N/GR*" )
oGet1:AddGets( nGetRow + 02, nGetCol, aGets_[ 2 ], "@ " , "N/W*,N/GR*" )
oGet1:AddGets( nGetRow + 04, nGetCol, aGets_[ 3 ], "@ " , "N/W*,N/GR*" )
oGet1:AddGets( nGetRow + 06, nGetCol, aGets_[ 4 ], "@ " , "N/W*,N/GR*" )
oGet1:AddGets( nGetRow + 08, nGetCol, aGets_[ 5 ], "@ " , "N/W*,N/GR*" )
oGet1:AddGets( nGetRow + 10, nGetCol, aGets_[ 6 ], "@ " , "N/W*,N/GR*" )
oGet1:AddGets( nGetRow + 12, nGetCol, aGets_[ 7 ], "@ " , "N/W*,N/GR*" )
oGet1:AddGets( nGetRow + 14, nGetCol, aGets_[ 8 ], "@Y" , "N/W*,N/GR*" )
oGet1:AddGets( nGetRow + 16, nGetCol, aGets_[ 9 ], "@Z 99" , "N/W*,N/GR*" )
oGet1:AddGets( nGetRow + 18, nGetCol, aGets_[ 10], "@Z 999999", "N/W*,N/GR*" )
oGet1:AddGets( nGetRow + 20, nGetCol, aGets_[ 11], "@S35" , "N/W*,N/GR*" )
oGet1:cDesc := "test.dbf Fields"
oGet1:Tooltip := "Double Click to Activate ReadModal()"
oGet1:bOnCreate := bBlock1
@@ -284,55 +288,56 @@ STATIC FUNCTION MyDialogOne( oCrt )
oMenu:AddItem( "Dialog Two", {|| DialogWvgClassesTwo() } )
oMenu:AddItem( "-" )
oMenu:AddItem( "Exit", {|| Wvt_Keyboard( K_ESC ) } )
g_oMenuBar:addItem( "",oMenu )
g_oMenuBar:addItem( "", oMenu )
oDlg:oMenu := g_oMenuBar
lOpen := .F.
cUseAlias := "TEST"
USE ( hb_DirBase() + ".." + hb_ps() + ".." + hb_ps() + ".." + hb_ps() + "tests" + hb_ps() + "test.dbf" ) NEW ALIAS ( cUseAlias ) SHARED
if !NetErr()
USE ( hb_DirBase() + ".." + hb_ps() + ".." + hb_ps() + ".." + hb_ps() + "tests" + hb_ps() + "test.dbf" ) NEW Alias ( cUseAlias ) SHARED
IF !NetErr()
lOpen := .T.
oWvtBrw := ConfigBrowser( { 1,7,9,10,8 }, cUseAlias, { 6,67,36,120 }, "test.dbf - 1,7,9,10,8", oDlg, "N/W*,N/GR*",1001 )
oWvtBrw := ConfigBrowser( { 1, 7, 9, 10, 8 }, cUseAlias, { 6, 67, 36, 120 }, "test.dbf - 1,7,9,10,8", oDlg, "N/W*,N/GR*", 1001 )
oDlg:AddObject( oWvtBrw )
endif
ENDIF
lOpen1 := .F.
cUseAlias1 := "TEST1"
USE ( hb_DirBase() + ".." + hb_ps() + ".." + hb_ps() + ".." + hb_ps() + "tests" + hb_ps() + "test.dbf" ) NEW ALIAS ( cUseAlias1 ) SHARED
if !NetErr()
USE ( hb_DirBase() + ".." + hb_ps() + ".." + hb_ps() + ".." + hb_ps() + "tests" + hb_ps() + "test.dbf" ) NEW Alias ( cUseAlias1 ) SHARED
IF !NetErr()
lOpen1 := .T.
oWvtBrw1 := ConfigBrowser( { 1,2,3,4,5,6 }, cUseAlias1, { 43,4,51,120 }, "test.dbf - 1,2,3,4,5,6",oDlg, "N/BG*,N/W*",1002 )
oWvtBrw1 := ConfigBrowser( { 1, 2, 3, 4, 5, 6 }, cUseAlias1, { 43, 4, 51, 120 }, "test.dbf - 1,2,3,4,5,6", oDlg, "N/BG*,N/W*", 1002 )
oDlg:AddObject( oWvtBrw1 )
endif
ENDIF
Setkey( K_F12, {|| hb_gtInfo( HB_GTI_SPEC, HB_GTS_FACTOR, 200 ) } )
SetKey( K_F12, {|| hb_gtInfo( HB_GTI_SPEC, HB_GTS_FACTOR, 200 ) } )
oDlg:Create()
oDlg:Execute()
oDlg:Destroy()
if lOpen
Select( cUseAlias )
IF lOpen
SELECT( cUseAlias )
USE
endif
if lOpen1
Select( cUseAlias1 )
ENDIF
IF lOpen1
SELECT( cUseAlias1 )
USE
endif
ENDIF
WvtSetBlocks( aObjects )
WvtSetKeys( .T. )
Wvt_SetPopupMenu( hPopup )
SetMouseCheck( lChkMouse )
RETURN Nil
RETURN NIL
//
FUNCTION DialogWvgClassesTwo()
LOCAL aObjects := WvtSetBlocks( {} )
LOCAL oDlg := WvtDialog():New( 30,90,"My Dialog Two" )
LOCAL oDlg := WvtDialog():New( 30, 90, "My Dialog Two" )
LOCAL g_oMenuBar, oMenu, oPBar
LOCAL oPBar1, oPBar2, oPBar3, oPBar4
@@ -342,25 +347,25 @@ FUNCTION DialogWvgClassesTwo()
oMenu:AddItem( "Progressbar", {|| ExeProgBar( oPBar,oPBar1,oPBar2,oPBar3, oPBar4 ) } )
oMenu:AddItem( "-" )
oMenu:AddItem( "Exit", {|| Wvt_Keyboard( K_ESC ) } )
g_oMenuBar:addItem( "",oMenu )
g_oMenuBar:addItem( "", oMenu )
oDlg:oMenu := g_oMenuBar
oPBar := WvtProgressBar():New( oDlg, , 3, 10, 5, 80 )
oPBar:nBarColor := RGB( 0,240,240 )
oPBar:nBarColor := RGB( 0, 240, 240 )
oPBar:cBackColor := "W/N*"
oPBar:nDirection := 1
oPBar:cImage := "vouch1.bmp"
oDlg:AddObject( oPBar )
oPBar1 := WvtProgressBar():New( oDlg, , 7, 10, 8, 80 )
oPBar1:nBarColor := RGB( 11,255,196 )
oPBar1:nBarColor := RGB( 11, 255, 196 )
oPBar1:cBackColor := "W/N*"
oPBar1:nDirection := 0
oDlg:AddObject( oPBar1 )
oPBar2 := WvtProgressBar():New( oDlg, , 11, 10, 28, 19 )
oPBar2:nBarColor := RGB( 240,240,0 )
oPBar2:nBarColor := RGB( 240, 240, 0 )
oPBar2:cBackColor := "W/N*"
oPBar2:lVertical := .T.
oPBar2:nDirection := 0
@@ -368,14 +373,14 @@ FUNCTION DialogWvgClassesTwo()
oDlg:AddObject( oPBar2 )
oPBar3 := WvtProgressBar():New( oDlg, , 11, 77, 28, 80 )
oPBar3:nBarColor := RGB( 0,0,255 )
oPBar3:nBarColor := RGB( 0, 0, 255 )
oPBar3:cBackColor := "W/N*"
oPBar3:lVertical := .T.
oPBar3:nDirection := 1
oDlg:AddObject( oPBar3 )
oPBar4 := WvtProgressBar():New( oDlg, , 22, 22, 28, 74 )
oPBar4:nBarColor := RGB( 255,255,0 )
oPBar4:nBarColor := RGB( 255, 255, 0 )
oPBar4:cBackColor := "W/N*"
oPBar4:lVertical := .T.
oPBar4:nDirection := 0
@@ -386,11 +391,13 @@ FUNCTION DialogWvgClassesTwo()
oDlg:Destroy()
WvtSetBlocks( aObjects )
RETURN Nil
RETURN NIL
//
STATIC FUNCTION ExeProgBar( oPBar,oPBar1,oPBar2,oPBar3,oPBar4 )
STATIC FUNCTION ExeProgBar( oPBar, oPBar1, oPBar2, oPBar3, oPBar4 )
LOCAL i
oPBar:Activate()
@@ -398,35 +405,36 @@ STATIC FUNCTION ExeProgBar( oPBar,oPBar1,oPBar2,oPBar3,oPBar4 )
oPBar2:Activate()
oPBar3:Activate()
oPBar4:Activate()
for i := 1 to 100
FOR i := 1 TO 100
oPBar:Display( i, 100 )
oPBar1:Display( i, 100 )
oPBar2:Display( i, 100 )
oPBar3:Display( i, 100 )
oPBar4:Display( i, 100 )
inkey( 0.3 )
next
inkey( 0 )
Inkey( 0.3 )
NEXT
Inkey( 0 )
oPBar:DeActivate()
oPBar1:DeActivate()
oPBar2:DeActivate()
oPBar3:DeActivate()
oPBar4:DeActivate()
RETURN nil
RETURN NIL
//
STATIC FUNCTION ExeProgressBar( oPBar, oPBar3 )
LOCAL i
oPBar:Activate()
oPBar3:Activate()
for i := 1 to 100
FOR i := 1 TO 100
oPBar:Display( i, 100 )
oPBar3:Display( i, 100 )
inkey( 0.3 )
next
Inkey( 0.3 )
NEXT
oPBar:DeActivate()
oPBar3:DeActivate()

View File

@@ -26,15 +26,16 @@
//
FUNCTION demoxbp()
Local oCrt, oTBar, oSBar, oStatic, oCom, oXbp, oTree, oItem1, oItem2
LOCAL oCrt, oTBar, oSBar, oStatic, oCom, oXbp, oTree, oItem1, oItem2
LOCAL oListBox, oCheck, oRadio, oStatic2, oMLE, oAddr
LOCAL oPanel, oPanel1, oPanel2, cText, cNavigate, oDA
LOCAL cVarA := "Test A", cVarB := "Test B"
LOCAL aState := {"not selected", "selected", "undefined"}
LOCAL aState := { "not selected", "selected", "undefined" }
LOCAL aParts := {}
//--------------------------- Dialog -------------------------------\\
oCrt := WvgDialog():new( , , { 30,30 }, { 900,600 }, , .T. )
oCrt := WvgDialog():new( , , { 30, 30 }, { 900, 600 }, , .T. )
oCrt:closable := .T.
oCrt:icon := GetResource( "vr_1.ico" )
oCrt:create()
@@ -63,10 +64,10 @@ FUNCTION demoxbp()
oStatic := WvgStatic():new( oDA )
oStatic:type := WVGSTATIC_TYPE_TEXT
oStatic:options := WVGSTATIC_TEXT_CENTER
oStatic:caption := chr(13)+'Implemented Xbase++ Parts'
oStatic:caption := Chr( 13 ) + 'Implemented Xbase++ Parts'
oStatic:create( , , { 0, oTBar:currentSize()[2]+3 }, { 120, oCrt:currentSize()[2]-;
oTBar:currentSize()[2]-oSBar:currentSize()[2]-4 }, , .T. )
oStatic:create( , , { 0, oTBar:currentSize()[ 2 ] + 3 }, { 120, oCrt:currentSize()[ 2 ] - ;
oTBar:currentSize()[ 2 ] - oSBar:currentSize()[ 2 ] - 4 }, , .T. )
oStatic:setColorBG( RGB( 200,200,200 ) )
//--------------------------- ListBox -----------------------------\\
@@ -74,46 +75,46 @@ FUNCTION demoxbp()
oListBox:create( oStatic, , { 5, 55 }, { 107, 380 } )
oListBox:setColorFG( RGB( 218,61,34 ) )
//oListBox:setColorBG( RGB( 250,244,182 ) )
// oListBox:setColorBG( RGB( 250,244,182 ) )
aadd( aParts, 'XbpDialog' )
aadd( aParts, 'XbpMenuBar' )
aadd( aParts, 'XbpToolBar' )
aadd( aParts, 'XbpToolBarButton' )
aadd( aParts, 'XbpStatusBar' )
aadd( aParts, 'XbpStatic' )
aadd( aParts, 'XbpTreeView' )
aadd( aParts, 'XbpTreeViewItem' )
aadd( aParts, 'XbpActiveXControl')
aadd( aParts, 'XbpListBox' )
aadd( aParts, 'XbpPushButton' )
aadd( aParts, 'XbpCheckBox' )
aadd( aParts, 'XbpRadioButton' )
aadd( aParts, 'Xbp3State' )
aadd( aParts, 'XbpSLE' )
aadd( aParts, 'XbpMLE' )
aadd( aParts, 'XbpHTMLViewer' )
aadd( aParts, 'XbpSysWindow' )
aadd( aParts, 'XbpFontDialog' )
aadd( aParts, 'XbpFont' )
aadd( aParts, '-------------' )
aadd( aParts, 'DataRef' )
AAdd( aParts, 'XbpDialog' )
AAdd( aParts, 'XbpMenuBar' )
AAdd( aParts, 'XbpToolBar' )
AAdd( aParts, 'XbpToolBarButton' )
AAdd( aParts, 'XbpStatusBar' )
AAdd( aParts, 'XbpStatic' )
AAdd( aParts, 'XbpTreeView' )
AAdd( aParts, 'XbpTreeViewItem' )
AAdd( aParts, 'XbpActiveXControl' )
AAdd( aParts, 'XbpListBox' )
AAdd( aParts, 'XbpPushButton' )
AAdd( aParts, 'XbpCheckBox' )
AAdd( aParts, 'XbpRadioButton' )
AAdd( aParts, 'Xbp3State' )
AAdd( aParts, 'XbpSLE' )
AAdd( aParts, 'XbpMLE' )
AAdd( aParts, 'XbpHTMLViewer' )
AAdd( aParts, 'XbpSysWindow' )
AAdd( aParts, 'XbpFontDialog' )
AAdd( aParts, 'XbpFont' )
AAdd( aParts, '-------------' )
AAdd( aParts, 'DataRef' )
aeval( aParts, {| e | oListBox:addItem( e ) } )
AEval( aParts, {| e | oListBox:addItem( e ) } )
oListBox:itemSelected := {|| WVG_MessageBox( , oListBox:getCurItem() ) }
oListBox:setData( 3 ) // show selected 'XbpToolBar'
//--------------------------- PushButton --------------------------\\
oXbp := WvgPushButton():new( oStatic )
oXbp:caption := "Hide"
oXbp:create( , , { 20,440 }, {80,30} )
oXbp:activate:= {|| oStatic:hide(), oCrt:sendMessage( WM_SIZE, 0, 0 ) }
oXbp:create( , , { 20, 440 }, { 80, 30 } )
oXbp:activate := {|| oStatic:hide(), oCrt:sendMessage( WM_SIZE, 0, 0 ) }
//--------------------------- TreeView ---------------------------\\
oTree := WvgTreeView():new( oDA, , { oCrt:currentSize()[1]-160,oTBar:currentSize()[2]+3 }, ;
{ 160, oCrt:currentSize()[2]-;
oTBar:currentSize()[2]-oSBar:currentSize()[2]-4 }, , .T. )
oTree := WvgTreeView():new( oDA, , { oCrt:currentSize()[ 1 ] - 160, oTBar:currentSize()[ 2 ] + 3 }, ;
{ 160, oCrt:currentSize()[ 2 ] - ;
oTBar:currentSize()[ 2 ] - oSBar:currentSize()[ 2 ] - 4 }, , .T. )
oTree:hasLines := .T.
oTree:hasButtons := .T.
oTree:alwaysShowSelection := .T.
@@ -133,26 +134,26 @@ FUNCTION demoxbp()
oItem2:addItem( "Third level B" )
oItem2:addItem( "Third level C" )
#if 0
#if 0
oItem1:expand( .T. )
#else
oTree:showExpanded( .T., 2 )
#endif
#else
oTree:showExpanded( .T. , 2 )
#endif
oTree:setData( oItem2 )
//--------------------------- Active-X ---------------------------\\
hb_gtInfo( HB_GTI_WINTITLE, 'http://www.harbour.vouch.info' )
#if 0
#if 0
oCom := WvgActiveXControl():New( oDA, , { 0, 0 }, { 100, 100 }, , .T. )
oCom:CLSID := 'Shell.Explorer.2'
oCom:mapEvent( 269, {|| QOut( ' E X P L O R E R - 2 6 9' ) } )
#else
#else
oCom := WvgHTMLViewer():New( oDA, , { 0, 0 }, { 100, 100 }, , .T. )
oCom:beforeNavigate := {| cURL, x, oHTML | x := x, oHTML := oHTML, oPanel:caption := cURL }
oCom:statusTextChange := {| cText | oPanel:caption := cText }
oCom:mapEvent( 112, {|| oPanel:caption := ' E X P L O R E R - 2 6 9' } )
#endif
#endif
oCom:create()
oCom:Navigate( 'http://www.harbour.vouch.info' )
@@ -163,52 +164,52 @@ FUNCTION demoxbp()
oAddr:dataLink := {| x | iif( x == NIL, cNavigate, cNavigate := x ) }
oAddr:setColorFG( RGB( 0,0,255 ) )
oAddr:setColorBG( RGB( 0,255,255 ) )
oAddr:create( oDA, , { 120, oTBar:currentSize()[2] }, { 500,20 }, , .T. )
oAddr:create( oDA, , { 120, oTBar:currentSize()[ 2 ] }, { 500, 20 }, , .T. )
oAddr:setData()
oAddr:killInputFocus := {| m1, m2, oS | m1:=m1, m2:=m2, oS:getData(), oCom:navigate( cNavigate ) }
oAddr:killInputFocus := {| m1, m2, oS | m1 := m1, m2 := m2, oS:getData(), oCom:navigate( cNavigate ) }
//----------------- Panel : Static + Radio + Checkbox ----------\\
oStatic2:= WvgStatic():New( oDA, , { 150, 150 }, { 500,310 }, , .F. )
//oStatic2:type := WVGSTATIC_TYPE_RAISEDBOX //BGNDFRAME
oStatic2 := WvgStatic():New( oDA, , { 150, 150 }, { 500, 310 }, , .F. )
// oStatic2:type := WVGSTATIC_TYPE_RAISEDBOX //BGNDFRAME
oStatic2:exStyle += WS_EX_WINDOWEDGE
//oStatic2:options := WVGSTATIC_FRAMETHICK
// oStatic2:options := WVGSTATIC_FRAMETHICK
oStatic2:create()
oStatic2:setColorBG( RGB( 175,175,175 ) )
oXbp := WvgPushButton():new( oStatic2 )
oXbp:caption := "Hide"
oXbp:caption := "Hide"
oXbp:create( , , { 430,275 }, { 60,25 } )
oXbp:create( , , { 430, 275 }, { 60, 25 } )
oXbp:activate := {|| oStatic2:hide(), oCrt:sendMessage( WM_SIZE, 0, 0 ) }
oRadio := WvgRadioButton():new( oStatic2,, { 10,10 }, { 100,15 } )
oRadio := WvgRadioButton():new( oStatic2, , { 10, 10 }, { 100, 15 } )
oRadio:caption := "Com 1"
oRadio:selection := .T.
oRadio:selected := {| m1, m2, obj | m1:=m1, m2:=m2, WVG_MessageBox( , obj:caption + iif( obj:selection, '< S >', '< N >' ) ) }
oRadio:selected := {| m1, m2, obj | m1 := m1, m2 := m2, WVG_MessageBox( , obj:caption + iif( obj:selection, '< S >', '< N >' ) ) }
oRadio:create()
oRadio := WvgRadioButton():new( oStatic2,, { 10,35 }, { 100,15 } )
oRadio := WvgRadioButton():new( oStatic2, , { 10, 35 }, { 100, 15 } )
oRadio:caption := "Com 2"
oRadio:create()
oCheck := WvgCheckBox():New( oStatic2, , { 10,70 }, { 100,15 }, , .T. )
oCheck := WvgCheckBox():New( oStatic2, , { 10, 70 }, { 100, 15 }, , .T. )
oCheck:caption := 'Checkbox A'
oCheck:create()
oCheck:selected := {| m1, m2, o | m1:=m1,m2:=m2, WVG_MessageBox( , iif( o:getData(), 'I am selected','I am not selected' ) ) }
oCheck:selected := {| m1, m2, o | m1 := m1, m2 := m2, WVG_MessageBox( , iif( o:getData(), 'I am selected','I am not selected' ) ) }
// Create first 3State button, passing the position to :create()
oXbp := Wvg3State():new()
oXbp:caption := "3 State A"
oXbp:create( oStatic2, , { 10,100 }, { 100,15 } )
oXbp:create( oStatic2, , { 10, 100 }, { 100, 15 } )
// Determine current state using mp1
oXbp:selected := {| m1, m2, oBtn | m2:=m2, oBtn:=oBtn, oPanel1:caption := "3State A ["+aState[ m1+1 ]+"]" }
oXbp:selected := {| m1, m2, oBtn | m2 := m2, oBtn := oBtn, oPanel1:caption := "3State A [" + aState[ m1+1 ] + "]" }
// Create second 3State Button, passing the position to :new()
oXbp := Wvg3State():new( oStatic2, , { 10,125 }, { 100,15 } )
oXbp := Wvg3State():new( oStatic2, , { 10, 125 }, { 100, 15 } )
oXbp:caption := "3 State B"
oXbp:create( oStatic2 )
// Determine current state using :getData()
oXbp:selected := {| m1, m2, oBtn | m1:=m1,m2:=m2, WVG_MessageBox( , "3State B", aState[ oBtn:getData()+1 ] ) }
oXbp:selected := {| m1, m2, oBtn | m1 := m1, m2 := m2, WVG_MessageBox( , "3State B", aState[ oBtn:getData()+1 ] ) }
// Create first SLE, specify position using :create()
// On :typeOut set the focus to the second SLE
@@ -217,19 +218,19 @@ FUNCTION demoxbp()
oXbp:bufferLength := 20
// Data code block containing assignment to LOCAL variable
oXbp:dataLink := {| x | iif( x == NIL, cVarA, cVarA := x ) }
oXbp:create( oStatic2, , { 10,170 }, { 150,20 } )
oXbp:create( oStatic2, , { 10, 170 }, { 150, 20 } )
oXbp:setData()
// Assign the value of the edit buffer to a LOCAL variable when the input focus is lost
oXbp:killInputFocus := {| x, y, oSLE | x:=x,y:=y, oSLE:getData(), oPanel:caption := "cVarA =" + cVarA }
oXbp:killInputFocus := {| x, y, oSLE | x := x, y := y, oSLE:getData(), oPanel:caption := "cVarA =" + cVarA }
// Create second SLE, specify position using :new()
oXbp := WvgSLE():new( , , { 10,200 }, { 150,20 } )
oXbp := WvgSLE():new( , , { 10, 200 }, { 150, 20 } )
oXbp:tabStop := .T.
oXbp:bufferLength := 15
oXbp:dataLink := {| x | iif( x == NIL, cVarB, cVarB := x ) }
oXbp:create( oStatic2 )
oXbp:setData()
oXbp:killInputFocus := {| x, y, oSLE | x:=x,y:=y, oSLE:getData(), oPanel:caption := "cVarB =" + cVarB }
oXbp:killInputFocus := {| x, y, oSLE | x := x, y := y, oSLE:getData(), oPanel:caption := "cVarB =" + cVarB }
// Read file into LOCAL variable
cText := MemoRead( GetResource( 'gtwvg.hbc' ) )
@@ -238,18 +239,18 @@ FUNCTION demoxbp()
oMLE := WvgMLE():new()
oMLE:wordWrap := .F.
oMLE:border := .T.
oMLE:dataLink := {| x | iif( x==NIL, cText, cText := x ) }
oMLE:create( oStatic2, , { 180,10 }, { 310,250 } )
oMLE:dataLink := {| x | iif( x == NIL, cText, cText := x ) }
oMLE:create( oStatic2, , { 180, 10 }, { 310, 250 } )
// Copy text from LOCAL variable into edit buffer via :dataLink
oMLE:setData()
//--------------------------- Misc Config ------------------------\\
oTBar:buttonClick := {| oBtn | iif( oBtn:caption == 'Hide' , oStatic:hide(), nil ),;
iif( oBtn:caption == 'Show' , oStatic:show(), nil ),;
iif( oBtn:caption == 'Tools' , oStatic2:show():toFront(), nil ),;
iif( oBtn:caption == 'FontDlg', ExeFontDialogXbp( oCrt ), nil ),;
iif( oBtn:caption $ 'Hide,Show', oCrt:sendMessage( WM_SIZE, 0, 0 ), NIL ),;
oPanel2:caption := "Button [ " + oBtn:caption + " ] clicked!" }
oTBar:buttonClick := {| oBtn | iif( oBtn:caption == 'Hide' , oStatic:hide(), NIL ), ;
iif( oBtn:caption == 'Show' , oStatic:show(), NIL ), ;
iif( oBtn:caption == 'Tools' , oStatic2:show():toFront(), NIL ), ;
iif( oBtn:caption == 'FontDlg', ExeFontDialogXbp( oCrt ), NIL ), ;
iif( oBtn:caption $ 'Hide,Show', oCrt:sendMessage( WM_SIZE, 0, 0 ), NIL ), ;
oPanel2:caption := "Button [ " + oBtn:caption + " ] clicked!" }
oCrt:resize := {|| ResizeDialogXbp( oCrt, oTBar, oSBar, oStatic, oCom, oTree, oAddr ) }
@@ -257,18 +258,19 @@ FUNCTION demoxbp()
oCrt:show()
DO WHILE .T.
IF inkey() == K_ESC
IF Inkey() == K_ESC
EXIT
ENDIF
ENDDO
oCrt:Destroy()
Return nil
RETURN NIL
//
STATIC FUNCTION ResizeDialogXbp( oCrt, oTBar, oSBar, oStatic, oCom, oTree, oAddr )
LOCAL aCrt, aTBar, aSBar
LOCAL nH, nT
@@ -276,19 +278,19 @@ STATIC FUNCTION ResizeDialogXbp( oCrt, oTBar, oSBar, oStatic, oCom, oTree, oAddr
aTBar := oTBar:currentSize()
aSBar := oSBar:currentSize()
nT := aTBar[2]
nH := aCrt[2] - aTBar[2] - aSBar[2]
nT := aTBar[ 2 ]
nH := aCrt[ 2 ] - aTBar[ 2 ] - aSBar[ 2 ]
IF oStatic:isVisible
oStatic:setPosAndSize( { 0, nT+3 }, { 120, nH-4 }, .T. )
oAddr:setPosAndSize( { 120, nT+2 }, { aCrt[1]-120-150, 20 }, .T. )
oCom:setPosAndSize( { 120, nT+2+20 }, { aCrt[1]-120-150, nH-20 }, .T. )
oTree:setPosAndSize( { aCrt[1]-150, nT }, { 150, nH }, .T. )
oStatic:setPosAndSize( { 0, nT + 3 }, { 120, nH - 4 }, .T. )
oAddr:setPosAndSize( { 120, nT + 2 }, { aCrt[ 1 ] - 120 - 150, 20 }, .T. )
oCom:setPosAndSize( { 120, nT + 2 + 20 }, { aCrt[ 1 ] - 120 - 150, nH - 20 }, .T. )
oTree:setPosAndSize( { aCrt[ 1 ] - 150, nT }, { 150, nH }, .T. )
ELSE
oAddr:setPosAndSize( { 0, nT+2 }, { aCrt[1]-150, 20 }, .T. )
oCom:setPosAndSize( { 0, nT+2+20 }, { aCrt[1]-150, nH-20 }, .T. )
oTree:setPosAndSize( { aCrt[1]-150, nT }, { 150, nH }, .T. )
oAddr:setPosAndSize( { 0, nT + 2 }, { aCrt[ 1 ] - 150, 20 }, .T. )
oCom:setPosAndSize( { 0, nT + 2 + 20 }, { aCrt[ 1 ] - 150, nH - 20 }, .T. )
oTree:setPosAndSize( { aCrt[ 1 ] - 150, nT }, { 150, nH }, .T. )
ENDIF
@@ -297,7 +299,8 @@ STATIC FUNCTION ResizeDialogXbp( oCrt, oTBar, oSBar, oStatic, oCom, oTree, oAddr
//
STATIC FUNCTION ActiveXBuildMenuXbp( oCrt, oStatic, oStatic2 )
Local oMenuBar, oSubMenu
LOCAL oMenuBar, oSubMenu
oMenuBar := WvgMenuBar():new( oCrt ):create()
@@ -309,7 +312,7 @@ STATIC FUNCTION ActiveXBuildMenuXbp( oCrt, oStatic, oStatic2 )
oSubMenu:title := "~Procedural"
oSubMenu:addItem( { "Play Charge ~1", } )
oSubMenu:addItem( { "Play Nannyboo ~2", } )
oSubMenu:itemSelected := {| mp1 | MyFunctionXbp( 100+mp1 ) }
oSubMenu:itemSelected := {| mp1 | MyFunctionXbp( 100 + mp1 ) }
oMenuBar:addItem( { oSubMenu, NIL } )
// Define submenu in the functional style:
@@ -326,7 +329,7 @@ STATIC FUNCTION ActiveXBuildMenuXbp( oCrt, oStatic, oStatic2 )
oSubMenu := WvgMenu():new( oMenuBar ):create()
oSubMenu:title := "F~eatures"
oSubMenu:addItem( { "~Hide or Show Left Panel" , {|| iif( oStatic:isVisible, ;
oStatic:hide(), oStatic:show() ), oCrt:sendMessage( WM_SIZE,0,0 ) } } )
oStatic:hide(), oStatic:show() ), oCrt:sendMessage( WM_SIZE, 0, 0 ) } } )
oSubMenu:addItem( { "~Show My Panel" , {|| oStatic2:show():toFront() } } )
oSubMenu:addItem()
oSubMenu:addItem( { "~Font Dialog" , {|| ExeFontDialogXbp( oCrt ) } } )
@@ -334,12 +337,14 @@ STATIC FUNCTION ActiveXBuildMenuXbp( oCrt, oStatic, oStatic2 )
oMenuBar:addItem( { oSubMenu, NIL } )
RETURN NIL
//
STATIC FUNCTION ActiveXBuildToolBarXbp( oCrt )
LOCAL oTBar
oTBar := WvgToolBar():new( oCrt , , { 0,0 }, { 0,0 }, , .T. )
oTBar := WvgToolBar():new( oCrt , , { 0, 0 }, { 0, 0 }, , .T. )
oTBar:style := WVGTOOLBAR_STYLE_FLAT
@@ -369,63 +374,64 @@ STATIC FUNCTION ActiveXBuildToolBarXbp( oCrt )
//
Static Function MyFunctionXbp( nMode )
STATIC FUNCTION MyFunctionXbp( nMode )
do case
case nMode == 1
tone( MUSIC_WAITON[1], 1 )
tone( MUSIC_WAITON[2], 1 )
DO CASE
CASE nMode == 1
Tone( MUSIC_WAITON[ 1 ], 1 )
Tone( MUSIC_WAITON[ 2 ], 1 )
case nMode == 2
tone( MUSIC_WAITON[2], 1 )
tone( MUSIC_WAITON[1], 1 )
CASE nMode == 2
Tone( MUSIC_WAITON[ 2 ], 1 )
Tone( MUSIC_WAITON[ 1 ], 1 )
case nMode == 3
CASE nMode == 3
WVG_MessageBox( , "Button clicked!" )
case nMode == 101 // Charge
Eval( {|| tone(523,2),tone(698,2),tone(880,2),tone(1046,4),tone(880,2),tone(1046,8) } )
CASE nMode == 101 // Charge
Eval( {|| Tone( 523,2 ), Tone( 698,2 ), Tone( 880,2 ), Tone( 1046,4 ), Tone( 880,2 ), Tone( 1046,8 ) } )
case nMode == 102 // NannyBoo
AEval( {{196,2},{196,2},{164,2},{220,2},{196,4},{164,4}}, {| a | tone( a[ 1 ], a[ 2 ] ) } )
CASE nMode == 102 // NannyBoo
AEval( { { 196,2 }, { 196,2 }, { 164,2 }, { 220,2 }, { 196,4 }, { 164,4 } }, {| a | Tone( a[ 1 ], a[ 2 ] ) } )
case nMode == 103 // BADKEY
tone( 480,0.25 )
tone( 240,0.25 )
CASE nMode == 103 // BADKEY
Tone( 480, 0.25 )
Tone( 240, 0.25 )
endcase
ENDCASE
Return nil
RETURN NIL
//
STATIC FUNCTION ExeFontDialogXbp( oCrt )
LOCAL oFontDlg
STATIC nMode := 0
STATIC s_nMode := 0
oFontDlg := WvgFontDialog():new( oCrt )
oFontDlg:title := 'Select a Screen Font'
oFontDlg:aPos := { 150,150 }
oFontDlg:aPos := { 150, 150 }
oFontDlg:buttonApply := .T.
oFontDlg:activateApply := {|| NIL }
oFontDlg:familyName := "Courier New"
oFontDlg:strikeout := .T.
oFontDlg:underscore := .F.
//oFontDlg:activateOk := {|| WVG_MessageBox( , 'activateOK Event Handelled in Windows!' ) }
// oFontDlg:activateOk := {|| WVG_MessageBox( , 'activateOK Event Handelled in Windows!' ) }
oFontDlg:nominalPointSize := 12
//oFontDlg:size := .F.
//oFontDlg:style := .F.
// oFontDlg:size := .F.
// oFontDlg:style := .F.
oFontDlg:create()
// Every 2nd FontDialog will be MODAL
oFontDlg:display( ++nMode % 2 )
oFontDlg:display( ++s_nMode % 2 )
oFontDlg:destroy()
RETURN nil
RETURN NIL
//

View File

@@ -49,6 +49,7 @@
* If you do not wish that, delete this exception notice.
*
*/
//
//
//
@@ -112,7 +113,7 @@ CLASS WvgToolBar INHERIT WvgWindow /*WvgActiveXControl*/
METHOD delItem()
METHOD getItem()
METHOD clear()
METHOD CLEAR()
METHOD customize()
METHOD loadImageSet()
METHOD saveToolbar()
@@ -125,7 +126,7 @@ CLASS WvgToolBar INHERIT WvgWindow /*WvgActiveXControl*/
METHOD buttonMenuClick( xParam ) SETGET
METHOD buttonDropDown( xParam ) SETGET
ENDCLASS
ENDCLASS
//
@@ -133,10 +134,10 @@ METHOD WvgToolBar:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::WvgWindow:new( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
#if 0
+ TBSTYLE_LIST caption to the right, otherwise caption to the bottom
#if 0
+ TBSTYLE_LIST caption TO the right, OTHERWISE caption TO the bottom
::style := WS_CHILD + TBSTYLE_FLAT + CCS_ADJUSTABLE + CCS_NODIVIDER + CCS_VERT
#endif
#endif
::exStyle := TBSTYLE_EX_DOUBLEBUFFER + TBSTYLE_EX_MIXEDBUTTONS
::className := TOOLBARCLASSNAME
@@ -168,26 +169,26 @@ METHOD WvgToolBar:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
IF ::borderStyle == WVGFRAME_RECT
::style += WS_BORDER
ENDIF
#if 0
#if 0
IF ::appearance == WVG_APPEARANCE_3D
ENDIF
#endif
#endif
::oParent:AddChild( SELF )
::createControl()
#if 0
#if 0
/* Should not be defined as we only require its notifications
* so the parent of toolbar will process them anyway
* All other functionality should be default until ownerdraw is introduced.
*/
::SetWindowProcCallback()
#endif
::SetWindowProcCallback()
#endif
IF !empty( ::hWnd )
IF !Empty( ::hWnd )
::SendToolbarMessage( TB_BUTTONSTRUCTSIZE )
::hImageList := WAPI_ImageList_Create( ::imageWidth, ::imageHeight, ILC_COLOR32+ILC_MASK, 0, 1 )
::hImageList := WAPI_ImageList_Create( ::imageWidth, ::imageHeight, ILC_COLOR32 + ILC_MASK, 0, 1 )
::SendToolbarMessage( TB_SETIMAGELIST, ::hImageList )
::SendToolbarMessage( TB_BUTTONSTRUCTSIZE )
@@ -203,6 +204,7 @@ METHOD WvgToolBar:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
//
METHOD WvgToolBar:handleEvent( nMessage, aNM )
LOCAL nObj, aNMMouse
SWITCH nMessage
@@ -223,7 +225,7 @@ METHOD WvgToolBar:handleEvent( nMessage, aNM )
DO CASE
CASE aNMMouse[ NMH_code ] == NM_CLICK
IF ( nObj := ascan( ::aItems, {| e_ | e_[ 1 ] == aNMMouse[ NMH_dwItemSpec ] } ) ) > 0
IF ( nObj := AScan( ::aItems, {| e_ | e_[ 1 ] == aNMMouse[ NMH_dwItemSpec ] } ) ) > 0
IF HB_ISBLOCK( ::sl_lbClick )
IF ::isParentCrt()
::oParent:setFocus()
@@ -247,6 +249,7 @@ METHOD WvgToolBar:handleEvent( nMessage, aNM )
//
METHOD WvgToolBar:destroy()
LOCAL i, nItems
IF ( nItems := Len( ::aItems ) ) > 0
@@ -263,7 +266,7 @@ METHOD WvgToolBar:destroy()
NEXT
ENDIF
IF !empty( ::hImageList )
IF !Empty( ::hImageList )
WAPI_ImageList_Destroy( ::hImageList )
ENDIF
@@ -288,6 +291,7 @@ METHOD WvgToolBar:sendToolbarMessage( nMsg, p1, p2 )
//
METHOD WvgToolBar:addItem( cCaption, xImage, xDisabledImage, xHotImage, cDLL, nStyle, cKey, nMapRGB )
LOCAL oBtn, pBitmap, cType, nBtn
HB_SYMBOL_UNUSED( xDisabledImage )
@@ -296,9 +300,9 @@ METHOD WvgToolBar:addItem( cCaption, xImage, xDisabledImage, xHotImage, cDLL, nS
/* Issue this at the begining of first item */
IF ! ::lSized
#if 0
#if 0
::SendToolbarMessage( TB_SETBUTTONWIDTH, ::buttonWidth, ::buttonWidth )
#endif
#endif
::lSized := .T.
ENDIF
@@ -307,26 +311,26 @@ METHOD WvgToolBar:addItem( cCaption, xImage, xDisabledImage, xHotImage, cDLL, nS
oBtn:index := ::numItems + 1
oBtn:command := 100 + oBtn:index
cType := valtype( xImage )
cType := ValType( xImage )
DO CASE
CASE cType == "C"
IF ( "." $ xImage ) .or. ( "/" $ xImage ) .or. ( "\" $ xImage ) .or. ( ":" $ xImage ) .or. file( xImage )
pBitmap := Wvg_PrepareBitmapFromFile( xImage, ::imageWidth, ::imageHeight, .T., ::hWnd )
IF ( "." $ xImage ) .OR. ( "/" $ xImage ) .OR. ( "\" $ xImage ) .OR. ( ":" $ xImage ) .OR. File( xImage )
pBitmap := Wvg_PrepareBitmapFromFile( xImage, ::imageWidth, ::imageHeight, .T. , ::hWnd )
ELSE
pBitmap := Wvg_PrepareBitmapFromResourceName( xImage, ::imageWidth, ::imageHeight, .T., ::hWnd )
pBitmap := Wvg_PrepareBitmapFromResourceName( xImage, ::imageWidth, ::imageHeight, .T. , ::hWnd )
ENDIF
CASE cType == "N"
pBitmap := Wvg_PrepareBitmapFromResourceID( xImage, ::imageWidth, ::imageHeight, .T., ::hWnd )
pBitmap := Wvg_PrepareBitmapFromResourceID( xImage, ::imageWidth, ::imageHeight, .T. , ::hWnd )
CASE cType == "P"
pBitmap := xImage
ENDCASE
IF ! empty( pBitmap )
IF ! Empty( pBitmap )
/* oBtn:image := pBitmap */
IF HB_ISNUMERIC( nMapRGB )
@@ -343,17 +347,17 @@ METHOD WvgToolBar:addItem( cCaption, xImage, xDisabledImage, xHotImage, cDLL, nS
/* Set Button Size */
::SendToolbarMessage( TB_SETBUTTONSIZE, ::buttonWidth, ::buttonHeight )
#if 0
#if 0
SendMessage( hWndTB, TB_SETPADDING, ( WPARAM ) 0, ( LPARAM ) MAKELPARAM( 10,10 ) );
::sendToolbarMessage( TB_SETPADDING, 10, 10 )
#endif
::sendToolbarMessage( TB_SETPADDING, 10, 10 )
#endif
::sendToolbarMessage( TB_AUTOSIZE )
ELSE
Wvg_AddToolbarButton( ::pWnd, , , oBtn:command, 3, .F. )
ENDIF
aadd( ::aItems, { oBtn:command, oBtn } )
AAdd( ::aItems, { oBtn:command, oBtn } )
RETURN oBtn
@@ -417,7 +421,7 @@ METHOD WvgToolBar:setSize()
METHOD WvgToolBar:buttonClick( xParam )
IF HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_lbClick := xParam
ENDIF
@@ -427,7 +431,7 @@ METHOD WvgToolBar:buttonClick( xParam )
METHOD WvgToolBar:change( xParam )
IF HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_change := xParam
ENDIF
@@ -437,7 +441,7 @@ METHOD WvgToolBar:change( xParam )
METHOD WvgToolBar:buttonMenuClick( xParam )
IF HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_buttonMenuClick := xParam
ENDIF
@@ -447,7 +451,7 @@ METHOD WvgToolBar:buttonMenuClick( xParam )
METHOD WvgToolBar:buttonDropDown( xParam )
IF HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_buttonDropDown := xParam
ENDIF
@@ -466,8 +470,8 @@ METHOD WvgToolBar:buttonDropDown( xParam )
CLASS WvgToolBarButton
DATA enabled INIT .T.
DATA index INIT 0
DATA key INIT ""
DATA INDEX INIT 0
DATA KEY INIT ""
DATA style INIT WVGTOOLBAR_BUTTON_DEFAULT
DATA caption INIT ""
DATA image INIT NIL
@@ -477,8 +481,8 @@ CLASS WvgToolBarButton
DATA pressed INIT .F.
DATA visible INIT .T.
DATA left INIT 0
DATA bottom INIT 0
DATA top INIT 0
DATA BOTTOM INIT 0
DATA TOP INIT 0
DATA width INIT 0
DATA height INIT 0
DATA description INIT ""
@@ -487,7 +491,7 @@ CLASS WvgToolBarButton
METHOD new( cCaption, nStyle, cKey )
ENDCLASS
ENDCLASS
//

View File

@@ -49,6 +49,7 @@
* If you do not wish that, delete this exception notice.
*
*/
//
//
//
@@ -118,9 +119,9 @@ CLASS WvgTreeView INHERIT WvgWindow, WvgDataRef
METHOD setColorBG( nRGB ) INLINE WVG_TreeView_SetBkColor( ::hWnd, iif( HB_ISSTRING( nRGB ), Wvt_GetRGBColorByString( nRGB, 1 ), nRGB ) )
METHOD setColorLines( nRGB ) INLINE WVG_TreeView_SetLineColor( ::hWnd, nRGB )
METHOD showExpanded( lExpanded, nLevels ) INLINE Wvg_TreeView_ShowExpanded( ::hWnd, ;
iif( HB_ISNIL( lExpanded ), .F., lExpanded ), nLevels )
iif( HB_ISNIL( lExpanded ), .F. , lExpanded ), nLevels )
ENDCLASS
ENDCLASS
//
@@ -174,6 +175,7 @@ METHOD WvgTreeView:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
//
METHOD WvgTreeView:handleEvent( nMessage, aNM )
LOCAL aHdr
SWITCH nMessage
@@ -186,7 +188,7 @@ METHOD WvgTreeView:handleEvent( nMessage, aNM )
CASE HB_GTE_COMMAND
IF HB_ISBLOCK( ::sl_lbClick )
eval( ::sl_lbClick, NIL, NIL, self )
Eval( ::sl_lbClick, NIL, NIL, self )
RETURN EVENT_HANDELLED
ENDIF
EXIT
@@ -201,7 +203,7 @@ METHOD WvgTreeView:handleEvent( nMessage, aNM )
::oParent:setFocus()
ENDIF
IF HB_ISBLOCK( ::sl_itemSelected )
Eval( ::sl_itemSelected, ::oItemSelected, { 0,0,0,0 }, Self )
Eval( ::sl_itemSelected, ::oItemSelected, { 0, 0, 0, 0 }, Self )
ENDIF
IF ::isParentCrt()
IF ::pointerFocus
@@ -218,7 +220,7 @@ METHOD WvgTreeView:handleEvent( nMessage, aNM )
::oParent:setFocus()
ENDIF
IF HB_ISBLOCK( ::sl_itemMarked )
Eval( ::sl_itemMarked, ::oItemSelected, { 0,0,0,0 }, Self )
Eval( ::sl_itemMarked, ::oItemSelected, { 0, 0, 0, 0 }, Self )
ENDIF
IF ::isParentCrt()
IF ::pointerFocus
@@ -244,7 +246,7 @@ METHOD WvgTreeView:handleEvent( nMessage, aNM )
IF ::isParentCrt()
::oParent:setFocus()
ENDIF
eval( ::sl_lbClick, NIL, NIL, Self )
Eval( ::sl_lbClick, NIL, NIL, Self )
IF ::isParentCrt()
::setFocus()
ENDIF
@@ -257,7 +259,7 @@ METHOD WvgTreeView:handleEvent( nMessage, aNM )
IF ::isParentCrt()
::oParent:setFocus()
ENDIF
Eval( ::sl_itemSelected, ::oItemSelected, { 0,0,0,0 }, Self )
Eval( ::sl_itemSelected, ::oItemSelected, { 0, 0, 0, 0 }, Self )
IF ::isParentCrt()
::setFocus()
ENDIF
@@ -274,25 +276,28 @@ METHOD WvgTreeView:handleEvent( nMessage, aNM )
//
METHOD WvgTreeView:destroy()
::wvgWindow:destroy()
RETURN NIL
//
METHOD WvgTreeView:getSelectionInfo( nlParam )
LOCAL hItemSelected, hParentOfSelected
LOCAL cParent := space( 20 )
LOCAL cText := space( 20 )
LOCAL cParent := Space( 20 )
LOCAL cText := Space( 20 )
LOCAL n
Wvg_TreeView_GetSelectionInfo( ::hWnd, nlParam, @cParent, @cText, @hParentOfSelected, @hItemSelected )
::hParentSelected := hParentOfSelected
::hItemSelected := hItemSelected
::textParentSelected := trim( cParent )
::textItemSelected := trim( cText )
::textParentSelected := Trim( cParent )
::textItemSelected := Trim( cText )
IF ( n := ascan( ::aItems, {| o | o:hItem == hItemSelected } ) ) > 0
IF ( n := AScan( ::aItems, {| o | o:hItem == hItemSelected } ) ) > 0
::oItemSelected := ::aItems[ n ]
ENDIF
@@ -301,20 +306,24 @@ METHOD WvgTreeView:getSelectionInfo( nlParam )
//
METHOD WvgTreeView:configure( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::Initialize( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
RETURN Self
//
METHOD WvgTreeView:itemFromPos( aPos )
HB_SYMBOL_UNUSED( aPos )
RETURN Self
//
METHOD WvgTreeView:itemCollapsed( xParam )
IF HB_ISBLOCK( xParam ) .or. ( xParam == NIL )
IF HB_ISBLOCK( xParam ) .OR. xParam == NIL
::sl_paint := xParam
ENDIF
@@ -324,7 +333,7 @@ METHOD WvgTreeView:itemCollapsed( xParam )
METHOD WvgTreeView:itemExpanded( xParam )
IF HB_ISBLOCK( xParam ) .or. ( xParam == NIL )
IF HB_ISBLOCK( xParam ) .OR. xParam == NIL
::sl_itemExpanded := xParam
ENDIF
@@ -334,7 +343,7 @@ METHOD WvgTreeView:itemExpanded( xParam )
METHOD WvgTreeView:itemMarked( xParam )
IF HB_ISBLOCK( xParam ) .or. ( xParam == NIL )
IF HB_ISBLOCK( xParam ) .OR. xParam == NIL
::sl_itemMarked := xParam
ENDIF
@@ -342,24 +351,28 @@ METHOD WvgTreeView:itemMarked( xParam )
//
#if 0
METHOD WvgTreeView:itemSelected( xParam )
IF HB_ISBLOCK( xParam ) .or. ( xParam == NIL )
IF HB_ISBLOCK( xParam ) .OR. xParam == NIL
::sl_itemSelected := xParam
ENDIF
RETURN Self
#endif
//
/* Class WvgTreeViewItem */
//
CLASS WvgTreeViewItem
DATA caption INIT ""
DATA dllName INIT NIL
DATA expandedImage INIT -1
DATA image INIT -1
DATA markedImage INIT -1
DATA expandedImage INIT - 1
DATA image INIT - 1
DATA markedImage INIT - 1
DATA hTree
DATA hItem
@@ -375,7 +388,7 @@ CLASS WvgTreeViewItem
METHOD destroy()
METHOD expand( lExpand ) INLINE WVG_TreeView_Expand( ::hTree, ::hItem, ;
iif( HB_ISLOGICAL( lExpand ), lExpand, .T. ) )
iif( HB_ISLOGICAL( lExpand ), lExpand, .T. ) )
METHOD isExpanded()
METHOD setCaption( cCaption )
METHOD setExpandedImage( nResIdoBitmap )
@@ -388,7 +401,8 @@ CLASS WvgTreeViewItem
METHOD getParentItem()
METHOD insItem()
ENDCLASS
ENDCLASS
//
METHOD new() CLASS WvgTreeViewItem
@@ -432,6 +446,7 @@ METHOD setCaption( cCaption ) CLASS WvgTreeViewItem
METHOD setExpandedImage( nResIdoBitmap ) CLASS WvgTreeViewItem
HB_SYMBOL_UNUSED( nResIdoBitmap )
RETURN NIL
//
@@ -453,7 +468,8 @@ METHOD setMarkedImage( nResIdoBitmap ) CLASS WvgTreeViewItem
//
METHOD addItem( cCaption ) CLASS WvgTreeViewItem
Local oItem, hParent
LOCAL oItem, hParent
oItem := WvgTreeViewItem():New()
@@ -466,7 +482,7 @@ METHOD addItem( cCaption ) CLASS WvgTreeViewItem
oItem:hItem := Wvg_TreeView_AddItem( oItem:hTree, hParent, oItem:caption )
aadd( oItem:oWnd:aItems, oItem )
AAdd( oItem:oWnd:aItems, oItem )
RETURN oItem

View File

@@ -49,6 +49,7 @@
* If you do not wish that, delete this exception notice.
*
*/
//
//
//
@@ -75,12 +76,12 @@
#include "wvgparts.ch"
//
* To Switch Over from ASCALLBACK() to SET/GET_Prop() calls
*
// To Switch Over from ASCALLBACK() to SET/GET_Prop() calls
//
#if 0
#define __BYASCALLBACK__
#define __BYASCALLBACK__
#else
#define __BYSETPROP__
#define __BYSETPROP__
#endif
//
@@ -163,8 +164,8 @@ CLASS WvgWindow INHERIT WvgPartHandler
DATA hWnd
DATA pWnd
DATA aPos INIT { 0,0 }
DATA aSize INIT { 0,0 }
DATA aPos INIT { 0, 0 }
DATA aSize INIT { 0, 0 }
DATA aPresParams INIT {}
DATA lHasInputFocus INIT .F.
DATA nFrameState INIT 0 /* normal */
@@ -248,9 +249,9 @@ CLASS WvgWindow INHERIT WvgPartHandler
METHOD rbDown( xParam ) SETGET
METHOD rbUp( xParam ) SETGET
METHOD wheel( xParam ) SETGET
METHOD close( xParam ) SETGET
METHOD CLOSE( xParam ) SETGET
METHOD helpRequest( xParam ) SETGET
METHOD keyboard( xParam ) SETGET
METHOD KEYBOARD( xParam ) SETGET
METHOD killDisplayFocus( xParam ) SETGET
METHOD killInputFocus( xParam ) SETGET
METHOD move( xParam ) SETGET
@@ -263,13 +264,13 @@ CLASS WvgWindow INHERIT WvgPartHandler
METHOD dragMotion( xParam ) SETGET
METHOD dragLeave( xParam ) SETGET
METHOD dragDrop( xParam, xParam1 ) SETGET
PROTECTED:
PROTECTED:
METHOD getPosAndSize( aPs, aSz )
METHOD isParentCrt() INLINE ( ::oParent:objType == objTypeCrt )
METHOD rePosition()
METHOD createControl()
ENDCLASS
ENDCLASS
//
@@ -311,7 +312,7 @@ METHOD WvgWindow:create( oParent, oOwner, aPos, aSize, aPresParams, lVisible )
::aPresParams := aPresParams
::visible := lVisible
IF empty( ::oParent )
IF Empty( ::oParent )
IF ! ( __objGetClsName( Self ) $ "WVGCRT,WVGDIALOG" )
::oParent := WvgSetAppWindow()
ENDIF
@@ -338,12 +339,12 @@ METHOD WvgWindow:configure( oParent, oOwner, aPos, aSize, aPresParams, lVisible
METHOD WvgWindow:destroy()
IF ! empty( ::oParent )
IF ! Empty( ::oParent )
::oParent:removeChild( Self )
ENDIF
IF Len( ::aChildren ) > 0
aeval( ::aChildren, {| o | o:destroy() } )
AEval( ::aChildren, {| o | o:destroy() } )
::aChildren := {}
ENDIF
@@ -427,12 +428,15 @@ METHOD WvgWindow:destroy()
//
METHOD WvgWindow:SetWindowProcCallback()
::nOldProc := WVG_SetWindowProcBlock( ::pWnd, {| h, m, w, l | ::ControlWndProc( h, m, w, l ) } )
RETURN Self
//
METHOD WvgWindow:captureMouse()
RETURN Self
//
@@ -489,6 +493,7 @@ METHOD WvgWindow:lockUpdate()
//
METHOD WvgWindow:setColorBG( nRGB )
LOCAL hBrush
IF HB_ISSTRING( nRGB )
@@ -500,7 +505,7 @@ METHOD WvgWindow:setColorBG( nRGB )
::clr_BG := nRGB
::hBrushBG := hBrush
IF ::className == "WVGDIALOG" .OR. __ObjGetClsName( Self ) == "WVGCHECKBOX"
IF ::className == "WVGDIALOG" .OR. __objGetClsName( Self ) == "WVGCHECKBOX"
Wvg_SetCurrentBrush( ::hWnd, ::hBrushBG )
ENDIF
ENDIF
@@ -529,6 +534,7 @@ METHOD WvgWindow:setTrackPointer()
//
METHOD WvgWindow:setPos( aPos, lPaint )
LOCAL aPosSz
IF HB_ISARRAY( aPos )
@@ -547,11 +553,10 @@ METHOD WvgWindow:setPos( aPos, lPaint )
END
ENDIF
RETURN Self
//
/* This will always be called from HB_GTE_RESIZED message of WVG engine */
/* This will always be called from HB_GTE_RESIZED message of WVG engine */
METHOD WvgWindow:rePosition()
@@ -560,6 +565,7 @@ METHOD WvgWindow:rePosition()
//
METHOD WvgWindow:setPosAndSize( aPos, aSize, lPaint )
LOCAL aPosSz
DEFAULT aPos TO ::aPos
@@ -586,6 +592,7 @@ METHOD WvgWindow:setPosAndSize( aPos, aSize, lPaint )
//
METHOD WvgWindow:setSize( aSize, lPaint )
LOCAL aPosSz
IF HB_ISARRAY( aSize )
@@ -603,23 +610,25 @@ METHOD WvgWindow:setSize( aSize, lPaint )
END
ENDIF
RETURN Self
//
METHOD WvgWindow:isDerivedFrom( cClassORoObject )
LOCAL lTrue := .F.
LOCAL cCls := __ObjGetClsName( self )
LOCAL cCls := __objGetClsName( self )
/* Compares without Xbp or Wvg prefixes */
IF HB_ISSTRING( cClassORoObject )
IF upper( substr( cClassORoObject,4 ) ) == upper( substr( cCls,4 ) )
IF Upper( SubStr( cClassORoObject,4 ) ) == Upper( SubStr( cCls,4 ) )
lTrue := .T.
ENDIF
ELSEIF HB_ISOBJECT( cClassORoObject )
IF upper( substr( cClassORoObject:className,4 ) ) == upper( substr( cCls,4 ) )
IF Upper( SubStr( cClassORoObject:className,4 ) ) == Upper( SubStr( cCls,4 ) )
lTrue := .T.
ENDIF
ENDIF
@@ -647,6 +656,7 @@ METHOD WvgWindow:toBack()
METHOD WvgWindow:toFront()
/*RETURN WVG_SetForeGroundWindow( ::hWnd ) */
RETURN WVG_SetWindowPosToTop( ::hWnd )
//
@@ -670,34 +680,35 @@ METHOD WvgWindow:setFont()
//
METHOD WvgWindow:setFontCompoundName( xFont )
LOCAL cOldFont, s, n, nPoint, cFont, cAttr, cFace
LOCAL aAttr := { "normal","italic","bold" }
LOCAL aAttr := { "normal", "italic", "bold" }
cOldFont := ::fnt_COMMPOUNDNAME
IF HB_ISNUMERIC( cFont )
ELSE
IF !empty( xFont )
IF !Empty( xFont )
cFont := xFont
s := lower( cFont )
n := ascan( aAttr, {| e | at( e, cFont ) > 0 } )
s := Lower( cFont )
n := AScan( aAttr, {| e | At( e, cFont ) > 0 } )
IF n > 0
cAttr := aAttr[ n ]
n := at( cAttr, s )
cFont := substr( cFont,1,n-1 )
n := At( cAttr, s )
cFont := SubStr( cFont, 1, n - 1 )
ELSE
cAttr := "normal"
ENDIF
IF ( n := at( ".", cFont ) ) > 0
nPoint := val( substr( cFont,1,n-1 ) )
cFont := substr( cFont,n+1 )
IF ( n := At( ".", cFont ) ) > 0
nPoint := Val( SubStr( cFont,1,n - 1 ) )
cFont := SubStr( cFont, n + 1 )
ELSE
nPoint := 0
ENDIF
cFace := alltrim( cFont )
cFace := AllTrim( cFont )
HB_SYMBOL_UNUSED( cFace )
HB_SYMBOL_UNUSED( cAttr )
@@ -716,6 +727,7 @@ METHOD WvgWindow:setPresParam()
//
METHOD WvgWindow:currentPos()
LOCAL aRect := WVG_GetWindowRect( ::hWnd )
RETURN { aRect[ 1 ], aRect[ 2 ] }
@@ -723,6 +735,7 @@ METHOD WvgWindow:currentPos()
//
METHOD WvgWindow:currentSize()
LOCAL aRect
aRect := WVG_GetClientRect( ::hWnd )
@@ -748,20 +761,20 @@ METHOD WvgWindow:hasInputFocus()
RETURN Self
//
* Callback Methods
// Callback Methods
//
METHOD WvgWindow:enter( xParam )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_enter )
eval( ::sl_enter, xParam, NIL, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_enter )
Eval( ::sl_enter, xParam, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_enter := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -769,15 +782,15 @@ METHOD WvgWindow:enter( xParam )
METHOD WvgWindow:leave( xParam )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_leave )
eval( ::sl_leave, NIL, NIL, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_leave )
Eval( ::sl_leave, NIL, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_leave := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -785,15 +798,15 @@ METHOD WvgWindow:leave( xParam )
METHOD WvgWindow:lbClick( xParam )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_lbClick )
eval( ::sl_lbClick, xParam, NIL, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_lbClick )
Eval( ::sl_lbClick, xParam, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_lbClick := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -801,15 +814,15 @@ METHOD WvgWindow:lbClick( xParam )
METHOD WvgWindow:lbDblClick( xParam )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_lbDblClick )
eval( ::sl_lbDblClick, xParam, NIL, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_lbDblClick )
Eval( ::sl_lbDblClick, xParam, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_lbDblClick := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -817,15 +830,15 @@ METHOD WvgWindow:lbDblClick( xParam )
METHOD WvgWindow:lbDown( xParam )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_lbDown )
eval( ::sl_lbDown, xParam, NIL, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_lbDown )
Eval( ::sl_lbDown, xParam, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_lbDown := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -833,15 +846,15 @@ METHOD WvgWindow:lbDown( xParam )
METHOD WvgWindow:lbUp( xParam )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_lbUp )
eval( ::sl_lbUp, xParam, NIL, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_lbUp )
Eval( ::sl_lbUp, xParam, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_lbUp := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -849,15 +862,15 @@ METHOD WvgWindow:lbUp( xParam )
METHOD WvgWindow:mbClick( xParam )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_mbClick )
eval( ::sl_mbClick, xParam, NIL, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_mbClick )
Eval( ::sl_mbClick, xParam, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_mbClick := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -865,15 +878,15 @@ METHOD WvgWindow:mbClick( xParam )
METHOD WvgWindow:mbDblClick( xParam )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_mbDblClick )
eval( ::sl_mbDblClick, xParam, NIL, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_mbDblClick )
Eval( ::sl_mbDblClick, xParam, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_mbDblClick := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -881,15 +894,15 @@ METHOD WvgWindow:mbDblClick( xParam )
METHOD WvgWindow:mbDown( xParam )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_mbDown )
eval( ::sl_mbDown, xParam, NIL, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_mbDown )
Eval( ::sl_mbDown, xParam, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_mbDown := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -897,15 +910,15 @@ METHOD WvgWindow:mbDown( xParam )
METHOD WvgWindow:mbUp( xParam )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_mbUp )
eval( ::sl_mbUp, xParam, NIL, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_mbUp )
Eval( ::sl_mbUp, xParam, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_mbUp := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -913,15 +926,15 @@ METHOD WvgWindow:mbUp( xParam )
METHOD WvgWindow:motion( xParam )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_motion )
eval( ::sl_motion, xParam, NIL, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_motion )
Eval( ::sl_motion, xParam, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_motion := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -929,15 +942,15 @@ METHOD WvgWindow:motion( xParam )
METHOD WvgWindow:rbClick( xParam )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_rbClick )
eval( ::sl_rbClick, xParam, NIL, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_rbClick )
Eval( ::sl_rbClick, xParam, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_rbClick := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -945,15 +958,15 @@ METHOD WvgWindow:rbClick( xParam )
METHOD WvgWindow:rbDblClick( xParam )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_rbDblClick )
eval( ::sl_rbDblClick, xParam, NIL, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_rbDblClick )
Eval( ::sl_rbDblClick, xParam, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_rbDblClick := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -961,15 +974,15 @@ METHOD WvgWindow:rbDblClick( xParam )
METHOD WvgWindow:rbDown( xParam )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_rbDown )
eval( ::sl_rbDown, xParam, NIL, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_rbDown )
Eval( ::sl_rbDown, xParam, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_rbDown := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -977,15 +990,15 @@ METHOD WvgWindow:rbDown( xParam )
METHOD WvgWindow:rbUp( xParam )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_rbUp )
eval( ::sl_rbUp, xParam, NIL, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_rbUp )
Eval( ::sl_rbUp, xParam, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_rbUp := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -993,49 +1006,51 @@ METHOD WvgWindow:rbUp( xParam )
METHOD WvgWindow:wheel( xParam )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_wheel )
eval( ::sl_wheel, xParam, NIL, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_wheel )
Eval( ::sl_wheel, xParam, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_wheel := xParam
RETURN NIL
endif
ENDIF
RETURN Self
//
* Other Messages
// Other Messages
//
METHOD WvgWindow:close( xParam )
if ::objType == objTypeCrt
if HB_ISNIL( xParam ) .and. HB_ISBLOCK( ::sl_close )
eval( ::sl_close, NIL, NIL, Self )
RETURN Self
endif
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
if ::objType == objTypeCrt
IF HB_ISNIL( xParam ) .AND. HB_ISBLOCK( ::sl_close )
Eval( ::sl_close, NIL, NIL, Self )
RETURN Self
ENDIF
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_close := xParam
RETURN NIL
endif
endif
ENDIF
ENDIF
RETURN Self
//
METHOD WvgWindow:helpRequest( xParam )
if HB_ISNIL( xParam ) .and. HB_ISBLOCK( ::sl_helpRequest )
eval( ::sl_helpRequest, NIL, NIL, Self )
IF HB_ISNIL( xParam ) .AND. HB_ISBLOCK( ::sl_helpRequest )
Eval( ::sl_helpRequest, NIL, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_helpRequest := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -1043,47 +1058,49 @@ METHOD WvgWindow:helpRequest( xParam )
METHOD WvgWindow:keyboard( xParam )
if HB_ISNUMERIC( xParam ) .and. HB_ISBLOCK( ::sl_keyboard )
eval( ::sl_keyboard, xParam, NIL, Self )
IF HB_ISNUMERIC( xParam ) .AND. HB_ISBLOCK( ::sl_keyboard )
Eval( ::sl_keyboard, xParam, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_keyboard := xParam
RETURN NIL
endif
ENDIF
RETURN Self
//
METHOD WvgWindow:killDisplayFocus( xParam )
if ::objType == objTypeCrt
if HB_ISNIL( xParam ) .and. HB_ISBLOCK( ::sl_killDisplayFocus )
eval( ::sl_killDisplayFocus, NIL, NIL, Self )
RETURN Self
endif
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
if ::objType == objTypeCrt
IF HB_ISNIL( xParam ) .AND. HB_ISBLOCK( ::sl_killDisplayFocus )
Eval( ::sl_killDisplayFocus, NIL, NIL, Self )
RETURN Self
ENDIF
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_killDisplayFocus := xParam
RETURN NIL
endif
endif
ENDIF
ENDIF
RETURN Self
//
METHOD WvgWindow:killInputFocus( xParam )
if HB_ISNIL( xParam ) .and. HB_ISBLOCK( ::sl_killInputFocus )
eval( ::sl_killInputFocus, NIL, NIL, Self )
IF HB_ISNIL( xParam ) .AND. HB_ISBLOCK( ::sl_killInputFocus )
Eval( ::sl_killInputFocus, NIL, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_killInputFocus := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -1091,15 +1108,15 @@ METHOD WvgWindow:killInputFocus( xParam )
METHOD WvgWindow:move( xParam )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_move )
eval( ::sl_move, xParam, NIL, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_move )
Eval( ::sl_move, xParam, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_move := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -1107,15 +1124,15 @@ METHOD WvgWindow:move( xParam )
METHOD WvgWindow:paint( xParam )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_paint )
eval( ::sl_paint, xParam, NIL, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_paint )
Eval( ::sl_paint, xParam, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_paint := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -1123,15 +1140,15 @@ METHOD WvgWindow:paint( xParam )
METHOD WvgWindow:quit( xParam, xParam1 )
if HB_ISNUMERIC( xParam ) .and. HB_ISBLOCK( ::sl_quit )
eval( ::sl_quit, xParam, xParam1, Self )
IF HB_ISNUMERIC( xParam ) .AND. HB_ISBLOCK( ::sl_quit )
Eval( ::sl_quit, xParam, xParam1, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_quit := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -1139,15 +1156,15 @@ METHOD WvgWindow:quit( xParam, xParam1 )
METHOD WvgWindow:resize( xParam, xParam1 )
if HB_ISARRAY( xParam ) .and. HB_ISARRAY( xParam1 ) .and. HB_ISBLOCK( ::sl_resize )
eval( ::sl_resize, xParam, xParam1, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISARRAY( xParam1 ) .AND. HB_ISBLOCK( ::sl_resize )
Eval( ::sl_resize, xParam, xParam1, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) /*.or. HB_ISNIL( xParam )*/
IF HB_ISBLOCK( xParam ) /*.or. HB_ISNIL( xParam )*/
::sl_resize := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -1156,31 +1173,32 @@ METHOD WvgWindow:resize( xParam, xParam1 )
METHOD WvgWindow:setDisplayFocus( xParam )
if ::objType == objTypeCrt
if HB_ISNIL( xParam ) .and. HB_ISBLOCK( ::setDisplayFocus )
eval( ::setDisplayFocus, NIL, NIL, Self )
IF HB_ISNIL( xParam ) .AND. HB_ISBLOCK( ::setDisplayFocus )
Eval( ::setDisplayFocus, NIL, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::setDisplayFocus := xParam
RETURN NIL
endif
endif
ENDIF
ENDIF
RETURN Self
//
METHOD WvgWindow:setInputFocus( xParam )
if HB_ISNIL( xParam ) .and. HB_ISBLOCK( ::sl_setInputFocus )
eval( ::sl_setInputFocus, NIL, NIL, Self )
IF HB_ISNIL( xParam ) .AND. HB_ISBLOCK( ::sl_setInputFocus )
Eval( ::sl_setInputFocus, NIL, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_setInputFocus := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -1188,15 +1206,15 @@ METHOD WvgWindow:setInputFocus( xParam )
METHOD WvgWindow:dragEnter( xParam, xParam1 )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_dragEnter )
eval( ::sl_dragEnter, xParam, xParam1, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_dragEnter )
Eval( ::sl_dragEnter, xParam, xParam1, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_dragEnter := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -1204,15 +1222,15 @@ METHOD WvgWindow:dragEnter( xParam, xParam1 )
METHOD WvgWindow:dragMotion( xParam )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_dragMotion )
eval( ::sl_dragMotion, xParam, NIL, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_dragMotion )
Eval( ::sl_dragMotion, xParam, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_dragMotion := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -1220,15 +1238,15 @@ METHOD WvgWindow:dragMotion( xParam )
METHOD WvgWindow:dragLeave( xParam )
if HB_ISNIL( xParam ) .and. HB_ISBLOCK( ::sl_dragLeave )
eval( ::sl_dragLeave, NIL, NIL, Self )
IF HB_ISNIL( xParam ) .AND. HB_ISBLOCK( ::sl_dragLeave )
Eval( ::sl_dragLeave, NIL, NIL, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_dragLeave := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -1236,15 +1254,15 @@ METHOD WvgWindow:dragLeave( xParam )
METHOD WvgWindow:dragDrop( xParam, xParam1 )
if HB_ISARRAY( xParam ) .and. HB_ISBLOCK( ::sl_dragDrop )
eval( ::sl_dragDrop, xParam, xParam1, Self )
IF HB_ISARRAY( xParam ) .AND. HB_ISBLOCK( ::sl_dragDrop )
Eval( ::sl_dragDrop, xParam, xParam1, Self )
RETURN Self
endif
ENDIF
if HB_ISBLOCK( xParam ) .or. HB_ISNIL( xParam )
IF HB_ISBLOCK( xParam ) .OR. HB_ISNIL( xParam )
::sl_dragDrop := xParam
RETURN NIL
endif
ENDIF
RETURN Self
@@ -1271,21 +1289,25 @@ METHOD WvgWindow:Initialize( oParent, oOwner, aPos, aSize, aPresParams, lVisible
//
METHOD WvgWindow:setFocus()
WVG_SetFocus( ::hWnd )
RETURN Self
//
METHOD WvgWindow:sendMessage( nMessage, nlParam, nwParam )
RETURN WVG_SendMessage( ::hWnd, nMessage, nlParam, nwParam )
//
METHOD WvgWindow:findObjectByHandle( hWnd )
LOCAL nObj
IF len( ::aChildren ) > 0
IF ( nObj := ascan( ::aChildren, {| o | o:hWnd == hWnd } ) ) > 0
IF Len( ::aChildren ) > 0
IF ( nObj := AScan( ::aChildren, {| o | o:hWnd == hWnd } ) ) > 0
RETURN ::aChildren[ nObj ]
ENDIF
ENDIF
@@ -1295,44 +1317,45 @@ METHOD WvgWindow:findObjectByHandle( hWnd )
//
METHOD WvgWindow:getPosAndSize( aPs, aSz )
LOCAL nX, nY, nW, nH, aXY
LOCAL aPos, aSize
LOCAL nFH, nFW
DEFAULT aPs TO aclone( ::aPos )
DEFAULT aSz TO aclone( ::aSize )
DEFAULT aPs TO AClone( ::aPos )
DEFAULT aSz TO AClone( ::aSize )
aPos := aclone( aPs )
aSize := aclone( aSz )
aPos := AClone( aPs )
aSize := AClone( aSz )
IF ::isParentCrt()
IF HB_ISBLOCK( aPos[ 1 ] )
aPos[ 1 ] := eval( aPos[ 1 ] )
aPos[ 1 ] := Eval( aPos[ 1 ] )
ENDIF
IF HB_ISBLOCK( aPos[ 2 ] )
aPos[ 2 ] := eval( aPos[ 2 ] )
aPos[ 2 ] := Eval( aPos[ 2 ] )
ENDIF
IF HB_ISBLOCK( aSize[ 1 ] )
aSize[ 1 ] := eval( aSize[ 1 ] )
aSize[ 1 ] := Eval( aSize[ 1 ] )
ENDIF
IF HB_ISBLOCK( aSize[ 2 ] )
aSize[ 2 ] := eval( aSize[ 2 ] )
aSize[ 2 ] := Eval( aSize[ 2 ] )
ENDIF
IF aPos[ 1 ] < 0 .AND. aPos[ 2 ] < 0 .AND. aSize[ 1 ] < 0 .AND. aSize[ 2 ] < 0
nX := abs( aPos[ 2 ] )
nX := Abs( aPos[ 2 ] )
IF nX < 1
nX := 0
ENDIF
nY := abs( aPos[ 1 ] )
nY := Abs( aPos[ 1 ] )
IF nY < 1
nY := 0
ENDIF
nW := abs( aSize[ 2 ] )
nW := Abs( aSize[ 2 ] )
IF nW < 1
nW := 0
ENDIF
nH := abs( aSize[ 1 ] )
nH := Abs( aSize[ 1 ] )
IF nH < 1
nH := 0
ENDIF
@@ -1361,6 +1384,7 @@ METHOD WvgWindow:toolTipText( cText )
//
METHOD WvgWindow:createControl()
LOCAL hWnd, aPosSz
::nID := ::oParent:GetControlId()
@@ -1368,15 +1392,15 @@ METHOD WvgWindow:createControl()
aPosSz := ::getPosAndSize( ::aPos, ::aSize )
hWnd := WVG_CreateWindowEx( ::exStyle, ;
::className, ;
"", ; /* window name */
::style, ;
aPosSz[ 1 ], aPosSz[ 2 ], ;
aPosSz[ 3 ], aPosSz[ 4 ], ;
::oParent:hWnd, ;
::nID, ; /* hMenu */
NIL, ; /* hInstance */
NIL ) /* lParam */
::className, ;
"", ; /* window name */
::style, ;
aPosSz[ 1 ], aPosSz[ 2 ], ;
aPosSz[ 3 ], aPosSz[ 4 ], ;
::oParent:hWnd, ;
::nID, ; /* hMenu */
NIL, ; /* hInstance */
NIL ) /* lParam */
IF WVG_IsWindow( hWnd )
::hWnd := hWnd
::pWnd := WIN_N2P( hWnd )

File diff suppressed because it is too large Load Diff

View File

@@ -64,27 +64,27 @@
#ifndef HB_WVW_H_
#define HB_WVW_H_
#define TTS_BALLOON 0x40 // added by MAG
#define TTS_BALLOON 0x40 // added by MAG
#ifndef GRADIENT_FILL_RECT_H
#define GRADIENT_FILL_RECT_H 0x00000000
#define GRADIENT_FILL_RECT_H 0x00000000
#endif
#ifndef TPM_RECURSE
#define TPM_RECURSE 0x0001L
#define TPM_RECURSE 0x0001L
#endif
#ifndef _WIN32_IE
#define _WIN32_IE 0x0400
#define _WIN32_IE 0x0400
#endif
/* NOTE: User programs should never call this layer directly! */
/* This definition has to be placed before #include "hbapigt.h" */
#define HB_GT_NAME WVW
#define HB_GT_NAME WVW
#ifndef CINTERFACE
#define CINTERFACE 1
#define CINTERFACE 1
#endif
#include "hbset.h"
@@ -110,19 +110,19 @@
#include <commctrl.h>
#include <commdlg.h>
#if defined(__MINGW32__) || defined(__WATCOMC__) || defined(_MSC_VER) || defined(__DMC__)
#if defined( __MINGW32__ ) || defined( __WATCOMC__ ) || defined( _MSC_VER ) || defined( __DMC__ )
#include <unknwn.h>
#include <ole2.h>
#include <ocidl.h>
#include <olectl.h>
#if defined(_MSC_VER) || defined( __DMC__ )
#if defined( _MSC_VER ) || defined( __DMC__ )
#include <conio.h>
#if ! defined( _MSC_VER )
#if !defined( LONG_PTR )
typedef __int64 LONG_PTR;
#if ! defined( LONG_PTR )
typedef __int64 LONG_PTR;
#endif
#endif
#endif
@@ -131,196 +131,199 @@
#endif
#if ( ( defined( _MSC_VER ) && ( _MSC_VER <= 1200 || defined( HB_OS_WIN_CE ) ) ) || \
defined( __DMC__ ) ) && !defined( HB_ARCH_64BIT )
defined( __DMC__ ) ) && ! defined( HB_ARCH_64BIT )
# ifndef GetWindowLongPtr
# define GetWindowLongPtr GetWindowLong
# define GetWindowLongPtr GetWindowLong
# endif
# ifndef SetWindowLongPtr
# define SetWindowLongPtr SetWindowLong
# define SetWindowLongPtr SetWindowLong
# endif
# ifndef SetClassLongPtr
# define SetClassLongPtr SetClassLong
# define SetClassLongPtr SetClassLong
# endif
#endif
#if (defined(__MSC6__) || defined(__DMC__))
#define LONG_PTR LONG
#if ( defined( __MSC6__ ) || defined( __DMC__ ) )
#define LONG_PTR LONG
#endif
#include <time.h>
#include <ctype.h>
/* xHarbour compatible definitions */
#if !defined( K_SH_LEFT )
#define K_SH_LEFT K_LEFT /* Shift-Left == Left */
#define K_SH_UP K_UP /* Shift-Up == Up */
#define K_SH_RIGHT K_RIGHT /* Shift-Right == Right */
#define K_SH_DOWN K_DOWN /* Shift-Down == Down */
#define K_SH_INS K_INS /* Shift-Ins == Ins */
#define K_SH_DEL K_DEL /* Shift-Del == Del */
#define K_SH_HOME K_HOME /* Shift-Home == Home */
#define K_SH_END K_END /* Shift-End == End */
#define K_SH_PGUP K_PGUP /* Shift-PgUp == PgUp */
#define K_SH_PGDN K_PGDN /* Shift-PgDn == PgDn */
#define K_SH_RETURN K_RETURN /* Shift-Enter == Enter */
#define K_SH_ENTER K_ENTER /* Shift-Enter == Enter */
#if ! defined( K_SH_LEFT )
#define K_SH_LEFT K_LEFT /* Shift-Left == Left */
#define K_SH_UP K_UP /* Shift-Up == Up */
#define K_SH_RIGHT K_RIGHT /* Shift-Right == Right */
#define K_SH_DOWN K_DOWN /* Shift-Down == Down */
#define K_SH_INS K_INS /* Shift-Ins == Ins */
#define K_SH_DEL K_DEL /* Shift-Del == Del */
#define K_SH_HOME K_HOME /* Shift-Home == Home */
#define K_SH_END K_END /* Shift-End == End */
#define K_SH_PGUP K_PGUP /* Shift-PgUp == PgUp */
#define K_SH_PGDN K_PGDN /* Shift-PgDn == PgDn */
#define K_SH_RETURN K_RETURN /* Shift-Enter == Enter */
#define K_SH_ENTER K_ENTER /* Shift-Enter == Enter */
#endif
#define WVW_MAXWINDOWS 40
#define WVW_MAXWINDOWS 40
#define WVW_MAXWINNAMELENGTH 256
#define WVW_MAXWINNAMELENGTH 256
#define WVW_DEFAULT_MENUKEYEVENT 1024
#define WVW_MAX_STATUS_PARTS 40 /* max # of parts in Status Bar */
#define WVW_SPACE_BETWEEN_PARTS 2 /* pixel space between Status Bar's parts */
#define WVW_MAX_STATUS_PARTS 40 /* max # of parts in Status Bar */
#define WVW_SPACE_BETWEEN_PARTS 2 /* pixel space between Status Bar's parts */
#define WVW_ID_SYSTEM_TIMER 1
#define WVW_ID_BASE_STATUSBAR 100
#define WVW_ID_BASE_TIMER 100
#define WVW_ID_BASE_STATUSBAR 100
#define WVW_ID_BASE_TIMER 100
#define WVW_ID_BASE_TOOLTIP 100
#define WVW_ID_BASE_TOOLTIP 100
#define WVW_ID_BASE_TOOLBAR 100
#define WVW_ID_BASE_TOOLBAR 100
#define WVW_ID_BASE_SCROLLBAR 100
#define WVW_ID_BASE_SCROLLBAR 100
#define WVW_ID_BASE_PROGRESSBAR 100
#define WVW_ID_BASE_STATIC 200
#define WVW_ID_BASE_PROGRESSBAR 100
#define WVW_ID_BASE_STATIC 200
#define WVW_ID_BASE_PUSHBUTTON 64000
#define WVW_ID_BASE_CHECKBOX 64000
#define WVW_ID_BASE_PUSHBUTTON 64000
#define WVW_ID_BASE_CHECKBOX 64000
#define WVW_ID_MAX_PUSHBUTTON WVW_ID_BASE_PUSHBUTTON+200-1
#define WVW_ID_MAX_CHECKBOX WVW_ID_BASE_CHECKBOX+200-1
#define WVW_ID_MAX_PUSHBUTTON WVW_ID_BASE_PUSHBUTTON + 200 - 1
#define WVW_ID_MAX_CHECKBOX WVW_ID_BASE_CHECKBOX + 200 - 1
/* ie. effectively there are max 200 buttons on a window */
#define WVW_ID_BASE_COMBOBOX WVW_ID_MAX_PUSHBUTTON+1
#define WVW_CB_KBD_STANDARD 0
#define WVW_CB_KBD_CLIPPER 1
#define WVW_ID_BASE_COMBOBOX WVW_ID_MAX_PUSHBUTTON + 1
#define WVW_CB_KBD_STANDARD 0
#define WVW_CB_KBD_CLIPPER 1
#define WVW_COMBOBOX_MAXLEN 255 /* maximum length of combobox string */
#define WVW_COMBOBOX_MAXLEN 255 /* maximum length of combobox string */
#define WVW_ID_MAX_COMBOBOX WVW_ID_BASE_COMBOBOX+200-1
#define WVW_ID_MAX_COMBOBOX WVW_ID_BASE_COMBOBOX + 200 - 1
#define WVW_ID_BASE_EDITBOX WVW_ID_MAX_COMBOBOX+1
#define WVW_ID_MAX_EDITBOX WVW_ID_BASE_EDITBOX+200-1
#define WVW_ID_BASE_EDITBOX WVW_ID_MAX_COMBOBOX + 1
#define WVW_ID_MAX_EDITBOX WVW_ID_BASE_EDITBOX + 200 - 1
#define WVW_EB_SINGLELINE 1
#define WVW_EB_MULTILINE 2
#define WVW_EB_SINGLELINE 1
#define WVW_EB_MULTILINE 2
#define WVW_CHAR_QUEUE_SIZE 128
#define WVW_MAX_TITLE_SIZE 128
#define WVW_CHAR_BUFFER 1024
#define WVW_MAX_ROWS 256
#define WVW_MAX_COLS 256
#define WVW_DEFAULT_ROWS 25
#define WVW_DEFAULT_COLS 80
#define WVW_CHAR_QUEUE_SIZE 128
#define WVW_MAX_TITLE_SIZE 128
#define WVW_CHAR_BUFFER 1024
#define WVW_MAX_ROWS 256
#define WVW_MAX_COLS 256
#define WVW_DEFAULT_ROWS 25
#define WVW_DEFAULT_COLS 80
#define WVW_PICTURES_MAX 20
#define WVW_PICTURES_MAX 20
#define WVW_FONTS_MAX 20
#define WVW_PENS_MAX 20
#define WVW_DLGML_MAX 20
#define WVW_DLGMD_MAX 20
#define WVW_FONTS_MAX 20
#define WVW_PENS_MAX 20
#define WVW_DLGML_MAX 20
#define WVW_DLGMD_MAX 20
/* default maximum number of user bitmap cache
One bitmap cache currently takes 280 bytes (see BITMAP_HANDLE).
See also wvw_setMaxBMCache().
*/
#define WVW_DEFAULT_MAX_BMCACHE 20
#define WVW_DEFAULT_MAX_BMCACHE 20
/* Como as descricoes sao grandes, precisei aumetar isso - Peluffo - 26/10/2007
#define WVW_TB_LABELMAXLENGTH 40
*/
#define WVW_TB_LABELMAXLENGTH 100
#define WVW_TB_LABELMAXLENGTH 100
//#define WVW_WHICH_WINDOW ( HB_ISNIL( 1 ) ? ( s_bMainCoordMode ? s_usNumWindows-1 : s_usCurWindow ) : ((UINT) hb_parni( 1 )) )
#define WVW_WHICH_WINDOW ( HB_ISNIL( 1 ) ? ( hb_gt_wvw_GetMainCoordMode() ? ((hb_gt_wvw_GetNumWindows())-1) : hb_gt_wvw_GetCurWindow() ) : ((UINT) hb_parni( 1 )) )
#define WVW_WHICH_WINDOW ( HB_ISNIL( 1 ) ? ( hb_gt_wvw_GetMainCoordMode() ? ( ( hb_gt_wvw_GetNumWindows() ) - 1 ) : hb_gt_wvw_GetCurWindow() ) : ( ( UINT ) hb_parni( 1 ) ) )
#define BLACK RGB( 0x0 ,0x0 ,0x0 )
#define BLUE RGB( 0x0 ,0x0 ,0x85 )
#define GREEN RGB( 0x0 ,0x85,0x0 )
#define CYAN RGB( 0x0 ,0x85,0x85 )
#define RED RGB( 0x85,0x0 ,0x0 )
#define MAGENTA RGB( 0x85,0x0 ,0x85 )
#define BROWN RGB( 0x85,0x85,0x0 )
#define WHITE RGB( 0xC6,0xC6,0xC6 )
#define LIGHT_GRAY RGB( 0x60,0x60,0x60 )
#define BRIGHT_BLUE RGB( 0x00,0x00,0xFF )
#define BRIGHT_GREEN RGB( 0x60,0xFF,0x60 )
#define BRIGHT_CYAN RGB( 0x60,0xFF,0xFF )
#define BRIGHT_RED RGB( 0xF8,0x00,0x26 )
#define BRIGHT_MAGENTA RGB( 0xFF,0x60,0xFF )
#define YELLOW RGB( 0xFF,0xFF,0x00 )
#define BRIGHT_WHITE RGB( 0xFF,0xFF,0xFF )
#define BLACK RGB( 0x0, 0x0, 0x0 )
#define BLUE RGB( 0x0, 0x0, 0x85 )
#define GREEN RGB( 0x0, 0x85, 0x0 )
#define CYAN RGB( 0x0, 0x85, 0x85 )
#define RED RGB( 0x85, 0x0, 0x0 )
#define MAGENTA RGB( 0x85, 0x0, 0x85 )
#define BROWN RGB( 0x85, 0x85, 0x0 )
#define WHITE RGB( 0xC6, 0xC6, 0xC6 )
#define LIGHT_GRAY RGB( 0x60, 0x60, 0x60 )
#define BRIGHT_BLUE RGB( 0x00, 0x00, 0xFF )
#define BRIGHT_GREEN RGB( 0x60, 0xFF, 0x60 )
#define BRIGHT_CYAN RGB( 0x60, 0xFF, 0xFF )
#define BRIGHT_RED RGB( 0xF8, 0x00, 0x26 )
#define BRIGHT_MAGENTA RGB( 0xFF, 0x60, 0xFF )
#define YELLOW RGB( 0xFF, 0xFF, 0x00 )
#define BRIGHT_WHITE RGB( 0xFF, 0xFF, 0xFF )
#if defined(__DMC__)
#if defined( __DMC__ )
#define SBT_TOOLTIPS 0x0800
#define SB_SETICON (WM_USER+15)
#define SB_SETTIPTEXT (WM_USER+17)
#define SB_GETTIPTEXT (WM_USER+18)
#define TBSTYLE_FLAT 0x0800
#define TBSTYLE_LIST 0x1000
#define BTNS_WHOLEDROPDOWN 0x0080
#define TBSTYLE_CUSTOMERASE 0x2000
#define IDB_HIST_SMALL_COLOR 8
#define IDB_HIST_LARGE_COLOR 9
#define TB_SETMAXTEXTROWS (WM_USER + 60)
#define PBS_VERTICAL 0x04
#define PBS_SMOOTH 0x01
#define CCM_FIRST 0x2000
#define CCM_SETBKCOLOR (CCM_FIRST + 1)
#define PBM_SETBKCOLOR CCM_SETBKCOLOR
#define PBM_SETBARCOLOR (WM_USER+9)
#define PBM_GETRANGE (WM_USER+7)
#define PBM_GETPOS (WM_USER+8)
#define SBT_TOOLTIPS 0x0800
#define SB_SETICON ( WM_USER + 15 )
#define SB_SETTIPTEXT ( WM_USER + 17 )
#define SB_GETTIPTEXT ( WM_USER + 18 )
#define TBSTYLE_FLAT 0x0800
#define TBSTYLE_LIST 0x1000
#define BTNS_WHOLEDROPDOWN 0x0080
#define TBSTYLE_CUSTOMERASE 0x2000
#define IDB_HIST_SMALL_COLOR 8
#define IDB_HIST_LARGE_COLOR 9
#define TB_SETMAXTEXTROWS ( WM_USER + 60 )
#define PBS_VERTICAL 0x04
#define PBS_SMOOTH 0x01
#define CCM_FIRST 0x2000
#define CCM_SETBKCOLOR ( CCM_FIRST + 1 )
#define PBM_SETBKCOLOR CCM_SETBKCOLOR
#define PBM_SETBARCOLOR ( WM_USER + 9 )
#define PBM_GETRANGE ( WM_USER + 7 )
#define PBM_GETPOS ( WM_USER + 8 )
typedef DWORD UINT_PTR;
typedef DWORD UINT_PTR;
typedef struct
{
int iLow;
int iHigh;
} PBRANGE, *PPBRANGE;
typedef struct
{
int iLow;
int iHigh;
} PBRANGE, * PPBRANGE;
#define ICC_BAR_CLASSES 0x00000004
#define ICC_BAR_CLASSES 0x00000004
typedef USHORT COLOR16;
typedef USHORT COLOR16;
typedef struct _TRIVERTEX {
LONG x;
LONG y;
COLOR16 Red;
COLOR16 Green;
COLOR16 Blue;
COLOR16 Alpha;
} TRIVERTEX,*PTRIVERTEX,*LPTRIVERTEX;
typedef struct _TRIVERTEX
{
LONG x;
LONG y;
COLOR16 Red;
COLOR16 Green;
COLOR16 Blue;
COLOR16 Alpha;
} TRIVERTEX, * PTRIVERTEX, * LPTRIVERTEX;
typedef struct tagINITCOMMONCONTROLSEX {
DWORD dwSize;
DWORD dwICC;
} INITCOMMONCONTROLSEX, *LPINITCOMMONCONTROLSEX;
typedef struct tagINITCOMMONCONTROLSEX
{
DWORD dwSize;
DWORD dwICC;
} INITCOMMONCONTROLSEX, * LPINITCOMMONCONTROLSEX;
WINCOMMCTRLAPI BOOL WINAPI InitCommonControlsEx(LPINITCOMMONCONTROLSEX);
WINCOMMCTRLAPI BOOL WINAPI InitCommonControlsEx( LPINITCOMMONCONTROLSEX );
typedef struct _GRADIENT_RECT {
ULONG UpperLeft;
ULONG LowerRight;
} GRADIENT_RECT,*PGRADIENT_RECT,*LPGRADIENT_RECT;
typedef struct _GRADIENT_RECT
{
ULONG UpperLeft;
ULONG LowerRight;
} GRADIENT_RECT, * PGRADIENT_RECT, * LPGRADIENT_RECT;
#endif
#define WM_MY_UPDATE_CARET ( WM_USER + 0x0101 )
typedef BOOL ( WINAPI *wvwGradientFill ) (
HDC hdc,
PTRIVERTEX pVertex,
ULONG dwNumVertex,
PVOID pMesh,
ULONG dwNumMesh,
ULONG dwMode );
typedef BOOL ( WINAPI * wvwGradientFill )(
HDC hdc,
PTRIVERTEX pVertex,
ULONG dwNumVertex,
PVOID pMesh,
ULONG dwNumMesh,
ULONG dwMode );
#ifndef _MAX_PATH
#define _MAX_PATH 256
@@ -328,18 +331,18 @@ typedef BOOL ( WINAPI *wvwGradientFill ) (
typedef struct bitmap_handle
{
char szFilename[_MAX_PATH+1];
HBITMAP hBitmap;
int iWidth, iHeight;
struct bitmap_handle * pNext;
char szFilename[ _MAX_PATH + 1 ];
HBITMAP hBitmap;
int iWidth, iHeight;
struct bitmap_handle * pNext;
} BITMAP_HANDLE;
typedef struct picture_handle
{
char szFilename[_MAX_PATH+1];
IPicture * iPicture;
int iWidth, iHeight;
struct picture_handle * pNext;
char szFilename[ _MAX_PATH + 1 ];
IPicture * iPicture;
int iWidth, iHeight;
struct picture_handle * pNext;
} PICTURE_HANDLE;
#define WVW_CONTROL_SCROLLBAR 1
@@ -350,269 +353,269 @@ typedef struct picture_handle
#define WVW_CONTROL_EDITBOX 5
#define WVW_CONTROL_STATIC 6
#define WVW_MAXCAPTIONLENGTH 80
#define WVW_MAXCAPTIONLENGTH 80
typedef struct control_data
{
BYTE byCtrlClass;
HWND hWndCtrl;
UINT uiCtrlid;
PHB_ITEM phiCodeBlock;
BOOL bBusy;
UINT uiBusy;
RECT rCtrl, rOffCtrl;
BYTE byCtrlClass;
HWND hWndCtrl;
UINT uiCtrlid;
PHB_ITEM phiCodeBlock;
BOOL bBusy;
UINT uiBusy;
RECT rCtrl, rOffCtrl;
/* SCROLLBAR specifics: */
/* also used by combobox to store kbd type */
/* also used by editbox to store editbox type */
byte bStyle;
/* SCROLLBAR specifics: */
/* also used by combobox to store kbd type */
/* also used by editbox to store editbox type */
byte bStyle;
/* PUSHBUTTON & CHECKBOX specifics: */
WNDPROC OldProc;
/* PUSHBUTTON & CHECKBOX specifics: */
WNDPROC OldProc;
struct control_data * pNext;
struct control_data * pNext;
} CONTROL_DATA;
typedef struct app_data
{
BOOL CaretExist; /* TRUE if a caret has been created */
BOOL displayCaret; /* flag to indicate if caret is on */
BOOL CaretExist; /* TRUE if a caret has been created */
BOOL displayCaret; /* flag to indicate if caret is on */
BOOL Win9X; /* Flag to say if running on Win9X not NT/2000/XP */
BOOL AltF4Close; /* Can use Alt+F4 to close application */
BOOL Win9X; /* Flag to say if running on Win9X not NT/2000/XP */
BOOL AltF4Close; /* Can use Alt+F4 to close application */
HPEN penWhite; /* White pen to draw GDI elements */
HPEN penBlack; /* Black pen to draw GDI elements */
HPEN penWhiteDim; /* White dim pen to draw GDI elements */
HPEN penDarkGray; /* Dark gray pen to draw GDI elements */
HPEN penGray; /* Gray pen equivalent to Clipper White */
HPEN penNull; /* Null pen */
HPEN OriginalPen; /* Handle da Pen original do Device Context */
HPEN currentPen; /* Handle to current pen settable at runtime */
HPEN gridPen; /* Handle da Pen para Grid */
HBRUSH currentBrush; /* Handle to current brush settable by runtime */
HBRUSH diagonalBrush; /* Handle to diaoganl brush to draw scrollbars */
HBRUSH solidBrush; /* Handle to solid brush */
HBRUSH wvwWhiteBrush; /* Wvw specific White colored brush */
HBRUSH OriginalBrush; /* Handle da Brush original do Device Context */
HPEN penWhite; /* White pen to draw GDI elements */
HPEN penBlack; /* Black pen to draw GDI elements */
HPEN penWhiteDim; /* White dim pen to draw GDI elements */
HPEN penDarkGray; /* Dark gray pen to draw GDI elements */
HPEN penGray; /* Gray pen equivalent to Clipper White */
HPEN penNull; /* Null pen */
HPEN OriginalPen; /* Handle da Pen original do Device Context */
HPEN currentPen; /* Handle to current pen settable at runtime */
HPEN gridPen; /* Handle da Pen para Grid */
HBRUSH currentBrush; /* Handle to current brush settable by runtime */
HBRUSH diagonalBrush; /* Handle to diaoganl brush to draw scrollbars */
HBRUSH solidBrush; /* Handle to solid brush */
HBRUSH wvwWhiteBrush; /* Wvw specific White colored brush */
HBRUSH OriginalBrush; /* Handle da Brush original do Device Context */
IPicture *iPicture[ WVW_PICTURES_MAX ]; /* Array to hold the Picture Streams to avoid recurring loading and unloading */
HFONT hUserFonts[ WVW_FONTS_MAX ] ; /* User defined font handles */
HPEN hUserPens[ WVW_PENS_MAX ]; /* User defined pens */
IPicture * iPicture[ WVW_PICTURES_MAX ]; /* Array to hold the Picture Streams to avoid recurring loading and unloading */
HFONT hUserFonts[ WVW_FONTS_MAX ]; /* User defined font handles */
HPEN hUserPens[ WVW_PENS_MAX ]; /* User defined pens */
HINSTANCE hMSImg32; /* Handle to the loaded library msimg32.dll */
wvwGradientFill pfnGF; /* Pointer to Address of the GradientFill function in MSImg32.dll */
HINSTANCE hMSImg32; /* Handle to the loaded library msimg32.dll */
wvwGradientFill pfnGF; /* Pointer to Address of the GradientFill function in MSImg32.dll */
HWND hDlgModeless[ WVW_DLGML_MAX ]; /* Handle to a modeless dialog */
HWND hDlgModeless[ WVW_DLGML_MAX ]; /* Handle to a modeless dialog */
PHB_ITEM pFunc[ WVW_DLGML_MAX ]; /* Function pointer for WndProc */
/* TODO: pcbFunc is redundant and should be removed */
PHB_ITEM pcbFunc[ WVW_DLGML_MAX ]; /* codeblock for WndProc */
int iType[ WVW_DLGML_MAX ]; /* Type of Function Pointers - Function 1, Block 2, Method 3 */
PHB_ITEM pFunc[ WVW_DLGML_MAX ]; /* Function pointer for WndProc */
/* TODO: pcbFunc is redundant and should be removed */
PHB_ITEM pcbFunc[ WVW_DLGML_MAX ]; /* codeblock for WndProc */
int iType[ WVW_DLGML_MAX ]; /* Type of Function Pointers - Function 1, Block 2, Method 3 */
HWND hDlgModal[ WVW_DLGMD_MAX ]; /* Handle to a modal dialog */
PHB_ITEM pFuncModal[ WVW_DLGMD_MAX ]; /* Function pointer for WndProc */
/* TODO: pcbFuncModal is redundant and should be removed */
PHB_ITEM pcbFuncModal[ WVW_DLGMD_MAX ]; /* codeblock for WndProc */
int iTypeModal[ WVW_DLGMD_MAX ]; /* Type of Function Pointers - Function 1, Block 2, Method 3 */
HWND hDlgModal[ WVW_DLGMD_MAX ]; /* Handle to a modal dialog */
PHB_ITEM pFuncModal[ WVW_DLGMD_MAX ]; /* Function pointer for WndProc */
/* TODO: pcbFuncModal is redundant and should be removed */
PHB_ITEM pcbFuncModal[ WVW_DLGMD_MAX ]; /* codeblock for WndProc */
int iTypeModal[ WVW_DLGMD_MAX ]; /* Type of Function Pointers - Function 1, Block 2, Method 3 */
BITMAP_HANDLE * pbhBitmapList;
PICTURE_HANDLE * pphPictureList;
BITMAP_HANDLE * pbhBitmapList;
PICTURE_HANDLE * pphPictureList;
BITMAP_HANDLE * pbhUserBitmap; /* User bitmap (wvw_drawimage) */
UINT uiBMcache; /* number of bitmap cached */
UINT uiMaxBMcache; /* maximum number of bitmap cached */
BITMAP_HANDLE * pbhUserBitmap; /* User bitmap (wvw_drawimage) */
UINT uiBMcache; /* number of bitmap cached */
UINT uiMaxBMcache; /* maximum number of bitmap cached */
PHB_DYNS pSymWVW_PAINT; /* Stores pointer to WVW_PAINT function */
PHB_DYNS pSymWVW_SETFOCUS; /* Stores pointer to WVW_SETFOCUS function */
PHB_DYNS pSymWVW_KILLFOCUS; /* Stores pointer to WVW_KILLFOCUS function */
PHB_DYNS pSymWVW_MOUSE; /* Stores pointer to WVW_MOUSE function */
PHB_DYNS pSymWVW_TBMOUSE; /* Stores pointer to WVW_TBMOUSE function */
PHB_DYNS pSymWVW_MENUSELECT; /* Stores pointer to WVW_MENUSELECT function*/
PHB_DYNS pSymWVW_PAINT; /* Stores pointer to WVW_PAINT function */
PHB_DYNS pSymWVW_SETFOCUS; /* Stores pointer to WVW_SETFOCUS function */
PHB_DYNS pSymWVW_KILLFOCUS; /* Stores pointer to WVW_KILLFOCUS function */
PHB_DYNS pSymWVW_MOUSE; /* Stores pointer to WVW_MOUSE function */
PHB_DYNS pSymWVW_TBMOUSE; /* Stores pointer to WVW_TBMOUSE function */
PHB_DYNS pSymWVW_MENUSELECT; /* Stores pointer to WVW_MENUSELECT function*/
PHB_DYNS pSymWVW_SIZE; /* Stores pointer to WVW_SIZE function */
PHB_DYNS pSymWVW_MOVE; /* Stores pointer to WVW_MOVE function */
PHB_DYNS pSymWVW_SIZE; /* Stores pointer to WVW_SIZE function */
PHB_DYNS pSymWVW_MOVE; /* Stores pointer to WVW_MOVE function */
PHB_DYNS pSymWVW_INPUTFOCUS; /* Stores pointer to WVW_INPUTFOCUS function*/
PHB_DYNS pSymWVW_INPUTFOCUS; /* Stores pointer to WVW_INPUTFOCUS function*/
PHB_DYNS pSymWVW_TIMER; /* Stores pointer to WVW_TIMER function */
PHB_DYNS pSymWVW_ONCTLCOLOR; /* Stores pointer to WVW_TIMER function */
PHB_DYNS pSymWVW_TIMER; /* Stores pointer to WVW_TIMER function */
PHB_DYNS pSymWVW_ONCTLCOLOR; /* Stores pointer to WVW_TIMER function */
} APP_DATA;
typedef struct win_data
{
UINT byWinId; /*x Window's Id, a number 0..WVWMAXWINDOWS */
TCHAR szWinName[ WVW_MAXWINNAMELENGTH ]; /*x name of Window ~ szAppName for Window 0 */
UINT byWinId; /*x Window's Id, a number 0..WVWMAXWINDOWS */
TCHAR szWinName[ WVW_MAXWINNAMELENGTH ]; /*x name of Window ~ szAppName for Window 0 */
int byLineSpacing; /*x linespacing in pixels */
int iLSpaceColor; /*x linespacing color index */
int byLineSpacing; /*x linespacing in pixels */
int iLSpaceColor; /*x linespacing color index */
USHORT usRowOfs; /*x offset to Main Window's (0,0) */
USHORT usColOfs; /*x offset to Main Window's (0,0) */
int uiDispCount; /*x pending DispEnd() request */
BOOL bPaintPending; /*x pending WVW_PAINT() execution */
RECT rPaintPending; /*x rect of pending bPaintPending */
HWND hStatusBar; /* handle to status bar */
USHORT usSBHeight; /* height of status bar */
USHORT usRowOfs; /*x offset to Main Window's (0,0) */
USHORT usColOfs; /*x offset to Main Window's (0,0) */
int uiDispCount; /*x pending DispEnd() request */
BOOL bPaintPending; /*x pending WVW_PAINT() execution */
RECT rPaintPending; /*x rect of pending bPaintPending */
HWND hStatusBar; /* handle to status bar */
USHORT usSBHeight; /* height of status bar */
HWND hToolBar; /* TB handle to toolbar */
USHORT usTBHeight; /* TB height of toolbar */
int iStartStdBitmap,
iStartViewBitmap,
iStartHistBitmap; /* start of bitmap index */
int iTBImgWidth,
iTBImgHeight; /* image width and height */
WNDPROC tbOldProc;
HWND hToolBar; /* TB handle to toolbar */
USHORT usTBHeight; /* TB height of toolbar */
int iStartStdBitmap,
iStartViewBitmap,
iStartHistBitmap; /* start of bitmap index */
int iTBImgWidth,
iTBImgHeight; /* image width and height */
WNDPROC tbOldProc;
CONTROL_DATA * pcdCtrlList; /* lists of created controls, eg. scrollbars */
CONTROL_DATA * pcdCtrlList; /* lists of created controls, eg. scrollbars */
HFONT hPBfont; /* handle to font used by pushbuttons & checkboxes */
HFONT hPBfont; /* handle to font used by pushbuttons & checkboxes */
HFONT hCBfont; /* handle to font used by comboboxes */
HFONT hCBfont; /* handle to font used by comboboxes */
HFONT hEBfont; /* handle to font used by editboxes */
HFONT hEBfont; /* handle to font used by editboxes */
HFONT hSBfont; /* handle to font used by pushbuttons & checkboxes */
HFONT hSBfont; /* handle to font used by pushbuttons & checkboxes */
HFONT hCXfont; /* handle to font used by checkboxes when 'focused' */
HFONT hSTfont; /* handle to font used by checkboxes when 'focused' */
HFONT hCXfont; /* handle to font used by checkboxes when 'focused' */
HFONT hSTfont; /* handle to font used by checkboxes when 'focused' */
BOOL bSBPaint;
COLORREF cSBColorForeground;
COLORREF cSBColorBackground;
BOOL bSBPaint;
COLORREF cSBColorForeground;
COLORREF cSBColorBackground;
BOOL bIgnoreWM_SYSCHAR;
BOOL bPaint;
BOOL bGetFocus;
BOOL bIgnoreWM_SYSCHAR;
BOOL bPaint;
BOOL bGetFocus;
POINT PTEXTSIZE; /* size of the fixed width font */
BOOL FixedFont; /* TRUE if current font is a fixed font */
int FixedSize[ WVW_MAX_COLS ]; /* buffer for ExtTextOut() to emulate fixed pitch when Proportional font selected */
USHORT ROWS; /* number of displayable rows in window */
USHORT COLS; /* number of displayable columns in window */
COLORREF foreground; /* foreground colour */
POINT PTEXTSIZE; /* size of the fixed width font */
BOOL FixedFont; /* TRUE if current font is a fixed font */
int FixedSize[ WVW_MAX_COLS ]; /* buffer for ExtTextOut() to emulate fixed pitch when Proportional font selected */
USHORT ROWS; /* number of displayable rows in window */
USHORT COLS; /* number of displayable columns in window */
COLORREF foreground; /* foreground colour */
COLORREF background; /* background colour */
COLORREF background; /* background colour */
USHORT BUFFERSIZE; /* size of the screen text buffer */
BYTE byBuffer[ WVW_MAX_ROWS * WVW_MAX_COLS ]; /* buffer with the text to be displayed on the screen */
BYTE byColors[ WVW_MAX_ROWS * WVW_MAX_COLS ];
BYTE *pBuffer; /* " " " */
BYTE *pColors; /* " " " */
POINT caretPos; /* the current caret position */
USHORT BUFFERSIZE; /* size of the screen text buffer */
BYTE byBuffer[ WVW_MAX_ROWS * WVW_MAX_COLS ]; /* buffer with the text to be displayed on the screen */
BYTE byColors[ WVW_MAX_ROWS * WVW_MAX_COLS ];
BYTE * pBuffer; /* " " " */
BYTE * pColors; /* " " " */
POINT caretPos; /* the current caret position */
int CaretSize; /*x this may be specific to each windows, eg. different font size */
POINT mousePos; /* the last mousedown position */
BOOL MouseMove; /* Flag to say whether to return mouse movement events */
HWND hWnd; /* the window handle */
int Keys[ WVW_CHAR_QUEUE_SIZE ]; /* Array to hold the characters & events */
int keyPointerIn; /* Offset into key array for character to be placed */
int keyPointerOut; /* Offset into key array of next character to read */
int keyLast;
int CaretSize; /*x this may be specific to each windows, eg. different font size */
POINT mousePos; /* the last mousedown position */
BOOL MouseMove; /* Flag to say whether to return mouse movement events */
HWND hWnd; /* the window handle */
int Keys[ WVW_CHAR_QUEUE_SIZE ]; /* Array to hold the characters & events */
int keyPointerIn; /* Offset into key array for character to be placed */
int keyPointerOut; /* Offset into key array of next character to read */
int keyLast;
RECT RectInvalid; /* Invalid rectangle if DISPBEGIN() active */
HFONT hFont;
int fontHeight; /* requested font height */
int fontWidth ; /* requested font width */
int fontWeight; /* Bold level */
int fontQuality;
char fontFace[ LF_FACESIZE ]; /* requested font face name LF_FACESIZE #defined in wingdi.h */
RECT RectInvalid; /* Invalid rectangle if DISPBEGIN() active */
HFONT hFont;
int fontHeight; /* requested font height */
int fontWidth; /* requested font width */
int fontWeight; /* Bold level */
int fontQuality;
char fontFace[ LF_FACESIZE ]; /* requested font face name LF_FACESIZE #defined in wingdi.h */
int LastMenuEvent; /* Last menu item selected */
int MenuKeyEvent; /* User definable event number for windows menu command */
BOOL CentreWindow; /* True if window is to be Reset into centre of window */
int LastMenuEvent; /* Last menu item selected */
int MenuKeyEvent; /* User definable event number for windows menu command */
BOOL CentreWindow; /* True if window is to be Reset into centre of window */
/* if CentreWindow is FALSE, two following settings are examined */
BOOL HCentreWindow; /* True if window is to be Reset into centre of window, horizontally */
BOOL VCentreWindow; /* True if window is to be Reset into centre of window, vertically */
/* if CentreWindow is FALSE, two following settings are examined */
BOOL HCentreWindow; /* True if window is to be Reset into centre of window, horizontally */
BOOL VCentreWindow; /* True if window is to be Reset into centre of window, vertically */
int CodePage; /* Code page to use for display characters */
int CodePage; /* Code page to use for display characters */
BOOL InvalidateWindow; /* Flag for controlling whether to use ScrollWindowEx() */
BOOL EnableShortCuts; /* Determines whether ALT key enables menu or system menu */
BOOL InvalidateWindow; /* Flag for controlling whether to use ScrollWindowEx() */
BOOL EnableShortCuts; /* Determines whether ALT key enables menu or system menu */
HDC hdc; /* Handle to Windows Device Context */
HDC hdc; /* Handle to Windows Device Context */
HMENU hPopup; /* Handle of context menu invokable with right click */
HMENU hPopup; /* Handle of context menu invokable with right click */
HDC hCompDC; /* Compatible DC to _s.hdc */
HWND hWndTT; /* Handle to hold tooltip information */
BOOL bToolTipActive; /* Flag to set whether tooltip is active or not */
HICON hIcon;
HDC hCompDC; /* Compatible DC to _s.hdc */
HWND hWndTT; /* Handle to hold tooltip information */
BOOL bToolTipActive; /* Flag to set whether tooltip is active or not */
HICON hIcon;
} WIN_DATA;
typedef struct wvw_data
{
UINT s_uiPaintRefresh ; /* milliseconds between timer check */
UINT s_uiPaintRefresh; /* milliseconds between timer check */
BOOL s_bMainCoordMode ; /* in this mode, all HB_GT_FUNC() uses Main Window's coordinate */
BOOL s_bMainCoordMode; /* in this mode, all HB_GT_FUNC() uses Main Window's coordinate */
BOOL s_bVertCaret ; /* if TRUE, caret is in Vertical style */
BOOL s_bVertCaret; /* if TRUE, caret is in Vertical style */
BOOL s_bNOSTARTUPSUBWINDOW ; /* if TRUE, subwindow will not be displayed during opening */
/* use WVW_NOSTARTUPSUBWINDOW() to check/set it */
BOOL s_bNOSTARTUPSUBWINDOW; /* if TRUE, subwindow will not be displayed during opening */
/* use WVW_NOSTARTUPSUBWINDOW() to check/set it */
BOOL s_bDefCentreWindow ; /* default CentreWindow setting for subwindows */
BOOL s_bDefCentreWindow; /* default CentreWindow setting for subwindows */
BOOL s_bDefHCentreWindow ; /* default HCentreWindow setting for subwindows */
BOOL s_bDefVCentreWindow ; /* default VCentreWindow setting for subwindows */
BOOL s_bDefHCentreWindow; /* default HCentreWindow setting for subwindows */
BOOL s_bDefVCentreWindow; /* default VCentreWindow setting for subwindows */
int s_byDefLineSpacing ; /* default line spacing */
int s_byDefLineSpacing; /* default line spacing */
int s_iDefLSpaceColor ; /* if >; //= 0 this will be the color index for spacing between lines */
int s_iDefLSpaceColor; /* if >; //= 0 this will be the color index for spacing between lines */
BOOL s_bAllowNonTop ; /* allow non-topmost window's control to accept input */
BOOL s_bAllowNonTop; /* allow non-topmost window's control to accept input */
BOOL s_bRecurseCBlock ; /* allow control's codeblock to recurse */
BOOL s_bRecurseCBlock; /* allow control's codeblock to recurse */
LOGFONT s_lfPB ; /* default font for pushbuttons */
LOGFONT s_lfPB; /* default font for pushbuttons */
LOGFONT s_lfSB ; /* default font for statusbar */
LOGFONT s_lfCB ; /* default font for comboboxes */
LOGFONT s_lfSB; /* default font for statusbar */
LOGFONT s_lfCB; /* default font for comboboxes */
LOGFONT s_lfEB ; /* default font for editboxes */
LOGFONT s_lfEB; /* default font for editboxes */
LOGFONT s_lfCX ; /* font for 'focused'checkbox */
LOGFONT s_lfST ; /* font for control */
LOGFONT s_lfCX; /* font for 'focused'checkbox */
LOGFONT s_lfST; /* font for control */
HWND hWndTT ; /* Window handle Tool Tip */
HWND hWndTT; /* Window handle Tool Tip */
/* read only by user ***/
/* for GTWVW private use: ***********************************************/
BOOL s_bQuickSetMode ; /* quick SetMode(), to reset maxrow() and maxcol() only */
BOOL s_bQuickSetMode; /* quick SetMode(), to reset maxrow() and maxcol() only */
BOOL s_bFlashingWindow ;
/* topmost window is flashing
due to invalid input on other
window */
BOOL s_bFlashingWindow;
/* topmost window is flashing
due to invalid input on other
window */
int s_iScrolling ; /* scrollbar is scrolling */
int s_iWrongButtonUp ; /* number of consecutive scrollbar's WM_LBUTTONUP encountered by gtProcessMessages */
int s_iMaxWrongButtonUp ;
/* max number of s_iWrongButtonUp. If it goes higher than this number,
the scrollbar is forced to stop */
int s_iScrolling; /* scrollbar is scrolling */
int s_iWrongButtonUp; /* number of consecutive scrollbar's WM_LBUTTONUP encountered by gtProcessMessages */
int s_iMaxWrongButtonUp;
/* max number of s_iWrongButtonUp. If it goes higher than this number,
the scrollbar is forced to stop */
TCHAR szAppName[13] ;
TCHAR szSubWinName[25] ;
BOOL s_bSWRegistered ;
TCHAR szAppName[ 13 ];
TCHAR szSubWinName[ 25 ];
BOOL s_bSWRegistered;
HINSTANCE hInstance;
HINSTANCE hInstance;
UINT s_usNumWindows; /*number of windows */
UINT s_usCurWindow ; /*current window handled by HB_GT_FUNC(...) */
UINT s_usNumWindows; /*number of windows */
UINT s_usCurWindow; /*current window handled by HB_GT_FUNC(...) */
WIN_DATA *s_pWindows[ WVW_MAXWINDOWS ]; /*array of WIN_DATA */
APP_DATA *s_sApp; /*application wide vars */
WIN_DATA * s_pWindows[ WVW_MAXWINDOWS ]; /*array of WIN_DATA */
APP_DATA * s_sApp; /*application wide vars */
}WVW_DATA ;
}WVW_DATA;
//#define HB_RETHANDLE( h ) hb_retptr( ( void * ) ( h ) )
//#define HB_PARHANDLE( n ) hb_parptr( n )
//#define HB_STOREHANDLE( h, n ) hb_storptr( ( void * ) ( h ), n )
//#define HB_RETHANDLE( h ) hb_retptr( ( void * ) ( h ) )
//#define HB_PARHANDLE( n ) hb_parptr( n )
//#define HB_STOREHANDLE( h, n ) hb_storptr( ( void * ) ( h ), n )
#define HB_RETHANDLE( h ) hb_retnl( ( LONG ) ( h ) )
#define HB_PARHANDLE( n ) ( ( LONG ) hb_parnl( n ) )
#define HB_STOREHANDLE( h, n ) hb_stornl( ( LONG ) ( h ), n )
@@ -622,9 +625,9 @@ HB_EXTERN_BEGIN
extern BOOL hb_gt_wvw_GetMainCoordMode( void );
extern UINT hb_gt_wvw_GetNumWindows( void );
extern UINT hb_gt_wvw_GetCurWindow( void );
extern APP_DATA* hb_gt_wvwGetAppData( void );
extern WIN_DATA * hb_gt_wvw_GetWindowsData( UINT iWin ) ;
extern WVW_DATA * hb_getWvwData( void ) ;
extern APP_DATA * hb_gt_wvwGetAppData( void );
extern WIN_DATA * hb_gt_wvw_GetWindowsData( UINT iWin );
extern WVW_DATA * hb_getWvwData( void );
extern char * hb_gt_wvw_GetAppName( void );
extern void hb_gt_wvwResetWindow( UINT usWinNum );
extern BOOL hb_gt_wvwSetMenuKeyEvent( UINT usWinNum, int iMenuKeyEvent );
@@ -641,35 +644,35 @@ extern RECT hb_gt_wvwGetXYFromColRowRect( WIN_DATA * pWindowData, RECT colrow
extern POINT hb_gt_wvwGetXYFromColRow( WIN_DATA * pWindowData, USHORT col, USHORT row );
extern DWORD hb_gt_wvwGetColorData( int iIndex );
extern BOOL GetImageDimension(const char * image, int * pWidth, int * pHeight);
extern BOOL GetIPictDimension(IPicture * pPic, int * pWidth, int * pHeight);
extern BOOL GetImageDimension( const char * image, int * pWidth, int * pHeight );
extern BOOL GetIPictDimension( IPicture * pPic, int * pWidth, int * pHeight );
extern LRESULT CALLBACK hb_gt_wvwTBProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam );
extern void hb_gt_wvwTBinitSize( WIN_DATA * pWindowData, HWND hWndTB );
extern int IndexToCommand(HWND hWndTB, int iIndex);
extern int CommandToIndex(HWND hWndTB, int iCommand);
extern BOOL AddTBButton(HWND hWndToolbar, char * szBitmap, UINT uiBitmap, char * pszLabel, int iCommand, int iBitmapType, BOOL bMap3Dcolors, WIN_DATA * pWindowData, BOOL bDropdown);
extern int IndexToCommand( HWND hWndTB, int iIndex );
extern int CommandToIndex( HWND hWndTB, int iCommand );
extern BOOL AddTBButton( HWND hWndToolbar, char * szBitmap, UINT uiBitmap, char * pszLabel, int iCommand, int iBitmapType, BOOL bMap3Dcolors, WIN_DATA * pWindowData, BOOL bDropdown );
extern RECT hb_gt_wvwGetColRowFromXYRect( WIN_DATA * pWIndowData, RECT xy );
extern BYTE hb_wvw_LineHeight( WIN_DATA * pWindowData );
extern DWORD hb_gt_wvwProcessMessages( WIN_DATA * pWindowData );
/* control (eg. scrollbar) supporters: */
extern HWND FindControlHandle(UINT usWinNum, BYTE byCtrlClass, UINT uiCtrlid, byte * pbStyle);
extern UINT FindControlId(UINT usWinNum, BYTE byCtrlClass, HWND hWndCtrl, byte * pbStyle);
extern UINT LastControlId(UINT usWinNum, BYTE byCtrlClass);
extern void AddControlHandle(UINT usWinNum, BYTE byCtrlClass, HWND hWndCtrl, UINT uiCtrlid, PHB_ITEM phiCodeBlock, RECT rCtrl, RECT rOffCtrl, byte bStyle);
extern HWND FindControlHandle( UINT usWinNum, BYTE byCtrlClass, UINT uiCtrlid, byte * pbStyle );
extern UINT FindControlId( UINT usWinNum, BYTE byCtrlClass, HWND hWndCtrl, byte * pbStyle );
extern UINT LastControlId( UINT usWinNum, BYTE byCtrlClass );
extern void AddControlHandle( UINT usWinNum, BYTE byCtrlClass, HWND hWndCtrl, UINT uiCtrlid, PHB_ITEM phiCodeBlock, RECT rCtrl, RECT rOffCtrl, byte bStyle );
extern CONTROL_DATA * GetControlData(UINT usWinNum, BYTE byCtrlClass, HWND hWndCtrl, UINT uiCtrlid);
extern CONTROL_DATA * GetControlData( UINT usWinNum, BYTE byCtrlClass, HWND hWndCtrl, UINT uiCtrlid );
extern BOOL StoreControlProc(UINT usWinNum, BYTE byCtrlClass, HWND hWndCtrl, WNDPROC OldProc);
extern WNDPROC GetControlProc(UINT usWinNum, BYTE byCtrlClass, HWND hWndCtrl);
extern BOOL StoreControlProc( UINT usWinNum, BYTE byCtrlClass, HWND hWndCtrl, WNDPROC OldProc );
extern WNDPROC GetControlProc( UINT usWinNum, BYTE byCtrlClass, HWND hWndCtrl );
extern LRESULT CALLBACK hb_gt_wvwXBProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam );
extern LRESULT CALLBACK hb_gt_wvwBtnProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam );
extern UINT ButtonCreate( UINT usWinNum, USHORT usTop, USHORT usLeft, USHORT usBottom, USHORT usRight, LPCTSTR lpszCaption,
extern UINT ButtonCreate( UINT usWinNum, USHORT usTop, USHORT usLeft, USHORT usBottom, USHORT usRight, LPCTSTR lpszCaption,
char * szBitmap, UINT uiBitmap, PHB_ITEM phbiCodeBlock,
int iOffTop, int iOffLeft, int iOffBottom, int iOffRight,
double dStretch, BOOL bMap3Dcolors,
int iStyle );
extern LRESULT CALLBACK hb_gt_wvwCBProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam );
extern LONG GetFontDialogUnits(HWND h,HFONT f);
extern LONG GetFontDialogUnits( HWND h, HFONT f );
extern HFONT hb_gt_wvwGetFont( const char * pszFace, int iHeight, int iWidth, int iWeight, int iQuality, int iCodePage );
extern LRESULT CALLBACK hb_gt_wvwEBProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam );
extern USHORT hb_gt_wvwGetMouseX( WIN_DATA * pWindowData );

View File

@@ -59,36 +59,36 @@
#ifndef HB_OLE_H_
#define HB_OLE_H_
#if defined(_MSC_VER) && !defined(HB_OS_WIN_64) && \
!defined(__LCC__) && !defined(__POCC__) && !defined(__XCC__)
#if defined( _MSC_VER ) && ! defined( HB_OS_WIN_64 ) && \
! defined( __LCC__ ) && ! defined( __POCC__ ) && ! defined( __XCC__ )
#ifndef CINTERFACE
#define CINTERFACE 1
#define CINTERFACE 1
#endif
#ifndef _REFGUID_DEFINED
#define _REFGUID_DEFINED 1
#define REFGUID const GUID * const
#define _REFGUID_DEFINED 1
#define REFGUID const GUID * const
#endif
#ifndef _REFIID_DEFINED
#define _REFIID_DEFINED 1
#define REFIID const IID * const
#define _REFIID_DEFINED 1
#define REFIID const IID * const
#endif
#ifndef _REFCLSID_DEFINED
#define _REFCLSID_DEFINED 1
#define REFCLSID const IID * const
#define _REFCLSID_DEFINED 1
#define REFCLSID const IID * const
#endif
#ifndef _REFFMTID_DEFINED
#define _REFFMTID_DEFINED 1
#define REFFMTID const IID * const
#define _REFFMTID_DEFINED 1
#define REFFMTID const IID * const
#endif
#ifndef _SYS_GUID_OPERATOR_EQ_
#define _SYS_GUID_OPERATOR_EQ_ 1
#endif // _SYS_GUID_OPERATOR_EQ_
#define _SYS_GUID_OPERATOR_EQ_ 1
#endif // _SYS_GUID_OPERATOR_EQ_
#endif // _MSC_VER
#endif // HB_OLE_H_
#endif // _MSC_VER
#endif // HB_OLE_H_

View File

@@ -1,5 +1,5 @@
/*
* $Id$
* $Id$
*/
/*
@@ -83,21 +83,21 @@
/*WVW_CXcreate( [nWinNum], nTop, nLeft, nBottom, nRight, cText, cImage/nImage, bBlock, aOffset,;
* nStretchBitmap, lMap3Dcolors)
*create CHECKBOX for window nWinNum
*nTop: row of top/left corner (in character unit)
*nLeft: col of top/left corner (in character unit)
*nBottom: row of bottom/right corner (in character unit) defaults==nTop
*nRight: col of bottom/right corner (in character unit) defaults==??
*cText: caption, default == ""
**create CHECKBOX for window nWinNum
**nTop: row of top/left corner (in character unit)
**nLeft: col of top/left corner (in character unit)
**nBottom: row of bottom/right corner (in character unit) defaults==nTop
**nRight: col of bottom/right corner (in character unit) defaults==??
**cText: caption, default == ""
*
*cImage: bitmap file name, can be supplied as nImage: bitmap resource id
*nStretchBitmap: a number between 0 and 1 (inclusive) as a factor to
**cImage: bitmap file name, can be supplied as nImage: bitmap resource id
**nStretchBitmap: a number between 0 and 1 (inclusive) as a factor to
* stretch the bitmap.
* 1.0: bitmap covers the whole button
* 0.5: bitmap covers 50% of button
* 0: bitmap is not stretch
* (default is 1)
*lMap3Dcolors: defaults to .f.
**lMap3Dcolors: defaults to .f.
* if .t. the following color mapping will be performed:
* RGB(192,192,192) --> COLOR_3DFACE ("transparent")
* RGB(128,128,128) --> COLOR_3DSHADOW
@@ -105,91 +105,94 @@
* This might be desirable to have transparent effect.
* LIMITATION: this will work on 256 colored bitmaps only
*
*aOffset: array {y1,x1,y2,x2} of offsets to corner pixels, to adjust
**aOffset: array {y1,x1,y2,x2} of offsets to corner pixels, to adjust
* dimension of CHECKBOX.
* defaults for CHECKBOX: {-2,-2,+2,+2}
*
*bBlock: codeblock to execute on every BN_CLICK event.
**bBlock: codeblock to execute on every BN_CLICK event.
* This codeblock will be evaluated with these parameters:
* nWinNum: window number
* nCXid : CHECKBOX id
*
*returns control id of newly created CHECKBOX of windows nWinNum
*returns 0 if failed
**returns control id of newly created CHECKBOX of windows nWinNum
**returns 0 if failed
*
*example:
**example:
*/
HB_FUNC( WVW_CXCREATE)
HB_FUNC( WVW_CXCREATE )
{
UINT usWinNum = WVW_WHICH_WINDOW;
int iOffTop, iOffLeft, iOffBottom, iOffRight;
UINT usWinNum = WVW_WHICH_WINDOW;
int iOffTop, iOffLeft, iOffBottom, iOffRight;
// int iStyle;
UINT uiPBid;
USHORT usTop = ( BYTE )hb_parni( 2 ),
usLeft = ( BYTE )hb_parni( 3 ),
usBottom = ( BYTE )hb_parni( 4 ),
usRight = ( BYTE )hb_parni( 5 );
LPCTSTR lpszCaption = HB_ISCHAR(6) ? hb_parcx(6) : NULL;
char * szBitmap = HB_ISCHAR(7) ? (char*) hb_parcx(7) : NULL;
UINT uiBitmap = HB_ISNUM(7) ? (UINT) hb_parni(7) : 0;
double dStretch = !HB_ISNIL(10) ? hb_parnd(10) : 1;
BOOL bMap3Dcolors = HB_ISLOG(11) ? (BOOL) hb_parl(11) : FALSE;
UINT uiPBid;
USHORT usTop = ( BYTE ) hb_parni( 2 ),
usLeft = ( BYTE ) hb_parni( 3 ),
usBottom = ( BYTE ) hb_parni( 4 ),
usRight = ( BYTE ) hb_parni( 5 );
LPCTSTR lpszCaption = HB_ISCHAR( 6 ) ? hb_parcx( 6 ) : NULL;
char * szBitmap = HB_ISCHAR( 7 ) ? ( char * ) hb_parcx( 7 ) : NULL;
UINT uiBitmap = HB_ISNUM( 7 ) ? ( UINT ) hb_parni( 7 ) : 0;
double dStretch = ! HB_ISNIL( 10 ) ? hb_parnd( 10 ) : 1;
BOOL bMap3Dcolors = HB_ISLOG( 11 ) ? ( BOOL ) hb_parl( 11 ) : FALSE;
if (!HB_ISBLOCK(8))
if( ! HB_ISBLOCK( 8 ) )
{
hb_retnl(0);
return;
hb_retnl( 0 );
return;
}
iOffTop = !HB_ISNIL( 9 ) ? hb_parvni( 9,1 ) : -2 ;
iOffLeft = !HB_ISNIL( 9 ) ? hb_parvni( 9,2 ) : -2 ;
iOffBottom = !HB_ISNIL( 9 ) ? hb_parvni( 9,3 ) : +2 ;
iOffRight = !HB_ISNIL( 9 ) ? hb_parvni( 9,4 ) : +2;
iOffTop = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 1 ) : -2;
iOffLeft = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 2 ) : -2;
iOffBottom = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 3 ) : +2;
iOffRight = ! HB_ISNIL( 9 ) ? hb_parvni( 9, 4 ) : +2;
uiPBid = ButtonCreate( usWinNum, usTop, usLeft, usBottom, usRight, lpszCaption,
szBitmap, uiBitmap, hb_param( 8, HB_IT_BLOCK ),
iOffTop, iOffLeft, iOffBottom, iOffRight,
dStretch, bMap3Dcolors,
BS_AUTOCHECKBOX);
hb_retnl( (LONG) uiPBid );
uiPBid = ButtonCreate( usWinNum, usTop, usLeft, usBottom, usRight, lpszCaption,
szBitmap, uiBitmap, hb_param( 8, HB_IT_BLOCK ),
iOffTop, iOffLeft, iOffBottom, iOffRight,
dStretch, bMap3Dcolors,
BS_AUTOCHECKBOX );
hb_retnl( ( LONG ) uiPBid );
}
/*WVW_CXdestroy( [nWinNum], nCXid )
*destroy checkbox nCXid for window nWinNum
*destroy checkbox nCXid for window nWinNum
*/
HB_FUNC( WVW_CXDESTROY)
HB_FUNC( WVW_CXDESTROY )
{
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
UINT uiCXid = (UINT) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) );
CONTROL_DATA * pcd = pWindowData->pcdCtrlList;
CONTROL_DATA * pcdPrev = NULL;
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
UINT uiCXid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) );
CONTROL_DATA * pcd = pWindowData->pcdCtrlList;
CONTROL_DATA * pcdPrev = NULL;
while (pcd)
while( pcd )
{
if (pcd->byCtrlClass == WVW_CONTROL_CHECKBOX && pcd->uiCtrlid == uiCXid)
{
break;
}
pcdPrev = pcd;
pcd = pcd->pNext;
if( pcd->byCtrlClass == WVW_CONTROL_CHECKBOX && pcd->uiCtrlid == uiCXid )
{
break;
}
pcdPrev = pcd;
pcd = pcd->pNext;
}
if (pcd==NULL) { return; }
DestroyWindow (pcd->hWndCtrl) ;
if (pcdPrev==NULL)
if( pcd == NULL )
{
pWindowData->pcdCtrlList = pcd->pNext;
return;
}
DestroyWindow( pcd->hWndCtrl );
if( pcdPrev == NULL )
{
pWindowData->pcdCtrlList = pcd->pNext;
}
else
{
pcdPrev->pNext = pcd->pNext;
pcdPrev->pNext = pcd->pNext;
}
if (pcd->phiCodeBlock)
if( pcd->phiCodeBlock )
{
hb_itemRelease( pcd->phiCodeBlock );
@@ -199,135 +202,135 @@ HB_FUNC( WVW_CXDESTROY)
}
/*WVW_CXsetFocus( [nWinNum], nButtonId )
*set the focus to checkbox nButtonId in window nWinNum
*set the focus to checkbox nButtonId in window nWinNum
*/
HB_FUNC( WVW_CXSETFOCUS )
{
UINT usWinNum = WVW_WHICH_WINDOW;
UINT uiCtrlId = HB_ISNIL(2) ? 0 : hb_parni(2);
byte bStyle;
HWND hWndCX = FindControlHandle(usWinNum, WVW_CONTROL_CHECKBOX, uiCtrlId, &bStyle);
UINT usWinNum = WVW_WHICH_WINDOW;
UINT uiCtrlId = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 );
byte bStyle;
HWND hWndCX = FindControlHandle( usWinNum, WVW_CONTROL_CHECKBOX, uiCtrlId, &bStyle );
if (hWndCX)
{
if( hWndCX )
{
hb_retl( SetFocus(hWndCX) != NULL );
}
else
{
hb_retl(FALSE);
}
hb_retl( SetFocus( hWndCX ) != NULL );
}
else
{
hb_retl( FALSE );
}
}
/*WVW_CXenable( [nWinNum], nButtonId, [lToggle] )
*enable/disable checkbox nButtonId on window nWinNum
*(lToggle defaults to .t., ie. enabling the checkbox)
*return previous state of the checkbox (TRUE:enabled FALSE:disabled)
*(if nButtonId is invalid, this function returns FALSE too)
*enable/disable checkbox nButtonId on window nWinNum
*(lToggle defaults to .t., ie. enabling the checkbox)
*return previous state of the checkbox (TRUE:enabled FALSE:disabled)
*(if nButtonId is invalid, this function returns FALSE too)
*/
HB_FUNC( WVW_CXENABLE )
{
UINT usWinNum = WVW_WHICH_WINDOW;
UINT uiCtrlId = HB_ISNIL(2) ? 0 : hb_parni(2);
BOOL bEnable = HB_ISNIL(3) ? TRUE : hb_parl(3);
byte bStyle;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
HWND hWndCX = FindControlHandle(usWinNum, WVW_CONTROL_CHECKBOX, uiCtrlId, &bStyle);
UINT usWinNum = WVW_WHICH_WINDOW;
UINT uiCtrlId = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 );
BOOL bEnable = HB_ISNIL( 3 ) ? TRUE : hb_parl( 3 );
byte bStyle;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
HWND hWndCX = FindControlHandle( usWinNum, WVW_CONTROL_CHECKBOX, uiCtrlId, &bStyle );
if (hWndCX)
{
hb_retl( EnableWindow(hWndCX, bEnable)==0 );
if( hWndCX )
{
hb_retl( EnableWindow( hWndCX, bEnable ) == 0 );
if (!bEnable)
{
SetFocus( pWindowData->hWnd );
}
}
else
{
hb_retl(FALSE);
}
if( ! bEnable )
{
SetFocus( pWindowData->hWnd );
}
}
else
{
hb_retl( FALSE );
}
}
/*WVW_CXsetcodeblock( [nWinNum], nCXid, bBlock )
*assign (new) codeblock bBlock to button nCXid for window nWinNum
*assign (new) codeblock bBlock to button nCXid for window nWinNum
*
* return .t. if successful
*/
HB_FUNC( WVW_CXSETCODEBLOCK )
{
UINT usWinNum = WVW_WHICH_WINDOW;
WVW_DATA * pData= hb_getWvwData( ) ;
UINT uiCXid = (UINT) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) );
CONTROL_DATA * pcd = GetControlData(usWinNum, WVW_CONTROL_CHECKBOX, NULL, uiCXid);
PHB_ITEM phiCodeBlock = hb_param( 3, HB_IT_BLOCK );
BOOL bOldSetting = pData->s_bRecurseCBlock;
UINT usWinNum = WVW_WHICH_WINDOW;
WVW_DATA * pData = hb_getWvwData();
UINT uiCXid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) );
CONTROL_DATA * pcd = GetControlData( usWinNum, WVW_CONTROL_CHECKBOX, NULL, uiCXid );
PHB_ITEM phiCodeBlock = hb_param( 3, HB_IT_BLOCK );
BOOL bOldSetting = pData->s_bRecurseCBlock;
if (!phiCodeBlock || pcd==NULL || pcd->bBusy)
if( ! phiCodeBlock || pcd == NULL || pcd->bBusy )
{
hb_retl( FALSE );
return;
hb_retl( FALSE );
return;
}
pData->s_bRecurseCBlock = FALSE;
pcd->bBusy = TRUE;
pcd->bBusy = TRUE;
if (pcd->phiCodeBlock)
if( pcd->phiCodeBlock )
{
hb_itemRelease( pcd->phiCodeBlock );
}
pcd->phiCodeBlock = hb_itemNew( phiCodeBlock );
pcd->phiCodeBlock = hb_itemNew( phiCodeBlock );
pcd->bBusy = FALSE;
pcd->bBusy = FALSE;
pData->s_bRecurseCBlock = bOldSetting;
hb_retl( TRUE );
}
/*WVW_CXsetcheck( [nWinNum], nCXid, nCheckState )
*assigns check-state of checkbox nCXid
*assigns check-state of checkbox nCXid
* 0==unchecked BST_UNCHECKED
* 1==checked BST_CHECKED
* 2==indeterminate BST_INDETERMINATE
*this function always returns .t.
**this function always returns .t.
*/
HB_FUNC( WVW_CXSETCHECK )
{
UINT usWinNum = WVW_WHICH_WINDOW;
UINT usWinNum = WVW_WHICH_WINDOW;
UINT uiCXid = (UINT) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) );
ULONG ulCheck = (ULONG) ( HB_ISNIL( 3 ) ? BST_CHECKED : hb_parni( 3 ) );
CONTROL_DATA * pcd = GetControlData(usWinNum, WVW_CONTROL_CHECKBOX, NULL, uiCXid);
UINT uiCXid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) );
ULONG ulCheck = ( ULONG ) ( HB_ISNIL( 3 ) ? BST_CHECKED : hb_parni( 3 ) );
CONTROL_DATA * pcd = GetControlData( usWinNum, WVW_CONTROL_CHECKBOX, NULL, uiCXid );
if (pcd->hWndCtrl)
if( pcd->hWndCtrl )
{
SendMessage(pcd->hWndCtrl,
BM_SETCHECK, (WPARAM) ulCheck, (LPARAM) 0);
SendMessage( pcd->hWndCtrl,
BM_SETCHECK, ( WPARAM ) ulCheck, ( LPARAM ) 0 );
}
hb_retl( TRUE );
}
/*WVW_CXgetcheck( [nWinNum], nCXid )
*returns check-state of checkbox nCXid
*returns check-state of checkbox nCXid
* 0==unchecked BST_UNCHECKED
* 1==checked BST_CHECKED
* 2==indeterminate BST_INDETERMINATE
*/
HB_FUNC( WVW_CXGETCHECK )
{
UINT usWinNum = WVW_WHICH_WINDOW;
UINT usWinNum = WVW_WHICH_WINDOW;
UINT uiCXid = (UINT) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) );
ULONG ulCheck = 0;
CONTROL_DATA * pcd = GetControlData(usWinNum, WVW_CONTROL_CHECKBOX, NULL, uiCXid);
UINT uiCXid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) );
ULONG ulCheck = 0;
CONTROL_DATA * pcd = GetControlData( usWinNum, WVW_CONTROL_CHECKBOX, NULL, uiCXid );
if (pcd->hWndCtrl)
if( pcd->hWndCtrl )
{
ulCheck = SendMessage(pcd->hWndCtrl,
BM_GETCHECK, (WPARAM) 0, (LPARAM) 0);
ulCheck = SendMessage( pcd->hWndCtrl,
BM_GETCHECK, ( WPARAM ) 0, ( LPARAM ) 0 );
}
hb_retnl( ulCheck );
@@ -336,54 +339,54 @@ HB_FUNC( WVW_CXGETCHECK )
/*WVW_CXSetFont([nWinNum], cFontFace, nHeight, nWidth, nWeight, nQUality,;
* lItalic, lUnderline, lStrikeout
*
*/
*/
HB_FUNC( WVW_CXSETFONT )
{
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
WVW_DATA * pData= hb_getWvwData( ) ;
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
WVW_DATA * pData = hb_getWvwData();
BOOL retval = TRUE;
BOOL retval = TRUE;
pData->s_lfCX.lfHeight = HB_ISNIL( 3 ) ? pWindowData->fontHeight - 2 : hb_parnl( 3 );
pData->s_lfCX.lfWidth = HB_ISNIL( 4 ) ? pData->s_lfCX.lfWidth : hb_parni( 4 );
pData->s_lfCX.lfEscapement = 0;
pData->s_lfCX.lfOrientation = 0;
pData->s_lfCX.lfWeight = HB_ISNIL( 5 ) ? pData->s_lfCX.lfWeight : hb_parni( 5 );
pData->s_lfCX.lfItalic = HB_ISNIL( 7 ) ? pData->s_lfCX.lfItalic : ( BYTE )hb_parl( 7 );
pData->s_lfCX.lfUnderline = HB_ISNIL( 8 ) ? pData->s_lfCX.lfUnderline : ( BYTE )hb_parl( 8 );
pData->s_lfCX.lfStrikeOut = HB_ISNIL( 9 ) ? pData->s_lfCX.lfStrikeOut : ( BYTE )hb_parl( 9 );
pData->s_lfCX.lfCharSet = DEFAULT_CHARSET;
pData->s_lfCX.lfHeight = HB_ISNIL( 3 ) ? pWindowData->fontHeight - 2 : hb_parnl( 3 );
pData->s_lfCX.lfWidth = HB_ISNIL( 4 ) ? pData->s_lfCX.lfWidth : hb_parni( 4 );
pData->s_lfCX.lfEscapement = 0;
pData->s_lfCX.lfOrientation = 0;
pData->s_lfCX.lfWeight = HB_ISNIL( 5 ) ? pData->s_lfCX.lfWeight : hb_parni( 5 );
pData->s_lfCX.lfItalic = HB_ISNIL( 7 ) ? pData->s_lfCX.lfItalic : ( BYTE ) hb_parl( 7 );
pData->s_lfCX.lfUnderline = HB_ISNIL( 8 ) ? pData->s_lfCX.lfUnderline : ( BYTE ) hb_parl( 8 );
pData->s_lfCX.lfStrikeOut = HB_ISNIL( 9 ) ? pData->s_lfCX.lfStrikeOut : ( BYTE ) hb_parl( 9 );
pData->s_lfCX.lfCharSet = DEFAULT_CHARSET;
pData->s_lfCX.lfQuality = HB_ISNIL( 6 ) ? pData->s_lfCX.lfQuality : ( BYTE )hb_parni( 6 );
pData->s_lfCX.lfPitchAndFamily = FF_DONTCARE;
if ( HB_ISCHAR( 2 ) )
pData->s_lfCX.lfQuality = HB_ISNIL( 6 ) ? pData->s_lfCX.lfQuality : ( BYTE ) hb_parni( 6 );
pData->s_lfCX.lfPitchAndFamily = FF_DONTCARE;
if( HB_ISCHAR( 2 ) )
{
strcpy( pData->s_lfCX.lfFaceName, hb_parcx( 2 ) );
}
if (pWindowData->hCXfont)
if( pWindowData->hCXfont )
{
HFONT hOldFont = pWindowData->hCXfont;
HFONT hFont = CreateFontIndirect( &pData->s_lfCX );
if (hFont)
HFONT hFont = CreateFontIndirect( &pData->s_lfCX );
if( hFont )
{
/*CONTROL_DATA * pcd = pWindowData->pcdCtrlList;
while (pcd)
{
if ((pcd->byCtrlClass == WVW_CONTROL_PUSHBUTTON) &&
while (pcd)
{
if ((pcd->byCtrlClass == WVW_CONTROL_PUSHBUTTON) &&
((HFONT) SendMessage( pcd->hWndCtrl, WM_GETFONT, (WPARAM) 0, (LPARAM) 0) == hOldFont)
)
{
{
SendMessage( pcd->hWndCtrl, WM_SETFONT, (WPARAM) hFont, (LPARAM) TRUE);
}
}
pcd = pcd->pNext;
} */
pcd = pcd->pNext;
} */
pWindowData->hCXfont = hFont;
DeleteObject( (HFONT) hOldFont );
DeleteObject( ( HFONT ) hOldFont );
}
else
@@ -397,22 +400,22 @@ HB_FUNC( WVW_CXSETFONT )
HB_FUNC( WVW_CXSTATUSFONT )
{
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
UINT uiPBid = (UINT) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) );
BOOL bFocus = HB_ISNIL(3) ? TRUE : hb_parl(3);
CONTROL_DATA * pcd = GetControlData(usWinNum, WVW_CONTROL_PUSHBUTTON, NULL, uiPBid);
UINT uiPBid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) );
BOOL bFocus = HB_ISNIL( 3 ) ? TRUE : hb_parl( 3 );
CONTROL_DATA * pcd = GetControlData( usWinNum, WVW_CONTROL_PUSHBUTTON, NULL, uiPBid );
if (pcd->hWndCtrl)
if( pcd->hWndCtrl )
{
if ( bFocus )
if( bFocus )
{
SendMessage( pcd->hWndCtrl, WM_SETFONT, (WPARAM) pWindowData->hCXfont, (LPARAM) TRUE);
SendMessage( pcd->hWndCtrl, WM_SETFONT, ( WPARAM ) pWindowData->hCXfont, ( LPARAM ) TRUE );
}
else
{
SendMessage( pcd->hWndCtrl, WM_SETFONT, (WPARAM) pWindowData->hPBfont, (LPARAM) TRUE);
SendMessage( pcd->hWndCtrl, WM_SETFONT, ( WPARAM ) pWindowData->hPBfont, ( LPARAM ) TRUE );
}
}
@@ -432,93 +435,93 @@ HB_FUNC( WVW_CXSTATUSFONT )
/*WVW_PGcreate( [nWinNum], nTop, nLeft, nBottom, nRight, [aOffset],
* [nBackColor], [nBarColor], [lSmooth], [lVertical])
*create progress bar for window nWinNum
*nTop: row of top/left corner (in character unit)
*nLeft: col of top/left corner (in character unit)
*nBottom: row of bottom/right corner (in character unit)
*nRight: col of bottom/right corner (in character unit)
*aOffset: array {y1,x1,y2,x2} of offsets to corner pixels, to adjust
**create progress bar for window nWinNum
**nTop: row of top/left corner (in character unit)
**nLeft: col of top/left corner (in character unit)
**nBottom: row of bottom/right corner (in character unit)
**nRight: col of bottom/right corner (in character unit)
**aOffset: array {y1,x1,y2,x2} of offsets to corner pixels, to adjust
* dimension of progress bar. defaults: {0, 0, 0, 0}
*nBackColor: color of background (as RGB value)
*nBarColor: color of bar (as RGB value)
*lSmooth: if .t., draw as smooth bar (default is .f.)
*lVertical: if .t., draw as vertical progress bar (default is .f.)
**nBackColor: color of background (as RGB value)
**nBarColor: color of bar (as RGB value)
**lSmooth: if .t., draw as smooth bar (default is .f.)
**lVertical: if .t., draw as vertical progress bar (default is .f.)
*
*returns control id of newly created progress bar of windows nWinNum
*returns 0 if failed
**returns control id of newly created progress bar of windows nWinNum
**returns 0 if failed
*
*example:
*WVW_PGcreate( , 5, 10, 5, 30)
**example:
**WVW_PGcreate( , 5, 10, 5, 30)
* :: creates horiz progressbar on current window at (5,10) to (5,30)
* colors using default ones.
*
*WVW_PGcreate( , 5, 10, 5, 30, {-1, 0, +1, 0} )
**WVW_PGcreate( , 5, 10, 5, 30, {-1, 0, +1, 0} )
* :: same as above, but the bar is enlarged 1 pixel to the top
* and 1 pixel to the bottom
*
*NOTES:
*ProgressRange is initially set as 0 - 100.
*Initial ProgressPos is 0
**NOTES:
**ProgressRange is initially set as 0 - 100.
**Initial ProgressPos is 0
*/
HB_FUNC( WVW_PGCREATE)
HB_FUNC( WVW_PGCREATE )
{
HANDLE hInstance = NULL;
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
HWND hWndParent = pWindowData->hWnd;
HWND hWndPG;
POINT xy = { 0 };
int iTop, iLeft, iBottom, iRight;
int iOffTop, iOffLeft, iOffBottom, iOffRight;
int iStyle = 0;
BOOL bBackColor= !HB_ISNIL(7);
BOOL bBarColor = !HB_ISNIL(8);
BOOL bSmooth = ( !HB_ISLOG( 9 ) ? FALSE : hb_parl( 9 ) );
BOOL bVertical = ( !HB_ISLOG(10 ) ? FALSE : hb_parl(10 ) );
UINT uiPGid;
USHORT usTop = ( USHORT )hb_parni( 2 ),
usLeft = ( USHORT )hb_parni( 3 ),
usBottom = ( USHORT )hb_parni( 4 ),
usRight = ( USHORT )hb_parni( 5 );
HANDLE hInstance = NULL;
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
HWND hWndParent = pWindowData->hWnd;
HWND hWndPG;
POINT xy = { 0 };
int iTop, iLeft, iBottom, iRight;
int iOffTop, iOffLeft, iOffBottom, iOffRight;
int iStyle = 0;
BOOL bBackColor = ! HB_ISNIL( 7 );
BOOL bBarColor = ! HB_ISNIL( 8 );
BOOL bSmooth = ( ! HB_ISLOG( 9 ) ? FALSE : hb_parl( 9 ) );
BOOL bVertical = ( ! HB_ISLOG( 10 ) ? FALSE : hb_parl( 10 ) );
UINT uiPGid;
USHORT usTop = ( USHORT ) hb_parni( 2 ),
usLeft = ( USHORT ) hb_parni( 3 ),
usBottom = ( USHORT ) hb_parni( 4 ),
usRight = ( USHORT ) hb_parni( 5 );
InitCommonControls();
iOffTop = !HB_ISNIL( 6 ) ? hb_parvni( 6,1 ) : 0;
iOffLeft = !HB_ISNIL( 6 ) ? hb_parvni( 6,2 ) : 0;
iOffBottom = !HB_ISNIL( 6 ) ? hb_parvni( 6,3 ) : 0;
iOffRight = !HB_ISNIL( 6 ) ? hb_parvni( 6,4 ) : 0;
iOffTop = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 1 ) : 0;
iOffLeft = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 2 ) : 0;
iOffBottom = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 3 ) : 0;
iOffRight = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 4 ) : 0;
if (hb_gt_wvw_GetMainCoordMode())
if( hb_gt_wvw_GetMainCoordMode() )
{
hb_wvw_HBFUNCPrologue(usWinNum, &usTop, &usLeft, &usBottom, &usRight);
hb_wvw_HBFUNCPrologue( usWinNum, &usTop, &usLeft, &usBottom, &usRight );
}
xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop );
iTop = xy.y + iOffTop ;
iLeft = xy.x + iOffLeft;
xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop );
iTop = xy.y + iOffTop;
iLeft = xy.x + iOffLeft;
xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 );
xy.y -= pWindowData->byLineSpacing;
iBottom = xy.y-1 + iOffBottom ;
iRight = xy.x-1 + iOffRight;
xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 );
xy.y -= pWindowData->byLineSpacing;
iBottom = xy.y - 1 + iOffBottom;
iRight = xy.x - 1 + iOffRight;
uiPGid = LastControlId(usWinNum, WVW_CONTROL_PROGRESSBAR);
if (uiPGid==0)
uiPGid = LastControlId( usWinNum, WVW_CONTROL_PROGRESSBAR );
if( uiPGid == 0 )
{
uiPGid = WVW_ID_BASE_PROGRESSBAR;
uiPGid = WVW_ID_BASE_PROGRESSBAR;
}
else
{
uiPGid++;
uiPGid++;
}
if (bVertical)
if( bVertical )
{
iStyle = iStyle | PBS_VERTICAL;
}
if (bSmooth)
if( bSmooth )
{
iStyle = iStyle | PBS_SMOOTH;
@@ -527,88 +530,91 @@ HB_FUNC( WVW_PGCREATE)
hb_winmainArgGet( &hInstance, NULL, NULL );
hWndPG = CreateWindowEx(
0L,
PROGRESS_CLASS,
(LPSTR) NULL,
WS_CHILD | WS_VISIBLE | (DWORD) iStyle,
iLeft,
iTop,
iRight-iLeft+1,
iBottom-iTop+1,
hWndParent,
(HMENU) uiPGid,
(HINSTANCE) hInstance,
(LPVOID) NULL
);
0L,
PROGRESS_CLASS,
( LPSTR ) NULL,
WS_CHILD | WS_VISIBLE | ( DWORD ) iStyle,
iLeft,
iTop,
iRight - iLeft + 1,
iBottom - iTop + 1,
hWndParent,
( HMENU ) uiPGid,
( HINSTANCE ) hInstance,
( LPVOID ) NULL
);
if(hWndPG)
if( hWndPG )
{
RECT rXB = { 0 } , rOffXB = { 0 };
RECT rXB = { 0 }, rOffXB = { 0 };
if (bBackColor)
if( bBackColor )
{
SendMessage( hWndPG, PBM_SETBKCOLOR, 0, (LPARAM) (COLORREF) hb_parnl(7) );
SendMessage( hWndPG, PBM_SETBKCOLOR, 0, ( LPARAM ) ( COLORREF ) hb_parnl( 7 ) );
}
if (bBarColor)
if( bBarColor )
{
SendMessage( hWndPG, PBM_SETBARCOLOR, 0, (LPARAM) (COLORREF) hb_parnl(8) );
SendMessage( hWndPG, PBM_SETBARCOLOR, 0, ( LPARAM ) ( COLORREF ) hb_parnl( 8 ) );
}
SendMessage( hWndPG, PBM_SETRANGE, 0, MAKELPARAM(0, 100) );
SendMessage( hWndPG, PBM_SETPOS, (WPARAM) 0, 0 );
SendMessage( hWndPG, PBM_SETRANGE, 0, MAKELPARAM( 0, 100 ) );
SendMessage( hWndPG, PBM_SETPOS, ( WPARAM ) 0, 0 );
rXB.top = usTop; rXB.left= usLeft;
rXB.bottom=usBottom; rXB.right =usRight;
rOffXB.top = iOffTop; rOffXB.left= iOffLeft;
rOffXB.bottom=iOffBottom; rOffXB.right =iOffRight;
rXB.top = usTop; rXB.left = usLeft;
rXB.bottom = usBottom; rXB.right = usRight;
rOffXB.top = iOffTop; rOffXB.left = iOffLeft;
rOffXB.bottom = iOffBottom; rOffXB.right = iOffRight;
AddControlHandle(usWinNum, WVW_CONTROL_PROGRESSBAR, hWndPG, uiPGid, (PHB_ITEM) NULL, rXB, rOffXB, (byte) iStyle);
AddControlHandle( usWinNum, WVW_CONTROL_PROGRESSBAR, hWndPG, uiPGid, ( PHB_ITEM ) NULL, rXB, rOffXB, ( byte ) iStyle );
hb_retnl( (LONG) uiPGid );
hb_retnl( ( LONG ) uiPGid );
}
else
{
hb_retnl( (LONG) 0 );
hb_retnl( ( LONG ) 0 );
}
}
/*WVW_PGdestroy( [nWinNum], nPGid )
*destroy progressbar nPGid for window nWinNum
*This function has no return value.
*destroy progressbar nPGid for window nWinNum
*This function has no return value.
*/
HB_FUNC( WVW_PGDESTROY)
HB_FUNC( WVW_PGDESTROY )
{
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
UINT uiPGid = (UINT) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) );
CONTROL_DATA * pcd = pWindowData->pcdCtrlList;
CONTROL_DATA * pcdPrev = NULL;
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
UINT uiPGid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) );
CONTROL_DATA * pcd = pWindowData->pcdCtrlList;
CONTROL_DATA * pcdPrev = NULL;
while (pcd)
while( pcd )
{
if (pcd->byCtrlClass == WVW_CONTROL_PROGRESSBAR && pcd->uiCtrlid == uiPGid)
{
break;
}
if( pcd->byCtrlClass == WVW_CONTROL_PROGRESSBAR && pcd->uiCtrlid == uiPGid )
{
break;
}
pcdPrev = pcd;
pcd = pcd->pNext;
pcdPrev = pcd;
pcd = pcd->pNext;
}
if (pcd==NULL) { return; }
DestroyWindow (pcd->hWndCtrl) ;
if (pcdPrev==NULL)
if( pcd == NULL )
{
pWindowData->pcdCtrlList = pcd->pNext;
return;
}
DestroyWindow( pcd->hWndCtrl );
if( pcdPrev == NULL )
{
pWindowData->pcdCtrlList = pcd->pNext;
}
else
{
pcdPrev->pNext = pcd->pNext;
pcdPrev->pNext = pcd->pNext;
}
if (pcd->phiCodeBlock)
if( pcd->phiCodeBlock )
{
hb_itemRelease( pcd->phiCodeBlock );
@@ -618,89 +624,89 @@ HB_FUNC( WVW_PGDESTROY)
}
/*WVW_PGsetrange(nWinNum, PGid, [nMin], [nMax])
*update progressbar data range (default is 0-100)
*nMin: a number in range of -32767 to +32767
*nMax: a number in range of -32767 to +32767
*update progressbar data range (default is 0-100)
*nMin: a number in range of -32767 to +32767
*nMax: a number in range of -32767 to +32767
*
*Remark: progress position is reset to nMin
**Remark: progress position is reset to nMin
*
*returns .t. if operation considered successfull
*/
**returns .t. if operation considered successfull
*/
HB_FUNC( WVW_PGSETRANGE )
{
UINT usWinNum = WVW_WHICH_WINDOW;
UINT usWinNum = WVW_WHICH_WINDOW;
UINT uiPGid = (UINT) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) );
byte bStyle;
HWND hWndPG = FindControlHandle(usWinNum, WVW_CONTROL_PROGRESSBAR, uiPGid, &bStyle);
int iMin = (int) ( HB_ISNIL(3) ? 0 : hb_parni( 3 ) );
int iMax = (int) ( HB_ISNIL(4) ? 0 : hb_parni( 4 ) );
UINT uiPGid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) );
byte bStyle;
HWND hWndPG = FindControlHandle( usWinNum, WVW_CONTROL_PROGRESSBAR, uiPGid, &bStyle );
int iMin = ( int ) ( HB_ISNIL( 3 ) ? 0 : hb_parni( 3 ) );
int iMax = ( int ) ( HB_ISNIL( 4 ) ? 0 : hb_parni( 4 ) );
if (uiPGid==0 || hWndPG==NULL || (iMin > iMax) )
if( uiPGid == 0 || hWndPG == NULL || ( iMin > iMax ) )
{
hb_retl(FALSE);
return;
hb_retl( FALSE );
return;
}
SendMessage( hWndPG, PBM_SETRANGE, 0, MAKELPARAM(iMin, iMax) );
SendMessage( hWndPG, PBM_SETPOS, (WPARAM) iMin, 0 );
SendMessage( hWndPG, PBM_SETRANGE, 0, MAKELPARAM( iMin, iMax ) );
SendMessage( hWndPG, PBM_SETPOS, ( WPARAM ) iMin, 0 );
hb_retl(TRUE);
hb_retl( TRUE );
}
/*WVW_PGsetpos(nWinNum, PGid, [nPos])
*update progressbar position within current range
*nPos: a number in range of current range
*returns .t. if operation considered successfull
*/
*update progressbar position within current range
*nPos: a number in range of current range
*returns .t. if operation considered successfull
*/
HB_FUNC( WVW_PGSETPOS )
{
UINT usWinNum = WVW_WHICH_WINDOW;
UINT usWinNum = WVW_WHICH_WINDOW;
UINT uiPGid = (UINT) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) );
byte bStyle;
HWND hWndPG = FindControlHandle(usWinNum, WVW_CONTROL_PROGRESSBAR, uiPGid, &bStyle);
int iPos = (int) ( HB_ISNIL(3) ? 0 : hb_parni( 3 ) );
PBRANGE pbrange;
UINT uiPGid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) );
byte bStyle;
HWND hWndPG = FindControlHandle( usWinNum, WVW_CONTROL_PROGRESSBAR, uiPGid, &bStyle );
int iPos = ( int ) ( HB_ISNIL( 3 ) ? 0 : hb_parni( 3 ) );
PBRANGE pbrange;
if (uiPGid==0 || hWndPG==NULL)
if( uiPGid == 0 || hWndPG == NULL )
{
hb_retl(FALSE);
return;
hb_retl( FALSE );
return;
}
SendMessage( hWndPG, PBM_GETRANGE, (WPARAM) TRUE, (LPARAM) &pbrange );
SendMessage( hWndPG, PBM_GETRANGE, ( WPARAM ) TRUE, ( LPARAM ) &pbrange );
if (iPos < pbrange.iLow || iPos > pbrange.iHigh)
if( iPos < pbrange.iLow || iPos > pbrange.iHigh )
{
hb_retl(FALSE);
return;
hb_retl( FALSE );
return;
}
SendMessage( hWndPG, PBM_SETPOS, (WPARAM) iPos, 0 );
SendMessage( hWndPG, PBM_SETPOS, ( WPARAM ) iPos, 0 );
hb_retl(TRUE);
hb_retl( TRUE );
}
/*WVW_PGgetpos(nWinNum, PGid)
*get progressbar current position
*returns 0 if operation failed
*/
*get progressbar current position
*returns 0 if operation failed
*/
HB_FUNC( WVW_PGGETPOS )
{
UINT usWinNum = WVW_WHICH_WINDOW;
UINT usWinNum = WVW_WHICH_WINDOW;
UINT uiPGid = (UINT) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) );
byte bStyle;
HWND hWndPG = FindControlHandle(usWinNum, WVW_CONTROL_PROGRESSBAR, uiPGid, &bStyle);
UINT uiPGid = ( UINT ) ( HB_ISNIL( 2 ) ? 0 : hb_parni( 2 ) );
byte bStyle;
HWND hWndPG = FindControlHandle( usWinNum, WVW_CONTROL_PROGRESSBAR, uiPGid, &bStyle );
if (uiPGid==0 || hWndPG==NULL)
if( uiPGid == 0 || hWndPG == NULL )
{
hb_retni(0);
return;
hb_retni( 0 );
return;
}
hb_retni( (int) SendMessage( hWndPG, PBM_GETPOS, (WPARAM) 0, (LPARAM) 0 ) );
hb_retni( ( int ) SendMessage( hWndPG, PBM_GETPOS, ( WPARAM ) 0, ( LPARAM ) 0 ) );
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
/*
* $Id$
* $Id$
*/
/*
@@ -90,20 +90,21 @@
HB_FUNC( WVW_SETMENU )
{
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWinData = hb_gt_wvw_GetWindowsData( usWinNum );
SetMenu( pWinData->hWnd, ( HMENU ) HB_PARHANDLE( 2 ) ) ;
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWinData = hb_gt_wvw_GetWindowsData( usWinNum );
hb_gt_wvwResetWindow( usWinNum );
SetMenu( pWinData->hWnd, ( HMENU ) HB_PARHANDLE( 2 ) );
hb_gt_wvwResetWindow( usWinNum );
}
HB_FUNC( WVW_SETPOPUPMENU )
{
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWinData = hb_gt_wvw_GetWindowsData( usWinNum );
HMENU hPopup = pWinData->hPopup ;
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWinData = hb_gt_wvw_GetWindowsData( usWinNum );
HMENU hPopup = pWinData->hPopup;
pWinData->hPopup = ( HMENU ) HB_PARHANDLE( 2 );
/* if ( hPopup ) */
@@ -116,14 +117,14 @@ HB_FUNC( WVW_SETPOPUPMENU )
HB_FUNC( WVW_CREATEMENU )
{
HB_RETHANDLE( CreateMenu() ) ;
HB_RETHANDLE( CreateMenu() );
}
HB_FUNC( WVW_CREATEPOPUPMENU )
{
HB_RETHANDLE( CreatePopupMenu() ) ;
HB_RETHANDLE( CreatePopupMenu() );
}
@@ -132,96 +133,98 @@ HB_FUNC( WVW_CREATEPOPUPMENU )
HB_FUNC( WVW_APPENDMENU )
{
char ucBuf[ 256 ];
int i,iLen ;
LPCTSTR lpszCaption;
char ucBuf[ 256 ];
int i, iLen;
LPCTSTR lpszCaption;
if ( !(hb_parni(2) & (MF_SEPARATOR|MF_POPUP)) &&
(hb_parni(3) >= WVW_ID_BASE_PUSHBUTTON ) )
{
MessageBox( NULL, TEXT( "Menu Command Id too high. Potential conflict with pushbutton" ),
hb_gt_wvw_GetAppName(), MB_ICONERROR );
hb_retl( FALSE );
return;
}
if( ! ( hb_parni( 2 ) & ( MF_SEPARATOR | MF_POPUP ) ) &&
( hb_parni( 3 ) >= WVW_ID_BASE_PUSHBUTTON ) )
{
MessageBox( NULL, TEXT( "Menu Command Id too high. Potential conflict with pushbutton" ),
hb_gt_wvw_GetAppName(), MB_ICONERROR );
hb_retl( FALSE );
return;
}
if ( HB_ISCHAR( 4 ) )
{
iLen = hb_parclen( 4 );
if ( iLen > 0 && iLen < 256 )
{
lpszCaption = hb_parcx( 4 ) ;
for ( i=0; i< iLen ; i++ )
if( HB_ISCHAR( 4 ) )
{
iLen = hb_parclen( 4 );
if( iLen > 0 && iLen < 256 )
{
ucBuf[ i ] = ( *lpszCaption == '~' ) ? '&' : *lpszCaption ;
lpszCaption++;
lpszCaption = hb_parcx( 4 );
for( i = 0; i < iLen; i++ )
{
ucBuf[ i ] = ( *lpszCaption == '~' ) ? '&' : *lpszCaption;
lpszCaption++;
}
ucBuf[ iLen ] = '\0';
lpszCaption = ucBuf;
}
ucBuf[ iLen ]= '\0';
lpszCaption = ucBuf ;
}
else
{
lpszCaption = hb_parcx( 4 ) ;
}
}
else
{
lpszCaption = ( LPCTSTR ) hb_parni( 4 ) ;
}
else
{
lpszCaption = hb_parcx( 4 );
}
}
else
{
lpszCaption = ( LPCTSTR ) hb_parni( 4 );
}
hb_retl( AppendMenu( ( HMENU ) HB_PARHANDLE( 1 ), ( UINT ) hb_parni( 2 ), ( UINT_PTR ) hb_parni( 3 ),( LPCTSTR ) lpszCaption ) ) ;
hb_retl( AppendMenu( ( HMENU ) HB_PARHANDLE( 1 ), ( UINT ) hb_parni( 2 ), ( UINT_PTR ) hb_parni( 3 ), ( LPCTSTR ) lpszCaption ) );
}
HB_FUNC( WVW_DELETEMENU )
{
hb_retl( DeleteMenu( ( HMENU ) HB_PARHANDLE( 1 ), ( UINT ) hb_parni( 2 ), ( UINT ) hb_parni( 3 ) ) );
hb_retl( DeleteMenu( ( HMENU ) HB_PARHANDLE( 1 ), ( UINT ) hb_parni( 2 ), ( UINT ) hb_parni( 3 ) ) );
}
HB_FUNC( WVW_DESTROYMENU )
{
hb_retl( DestroyMenu( ( HMENU ) HB_PARHANDLE( 1 ) ) );
hb_retl( DestroyMenu( ( HMENU ) HB_PARHANDLE( 1 ) ) );
}
HB_FUNC( WVW_ENABLEMENUITEM )
{
hb_retni( EnableMenuItem( ( HMENU ) HB_PARHANDLE( 1 ), ( UINT ) hb_parni( 2 ), ( UINT ) hb_parni( 3 ) ) );
hb_retni( EnableMenuItem( ( HMENU ) HB_PARHANDLE( 1 ), ( UINT ) hb_parni( 2 ), ( UINT ) hb_parni( 3 ) ) );
}
HB_FUNC( WVW_GETLASTMENUEVENT )
{
UINT usWinNum = WVW_WHICH_WINDOW;
hb_retni( hb_gt_wvwGetLastMenuEvent( usWinNum ) ) ;
UINT usWinNum = WVW_WHICH_WINDOW;
hb_retni( hb_gt_wvwGetLastMenuEvent( usWinNum ) );
}
HB_FUNC( WVW_SETLASTMENUEVENT )
{
UINT usWinNum = WVW_WHICH_WINDOW;
hb_retni( hb_gt_wvwSetLastMenuEvent( usWinNum, hb_parni(2) ) );
UINT usWinNum = WVW_WHICH_WINDOW;
hb_retni( hb_gt_wvwSetLastMenuEvent( usWinNum, hb_parni( 2 ) ) );
}
HB_FUNC( WVW_SETMENUKEYEVENT )
{
UINT usWinNum = WVW_WHICH_WINDOW;
int iEvent = 0;
UINT usWinNum = WVW_WHICH_WINDOW;
int iEvent = 0;
if ( HB_ISNUM( 2 ) )
{
iEvent = hb_parnl( 2 ) ;
}
if( HB_ISNUM( 2 ) )
{
iEvent = hb_parnl( 2 );
}
hb_retni( hb_gt_wvwSetMenuKeyEvent( usWinNum, iEvent ) ) ;
hb_retni( hb_gt_wvwSetMenuKeyEvent( usWinNum, iEvent ) );
}
// WVW_MENUITEM_SETBITMAPS(
@@ -231,72 +234,72 @@ HB_FUNC( WVW_SETMENUKEYEVENT )
// ncBitmapUnchecked,
// ncBimapChecked )
//
HB_FUNC ( WVW_MENUITEM_SETBITMAPS )
HB_FUNC( WVW_MENUITEM_SETBITMAPS )
{
HBITMAP hBitmapUnchecked = NULL;
HBITMAP hBitmapChecked = NULL;
char szResname[_MAX_PATH+1];
int iWidth, iHeight;
HBITMAP hBitmapUnchecked = NULL;
HBITMAP hBitmapChecked = NULL;
char szResname[ _MAX_PATH + 1 ];
int iWidth, iHeight;
if ( !HB_ISNIL(4) )
if( ! HB_ISNIL( 4 ) )
{
if ( HB_ISNUM(4) )
{
sprintf( szResname, "?%u", hb_parni(4) );
if( HB_ISNUM( 4 ) )
{
sprintf( szResname, "?%u", hb_parni( 4 ) );
hBitmapUnchecked = FindBitmapHandle(szResname, &iWidth, &iHeight);
hBitmapUnchecked = FindBitmapHandle( szResname, &iWidth, &iHeight );
if (!hBitmapUnchecked)
{
hBitmapUnchecked = (HBITMAP)LoadImage(hb_getWvwData()->hInstance,(LPCTSTR) MAKEINTRESOURCE( (WORD) hb_parni(4) ),IMAGE_BITMAP,0,0, LR_DEFAULTCOLOR);
AddBitmapHandle(szResname, hBitmapUnchecked, iWidth, iHeight);
}
}
else
{
hBitmapUnchecked = FindBitmapHandle(hb_parcx(4), &iWidth, &iHeight);
if( ! hBitmapUnchecked )
{
hBitmapUnchecked = ( HBITMAP ) LoadImage( hb_getWvwData()->hInstance, ( LPCTSTR ) MAKEINTRESOURCE( ( WORD ) hb_parni( 4 ) ), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR );
AddBitmapHandle( szResname, hBitmapUnchecked, iWidth, iHeight );
}
}
else
{
hBitmapUnchecked = FindBitmapHandle( hb_parcx( 4 ), &iWidth, &iHeight );
if (!hBitmapUnchecked)
{
hBitmapUnchecked = (HBITMAP)LoadImage(hb_getWvwData()->hInstance, hb_parcx(4), IMAGE_BITMAP,0,0, LR_DEFAULTCOLOR);
AddBitmapHandle(hb_parcx(4), hBitmapUnchecked , iWidth, iHeight);
}
}
}
if ( !HB_ISNIL(5) )
{
if ( HB_ISNUM(5) )
{
sprintf( szResname, "?%u", hb_parni(5) );
hBitmapChecked = FindBitmapHandle(szResname, &iWidth, &iHeight);
if (!hBitmapChecked)
{
hBitmapChecked = (HBITMAP)LoadImage(hb_getWvwData()->hInstance,(LPCTSTR) MAKEINTRESOURCE( (WORD) hb_parni(5) ),IMAGE_BITMAP,0,0, LR_DEFAULTCOLOR);
AddBitmapHandle(szResname, hBitmapChecked, iWidth, iHeight);
}
}
else
{
hBitmapChecked = FindBitmapHandle(hb_parcx(5), &iWidth, &iHeight);
if (!hBitmapChecked)
{
hBitmapChecked = (HBITMAP)LoadImage(hb_getWvwData()->hInstance, hb_parcx(5), IMAGE_BITMAP,0,0, LR_DEFAULTCOLOR);
AddBitmapHandle(hb_parcx(5), hBitmapChecked , iWidth, iHeight);
}
}
if( ! hBitmapUnchecked )
{
hBitmapUnchecked = ( HBITMAP ) LoadImage( hb_getWvwData()->hInstance, hb_parcx( 4 ), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR );
AddBitmapHandle( hb_parcx( 4 ), hBitmapUnchecked, iWidth, iHeight );
}
}
}
if ( !HB_ISNIL(2) )
if( ! HB_ISNIL( 5 ) )
{
SetMenuItemBitmaps( (HMENU) HB_PARHANDLE(1) , hb_parni(2), MF_BYCOMMAND , (HBITMAP) hBitmapUnchecked, (HBITMAP) hBitmapChecked ) ;
if( HB_ISNUM( 5 ) )
{
sprintf( szResname, "?%u", hb_parni( 5 ) );
hBitmapChecked = FindBitmapHandle( szResname, &iWidth, &iHeight );
if( ! hBitmapChecked )
{
hBitmapChecked = ( HBITMAP ) LoadImage( hb_getWvwData()->hInstance, ( LPCTSTR ) MAKEINTRESOURCE( ( WORD ) hb_parni( 5 ) ), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR );
AddBitmapHandle( szResname, hBitmapChecked, iWidth, iHeight );
}
}
else
{
hBitmapChecked = FindBitmapHandle( hb_parcx( 5 ), &iWidth, &iHeight );
if( ! hBitmapChecked )
{
hBitmapChecked = ( HBITMAP ) LoadImage( hb_getWvwData()->hInstance, hb_parcx( 5 ), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR );
AddBitmapHandle( hb_parcx( 5 ), hBitmapChecked, iWidth, iHeight );
}
}
}
if( ! HB_ISNIL( 2 ) )
{
SetMenuItemBitmaps( ( HMENU ) HB_PARHANDLE( 1 ), hb_parni( 2 ), MF_BYCOMMAND, ( HBITMAP ) hBitmapUnchecked, ( HBITMAP ) hBitmapChecked );
}
else
{
SetMenuItemBitmaps( (HMENU) HB_PARHANDLE(1) , hb_parni(3), MF_BYPOSITION , (HBITMAP) hBitmapUnchecked, (HBITMAP) hBitmapChecked ) ;
SetMenuItemBitmaps( ( HMENU ) HB_PARHANDLE( 1 ), hb_parni( 3 ), MF_BYPOSITION, ( HBITMAP ) hBitmapUnchecked, ( HBITMAP ) hBitmapChecked );
}
}
@@ -305,64 +308,66 @@ HB_FUNC ( WVW_MENUITEM_SETBITMAPS )
HB_FUNC( WVW_DRAWMENUBAR )
{
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
DrawMenuBar( pWindowData->hWnd ) ;
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
DrawMenuBar( pWindowData->hWnd );
}
HB_FUNC( WVW_ENDMENU )
{
hb_retl( EndMenu() ) ;
hb_retl( EndMenu() );
}
/* WVW_GetMenu([nWinNum]) */
HB_FUNC( WVW_GETMENU )
{
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
HB_RETHANDLE( GetMenu( pWindowData->hWnd ) );
}
/* WVW_TrackPopupMenu([nWinNum], n) */
HB_FUNC( WVW_TRACKPOPUPMENU )
{
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
POINT xy = { 0 };
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
POINT xy = { 0 };
GetCursorPos( &xy );
hb_retnl( TrackPopupMenu( ( HMENU ) HB_PARHANDLE( 2 ) ,
TPM_CENTERALIGN | TPM_RETURNCMD | TPM_RECURSE,
xy.x ,
xy.y ,
0 ,
pWindowData->hWnd ,
NULL ) );
hb_retnl( TrackPopupMenu( ( HMENU ) HB_PARHANDLE( 2 ),
TPM_CENTERALIGN | TPM_RETURNCMD | TPM_RECURSE,
xy.x,
xy.y,
0,
pWindowData->hWnd,
NULL ) );
}
HB_FUNC( WIN_SETMENU )
{
SetMenu( ( HWND ) HB_PARHANDLE( 1 ), ( HMENU ) HB_PARHANDLE( 2 ) ) ;
SetMenu( ( HWND ) HB_PARHANDLE( 1 ), ( HMENU ) HB_PARHANDLE( 2 ) );
}
/*
*WVW_NOSYSMENU( [nWinNum], lRemoveClose )
*removes System Menu of a window
*if lRemoveClose is .t., also removes the 'Close' command and 'X' button
*WVW_NOSYSMENU( [nWinNum], lRemoveClose )
*removes System Menu of a window
*if lRemoveClose is .t., also removes the 'Close' command and 'X' button
*
*no return value
**no return value
*/
HB_FUNC( WVW_NOSYSMENU )
{
UINT usWinNum = WVW_WHICH_WINDOW;
BOOL lRemoveClose = HB_ISNIL(2) ? FALSE : hb_parl(2);
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
HMENU hMenu = GetSystemMenu(pWindowData->hWnd, FALSE);
UINT usWinNum = WVW_WHICH_WINDOW;
BOOL lRemoveClose = HB_ISNIL( 2 ) ? FALSE : hb_parl( 2 );
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
HMENU hMenu = GetSystemMenu( pWindowData->hWnd, FALSE );
if (hMenu)
if( hMenu )
{
DeleteMenu( hMenu, SC_MAXIMIZE, MF_BYCOMMAND );
DeleteMenu( hMenu, SC_MINIMIZE, MF_BYCOMMAND );
@@ -370,7 +375,7 @@ HB_FUNC( WVW_NOSYSMENU )
DeleteMenu( hMenu, SC_MOVE, MF_BYCOMMAND );
DeleteMenu( hMenu, SC_RESTORE, MF_BYCOMMAND );
DeleteMenu( hMenu, SC_NEXTWINDOW, MF_BYCOMMAND );
if (lRemoveClose)
if( lRemoveClose )
{
DeleteMenu( hMenu, SC_CLOSE, MF_BYCOMMAND );
DeleteMenu( hMenu, 0, MF_BYPOSITION );
@@ -380,13 +385,14 @@ HB_FUNC( WVW_NOSYSMENU )
}
/* WVW_GetSystemMenu( [nWinNum], lReset )
*returns the System Menu of a window
*if lRemoveClose is .t., also removes the 'Close' command and 'X' button
*returns the System Menu of a window
*if lRemoveClose is .t., also removes the 'Close' command and 'X' button
*/
HB_FUNC( WVW_GETSYSTEMMENU )
{
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
BOOL lReset = HB_ISNIL(2) ? FALSE : hb_parl(2);
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
BOOL lReset = HB_ISNIL( 2 ) ? FALSE : hb_parl( 2 );
hb_retnl( ( ULONG ) GetSystemMenu( pWindowData->hWnd, lReset ) );
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -78,39 +78,39 @@
#include "hbgtwvw.h"
/*WVW_TBCreate([nWinNum], lDisplayText, nStyle, nSystemBitmap, nImageWidth, nImageHeight)
*creates a toolbar at the top (no button initially)
*lDisplayText==.f. button's string is used as tooltips (default)
*nStyle: toolbar style, defaults to TBSTYLE_FLAT | TBSTYLE_TOOLTIPS
*nSystemBitmap: 0:none, 1:small, 2:large (defaults: 1)
*creates a toolbar at the top (no button initially)
*lDisplayText==.f. button's string is used as tooltips (default)
*nStyle: toolbar style, defaults to TBSTYLE_FLAT | TBSTYLE_TOOLTIPS
*nSystemBitmap: 0:none, 1:small, 2:large (defaults: 1)
* small=16x16 large=24x24
*nImageWidth/Height are in effect only if nSystemBitmap==0
**nImageWidth/Height are in effect only if nSystemBitmap==0
*/
HB_FUNC( WVW_TBCREATE)
HB_FUNC( WVW_TBCREATE )
{
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
HWND hWndParent = pWindowData->hWnd;
HWND hWndTB;
int iMaxTextRows = (int) ( HB_ISNIL( 2 ) ? 0 : (hb_parl( 2 ) ? 1 : 0) );
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
HWND hWndParent = pWindowData->hWnd;
HWND hWndTB;
int iMaxTextRows = ( int ) ( HB_ISNIL( 2 ) ? 0 : ( hb_parl( 2 ) ? 1 : 0 ) );
// DWORD dwStyle = (DWORD) ( HB_ISNIL( 3 ) ? TBSTYLE_FLAT | TBSTYLE_TOOLTIPS : hb_parni( 3 ) );
DWORD dwStyle = (DWORD) ( HB_ISNIL( 3 ) ? TBSTYLE_ALTDRAG | TBSTYLE_FLAT | TBSTYLE_TOOLTIPS | TBSTYLE_TRANSPARENT | TBSTYLE_WRAPABLE : hb_parnl( 3 ) );
DWORD dwStyle = ( DWORD ) ( HB_ISNIL( 3 ) ? TBSTYLE_ALTDRAG | TBSTYLE_FLAT | TBSTYLE_TOOLTIPS | TBSTYLE_TRANSPARENT | TBSTYLE_WRAPABLE : hb_parnl( 3 ) );
int iSystemBitmap = (int) ( HB_ISNIL( 4 ) ? 1 : hb_parni( 4 ) );
int iImageWidth = (int) ( iSystemBitmap==0 && HB_ISNUM( 5 ) ? hb_parni( 5 ) : -1 );
int iImageHeight = (int) ( iSystemBitmap==0 && HB_ISNUM( 6 ) ? hb_parni( 6 ) : -1 );
TBADDBITMAP tbab = { 0 };
int iSystemBitmap = ( int ) ( HB_ISNIL( 4 ) ? 1 : hb_parni( 4 ) );
int iImageWidth = ( int ) ( iSystemBitmap == 0 && HB_ISNUM( 5 ) ? hb_parni( 5 ) : -1 );
int iImageHeight = ( int ) ( iSystemBitmap == 0 && HB_ISNUM( 6 ) ? hb_parni( 6 ) : -1 );
TBADDBITMAP tbab = { 0 };
InitCommonControls();
if (pWindowData->hToolBar!=NULL)
if( pWindowData->hToolBar != NULL )
{
hb_retnl( 0 );
return;
hb_retnl( 0 );
return;
}
if (iImageWidth < 0)
if( iImageWidth < 0 )
{
switch (iSystemBitmap)
switch( iSystemBitmap )
{
case 1:
iImageWidth = 16;
@@ -123,99 +123,99 @@ HB_FUNC( WVW_TBCREATE)
break;
}
}
if (iImageHeight < 0)
if( iImageHeight < 0 )
{
switch (iSystemBitmap)
switch( iSystemBitmap )
{
case 1:
iImageHeight = 16;
iImageHeight = 16;
break;
case 2:
iImageHeight = 24;
iImageHeight = 24;
break;
default:
iImageHeight = iImageWidth;
iImageHeight = iImageWidth;
break;
}
}
hWndTB = CreateToolbarEx(hWndParent,
WS_CHILD | WS_VISIBLE | dwStyle,
WVW_ID_BASE_TOOLBAR+usWinNum,
0,
hb_getWvwData()->hInstance,
0,
NULL,
0,
0,
0,
iImageWidth,
iImageHeight,
sizeof(TBBUTTON));
hWndTB = CreateToolbarEx( hWndParent,
WS_CHILD | WS_VISIBLE | dwStyle,
WVW_ID_BASE_TOOLBAR + usWinNum,
0,
hb_getWvwData()->hInstance,
0,
NULL,
0,
0,
0,
iImageWidth,
iImageHeight,
sizeof( TBBUTTON ) );
if (hWndTB == NULL)
if( hWndTB == NULL )
{
MessageBox( NULL, TEXT( "Failed CreateToolbarEx..." ),
hb_gt_wvw_GetAppName(), MB_ICONERROR );
hb_retnl(0);
hb_retnl( 0 );
}
pWindowData->tbOldProc = (WNDPROC) SetWindowLongPtr (hWndTB,
GWLP_WNDPROC, (LONG_PTR) hb_gt_wvwTBProc) ;
pWindowData->tbOldProc = ( WNDPROC ) SetWindowLongPtr( hWndTB,
GWLP_WNDPROC, ( LONG_PTR ) hb_gt_wvwTBProc );
if (iSystemBitmap > 0)
if( iSystemBitmap > 0 )
{
tbab.hInst = HINST_COMMCTRL;
tbab.hInst = HINST_COMMCTRL;
tbab.nID = iSystemBitmap == 1 ? IDB_STD_SMALL_COLOR : IDB_STD_LARGE_COLOR;
pWindowData->iStartStdBitmap= SendMessage(hWndTB, TB_ADDBITMAP, (WPARAM) 0, (WPARAM) &tbab);
tbab.nID = iSystemBitmap == 1 ? IDB_STD_SMALL_COLOR : IDB_STD_LARGE_COLOR;
pWindowData->iStartStdBitmap = SendMessage( hWndTB, TB_ADDBITMAP, ( WPARAM ) 0, ( WPARAM ) &tbab );
tbab.nID = iSystemBitmap == 1 ? IDB_VIEW_SMALL_COLOR : IDB_VIEW_LARGE_COLOR;
pWindowData->iStartViewBitmap = SendMessage(hWndTB, TB_ADDBITMAP, (WPARAM) 0, (WPARAM) &tbab);
tbab.nID = iSystemBitmap == 1 ? IDB_VIEW_SMALL_COLOR : IDB_VIEW_LARGE_COLOR;
pWindowData->iStartViewBitmap = SendMessage( hWndTB, TB_ADDBITMAP, ( WPARAM ) 0, ( WPARAM ) &tbab );
tbab.nID = iSystemBitmap == 1 ? IDB_HIST_SMALL_COLOR : IDB_HIST_LARGE_COLOR;
pWindowData->iStartHistBitmap = SendMessage(hWndTB, TB_ADDBITMAP, (WPARAM) 0, (WPARAM) &tbab);
tbab.nID = iSystemBitmap == 1 ? IDB_HIST_SMALL_COLOR : IDB_HIST_LARGE_COLOR;
pWindowData->iStartHistBitmap = SendMessage( hWndTB, TB_ADDBITMAP, ( WPARAM ) 0, ( WPARAM ) &tbab );
}
else
{
pWindowData->iStartStdBitmap = 0;
pWindowData->iStartStdBitmap = 0;
pWindowData->iStartViewBitmap = 0;
pWindowData->iStartHistBitmap = 0;
}
pWindowData->iTBImgWidth = iImageWidth;
pWindowData->iTBImgHeight = iImageHeight;
pWindowData->iTBImgWidth = iImageWidth;
pWindowData->iTBImgHeight = iImageHeight;
SendMessage(hWndTB, TB_SETMAXTEXTROWS,(WPARAM) iMaxTextRows, (LPARAM) 0);
SendMessage( hWndTB, TB_SETMAXTEXTROWS, ( WPARAM ) iMaxTextRows, ( LPARAM ) 0 );
if (hWndTB)
if( hWndTB )
{
hb_stornl(pWindowData->iStartStdBitmap,7);
hb_stornl(pWindowData->iStartViewBitmap,8);
hb_stornl(pWindowData->iStartHistBitmap,9);
hb_stornl( pWindowData->iStartStdBitmap, 7 );
hb_stornl( pWindowData->iStartViewBitmap, 8 );
hb_stornl( pWindowData->iStartHistBitmap, 9 );
hb_gt_wvwTBinitSize( pWindowData, hWndTB );
hb_gt_wvwTBinitSize( pWindowData, hWndTB );
pWindowData->hToolBar = hWndTB;
pWindowData->hToolBar = hWndTB;
hb_gt_wvwResetWindow( usWinNum );
hb_gt_wvwResetWindow( usWinNum );
}
hb_retnl ( (LONG) hWndTB );
hb_retnl( ( LONG ) hWndTB );
}
/*WVW_TBAddButton([nWinNum], nCommand, xBitmap, cLabel, nBitmapType,;
* lMap3Dcolors, lDropdown)
*adds one button on the right of existing buttons
*xBitmap:
*nBitmap is resource id. or use cBitmap as bitmap file name.
*(bitmap from resources cannot have > 256 colors)
**adds one button on the right of existing buttons
**xBitmap:
**nBitmap is resource id. or use cBitmap as bitmap file name.
**(bitmap from resources cannot have > 256 colors)
*
*cLabel: if lDisplayText, it will be displayed below the bitmap
**cLabel: if lDisplayText, it will be displayed below the bitmap
* otherwise it will be used as tooltip
*nBitmapType: 0:custom, 1:system std bitmap, 2:system view bitmap, 3:system hist bitmap
*lMap3Dcolors: defaults to .f.
**nBitmapType: 0:custom, 1:system std bitmap, 2:system view bitmap, 3:system hist bitmap
**lMap3Dcolors: defaults to .f.
* (meaningfull for custom bitmap only)
* if .t. the following color mapping will be performed:
* RGB(192,192,192) --> COLOR_3DFACE ("transparent")
@@ -227,36 +227,36 @@ HB_FUNC( WVW_TBCREATE)
HB_FUNC( WVW_TBADDBUTTON )
{
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
int iCommand = HB_ISNIL(2) ? 0 : hb_parni(2);
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
int iCommand = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 );
char * szBitmap = HB_ISCHAR(3) ? (char*) hb_parcx(3) : NULL;
UINT uiBitmap = HB_ISNUM(3) ? (UINT) hb_parni(3) : 0;
char * szBitmap = HB_ISCHAR( 3 ) ? ( char * ) hb_parcx( 3 ) : NULL;
UINT uiBitmap = HB_ISNUM( 3 ) ? ( UINT ) hb_parni( 3 ) : 0;
char * szLabel= HB_ISNIL(4) ? (char*) "" : (char*) hb_parcx(4);
int iBitmapType = HB_ISNIL(5) ? 0 : (int) hb_parni(5);
BOOL bMap3Dcolors = HB_ISLOG(6) ? hb_parl(6) : FALSE;
BOOL bDropdown = HB_ISLOG(7) ? hb_parl(7) : FALSE;
HWND hWndTB;
USHORT usOldHeight;
char * szLabel = HB_ISNIL( 4 ) ? ( char * ) "" : ( char * ) hb_parcx( 4 );
int iBitmapType = HB_ISNIL( 5 ) ? 0 : ( int ) hb_parni( 5 );
BOOL bMap3Dcolors = HB_ISLOG( 6 ) ? hb_parl( 6 ) : FALSE;
BOOL bDropdown = HB_ISLOG( 7 ) ? hb_parl( 7 ) : FALSE;
HWND hWndTB;
USHORT usOldHeight;
hWndTB = pWindowData->hToolBar;
if (hWndTB==NULL)
if( hWndTB == NULL )
{
hb_retl( FALSE );
return;
hb_retl( FALSE );
return;
}
if ( iCommand >= WVW_ID_BASE_PUSHBUTTON )
if( iCommand >= WVW_ID_BASE_PUSHBUTTON )
{
MessageBox( NULL, TEXT( "Toolbar button Command Id too high. Potential conflict with pushbutton" ),
hb_gt_wvw_GetAppName(), MB_ICONERROR );
hb_retl( FALSE );
return;
MessageBox( NULL, TEXT( "Toolbar button Command Id too high. Potential conflict with pushbutton" ),
hb_gt_wvw_GetAppName(), MB_ICONERROR );
hb_retl( FALSE );
return;
}
if (strlen(szLabel) > WVW_TB_LABELMAXLENGTH)
if( strlen( szLabel ) > WVW_TB_LABELMAXLENGTH )
{
MessageBox( NULL, TEXT( "Cannot addbutton, Label too long..." ),
hb_gt_wvw_GetAppName(), MB_ICONERROR );
@@ -266,92 +266,92 @@ HB_FUNC( WVW_TBADDBUTTON )
usOldHeight = pWindowData->usTBHeight;
if (! AddTBButton(hWndTB, szBitmap, uiBitmap, szLabel, iCommand, iBitmapType, bMap3Dcolors, pWindowData, bDropdown) )
if( ! AddTBButton( hWndTB, szBitmap, uiBitmap, szLabel, iCommand, iBitmapType, bMap3Dcolors, pWindowData, bDropdown ) )
{
if ( iBitmapType == 0 )
if( iBitmapType == 0 )
{
if (! AddTBButton(hWndTB, szBitmap, uiBitmap, szLabel, iCommand, 1, bMap3Dcolors, pWindowData, bDropdown) )
{
if( ! AddTBButton( hWndTB, szBitmap, uiBitmap, szLabel, iCommand, 1, bMap3Dcolors, pWindowData, bDropdown ) )
{
MessageBox( NULL, TEXT( "Failed addbutton..." ),
hb_gt_wvw_GetAppName(), MB_ICONERROR );
hb_retl( FALSE );
return;
}
}
}
else
{
MessageBox( NULL, TEXT( "Failed addbutton..." ),
hb_gt_wvw_GetAppName(), MB_ICONERROR );
hb_retl( FALSE );
return;
MessageBox( NULL, TEXT( "Failed addbutton..." ),
hb_gt_wvw_GetAppName(), MB_ICONERROR );
hb_retl( FALSE );
return;
}
}
hb_gt_wvwTBinitSize( pWindowData, hWndTB );
if (pWindowData->usTBHeight != usOldHeight)
if( pWindowData->usTBHeight != usOldHeight )
{
hb_gt_wvwResetWindow( usWinNum );
hb_gt_wvwResetWindow( usWinNum );
}
hb_retl ( TRUE );
hb_retl( TRUE );
}
/*WVW_TBButtonCount([nWinNum])
*returns number of buttons in toolbar on window nWinNum
*returns number of buttons in toolbar on window nWinNum
*/
HB_FUNC( WVW_TBBUTTONCOUNT )
{
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
HWND hWndTB;
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
HWND hWndTB;
hWndTB = pWindowData->hToolBar;
if (hWndTB==NULL)
if( hWndTB == NULL )
{
hb_retni( 0 );
return;
hb_retni( 0 );
return;
}
hb_retni ( SendMessage(hWndTB, TB_BUTTONCOUNT,(WPARAM) 0, (LPARAM) 0) );
hb_retni( SendMessage( hWndTB, TB_BUTTONCOUNT, ( WPARAM ) 0, ( LPARAM ) 0 ) );
}
/*WVW_TBDelButton([nWinNum], nButton)
*nButton is zero based index of button to delete
*index=0 is the leftmost button
*NOTE: button separator is indexed and deleteable too
*nButton is zero based index of button to delete
*index=0 is the leftmost button
*NOTE: button separator is indexed and deleteable too
*/
HB_FUNC( WVW_TBDELBUTTON )
{
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
int iButton = HB_ISNUM(2) ? hb_parni(2) : -1;
HWND hWndTB;
USHORT usOldHeight;
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
int iButton = HB_ISNUM( 2 ) ? hb_parni( 2 ) : -1;
HWND hWndTB;
USHORT usOldHeight;
hWndTB = pWindowData->hToolBar;
if (hWndTB==NULL || iButton < 0)
if( hWndTB == NULL || iButton < 0 )
{
hb_retl( FALSE );
return;
hb_retl( FALSE );
return;
}
usOldHeight = pWindowData->usTBHeight;
if (! SendMessage(hWndTB, TB_DELETEBUTTON,(WPARAM) iButton, (LPARAM) 0) )
if( ! SendMessage( hWndTB, TB_DELETEBUTTON, ( WPARAM ) iButton, ( LPARAM ) 0 ) )
{
hb_retl( FALSE );
return;
hb_retl( FALSE );
return;
}
hb_gt_wvwTBinitSize( pWindowData, hWndTB );
if (pWindowData->usTBHeight != usOldHeight)
if( pWindowData->usTBHeight != usOldHeight )
{
hb_gt_wvwResetWindow( usWinNum );
hb_gt_wvwResetWindow( usWinNum );
}
hb_retl ( TRUE );
hb_retl( TRUE );
}
/* WVW_TBGetButtonRect([nWinNum], nButton)
@@ -359,33 +359,33 @@ HB_FUNC( WVW_TBDELBUTTON )
*/
HB_FUNC( WVW_TBGETBUTTONRECT )
{
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
int iButton = HB_ISNUM(2) ? hb_parni(2) : -1;
HWND hWndTB;
RECT rc;
RECT rcRect = { 0 };
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
int iButton = HB_ISNUM( 2 ) ? hb_parni( 2 ) : -1;
HWND hWndTB;
RECT rc;
RECT rcRect = { 0 };
PHB_ITEM aXY = hb_itemNew( NULL );
PHB_ITEM temp;
PHB_ITEM aXY = hb_itemNew( NULL );
PHB_ITEM temp;
hWndTB = pWindowData->hToolBar;
if (hWndTB==NULL || iButton < 0 || !SendMessage(hWndTB, TB_GETRECT, (WPARAM) iButton, (LPARAM) &rc))
if( hWndTB == NULL || iButton < 0 || ! SendMessage( hWndTB, TB_GETRECT, ( WPARAM ) iButton, ( LPARAM ) &rc ) )
{
hb_itemReturnRelease( aXY );
return;
hb_itemReturnRelease( aXY );
return;
}
temp = hb_itemNew( NULL );
hb_arrayNew( aXY, 4 );
rcRect = hb_gt_wvwGetColRowFromXYRect( pWindowData, rc );
hb_arraySetForward( aXY, 1, hb_itemPutNL( temp, max( 0, rcRect.top ) ));
hb_arraySetForward( aXY, 2, hb_itemPutNL( temp, rcRect.left ));
rcRect = hb_gt_wvwGetColRowFromXYRect( pWindowData, rc );
hb_arraySetForward( aXY, 1, hb_itemPutNL( temp, max( 0, rcRect.top ) ) );
hb_arraySetForward( aXY, 2, hb_itemPutNL( temp, rcRect.left ) );
hb_arraySetForward( aXY, 3, hb_itemPutNL( temp, min( pWindowData->ROWS-1, rcRect.bottom ) ));
hb_arraySetForward( aXY, 4, hb_itemPutNL( temp, rcRect.right ));
hb_arraySetForward( aXY, 3, hb_itemPutNL( temp, min( pWindowData->ROWS - 1, rcRect.bottom ) ) );
hb_arraySetForward( aXY, 4, hb_itemPutNL( temp, rcRect.right ) );
hb_itemRelease( temp );
@@ -394,98 +394,98 @@ HB_FUNC( WVW_TBGETBUTTONRECT )
/*WVW_TBEnableButton([nWinNum], nButton, [lToggle])
*nButton is zero based index of button to enable/disable
*index=0 is the leftmost button
*NOTE: button separator is indexed too
*returns .t. if successful
*nButton is zero based index of button to enable/disable
*index=0 is the leftmost button
*NOTE: button separator is indexed too
*returns .t. if successful
*/
HB_FUNC( WVW_TBENABLEBUTTON )
{
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
int iButton = HB_ISNUM(2) ? hb_parni(2) : -1;
BOOL bEnable = HB_ISLOG(3)? hb_parl(3) : TRUE;
int iCommand;
HWND hWndTB;
USHORT usOldHeight;
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
int iButton = HB_ISNUM( 2 ) ? hb_parni( 2 ) : -1;
BOOL bEnable = HB_ISLOG( 3 ) ? hb_parl( 3 ) : TRUE;
int iCommand;
HWND hWndTB;
USHORT usOldHeight;
hWndTB = pWindowData->hToolBar;
if (hWndTB==NULL || iButton < 0)
if( hWndTB == NULL || iButton < 0 )
{
hb_retl( FALSE );
return;
hb_retl( FALSE );
return;
}
iCommand = IndexToCommand(hWndTB, iButton);
if (iCommand < 0)
iCommand = IndexToCommand( hWndTB, iButton );
if( iCommand < 0 )
{
hb_retl( FALSE );
return;
hb_retl( FALSE );
return;
}
usOldHeight = pWindowData->usTBHeight;
if (! SendMessage(hWndTB, TB_ENABLEBUTTON,(WPARAM) iCommand, (LPARAM) MAKELONG(bEnable,0) ) )
if( ! SendMessage( hWndTB, TB_ENABLEBUTTON, ( WPARAM ) iCommand, ( LPARAM ) MAKELONG( bEnable, 0 ) ) )
{
hb_retl( FALSE );
return;
hb_retl( FALSE );
return;
}
hb_gt_wvwTBinitSize( pWindowData, hWndTB );
if (pWindowData->usTBHeight != usOldHeight)
if( pWindowData->usTBHeight != usOldHeight )
{
hb_gt_wvwResetWindow( usWinNum );
hb_gt_wvwResetWindow( usWinNum );
}
hb_retl ( TRUE );
hb_retl( TRUE );
}
/*WVW_TBdestroy( [nWinNum] )
*destroy toolbar for window nWinNum
*destroy toolbar for window nWinNum
*/
HB_FUNC( WVW_TBDESTROY)
HB_FUNC( WVW_TBDESTROY )
{
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
if (!(pWindowData->hToolBar==NULL))
if( ! ( pWindowData->hToolBar == NULL ) )
{
DestroyWindow( pWindowData->hToolBar );
pWindowData->hToolBar = NULL;
pWindowData->usTBHeight = 0;
DestroyWindow( pWindowData->hToolBar );
pWindowData->hToolBar = NULL;
pWindowData->usTBHeight = 0;
hb_gt_wvwResetWindow( usWinNum );
hb_gt_wvwResetWindow( usWinNum );
}
}
/*WVW_TBINDEX2CMD([nWinNum], nIndex)
*returns Command Id of button nIndex (0 based)
*returns -1 if the button does not exist
*returns Command Id of button nIndex (0 based)
*returns -1 if the button does not exist
*/
HB_FUNC( WVW_TBINDEX2CMD )
{
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
HWND hWndTB = pWindowData->hToolBar;
int iIndex = hb_parni(2);
int iCmd = IndexToCommand(hWndTB, iIndex);
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
HWND hWndTB = pWindowData->hToolBar;
int iIndex = hb_parni( 2 );
int iCmd = IndexToCommand( hWndTB, iIndex );
hb_retni( (int) ( iCmd > 0 ? iCmd : -1 ) );
hb_retni( ( int ) ( iCmd > 0 ? iCmd : -1 ) );
}
/*WVW_TBCmd2Index([nWinNum], nCmd)
*returns Index (0 based) of button whose command id is nCmd
*returns -1 if the button does not exist
*returns Index (0 based) of button whose command id is nCmd
*returns -1 if the button does not exist
*/
HB_FUNC( WVW_TBCMD2INDEX )
{
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
HWND hWndTB = pWindowData->hToolBar;
int iCmd = hb_parni(2);
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
HWND hWndTB = pWindowData->hToolBar;
int iCmd = hb_parni( 2 );
hb_retni( CommandToIndex(hWndTB, iCmd) );
hb_retni( CommandToIndex( hWndTB, iCmd ) );
}
@@ -505,17 +505,17 @@ HB_FUNC( WVW_TBCMD2INDEX )
/*WVW_SetToolTopActive([nWinNum], [lToggle]) */
HB_FUNC( WVW_SETTOOLTIPACTIVE )
{
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
BOOL bActive = pWindowData->bToolTipActive;
BOOL bActive = pWindowData->bToolTipActive;
if ( ! HB_ISNIL( 2 ) )
if( ! HB_ISNIL( 2 ) )
{
if ( hb_parl(2) && (pWindowData->hWndTT==NULL) )
if( hb_parl( 2 ) && ( pWindowData->hWndTT == NULL ) )
{
hb_gt_wvwCreateToolTipWindow(pWindowData);
hb_gt_wvwCreateToolTipWindow( pWindowData );
}
pWindowData->bToolTipActive = hb_parl( 2 );
@@ -530,41 +530,41 @@ HB_FUNC( WVW_SETTOOLTIPACTIVE )
/* */
HB_FUNC( WVW_SETTOOLTIP )
{
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
TOOLINFO ti = { 0 };
POINT xy = { 0 };
int iTop, iLeft, iBottom, iRight;
TOOLINFO ti = { 0 };
POINT xy = { 0 };
int iTop, iLeft, iBottom, iRight;
USHORT usTop = hb_parni( 2 ),
usLeft = hb_parni( 3 ),
usBottom = hb_parni( 4 ),
usRight = hb_parni( 5 );
USHORT usTop = hb_parni( 2 ),
usLeft = hb_parni( 3 ),
usBottom = hb_parni( 4 ),
usRight = hb_parni( 5 );
if ( ! pWindowData->bToolTipActive )
if( ! pWindowData->bToolTipActive )
{
return;
}
if (hb_getWvwData()->s_bMainCoordMode)
if( hb_getWvwData()->s_bMainCoordMode )
{
hb_wvw_HBFUNCPrologue(usWinNum, &usTop, &usLeft, &usBottom, &usRight);
hb_wvw_HBFUNCPrologue( usWinNum, &usTop, &usLeft, &usBottom, &usRight );
}
ti.cbSize = sizeof( TOOLINFO );
ti.hwnd = pWindowData->hWnd;
ti.uId = WVW_ID_BASE_TOOLTIP+usWinNum;
ti.cbSize = sizeof( TOOLINFO );
ti.hwnd = pWindowData->hWnd;
ti.uId = WVW_ID_BASE_TOOLTIP + usWinNum;
if ( SendMessage( pWindowData->hWndTT, TTM_GETTOOLINFO, 0, ( LPARAM ) &ti ) )
if( SendMessage( pWindowData->hWndTT, TTM_GETTOOLINFO, 0, ( LPARAM ) &ti ) )
{
xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop );
iTop = xy.y;
iLeft = xy.x;
xy = hb_gt_wvwGetXYFromColRow( pWindowData, usLeft, usTop );
iTop = xy.y;
iLeft = xy.x;
xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight+1, usBottom+1 );
iBottom = xy.y - 1;
iRight = xy.x - 1;
xy = hb_gt_wvwGetXYFromColRow( pWindowData, usRight + 1, usBottom + 1 );
iBottom = xy.y - 1;
iRight = xy.x - 1;
ti.lpszText = hb_parc( 6 );
ti.rect.left = iLeft;
@@ -580,15 +580,15 @@ HB_FUNC( WVW_SETTOOLTIP )
HB_FUNC( WVW_SETTOOLTIPTEXT )
{
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
TOOLINFO ti;
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
TOOLINFO ti;
ti.cbSize = sizeof( TOOLINFO );
ti.hwnd = pWindowData->hWnd;
ti.uId = 100000;
ti.cbSize = sizeof( TOOLINFO );
ti.hwnd = pWindowData->hWnd;
ti.uId = 100000;
if ( SendMessage( pWindowData->hWndTT, TTM_GETTOOLINFO, 0, ( LPARAM ) &ti ) )
if( SendMessage( pWindowData->hWndTT, TTM_GETTOOLINFO, 0, ( LPARAM ) &ti ) )
{
ti.lpszText = hb_parcx( 2 );
SendMessage( pWindowData->hWndTT, TTM_UPDATETIPTEXT, 0, ( LPARAM ) &ti );
@@ -599,26 +599,26 @@ HB_FUNC( WVW_SETTOOLTIPTEXT )
HB_FUNC( WVW_SETTOOLTIPMARGIN )
{
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
RECT rc = { 0 };
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
RECT rc = { 0 };
rc.left = hb_parni( 3 );
rc.top = hb_parni( 2 );
rc.right = hb_parni( 5 );
rc.bottom = hb_parni( 4 );
rc.left = hb_parni( 3 );
rc.top = hb_parni( 2 );
rc.right = hb_parni( 5 );
rc.bottom = hb_parni( 4 );
SendMessage( pWindowData->hWndTT, TTM_SETMARGIN, 0, ( LPARAM ) &rc );
}
HB_FUNC( WVW_SETTOOLTIPWIDTH )
{
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
int iTipWidth = SendMessage( pWindowData->hWndTT, TTM_GETMAXTIPWIDTH, 0, 0 );
int iTipWidth = SendMessage( pWindowData->hWndTT, TTM_GETMAXTIPWIDTH, 0, 0 );
if ( HB_ISNUM( 2 ) )
if( HB_ISNUM( 2 ) )
{
SendMessage( pWindowData->hWndTT, TTM_SETMAXTIPWIDTH, 0, ( LPARAM ) ( int ) hb_parni( 2 ) );
}
@@ -630,12 +630,12 @@ HB_FUNC( WVW_SETTOOLTIPWIDTH )
HB_FUNC( WVW_SETTOOLTIPBKCOLOR )
{
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
COLORREF cr = SendMessage( pWindowData->hWndTT, TTM_GETTIPBKCOLOR, 0, 0 );
COLORREF cr = SendMessage( pWindowData->hWndTT, TTM_GETTIPBKCOLOR, 0, 0 );
if ( HB_ISNUM( 2 ) )
if( HB_ISNUM( 2 ) )
{
SendMessage( pWindowData->hWndTT, TTM_SETTIPBKCOLOR, ( WPARAM ) ( COLORREF ) hb_parnl( 2 ), 0 );
}
@@ -646,12 +646,12 @@ HB_FUNC( WVW_SETTOOLTIPBKCOLOR )
HB_FUNC( WVW_SETTOOLTIPTEXTCOLOR )
{
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
COLORREF cr = SendMessage( pWindowData->hWndTT, TTM_GETTIPTEXTCOLOR, 0, 0 );
COLORREF cr = SendMessage( pWindowData->hWndTT, TTM_GETTIPTEXTCOLOR, 0, 0 );
if ( HB_ISNUM( 2 ) )
if( HB_ISNUM( 2 ) )
{
SendMessage( pWindowData->hWndTT, TTM_SETTIPTEXTCOLOR, ( WPARAM ) ( COLORREF ) hb_parnl( 2 ), 0 );
}
@@ -662,16 +662,16 @@ HB_FUNC( WVW_SETTOOLTIPTEXTCOLOR )
HB_FUNC( WVW_SETTOOLTIPTITLE )
{
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
int iIcon;
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
int iIcon;
if ( ! HB_ISNIL( 3 ) )
if( ! HB_ISNIL( 3 ) )
{
iIcon = HB_ISNIL( 2 ) ? 0 : hb_parni( 2 );
if ( iIcon > 3 )
if( iIcon > 3 )
{
iIcon = 0 ;
iIcon = 0;
}
SendMessage( pWindowData->hWndTT, TTM_SETTITLE, ( WPARAM ) iIcon, ( LPARAM ) hb_parcx( 3 ) );
}
@@ -681,8 +681,9 @@ HB_FUNC( WVW_SETTOOLTIPTITLE )
HB_FUNC( WVW_GETTOOLTIPWIDTH )
{
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
hb_retni( SendMessage( pWindowData->hWndTT, TTM_GETMAXTIPWIDTH, 0, 0 ) );
}
@@ -690,8 +691,9 @@ HB_FUNC( WVW_GETTOOLTIPWIDTH )
HB_FUNC( WVW_GETTOOLTIPBKCOLOR )
{
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
hb_retnl( ( COLORREF ) SendMessage( pWindowData->hWndTT, TTM_GETTIPBKCOLOR, 0, 0 ) );
}
@@ -699,8 +701,9 @@ HB_FUNC( WVW_GETTOOLTIPBKCOLOR )
HB_FUNC( WVW_GETTOOLTIPTEXTCOLOR )
{
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
hb_retnl( ( COLORREF ) SendMessage( pWindowData->hWndTT, TTM_GETTIPTEXTCOLOR, 0, 0 ) );
}