/* 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