From cfcc400c75a30feb84e311d43ad2f95f8bfe69ad Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 11 Nov 2012 01:39:49 +0000 Subject: [PATCH] 2012-11-11 02:38 UTC+0100 Viktor Szakats (harbour syenar.net) + extras/gtwvw/wvt2wvw.ch - extras/gtwvw/tests/wvt2wvw.ch * extras/gtwvw/tests/readme.txt * cased function names, misc cleanups, moved to main project dir --- harbour/ChangeLog | 7 + harbour/extras/gtwvw/tests/readme.txt | 12 +- harbour/extras/gtwvw/tests/wvt2wvw.ch | 295 -------------------------- harbour/extras/gtwvw/wvt2wvw.ch | 266 +++++++++++++++++++++++ 4 files changed, 276 insertions(+), 304 deletions(-) delete mode 100644 harbour/extras/gtwvw/tests/wvt2wvw.ch create mode 100644 harbour/extras/gtwvw/wvt2wvw.ch diff --git a/harbour/ChangeLog b/harbour/ChangeLog index e325840603..6fe399f30c 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,13 @@ The license applies to all entries newer than 2009-04-28. */ +2012-11-11 02:38 UTC+0100 Viktor Szakats (harbour syenar.net) + + extras/gtwvw/wvt2wvw.ch + - extras/gtwvw/tests/wvt2wvw.ch + * extras/gtwvw/tests/readme.txt + * cased function names, misc cleanups, moved + to main project dir + 2012-11-11 01:58 UTC+0100 Viktor Szakats (harbour syenar.net) * contrib/hbgs/core.c * contrib/hbwin/wapi_wingdi.c diff --git a/harbour/extras/gtwvw/tests/readme.txt b/harbour/extras/gtwvw/tests/readme.txt index 3f998667ef..e1f7d9da02 100644 --- a/harbour/extras/gtwvw/tests/readme.txt +++ b/harbour/extras/gtwvw/tests/readme.txt @@ -4,19 +4,19 @@ To run samples: -(1) Make sure you have GTWVW.LIB in your Harbour LIB directory +(1) Make sure you have GTWVW library (2) Compile/link the .prg/.hbp using hbmk2 BRIEF DESCRIPTIONS: -AS described in www.csacomputer.com/gtwvw : +AS described in http://www.csacomputer.com/gtwvw/ : prog0.prg : to be compiled with clipper prog1.prg : 1st evolution with gtwvw prog2.prg : 2nd evolution with gtwvw Supporting routines: (required by wvwtest9.prg only) -wvwmouse.prg : sample of how to handle graphic primitives +_wvwmous.prg : sample of how to handle graphic primitives Supporting files: test.dbf @@ -28,9 +28,3 @@ Main programs: wvwtest9.prg : demo of several gtwvw features. maincoor.prg : to show differences of MainCoord and Standard Mode. inpfocus.prg : demo of how to handle input on non topmost window. - -Others: -wvt2wvw.ch : header file to be included in your gtwvt program if you - wish to link it with gtwvw. - See gtwvw documentation (and description inside wvt2wvw.ch) - about how to compile and link gtwvt program using gtwvw. diff --git a/harbour/extras/gtwvw/tests/wvt2wvw.ch b/harbour/extras/gtwvw/tests/wvt2wvw.ch deleted file mode 100644 index 9aa068a2c9..0000000000 --- a/harbour/extras/gtwvw/tests/wvt2wvw.ch +++ /dev/null @@ -1,295 +0,0 @@ -/* - * $Id$ - */ - -/* - Copyright 2004 Budyanto Dj. - - Mapping of gtwvt functions and their coresponding ones in gtwvw. - - WARNING: - This mapping is made globally. Should you find any error(s) please let me know. -*/ - -MEMVAR _wvwtemp_ - -/********************************************************************/ -/******************************************************************** -PART-1: WINDOW INDEPENDENT (the same parameter list) -*********************************************************************/ -/********************************************************************/ - -#xtranslate WVT_CREATEMENU ( [] ) => WVW_CREATEMENU ( [] ) -#xtranslate WVT_CREATEPOPUPMENU ( [] ) => WVW_CREATEPOPUPMENU ( [] ) -#xtranslate WVT_APPENDMENU ( [] ) => WVW_APPENDMENU ( [] ) -#xtranslate WVT_DELETEMENU ( [] ) => WVW_DELETEMENU ( [] ) -#xtranslate WVT_DESTROYMENU ( [] ) => WVW_DESTROYMENU ( [] ) -#xtranslate WVT_ENABLEMENUITEM ( [] ) => WVW_ENABLEMENUITEM ( [] ) -#xtranslate WVT_GETSCREENWIDTH ( [] ) => WVW_GETSCREENWIDTH ( [] ) -#xtranslate WVT_GETSCREENHEIGHT ( [] ) => WVW_GETSCREENHEIGHT ( [] ) -#xtranslate WVT_SETALTF4CLOSE ( [] ) => WVW_SETALTF4CLOSE ( [] ) -#xtranslate WVT_GETRGBCOLOR ( [] ) => WVW_GETRGBCOLOR ( [] ) -#xtranslate WVT_GETCLIPBOARD ( [] ) => WVW_GETCLIPBOARD ( [] ) -#xtranslate WVT_SETCLIPBOARD ( [] ) => WVW_SETCLIPBOARD ( [] ) -#xtranslate WVT_PASTEFROMCLIPBOARD ( [] ) => WVW_PASTEFROMCLIPBOARD ( [] ) -#xtranslate WVT_KEYBOARD ( [] ) => WVW_KEYBOARD ( [] ) -#xtranslate WVT_ISLBUTTONPRESSED ( [] ) => WVW_ISLBUTTONPRESSED ( [] ) -#xtranslate WVT_GETPALETTE ( [] ) => WVW_GETPALETTE ( [] ) -#xtranslate WVT_SETPALETTE ( [] ) => WVW_SETPALETTE ( [] ) -#xtranslate WVT_CREATEFONT ( [] ) => WVW_CREATEFONT ( [] ) -#xtranslate WVT_GETCURSORPOS ( [] ) => WVW_GETCURSORPOS ( [] ) -#xtranslate WVT_CHOOSEFONT ( [] ) => WVW_CHOOSEFONT ( [] ) -#xtranslate WVT_CHOOSECOLOR ( [] ) => WVW_CHOOSECOLOR ( [] ) -#xtranslate WVT_LOADPICTURE ( [] ) => WVW_LOADPICTURE ( [] ) -#xtranslate WVT_LOADFONT ( [] ) => WVW_LOADFONT ( [] ) -#xtranslate WVT_LOADPEN ( [] ) => WVW_LOADPEN ( [] ) -#xtranslate WVT_SETPEN ( [] ) => WVW_SETPEN ( [] ) -#xtranslate WVT_SETBRUSH ( [] ) => WVW_SETBRUSH ( [] ) - -#xtranslate WVT_CREATEDIALOGDYNAMIC( [] ) => WVW_CREATEDIALOGDYNAMIC( [] ) -#xtranslate WVT_CREATEDIALOGMODAL ( [] ) => WVW_CREATEDIALOGMODAL ( [] ) -#xtranslate WVT__MAKEDLGTEMPLATE ( [] ) => WVW__MAKEDLGTEMPLATE ( [] ) -#xtranslate WVT_LBADDSTRING ( [] ) => WVW_LBADDSTRING ( [] ) -#xtranslate WVT_LBSETCURSEL ( [] ) => WVW_LBSETCURSEL ( [] ) -#xtranslate WVT_CBADDSTRING ( [] ) => WVW_CBADDSTRING ( [] ) -#xtranslate WVT_CBSETCURSEL ( [] ) => WVW_CBSETCURSEL ( [] ) -#xtranslate WVT_DLGSETICON ( [] ) => WVW_DLGSETICON ( [] ) - - -/******************************************************************** -These functions do not exist in WVT. -*********************************************************************/ -//WVT_SETVERTCARET ( [] ) => WVW_SETVERTCARET ( [] ) -//WVT_SETDEFLINESPACING ( [] ) => WVW_SETDEFLINESPACING ( [] ) - -/********************************************************************/ -/******************************************************************** -PART-2: WINDOW DEPENDENT (additional nWinNum parameter) -*********************************************************************/ -/********************************************************************/ - -/* - Notes: - - nWinNum parameter passed as NIL will be translated by gtwvw into : - IF MainCoordMode - Topmost Window - ELSE - Current Window - ENDIF - - Since gtwvt application can't be in MainCoordMode, - the following approach makes these functions work on current window. - - You may want to replace NIL with your own function/variable by which you can decide - which window to direct your output to. - -*/ - -#xtranslate WVT_SETMENU ( [] ) => WVW_SETMENU ( NIL [, ] ) -#xtranslate WVT_SETPOPUPMENU ( [] ) => WVW_SETPOPUPMENU ( NIL [, ] ) -#xtranslate WVT_GETLASTMENUEVENT ( [] ) => WVW_GETLASTMENUEVENT ( NIL [, ] ) -#xtranslate WVT_SETMENUKEYEVENT ( [] ) => WVW_SETMENUKEYEVENT ( NIL [, ] ) -#xtranslate WVT_DRAWMENUBAR ( [] ) => WVW_DRAWMENUBAR ( NIL [, ] ) -#xtranslate WVT_SETWINDOWCENTRE ( [] ) => WVW_SETWINDOWCENTRE ( NIL [, ] ) -#xtranslate WVT_PROCESSMESSAGES ( [] ) => WVW_PROCESSMESSAGES ( NIL [, ] ) -#xtranslate WVT_GETTITLE ( [] ) => WVW_GETTITLE ( NIL [, ] ) -#xtranslate WVT_INVALIDATERECT ( [] ) => WVW_INVALIDATERECT ( NIL [, ] ) -#xtranslate WVT_CLIENTTOSCREEN ( [] ) => WVW_CLIENTTOSCREEN ( NIL [, ] ) -#xtranslate WVT_SETFONT ( [] ) => WVW_SETFONT ( NIL [, ] ) -#xtranslate WVT_SETICON ( [] ) => WVW_SETICON ( NIL [, ] ) -#xtranslate WVT_SETTITLE ( [] ) => WVW_SETTITLE ( NIL [, ] ) -#xtranslate WVT_SETWINDOWPOS ( [] ) => WVW_SETWINDOWPOS ( NIL [, ] ) -#xtranslate WVT_GETWINDOWHANDLE ( [] ) => WVW_GETWINDOWHANDLE ( NIL [, ] ) -#xtranslate WVT_SETCODEPAGE ( [] ) => WVW_SETCODEPAGE ( NIL [, ] ) -#xtranslate WVT_CENTERWINDOW ( [] ) => WVW_CENTERWINDOW ( NIL [, ] ) -#xtranslate WVT_SETMOUSEMOVE ( [] ) => WVW_SETMOUSEMOVE ( NIL [, ] ) -#xtranslate WVT_GETXYFROMROWCOL ( [] ) => WVW_GETXYFROMROWCOL ( NIL [, ] ) -#xtranslate WVT_GETFONTINFO ( [] ) => WVW_GETFONTINFO ( NIL [, ] ) -#xtranslate WVT_MINIMIZE ( [] ) => WVW_MINIMIZE ( NIL [, ] ) -#xtranslate WVT_MAXIMIZE ( [] ) => WVW_MAXIMIZE ( NIL [, ] ) -#xtranslate WVT_SETONTOP ( [] ) => WVW_SETONTOP ( NIL [, ] ) -#xtranslate WVT_SETASNORMAL ( [] ) => WVW_SETASNORMAL ( NIL [, ] ) -#xtranslate WVT_SAVESCREEN ( [] ) => WVW_SAVESCREEN ( NIL [, ] ) -#xtranslate WVT_RESTSCREEN ( [] ) => WVW_RESTSCREEN ( NIL [, ] ) -#xtranslate WVT_DRAWLABELOBJ ( [] ) => WVW_DRAWLABELOBJ ( NIL [, ] ) -#xtranslate WVT_DRAWTOOLBUTTONSTATE ( [] ) => WVW_DRAWTOOLBUTTONSTATE ( NIL [, ] ) -#xtranslate WVT_DRAWSCROLLBUTTON ( [] ) => WVW_DRAWSCROLLBUTTON ( NIL [, ] ) -#xtranslate WVT_DRAWSCROLLTHUMBVERT ( [] ) => WVW_DRAWSCROLLTHUMBVERT ( NIL [, ] ) -#xtranslate WVT_DRAWSCROLLTHUMBHORZ ( [] ) => WVW_DRAWSCROLLTHUMBHORZ ( NIL [, ] ) -#xtranslate WVT_DRAWSHADEDRECT ( [] ) => WVW_DRAWSHADEDRECT ( NIL [, ] ) -#xtranslate WVT_DRAWTEXTBOX ( [] ) => WVW_DRAWTEXTBOX ( NIL [, ] ) -#xtranslate WVT_DRAWPROGRESSBAR ( [] ) => WVW_DRAWPROGRESSBAR ( NIL [, ] ) -#xtranslate WVT_TRACKPOPUPMENU ( [] ) => WVW_TRACKPOPUPMENU ( NIL [, ] ) -#xtranslate WVT_GETMENU ( [] ) => WVW_GETMENU ( NIL [, ] ) -#xtranslate WVT_SHOWWINDOW ( [] ) => WVW_SHOWWINDOW ( NIL [, ] ) -#xtranslate WVT_UPDATEWINDOW ( [] ) => WVW_UPDATEWINDOW ( NIL [, ] ) -#xtranslate WVT_DRAWBOXGET ( [] ) => WVW_DRAWBOXGET ( NIL [, ] ) -#xtranslate WVT_DRAWBOXRAISED ( [] ) => WVW_DRAWBOXRAISED ( NIL [, ] ) -#xtranslate WVT_DRAWBOXRECESSED ( [] ) => WVW_DRAWBOXRECESSED ( NIL [, ] ) -#xtranslate WVT_DRAWBOXGROUP ( [] ) => WVW_DRAWBOXGROUP ( NIL [, ] ) -#xtranslate WVT_DRAWBOXGROUPRAISED ( [] ) => WVW_DRAWBOXGROUPRAISED ( NIL [, ] ) -#xtranslate WVT_DRAWIMAGE ( [] ) => WVW_DRAWIMAGE ( NIL [, ] ) -#xtranslate WVT_DRAWLABEL ( [] ) => WVW_DRAWLABEL ( NIL [, ] ) -#xtranslate WVT_DRAWOUTLINE ( [] ) => WVW_DRAWOUTLINE ( NIL [, ] ) -#xtranslate WVT_DRAWLINE ( [] ) => WVW_DRAWLINE ( NIL [, ] ) -#xtranslate WVT_DRAWELLIPSE ( [] ) => WVW_DRAWELLIPSE ( NIL [, ] ) -#xtranslate WVT_DRAWRECTANGLE ( [] ) => WVW_DRAWRECTANGLE ( NIL [, ] ) -#xtranslate WVT_FILLRECTANGLE ( [] ) => WVW_FILLRECTANGLE ( NIL [, ] ) -#xtranslate WVT_DRAWCOLORRECT ( [] ) => WVW_DRAWCOLORRECT ( NIL [, ] ) -#xtranslate WVT_DRAWROUNDRECT ( [] ) => WVW_DRAWROUNDRECT ( NIL [, ] ) -#xtranslate WVT_DRAWFOCUSRECT ( [] ) => WVW_DRAWFOCUSRECT ( NIL [, ] ) -#xtranslate WVT_DRAWGRIDHORZ ( [] ) => WVW_DRAWGRIDHORZ ( NIL [, ] ) -#xtranslate WVT_DRAWGRIDVERT ( [] ) => WVW_DRAWGRIDVERT ( NIL [, ] ) -#xtranslate WVT_DRAWBUTTON ( [] ) => WVW_DRAWBUTTON ( NIL [, ] ) - -#xtranslate WVT_SETMOUSEPOS ( [] ) => WVW_SETMOUSEPOS ( NIL [, ] ) - -/* in gtwvt no pending rect is reflected as {0,0,0,0} - in gtwvw no pending rect is reflected as {y1,x1,y2,x2} where y1 > y2 or x1 > x2 - thus we need some temporary var to check this exception -*/ -#xtranslate WVT_GETPAINTRECT ( [] ) => ( _wvwtemp_ := WVW_GETPAINTRECT( NIL [, ] ), ; - iif( _wvwtemp_\[ 1 \] > _wvwtemp_\[ 3 \] .OR. _wvwtemp_\[ 2 \] > _wvwtemp_\[ 4 \], ; - { 0, 0, 0, 0 }, _wvwtemp_ ) ) - -#xtranslate WVT_SETPOINTER ( [] ) => WVW_SETPOINTER ( NIL [, ] ) -#xtranslate WVT_DRAWPICTURE ( [] ) => WVW_DRAWPICTURE ( NIL [, ] ) -#xtranslate WVT_DRAWLABELEX ( [] ) => WVW_DRAWLABELEX ( NIL [, ] ) -#xtranslate WVT_DRAWLINEEX ( [] ) => WVW_DRAWLINEEX ( NIL [, ] ) -#xtranslate WVT_DRAWOUTLINEEX ( [] ) => WVW_DRAWOUTLINEEX ( NIL [, ] ) -#xtranslate WVT_MESSAGEBOX ( [] ) => WVW_MESSAGEBOX ( NIL [, ] ) -#xtranslate WVT_SETTOOLTIPACTIVE ( [] ) => WVW_SETTOOLTIPACTIVE ( NIL [, ] ) -#xtranslate WVT_SETTOOLTIP ( [] ) => WVW_SETTOOLTIP ( NIL [, ] ) -#xtranslate WVT_SETTOOLTIPTEXT ( [] ) => WVW_SETTOOLTIPTEXT ( NIL [, ] ) -#xtranslate WVT_SETTOOLTIPMARGIN ( [] ) => WVW_SETTOOLTIPMARGIN ( NIL [, ] ) -#xtranslate WVT_SETTOOLTIPWIDTH ( [] ) => WVW_SETTOOLTIPWIDTH ( NIL [, ] ) -#xtranslate WVT_SETTOOLTIPBKCOLOR ( [] ) => WVW_SETTOOLTIPBKCOLOR ( NIL [, ] ) -#xtranslate WVT_SETTOOLTIPTEXTCOLOR ( [] ) => WVW_SETTOOLTIPTEXTCOLOR ( NIL [, ] ) -#xtranslate WVT_SETTOOLTIPTITLE ( [] ) => WVW_SETTOOLTIPTITLE ( NIL [, ] ) -#xtranslate WVT_GETTOOLTIPWIDTH ( [] ) => WVW_GETTOOLTIPWIDTH ( NIL [, ] ) -#xtranslate WVT_GETTOOLTIPBKCOLOR ( [] ) => WVW_GETTOOLTIPBKCOLOR ( NIL [, ] ) -#xtranslate WVT_GETTOOLTIPTEXTCOLOR ( [] ) => WVW_GETTOOLTIPTEXTCOLOR ( NIL [, ] ) - -/******************************************************************** -Timer functions. WARNING: WVT implementation is slightly different. -*********************************************************************/ - -#xtranslate WVT_SETTIMER ( [] ) => WVW_SETTIMER ( NIL [, ] ) -#xtranslate WVT_KILLTIMER ( [] ) => WVW_KILLTIMER ( NIL [, ] ) - -/******************************************************************** -WVW_DRAWSTATUSBAR is for compatibility only. -Recommended to use WVW_SBxxxx functions instead. -*********************************************************************/ -#xtranslate WVT_DRAWSTATUSBAR ( [] ) => WVW_DRAWSTATUSBAR ( NIL [, ] ) - -/******************************************************************** -Native Statusbar functions. Currently none in WVT. -WVT uses different approach (WVT_DRAWSTATUSBAR) -*********************************************************************/ - -//WVW_SBCREATE -//WVW_SBDESTROY -//WVW_SBADDPART -//WVW_SBREFRESH -//WVW_SBSETTEXT -//WVW_SBGETTEXT -//WVW_SBGETPARTS - -/******************************************************************** -Toolbar functions. Currently none in WVT. -WVT uses different approach. -*********************************************************************/ - -//WVW_TBCREATE -//WVW_TBADDBUTTON -//WVW_TBBUTTONCOUNT -//WVW_TBDELBUTTON -//WVW_TBENABLEBUTTON -//WVW_TBDESTROY - -/******************************************************************** -Scrollbar functions. Currently none in WVT. -WVT uses different approach. -*********************************************************************/ - -//WVW_XBCREATE -//WVW_XBDESTROY -//WVW_XBUPDATE -//WVW_XBENABLE - - -/******************************************************************** -Line Spacing. Currently none in WVT. -*********************************************************************/ -//WVW_SETLINESPACING - -/********************************************************************/ -/******************************************************************** -PART-3: RESERVED FUNCTION NAMES ("callback" prg functions, called by gtwvw) -*********************************************************************/ -/********************************************************************/ - -/* - Notes: - - Generally, each function is supplied additional nWinNum parameter at the front. - nWinNum is 0-based (with 0 being the Main Window). - - If you have single (main) window, no further change is needed. - However, once you open a second window you you should decide what to do - with nWinNum parameter in these callback functions. - - Typically your WVT_xxx function will need adjustment like below: - - FUNCTION WVT_xxx(...) - LOCAL nOldWin := wvw_nsetcurwindow( nWinNum ) //<-- add this - - ...existing code... - - wvw_nsetcurwindow( nOldWin ) //<--add this - RETURN NIL - - Although the above may be enough, each individual function may need careful review - to make sure it follows gtwvw convention. For example, if you have multiple - exit points in that function. - - IMPORTANT NOTES ON MainCoord Mode: - - Using wvw_nsetcurwindow() in MainCoord Mode may not be appropriate, because - current window is reset to 0 upon returning from a standard GT function - (DispOut(), QQout(), DevOut(), etc.). Remember that these functions - may also be called indirectly through many other functions/commands - (Alert(), Achoice(), GET, etc.). - - You may want to replace wvw_nsetcurwindow() with your own function in this case. - -*/ - -#xtranslate FUNCTION WVT_PAINT( [] ) => FUNCTION WVW_PAINT( nWinNum [,] ) -#xtranslate PROCEDURE WVT_PAINT( [] ) => PROCEDURE WVW_PAINT( nWinNum [,] ) -#xtranslate WVT_PAINT( [] ) => WVW_PAINT( NIL [,] ) - -#xtranslate FUNCTION WVT_SETFOCUS( [] ) => FUNCTION WVW_SETFOCUS( nWinNum [,] ) -#xtranslate PROCEDURE WVT_SETFOCUS( [] ) => PROCEDURE WVW_SETFOCUS( nWinNum [,] ) -#xtranslate WVT_SETFOCUS( [] ) => WVW_SETFOCUS( NIL [,] ) - -#xtranslate FUNCTION WVT_KILLFOCUS( [] ) => FUNCTION WVW_KILLFOCUS( nWinNum [,] ) -#xtranslate PROCEDURE WVT_KILLFOCUS( [] ) => PROCEDURE WVW_KILLFOCUS( nWinNum [,] ) -#xtranslate WVT_KILLFOCUS( [] ) => WVW_KILLFOCUS( NIL [,] ) - -#xtranslate FUNCTION WVT_MOUSE( [] ) => FUNCTION WVW_MOUSE( nWinNum [,] ) -#xtranslate PROCEDURE WVT_MOUSE( [] ) => PROCEDURE WVW_MOUSE( nWinNum [,] ) -#xtranslate WVT_MOUSE( [] ) => WVW_MOUSE( NIL [,] ) - -#xtranslate FUNCTION WVT_TIMER() => FUNCTION WVW_TIMER( nWinNum, hWnd, message, wParam, lParam ) -#xtranslate PROCEDURE WVT_TIMER() => PROCEDURE WVW_TIMER( nWinNum, hWnd, message, wParam, lParam ) -/* Currently WVT_TIMER is never called by GTWVT. - There should never be any existing usage of this function. -*/ - -/******************************************************************** -WVT_MENUSELECT does not exist in WVT. -*********************************************************************/ -//WVT_MENUSELECT diff --git a/harbour/extras/gtwvw/wvt2wvw.ch b/harbour/extras/gtwvw/wvt2wvw.ch new file mode 100644 index 0000000000..b3a1b7f8d2 --- /dev/null +++ b/harbour/extras/gtwvw/wvt2wvw.ch @@ -0,0 +1,266 @@ +/* + * $Id$ + */ + +/* + Copyright 2004 Budyanto Dj. + + Mapping of gtwvt functions and their coresponding ones in gtwvw. + + header file to be included in your gtwvt program if you + wish to link it with gtwvw. + + WARNING: + This mapping is made globally. Should you find any error(s) please let me know. +*/ + +MEMVAR _wvwtemp_ + +/* PART-1: WINDOW INDEPENDENT (the same parameter list) */ +/* ==================================================== */ + +#xtranslate Wvt_CreateMenu ( [] ) => wvw_CreateMenu ( [] ) +#xtranslate Wvt_CreatePOPUPMenu ( [] ) => wvw_CreatePOPUPMenu ( [] ) +#xtranslate Wvt_AppendMenu ( [] ) => wvw_AppendMenu ( [] ) +#xtranslate Wvt_DeleteMenu ( [] ) => wvw_DeleteMenu ( [] ) +#xtranslate Wvt_DestroyMenu ( [] ) => wvw_DestroyMenu ( [] ) +#xtranslate Wvt_EnableMenuItem ( [] ) => wvw_EnableMenuItem ( [] ) +#xtranslate Wvt_GetScreenWidth ( [] ) => wvw_GetScreenWidth ( [] ) +#xtranslate Wvt_GetScreenHeight ( [] ) => wvw_GetScreenHeight ( [] ) +#xtranslate Wvt_SetAltF4Close ( [] ) => wvw_SetAltF4Close ( [] ) +#xtranslate Wvt_GetRGBColor ( [] ) => wvw_GetRGBColor ( [] ) +#xtranslate Wvt_GetClipboard ( [] ) => wvw_GetClipboard ( [] ) +#xtranslate Wvt_SetClipboard ( [] ) => wvw_SetClipboard ( [] ) +#xtranslate Wvt_PasteFromClipboard ( [] ) => wvw_PasteFromClipboard ( [] ) +#xtranslate Wvt_Keyboard ( [] ) => wvw_Keyboard ( [] ) +#xtranslate Wvt_IsLButtonPressed ( [] ) => wvw_IsLButtonPressed ( [] ) +#xtranslate Wvt_GetPalette ( [] ) => wvw_GetPalette ( [] ) +#xtranslate Wvt_SetPalette ( [] ) => wvw_SetPalette ( [] ) +#xtranslate Wvt_CreateFont ( [] ) => wvw_CreateFont ( [] ) +#xtranslate Wvt_GetCursorPos ( [] ) => wvw_GetCursorPos ( [] ) +#xtranslate Wvt_ChooseFont ( [] ) => wvw_ChooseFont ( [] ) +#xtranslate Wvt_ChooseColor ( [] ) => wvw_ChooseColor ( [] ) +#xtranslate Wvt_LoadPicture ( [] ) => wvw_LoadPicture ( [] ) +#xtranslate Wvt_LoadFont ( [] ) => wvw_LoadFont ( [] ) +#xtranslate Wvt_LoadPen ( [] ) => wvw_LoadPen ( [] ) +#xtranslate Wvt_SetPen ( [] ) => wvw_SetPen ( [] ) +#xtranslate Wvt_SetBrush ( [] ) => wvw_SetBrush ( [] ) + +#xtranslate Wvt_CreateDialogDynamic( [] ) => wvw_CreateDialogDynamic( [] ) +#xtranslate Wvt_CreateDialogModal ( [] ) => wvw_CreateDialogModal ( [] ) +#xtranslate Wvt__MakeDlgTemplate ( [] ) => wvw__MakeDlgTemplate ( [] ) +#xtranslate Wvt_LBAddString ( [] ) => wvw_LBAddString ( [] ) +#xtranslate Wvt_LBSetCurSel ( [] ) => wvw_LBSetCurSel ( [] ) +#xtranslate Wvt_CBAddString ( [] ) => wvw_cbAddString ( [] ) +#xtranslate Wvt_CBSetCurSel ( [] ) => wvw_CBSetCurSel ( [] ) +#xtranslate Wvt_DlgSetIcon ( [] ) => wvw_DlgSetIcon ( [] ) + + +/* These functions do not exist in WVT. */ +//Wvt_SetVertCaret ( [] ) => wvw_SetVertCaret ( [] ) +//Wvt_SetDefLineSpacing ( [] ) => wvw_SetDefLineSpacing ( [] ) + +/* PART-2: WINDOW DEPENDENT (additional nWinNum parameter) */ +/* ======================================================= */ + +/* + Notes: + + nWinNum parameter passed as NIL will be translated by gtwvw into : + IF MainCoordMode + Topmost Window + ELSE + Current Window + ENDIF + + Since gtwvt application can't be in MainCoordMode, + the following approach makes these functions work on current window. + + You may want to replace NIL with your own function/variable by which you can decide + which window to direct your output to. + +*/ + +#xtranslate Wvt_SetMenu ( [] ) => wvw_SetMenu ( NIL [, ] ) +#xtranslate Wvt_SetPopupMenu ( [] ) => wvw_SetPopupMenu ( NIL [, ] ) +#xtranslate Wvt_GetLastMenuEvent ( [] ) => wvw_GetLastMenuEvent ( NIL [, ] ) +#xtranslate Wvt_SetMenuKeyEvent ( [] ) => wvw_SetMenuKeyEvent ( NIL [, ] ) +#xtranslate Wvt_DrawMenuBar ( [] ) => wvw_DrawMenuBar ( NIL [, ] ) +#xtranslate WVT_SETWINDOWCENTRE ( [] ) => wvw_SetWindowCentre ( NIL [, ] ) +#xtranslate Wvt_ProcessMessages ( [] ) => wvw_ProcessMessages ( NIL [, ] ) +#xtranslate Wvt_GetTitle ( [] ) => wvw_GetTitle ( NIL [, ] ) +#xtranslate Wvt_InvalidateRect ( [] ) => wvw_InvalidateRect ( NIL [, ] ) +#xtranslate Wvt_ClientToScreen ( [] ) => wvw_ClientToScreen ( NIL [, ] ) +#xtranslate Wvt_SetFont ( [] ) => wvw_SetFont ( NIL [, ] ) +#xtranslate Wvt_SetIcon ( [] ) => wvw_SetIcon ( NIL [, ] ) +#xtranslate Wvt_SetTitle ( [] ) => wvw_SetTitle ( NIL [, ] ) +#xtranslate Wvt_SetWindowPos ( [] ) => wvw_SetWindowPos ( NIL [, ] ) +#xtranslate Wvt_GetWindowHandle ( [] ) => wvw_GetWindowHandle ( NIL [, ] ) +#xtranslate Wvt_SetCodepage ( [] ) => wvw_SetCodepage ( NIL [, ] ) +#xtranslate Wvt_CenterWindow ( [] ) => wvw_CenterWindow ( NIL [, ] ) +#xtranslate Wvt_SetMouseMove ( [] ) => wvw_SetMouseMove ( NIL [, ] ) +#xtranslate Wvt_GetXYFromRowCol ( [] ) => wvw_GetXYFromRowCol ( NIL [, ] ) +#xtranslate Wvt_GetFontInfo ( [] ) => wvw_GetFontInfo ( NIL [, ] ) +#xtranslate Wvt_Minimize ( [] ) => wvw_Minimize ( NIL [, ] ) +#xtranslate Wvt_Maximize ( [] ) => wvw_Maximize ( NIL [, ] ) +#xtranslate Wvt_SetOnTop ( [] ) => wvw_SetOnTop ( NIL [, ] ) +#xtranslate Wvt_SetAsNormal ( [] ) => wvw_SetAsNormal ( NIL [, ] ) +#xtranslate Wvt_SaveScreen ( [] ) => wvw_SaveScreen ( NIL [, ] ) +#xtranslate Wvt_RestScreen ( [] ) => wvw_RestScreen ( NIL [, ] ) +#xtranslate Wvt_DrawLabelObj ( [] ) => wvw_DrawLabelObj ( NIL [, ] ) +#xtranslate Wvt_DrawToolButtonState ( [] ) => wvw_DrawToolButtonState ( NIL [, ] ) +#xtranslate Wvt_DrawScrollButton ( [] ) => wvw_DrawScrollButton ( NIL [, ] ) +#xtranslate Wvt_DrawScrollThumbVert ( [] ) => wvw_DrawScrollThumbVert ( NIL [, ] ) +#xtranslate Wvt_DrawScrollThumbHorz ( [] ) => wvw_DrawScrollThumbHorz ( NIL [, ] ) +#xtranslate Wvt_DrawShadedRect ( [] ) => wvw_DrawShadedRect ( NIL [, ] ) +#xtranslate Wvt_DrawTextBox ( [] ) => wvw_DrawTextBox ( NIL [, ] ) +#xtranslate Wvt_DrawProgressBar ( [] ) => wvw_DrawProgressBar ( NIL [, ] ) +#xtranslate Wvt_TrackPopupMenu ( [] ) => wvw_TrackPopupMenu ( NIL [, ] ) +#xtranslate Wvt_GetMenu ( [] ) => wvw_GetMenu ( NIL [, ] ) +#xtranslate Wvt_ShowWindow ( [] ) => wvw_ShowWindow ( NIL [, ] ) +#xtranslate Wvt_UpdateWINDOW ( [] ) => wvw_UpdateWindow ( NIL [, ] ) +#xtranslate Wvt_DrawBoxGet ( [] ) => wvw_DrawBoxGet ( NIL [, ] ) +#xtranslate Wvt_DrawBoxRaised ( [] ) => wvw_DrawBoxRaised ( NIL [, ] ) +#xtranslate Wvt_DrawBoxRecessed ( [] ) => wvw_DrawBoxRecessed ( NIL [, ] ) +#xtranslate Wvt_DrawBoxGroup ( [] ) => wvw_DrawBoxGroup ( NIL [, ] ) +#xtranslate Wvt_DrawBoxGroupRaised ( [] ) => wvw_DrawBoxGroupRaised ( NIL [, ] ) +#xtranslate Wvt_DrawImage ( [] ) => wvw_DrawImage ( NIL [, ] ) +#xtranslate Wvt_DrawLabel ( [] ) => wvw_DrawLabel ( NIL [, ] ) +#xtranslate Wvt_DrawOutline ( [] ) => wvw_DrawOutline ( NIL [, ] ) +#xtranslate Wvt_DrawLine ( [] ) => wvw_DrawLine ( NIL [, ] ) +#xtranslate Wvt_DrawEllipse ( [] ) => wvw_DrawEllipse ( NIL [, ] ) +#xtranslate Wvt_DrawRectangle ( [] ) => wvw_DrawRectangle ( NIL [, ] ) +#xtranslate WVT_FILLRECTANGLE ( [] ) => wvw_FillRectangle ( NIL [, ] ) +#xtranslate Wvt_DrawColorRect ( [] ) => wvw_DrawColorRect ( NIL [, ] ) +#xtranslate Wvt_DrawRoundRect ( [] ) => wvw_DrawRoundRect ( NIL [, ] ) +#xtranslate Wvt_DrawFocusRect ( [] ) => wvw_DrawFocusRect ( NIL [, ] ) +#xtranslate Wvt_DrawGridHorz ( [] ) => wvw_DrawGridHorz ( NIL [, ] ) +#xtranslate Wvt_DrawGridVert ( [] ) => wvw_DrawGridVert ( NIL [, ] ) +#xtranslate Wvt_DrawButton ( [] ) => wvw_DrawButton ( NIL [, ] ) + +#xtranslate Wvt_SetMousePos ( [] ) => wvw_SetMousePos ( NIL [, ] ) + +/* in gtwvt no pending rect is reflected as {0,0,0,0} + in gtwvw no pending rect is reflected as {y1,x1,y2,x2} where y1 > y2 or x1 > x2 + thus we need some temporary var to check this exception +*/ +#xtranslate Wvt_GetPaintRect ( [] ) => ( _wvwtemp_ := wvw_GetPaintRect( NIL [, ] ), ; + iif( _wvwtemp_\[ 1 \] > _wvwtemp_\[ 3 \] .OR. _wvwtemp_\[ 2 \] > _wvwtemp_\[ 4 \], ; + { 0, 0, 0, 0 }, _wvwtemp_ ) ) + +#xtranslate Wvt_SetPointer ( [] ) => wvw_SetPointer ( NIL [, ] ) +#xtranslate Wvt_DrawPicture ( [] ) => wvw_DrawPicture ( NIL [, ] ) +#xtranslate Wvt_DrawLabelEx ( [] ) => wvw_DrawLabelEx ( NIL [, ] ) +#xtranslate Wvt_DrawLineEx ( [] ) => wvw_DrawLineEx ( NIL [, ] ) +#xtranslate Wvt_DrawOutlineEx ( [] ) => wvw_DrawOutlineEx ( NIL [, ] ) +#xtranslate Wvt_MessageBox ( [] ) => wvw_MessageBox ( NIL [, ] ) +#xtranslate Wvt_SetToolTipActive ( [] ) => wvw_SetToolTipActive ( NIL [, ] ) +#xtranslate Wvt_SetToolTip ( [] ) => wvw_SetToolTip ( NIL [, ] ) +#xtranslate Wvt_SetToolTipText ( [] ) => wvw_SetToolTipText ( NIL [, ] ) +#xtranslate Wvt_SetToolTipMargin ( [] ) => wvw_SetToolTipMargin ( NIL [, ] ) +#xtranslate Wvt_SetToolTipWidth ( [] ) => wvw_SetToolTipWidth ( NIL [, ] ) +#xtranslate Wvt_SetToolTipBkColor ( [] ) => wvw_SetToolTipBkColor ( NIL [, ] ) +#xtranslate Wvt_SetToolTipTextColor ( [] ) => wvw_SetToolTipTextColor ( NIL [, ] ) +#xtranslate Wvt_SetToolTipTitle ( [] ) => wvw_SetToolTipTitle ( NIL [, ] ) +#xtranslate Wvt_GetToolTipWidth ( [] ) => wvw_GetToolTipWidth ( NIL [, ] ) +#xtranslate Wvt_GetToolTipBKColor ( [] ) => wvw_GetToolTipBkColor ( NIL [, ] ) +#xtranslate Wvt_GetToolTipTextColor ( [] ) => wvw_GetToolTipTextColor ( NIL [, ] ) + +/* Timer functions. WARNING: WVT implementation is slightly different. */ +#xtranslate Wvt_SetTimer ( [] ) => wvw_SetTimer ( NIL [, ] ) +#xtranslate Wvt_KillTimer ( [] ) => wvw_KillTimer ( NIL [, ] ) + +/* wvw_DrawStatusBar() is for compatibility only. + Recommended to use wvw_sb*() functions instead. */ +#xtranslate Wvt_DrawStatusBar ( [] ) => wvw_DrawStatusBar ( NIL [, ] ) + +/* Native Statusbar functions. Currently none in WVT. + WVT uses different approach (Wvt_DrawStatusBar) */ +//wvw_sbCreate +//wvw_sbDestroy +//wvw_sbAddPart +//wvw_sbRefresh +//wvw_sbSetText +//wvw_sbGetText +//wvw_sbGetParts + +/* Toolbar functions. Currently none in WVT. WVT uses different approach. */ +//wvw_tbCreate +//wvw_tbAddButton +//wvw_tbButtonCount +//wvw_tbDelButton +//wvw_tbEnableButton +//wvw_tbDestroy + +/* Scrollbar functions. Currently none in WVT. WVT uses different approach. */ +//wvw_xbCreate +//wvw_xbDestroy +//wvw_xbUpdate +//wvw_xbEnable + +/* Line Spacing. Currently none in WVT. */ +//wvw_SetLineSpacing + +/* PART-3: RESERVED FUNCTION NAMES ("callback" prg functions, called by gtwvw) */ +/* =========================================================================== */ + +/* + Notes: + + Generally, each function is supplied additional nWinNum parameter at the front. + nWinNum is 0-based (with 0 being the Main Window). + + If you have single (main) window, no further change is needed. + However, once you open a second window you you should decide what to do + with nWinNum parameter in these callback functions. + + Typically your WVT_xxx function will need adjustment like below: + + FUNCTION WVT_xxx(...) + LOCAL nOldWin := wvw_nSetCurWindow( nWinNum ) //<-- add this + + ...existing code... + + wvw_nSetCurWindow( nOldWin ) //<--add this + RETURN NIL + + Although the above may be enough, each individual function may need careful review + to make sure it follows gtwvw convention. For example, if you have multiple + exit points in that function. + + IMPORTANT NOTES ON MainCoord Mode: + + Using wvw_nSetCurWindow() in MainCoord Mode may not be appropriate, because + current window is reset to 0 upon returning from a standard GT function + (DispOut(), QQout(), DevOut(), etc.). Remember that these functions + may also be called indirectly through many other functions/commands + (Alert(), AChoice(), GET, etc.). + + You may want to replace wvw_nSetCurWindow() with your own function in this case. + +*/ + +#xtranslate FUNCTION Wvt_Paint( [] ) => FUNCTION wvw_Paint( nWinNum [,] ) +#xtranslate PROCEDURE Wvt_Paint( [] ) => PROCEDURE wvw_Paint( nWinNum [,] ) +#xtranslate Wvt_Paint( [] ) => wvw_Paint( NIL [,] ) + +#xtranslate FUNCTION Wvt_SetFocus( [] ) => FUNCTION wvw_SetFocus( nWinNum [,] ) +#xtranslate PROCEDURE Wvt_SetFocus( [] ) => PROCEDURE wvw_SetFocus( nWinNum [,] ) +#xtranslate Wvt_SetFocus( [] ) => wvw_SetFocus( NIL [,] ) + +#xtranslate FUNCTION Wvt_KillFocus( [] ) => FUNCTION wvw_KillFocus( nWinNum [,] ) +#xtranslate PROCEDURE Wvt_KillFocus( [] ) => PROCEDURE wvw_KillFocus( nWinNum [,] ) +#xtranslate Wvt_KillFocus( [] ) => wvw_KillFocus( NIL [,] ) + +#xtranslate FUNCTION Wvt_Mouse( [] ) => FUNCTION wvw_Mouse( nWinNum [,] ) +#xtranslate PROCEDURE Wvt_Mouse( [] ) => PROCEDURE wvw_Mouse( nWinNum [,] ) +#xtranslate Wvt_Mouse( [] ) => wvw_Mouse( NIL [,] ) + +#xtranslate FUNCTION Wvt_Timer() => FUNCTION wvw_Timer( nWinNum, hWnd, message, wParam, lParam ) +#xtranslate PROCEDURE Wvt_Timer() => PROCEDURE wvw_Timer( nWinNum, hWnd, message, wParam, lParam ) +/* Currently Wvt_Timer() is never called by GTWVT. + There should never be any existing usage of this function. +*/ + +/* Wvt_MenuSelect does not exist in WVT. */ +//Wvt_MenuSelect