2012-11-11 01:58 UTC+0100 Viktor Szakats (harbour syenar.net)

* contrib/hbgs/core.c
  * contrib/hbwin/wapi_wingdi.c
  * contrib/hbwin/win_com.c
    * minor uncrustify fixes

  * extras/gtwvw/gtwvw.hbx
    * cased all function names

  * extras/gtwvw/wvwdraw.c
  * extras/gtwvw/wvwedit.c
  * extras/gtwvw/wvwfuncs.c
    * cleanups

  * extras/gtwvw/wvwfuncs.c
    ! fixed a few GPFs. There are so plenty of
      them and other sloppy code that it's
      an impossible task.

  * extras/gtwvw/tests/hbmk.hbm
    * set warning level to -w3

  * extras/gtwvw/tests/_wvwmous.prg
  * extras/gtwvw/tests/cbtest1.prg
  * extras/gtwvw/tests/cbtest6.prg
  * extras/gtwvw/tests/drawimg.prg
  * extras/gtwvw/tests/ebtest7.prg
  * extras/gtwvw/tests/inpfocus.prg
  * extras/gtwvw/tests/maincoor.prg
  * extras/gtwvw/tests/maximize.prg
  * extras/gtwvw/tests/prog0.prg
  * extras/gtwvw/tests/prog1.prg
  * extras/gtwvw/tests/prog2.prg
  * extras/gtwvw/tests/wvwtest9.prg
    ! fixed one doubly defined function after
      recent change
    ! fixed all -w3 warnings
    ! enabled GTWVW specific code where it
      was conditionally enabled.
    ! hbformat formattings and related fixes
    ; Strangely all samples work relatively
      okay in script mode, but when built as
      exe they all crash badly.
This commit is contained in:
Viktor Szakats
2012-11-11 01:13:28 +00:00
parent c14efb05a4
commit 93245b2e11
21 changed files with 762 additions and 671 deletions

View File

@@ -16,6 +16,50 @@
The license applies to all entries newer than 2009-04-28.
*/
2012-11-11 01:58 UTC+0100 Viktor Szakats (harbour syenar.net)
* contrib/hbgs/core.c
* contrib/hbwin/wapi_wingdi.c
* contrib/hbwin/win_com.c
* minor uncrustify fixes
* extras/gtwvw/gtwvw.hbx
* cased all function names
* extras/gtwvw/wvwdraw.c
* extras/gtwvw/wvwedit.c
* extras/gtwvw/wvwfuncs.c
* cleanups
* extras/gtwvw/wvwfuncs.c
! fixed a few GPFs. There are so plenty of
them and other sloppy code that it's
an impossible task.
* extras/gtwvw/tests/hbmk.hbm
* set warning level to -w3
* extras/gtwvw/tests/_wvwmous.prg
* extras/gtwvw/tests/cbtest1.prg
* extras/gtwvw/tests/cbtest6.prg
* extras/gtwvw/tests/drawimg.prg
* extras/gtwvw/tests/ebtest7.prg
* extras/gtwvw/tests/inpfocus.prg
* extras/gtwvw/tests/maincoor.prg
* extras/gtwvw/tests/maximize.prg
* extras/gtwvw/tests/prog0.prg
* extras/gtwvw/tests/prog1.prg
* extras/gtwvw/tests/prog2.prg
* extras/gtwvw/tests/wvwtest9.prg
! fixed one doubly defined function after
recent change
! fixed all -w3 warnings
! enabled GTWVW specific code where it
was conditionally enabled.
! hbformat formattings and related fixes
; Strangely all samples work relatively
okay in script mode, but when built as
exe they all crash badly.
2012-11-10 21:25 UTC+0100 Viktor Szakats (harbour syenar.net)
* extras/hbdoc/hbdoc.hbp
+ use $hb_pkg_install.hbm

View File

@@ -69,9 +69,9 @@ HB_FUNC( HB_GS )
if( pParam )
{
void * minst;
int gsargc = ( int ) hb_arrayLen( pParam ) + 1;
int pos;
int code, code1;
int gsargc = ( int ) hb_arrayLen( pParam ) + 1;
char ** gsargv = ( char ** ) hb_xgrab( gsargc * sizeof( const char * ) );
gsargv[ 0 ] = ( char * ) "hbgs"; /* actual value doesn't matter */

View File

@@ -542,14 +542,14 @@ HB_FUNC( WAPI_TEXTOUT )
LPCTSTR lpData = HB_PARSTR( 4, &hData, &nDataLen );
#if ! defined( HB_OS_WIN_CE )
hb_retl( TextOut( hDC,
hb_retl( TextOut( hDC,
hb_parni( 2 ) /* iRow */,
hb_parni( 3 ) /* iCol */,
lpData,
( int ) nDataLen ) );
#else
/* Emulating TextOut() using ExtTextOut(). [vszakats] */
hb_retl( ExtTextOut( hDC,
hb_retl( ExtTextOut( hDC,
hb_parni( 2 ) /* iRow */,
hb_parni( 3 ) /* iCol */,
0,
@@ -601,7 +601,7 @@ HB_FUNC( WAPI_EXTTEXTOUT )
lpFontWidths = NULL;
hb_retl( ExtTextOut( hDC,
hb_retl( ExtTextOut( hDC,
hb_parni( 2 ) /* iRow */,
hb_parni( 3 ) /* iCol */,
( UINT ) hb_parni( 4 ) /* fuOptions */,

View File

@@ -776,10 +776,10 @@ HB_FUNC( WIN_COMDEBUGDCB )
{
if( iDebugLevel & HB_WIN_COM_DBGBASIC )
{
hb_snprintf( buffer, sizeof( buffer ), "Baud : %lu\n", CurDCB.BaudRate ) ; hb_strncat( szDebugString, buffer, sizeof( szDebugString ) - 1 );
hb_snprintf( buffer, sizeof( buffer ), "ByteSize : %i\n" , CurDCB.ByteSize ) ; hb_strncat( szDebugString, buffer, sizeof( szDebugString ) - 1 );
hb_snprintf( buffer, sizeof( buffer ), "Parity : %i\n" , CurDCB.Parity ) ; hb_strncat( szDebugString, buffer, sizeof( szDebugString ) - 1 );
hb_snprintf( buffer, sizeof( buffer ), "StopBits : %i\n" , CurDCB.StopBits ) ; hb_strncat( szDebugString, buffer, sizeof( szDebugString ) - 1 );
hb_snprintf( buffer, sizeof( buffer ), "Baud : %lu\n", CurDCB.BaudRate ); hb_strncat( szDebugString, buffer, sizeof( szDebugString ) - 1 );
hb_snprintf( buffer, sizeof( buffer ), "ByteSize : %i\n" , CurDCB.ByteSize ); hb_strncat( szDebugString, buffer, sizeof( szDebugString ) - 1 );
hb_snprintf( buffer, sizeof( buffer ), "Parity : %i\n" , CurDCB.Parity ); hb_strncat( szDebugString, buffer, sizeof( szDebugString ) - 1 );
hb_snprintf( buffer, sizeof( buffer ), "StopBits : %i\n" , CurDCB.StopBits ); hb_strncat( szDebugString, buffer, sizeof( szDebugString ) - 1 );
}
if( iDebugLevel & HB_WIN_COM_DBGFLOW )
{
@@ -805,10 +805,10 @@ HB_FUNC( WIN_COMDEBUGDCB )
hb_strncat( szDebugString, CurDCB.fDsrSensitivity ? "true\n" : "false\n", sizeof( szDebugString ) - 1 );
hb_strncat( szDebugString, "fTXContinueOnXoff : ", sizeof( szDebugString ) - 1 );
hb_strncat( szDebugString, CurDCB.fTXContinueOnXoff ? "true\n" : "false\n", sizeof( szDebugString ) - 1 );
hb_snprintf( buffer, sizeof( buffer ), "XonLim : %i\n" , CurDCB.XonLim ) ; hb_strncat( szDebugString, buffer, sizeof( szDebugString ) - 1 );
hb_snprintf( buffer, sizeof( buffer ), "XoffLim : %i\n" , CurDCB.XoffLim ) ; hb_strncat( szDebugString, buffer, sizeof( szDebugString ) - 1 );
hb_snprintf( buffer, sizeof( buffer ), "XonChar : 0x%i\n" , CurDCB.XonChar ) ; hb_strncat( szDebugString, buffer, sizeof( szDebugString ) - 1 );
hb_snprintf( buffer, sizeof( buffer ), "XoffChar : 0x%i\n", CurDCB.XoffChar ) ; hb_strncat( szDebugString, buffer, sizeof( szDebugString ) - 1 );
hb_snprintf( buffer, sizeof( buffer ), "XonLim : %i\n" , CurDCB.XonLim ); hb_strncat( szDebugString, buffer, sizeof( szDebugString ) - 1 );
hb_snprintf( buffer, sizeof( buffer ), "XoffLim : %i\n" , CurDCB.XoffLim ); hb_strncat( szDebugString, buffer, sizeof( szDebugString ) - 1 );
hb_snprintf( buffer, sizeof( buffer ), "XonChar : 0x%i\n" , CurDCB.XonChar ); hb_strncat( szDebugString, buffer, sizeof( szDebugString ) - 1 );
hb_snprintf( buffer, sizeof( buffer ), "XoffChar : 0x%i\n", CurDCB.XoffChar ); hb_strncat( szDebugString, buffer, sizeof( szDebugString ) - 1 );
}
if( iDebugLevel & HB_WIN_COM_DBGOTHER )
{
@@ -822,9 +822,9 @@ HB_FUNC( WIN_COMDEBUGDCB )
hb_strncat( szDebugString, CurDCB.fNull ? "true\n" : "false\n", sizeof( szDebugString ) - 1 );
hb_strncat( szDebugString, "fAbortOnError : ", sizeof( szDebugString ) - 1 );
hb_strncat( szDebugString, CurDCB.fAbortOnError ? "true\n" : "false\n", sizeof( szDebugString ) - 1 );
hb_snprintf( buffer, sizeof( buffer ), "ErrorChar : 0x%i\n", CurDCB.ErrorChar ) ; hb_strncat( szDebugString, buffer, sizeof( szDebugString ) - 1 );
hb_snprintf( buffer, sizeof( buffer ), "EofChar : 0x%i\n" , CurDCB.EofChar ) ; hb_strncat( szDebugString, buffer, sizeof( szDebugString ) - 1 );
hb_snprintf( buffer, sizeof( buffer ), "EvtChar : 0x%i\n" , CurDCB.EvtChar ) ; hb_strncat( szDebugString, buffer, sizeof( szDebugString ) - 1 );
hb_snprintf( buffer, sizeof( buffer ), "ErrorChar : 0x%i\n", CurDCB.ErrorChar ); hb_strncat( szDebugString, buffer, sizeof( szDebugString ) - 1 );
hb_snprintf( buffer, sizeof( buffer ), "EofChar : 0x%i\n" , CurDCB.EofChar ); hb_strncat( szDebugString, buffer, sizeof( szDebugString ) - 1 );
hb_snprintf( buffer, sizeof( buffer ), "EvtChar : 0x%i\n" , CurDCB.EvtChar ); hb_strncat( szDebugString, buffer, sizeof( szDebugString ) - 1 );
}
}
else
@@ -840,11 +840,11 @@ HB_FUNC( WIN_COMDEBUGDCB )
s_PortData[ iPort ].dwError = 0;
if( GetCommTimeouts( hCommPort, &CurCOMMTIMEOUTS ) )
{
hb_snprintf( buffer, sizeof( buffer ), "ReadIntervalTimeout : %lu\n" , CurCOMMTIMEOUTS.ReadIntervalTimeout ) ; hb_strncat( szDebugString, buffer, sizeof( szDebugString ) - 1 );
hb_snprintf( buffer, sizeof( buffer ), "ReadTotalTimeoutMultiplier : %ld\n" , CurCOMMTIMEOUTS.ReadTotalTimeoutMultiplier ) ; hb_strncat( szDebugString, buffer, sizeof( szDebugString ) - 1 );
hb_snprintf( buffer, sizeof( buffer ), "ReadTotalTimeoutConstant : %ld\n" , CurCOMMTIMEOUTS.ReadTotalTimeoutConstant ) ; hb_strncat( szDebugString, buffer, sizeof( szDebugString ) - 1 );
hb_snprintf( buffer, sizeof( buffer ), "WriteTotalTimeoutMultiplier : %ld\n", CurCOMMTIMEOUTS.WriteTotalTimeoutMultiplier ) ; hb_strncat( szDebugString, buffer, sizeof( szDebugString ) - 1 );
hb_snprintf( buffer, sizeof( buffer ), "WriteTotalTimeoutConstant : %ld\n" , CurCOMMTIMEOUTS.WriteTotalTimeoutConstant ) ; hb_strncat( szDebugString, buffer, sizeof( szDebugString ) - 1 );
hb_snprintf( buffer, sizeof( buffer ), "ReadIntervalTimeout : %lu\n" , CurCOMMTIMEOUTS.ReadIntervalTimeout ); hb_strncat( szDebugString, buffer, sizeof( szDebugString ) - 1 );
hb_snprintf( buffer, sizeof( buffer ), "ReadTotalTimeoutMultiplier : %ld\n" , CurCOMMTIMEOUTS.ReadTotalTimeoutMultiplier ); hb_strncat( szDebugString, buffer, sizeof( szDebugString ) - 1 );
hb_snprintf( buffer, sizeof( buffer ), "ReadTotalTimeoutConstant : %ld\n" , CurCOMMTIMEOUTS.ReadTotalTimeoutConstant ); hb_strncat( szDebugString, buffer, sizeof( szDebugString ) - 1 );
hb_snprintf( buffer, sizeof( buffer ), "WriteTotalTimeoutMultiplier : %ld\n", CurCOMMTIMEOUTS.WriteTotalTimeoutMultiplier ); hb_strncat( szDebugString, buffer, sizeof( szDebugString ) - 1 );
hb_snprintf( buffer, sizeof( buffer ), "WriteTotalTimeoutConstant : %ld\n" , CurCOMMTIMEOUTS.WriteTotalTimeoutConstant ); hb_strncat( szDebugString, buffer, sizeof( szDebugString ) - 1 );
}
else
{
@@ -860,8 +860,8 @@ HB_FUNC( WIN_COMDEBUGDCB )
s_PortData[ iPort ].dwError = 0;
if( GetCommProperties( hCommPort, &CurCOMMPROP ) )
{
hb_snprintf( buffer, sizeof( buffer ), "dwCurrentTxQueue : %lu\n", CurCOMMPROP.dwCurrentTxQueue ) ; hb_strncat( szDebugString, buffer, sizeof( szDebugString ) - 1 );
hb_snprintf( buffer, sizeof( buffer ), "dwCurrentRxQueue : %lu\n", CurCOMMPROP.dwCurrentRxQueue ) ; hb_strncat( szDebugString, buffer, sizeof( szDebugString ) - 1 );
hb_snprintf( buffer, sizeof( buffer ), "dwCurrentTxQueue : %lu\n", CurCOMMPROP.dwCurrentTxQueue ); hb_strncat( szDebugString, buffer, sizeof( szDebugString ) - 1 );
hb_snprintf( buffer, sizeof( buffer ), "dwCurrentRxQueue : %lu\n", CurCOMMPROP.dwCurrentRxQueue ); hb_strncat( szDebugString, buffer, sizeof( szDebugString ) - 1 );
}
else
{

View File

@@ -21,14 +21,14 @@
#command DYNAMIC <fncs,...> => EXTERNAL <fncs>
#endif
DYNAMIC ADDTOOLTIPEX
DYNAMIC BRINGTOTOP1
DYNAMIC AddToolTipEx
DYNAMIC BringToTop1
DYNAMIC CreateFont
DYNAMIC CreateHatchBrush
DYNAMIC CREATEIMAGELIST
DYNAMIC CreateImageList
DYNAMIC CreateSolidBrush
DYNAMIC DRAWBITMAP
DYNAMIC DRAWICON
DYNAMIC DrawBitmap
DYNAMIC DrawIcon
DYNAMIC GetBitmapSize
DYNAMIC GetIconSize
DYNAMIC GetSysColor
@@ -41,18 +41,18 @@ DYNAMIC LoadBitmap
DYNAMIC LoadBitmapEx
DYNAMIC LoadIcon
DYNAMIC LoadImage
DYNAMIC OPENBITMAP
DYNAMIC OPENIMAGE
DYNAMIC OpenBitmap
DYNAMIC OpenImage
DYNAMIC RedrawWindow
DYNAMIC RGB
DYNAMIC SelectFont
DYNAMIC SendMessage
DYNAMIC SETBITMAPRESOURCEID
DYNAMIC SetBitmapResourceId
DYNAMIC SetBkColor
DYNAMIC SetParent
DYNAMIC SetTextColor
DYNAMIC TOOLBARADDBUTTONS
DYNAMIC WINDOW2BITMAP
DYNAMIC ToolBarAddButtons
DYNAMIC Window2Bitmap
DYNAMIC win_CheckDlgButton
DYNAMIC win_CheckRadioButton
DYNAMIC win_CreateBrush
@@ -80,24 +80,24 @@ DYNAMIC win_SetFocus
DYNAMIC win_SetMenu
DYNAMIC win_SetTextColor
DYNAMIC win_SetTimer
DYNAMIC WVW_ADDROWS
DYNAMIC WVW_ALLOWNONTOPEVENT
DYNAMIC wvw_AddRows
DYNAMIC wvw_AllowNonTopEvent
DYNAMIC wvw_AppendMenu
DYNAMIC wvw_CBAddString
DYNAMIC WVW_CBCREATE
DYNAMIC WVW_CBDESTROY
DYNAMIC WVW_CBENABLE
DYNAMIC WVW_CBFINDSTRING
DYNAMIC WVW_CBGETCURTEXT
DYNAMIC WVW_CBGETINDEX
DYNAMIC WVW_CBISDROPPED
DYNAMIC WVW_CBISFOCUSED
DYNAMIC WVW_CBSETCODEBLOCK
DYNAMIC wvw_cbAddString
DYNAMIC wvw_cbCreate
DYNAMIC wvw_cbDestroy
DYNAMIC wvw_cbEnable
DYNAMIC wvw_cbFindString
DYNAMIC wvw_cbGetCurText
DYNAMIC wvw_cbGetIndex
DYNAMIC wvw_cbIsDropped
DYNAMIC wvw_cbIsFocused
DYNAMIC wvw_cbSetCodeblock
DYNAMIC wvw_CBSetCurSel
DYNAMIC WVW_CBSETFOCUS
DYNAMIC WVW_CBSETFONT
DYNAMIC WVW_CBSETINDEX
DYNAMIC WVW_CBVISIBLE
DYNAMIC wvw_cbSetFocus
DYNAMIC wvw_cbSetFont
DYNAMIC wvw_cbSetIndex
DYNAMIC wvw_cbVisible
DYNAMIC wvw_CenterWindow
DYNAMIC wvw_ChooseColor
DYNAMIC wvw_ChooseFont
@@ -107,22 +107,22 @@ DYNAMIC wvw_CreateDialogModal
DYNAMIC wvw_CreateFont
DYNAMIC wvw_CreateMenu
DYNAMIC wvw_CreatePOPUPMenu
DYNAMIC WVW_CXCREATE
DYNAMIC WVW_CXDESTROY
DYNAMIC WVW_CXENABLE
DYNAMIC WVW_CXGETCHECK
DYNAMIC WVW_CXSETCHECK
DYNAMIC WVW_CXSETCODEBLOCK
DYNAMIC WVW_CXSETFOCUS
DYNAMIC WVW_CXSETFONT
DYNAMIC WVW_CXSTATUSFONT
DYNAMIC WVW_CXVISIBLE
DYNAMIC wvw_cxCreate
DYNAMIC wvw_cxDestroy
DYNAMIC wvw_cxEnable
DYNAMIC wvw_cxGetCheck
DYNAMIC wvw_cxSetCheck
DYNAMIC wvw_cxSetCodeblock
DYNAMIC wvw_cxSetFocus
DYNAMIC wvw_cxSetFont
DYNAMIC wvw_cxStatusFont
DYNAMIC wvw_cxVisible
DYNAMIC wvw_DeleteMenu
DYNAMIC wvw_DeleteObject
DYNAMIC wvw_DestroyMenu
DYNAMIC wvw_DlgSetIcon
DYNAMIC wvw_DrawBoxGet
DYNAMIC WVW_DRAWBOXGET_XP
DYNAMIC wvw_DrawBoxGet_XP
DYNAMIC wvw_DrawBoxGroup
DYNAMIC wvw_DrawBoxGroupRaised
DYNAMIC wvw_DrawBoxRaised
@@ -134,7 +134,7 @@ DYNAMIC wvw_DrawFocusRect
DYNAMIC wvw_DrawGridHorz
DYNAMIC wvw_DrawGridVert
DYNAMIC wvw_DrawImage
DYNAMIC WVW_DRAWIMAGE_RESOURCE
DYNAMIC wvw_DrawImage_Resource
DYNAMIC wvw_DrawLabel
DYNAMIC wvw_DrawLabelEx
DYNAMIC wvw_DrawLabelObj
@@ -154,42 +154,42 @@ DYNAMIC wvw_DrawShadedRect
DYNAMIC wvw_DrawStatusBar
DYNAMIC wvw_DrawTextBox
DYNAMIC wvw_DrawToolButtonState
DYNAMIC WVW_EBCREATE
DYNAMIC WVW_EBDESTROY
DYNAMIC WVW_EBEDITABLE
DYNAMIC WVW_EBENABLE
DYNAMIC WVW_EBGETSEL
DYNAMIC WVW_EBGETTEXT
DYNAMIC WVW_EBISFOCUSED
DYNAMIC WVW_EBISMULTILINE
DYNAMIC WVW_EBSETCODEBLOCK
DYNAMIC WVW_EBSETFOCUS
DYNAMIC WVW_EBSETFONT
DYNAMIC WVW_EBSETSEL
DYNAMIC WVW_EBSETTEXT
DYNAMIC WVW_ENABLEMAXIMIZE
DYNAMIC wvw_ebCreate
DYNAMIC wvw_ebDestroy
DYNAMIC wvw_ebEditable
DYNAMIC wvw_ebEnable
DYNAMIC wvw_ebGetSel
DYNAMIC wvw_ebGetText
DYNAMIC wvw_ebIsFocused
DYNAMIC wvw_ebIsMultiline
DYNAMIC wvw_ebSetCodeblock
DYNAMIC wvw_ebSetFocus
DYNAMIC wvw_ebSetFont
DYNAMIC wvw_ebSetSel
DYNAMIC wvw_ebSetText
DYNAMIC wvw_EnableMaximize
DYNAMIC wvw_EnableMenuItem
DYNAMIC wvw_EnableShortcuts
DYNAMIC WVW_ENDMENU
DYNAMIC WVW_FILLRECTANGLE
DYNAMIC WVW_GBCREATE
DYNAMIC wvw_EndMenu
DYNAMIC wvw_FillRectangle
DYNAMIC wvw_GBCreate
DYNAMIC wvw_GetClipboard
DYNAMIC wvw_GetCursorPos
DYNAMIC wvw_GetFontInfo
DYNAMIC WVW_GETKEYSTATE
DYNAMIC wvw_GetKeyState
DYNAMIC wvw_GetLastMenuEvent
DYNAMIC wvw_GetMenu
DYNAMIC wvw_GetPaintRect
DYNAMIC wvw_GetPalette
DYNAMIC wvw_GetRGBColor
DYNAMIC WVW_GETROWCOLFROMXY
DYNAMIC wvw_GetRowColFromXY
DYNAMIC wvw_GetScreenHeight
DYNAMIC wvw_GetScreenWidth
DYNAMIC WVW_GETSYSTEMMENU
DYNAMIC wvw_GetSystemMenu
DYNAMIC wvw_GetTitle
DYNAMIC wvw_GetWindowHandle
DYNAMIC wvw_GetXYFromRowCol
DYNAMIC WVW_GET_HND_WINDOW
DYNAMIC wvw_Get_hnd_Window
DYNAMIC wvw_HIWORD
DYNAMIC wvw_InvalidateRect
DYNAMIC wvw_IsLButtonPressed
@@ -197,120 +197,120 @@ DYNAMIC wvw_Keyboard
DYNAMIC wvw_KillTimer
DYNAMIC wvw_LBAddString
DYNAMIC wvw_LBSetCurSel
DYNAMIC WVW_LCLOSEWINDOW
DYNAMIC wvw_lCloseWindow
DYNAMIC wvw_LoadFont
DYNAMIC wvw_LoadPen
DYNAMIC wvw_LoadPicture
DYNAMIC wvw_LOWORD
DYNAMIC wvw_Maximize
DYNAMIC WVW_MAXMAXCOL
DYNAMIC WVW_MAXMAXROW
DYNAMIC WVW_MENUITEM_SETBITMAPS
DYNAMIC wvw_MaxMaxCol
DYNAMIC wvw_MaxMaxRow
DYNAMIC wvw_MenuItem_SetBitmaps
DYNAMIC wvw_MessageBox
DYNAMIC wvw_Minimize
DYNAMIC WVW_MOUSE_COL
DYNAMIC WVW_MOUSE_ROW
DYNAMIC WVW_MOVE_READY
DYNAMIC WVW_NCOLOFS
DYNAMIC WVW_NNUMWINDOWS
DYNAMIC WVW_NOCLOSE
DYNAMIC WVW_NOPENWINDOW
DYNAMIC WVW_NOSTARTUPSUBWINDOW
DYNAMIC WVW_NOSYSMENU
DYNAMIC WVW_NROWOFS
DYNAMIC WVW_NSETCURWINDOW
DYNAMIC WVW_NUMBMCACHE
DYNAMIC wvw_mouse_Col
DYNAMIC wvw_mouse_Row
DYNAMIC wvw_Move_Ready
DYNAMIC wvw_nColOfs
DYNAMIC wvw_nNumWindows
DYNAMIC wvw_NoClose
DYNAMIC wvw_nOpenWindow
DYNAMIC wvw_NoStartupSubWindow
DYNAMIC wvw_NoSysMenu
DYNAMIC wvw_nRowOfs
DYNAMIC wvw_nSetCurWindow
DYNAMIC wvw_NumBMCache
DYNAMIC wvw_PasteFromClipboard
DYNAMIC WVW_PBCREATE
DYNAMIC WVW_PBDESTROY
DYNAMIC WVW_PBENABLE
DYNAMIC WVW_PBISFOCUSED
DYNAMIC WVW_PBSETCODEBLOCK
DYNAMIC WVW_PBSETFOCUS
DYNAMIC WVW_PBSETFONT
DYNAMIC WVW_PBSETSTYLE
DYNAMIC WVW_PBVISIBLE
DYNAMIC WVW_PGCREATE
DYNAMIC WVW_PGDESTROY
DYNAMIC WVW_PGGETPOS
DYNAMIC WVW_PGSETPOS
DYNAMIC WVW_PGSETRANGE
DYNAMIC wvw_pbCreate
DYNAMIC wvw_pbDestroy
DYNAMIC wvw_pbEnable
DYNAMIC wvw_pbIsFocused
DYNAMIC wvw_pbSetCodeblock
DYNAMIC wvw_pbSetFocus
DYNAMIC wvw_pbSetFont
DYNAMIC wvw_pbSetStyle
DYNAMIC wvw_pbVisible
DYNAMIC wvw_pgCreate
DYNAMIC wvw_pgDestroy
DYNAMIC wvw_pgGetPos
DYNAMIC wvw_pgSetPos
DYNAMIC wvw_pgSetRange
DYNAMIC wvw_ProcessMessages
DYNAMIC WVW_RBCREATE
DYNAMIC wvw_RBCreate
DYNAMIC wvw_Rectangle
DYNAMIC WVW_RECURSECBLOCK
DYNAMIC WVW_RESTORE
DYNAMIC wvw_RecurseCBlock
DYNAMIC wvw_Restore
DYNAMIC wvw_RestScreen
DYNAMIC wvw_SaveScreen
DYNAMIC WVW_SBADDPART
DYNAMIC WVW_SBCREATE
DYNAMIC WVW_SBDESTROY
DYNAMIC WVW_SBGETPARTS
DYNAMIC WVW_SBGETTEXT
DYNAMIC WVW_SBREFRESH
DYNAMIC WVW_SBSETFONT
DYNAMIC WVW_SBSETTEXT
DYNAMIC wvw_sbAddPart
DYNAMIC wvw_sbCreate
DYNAMIC wvw_sbDestroy
DYNAMIC wvw_sbGetParts
DYNAMIC wvw_sbGetText
DYNAMIC wvw_sbRefresh
DYNAMIC wvw_sbSetFont
DYNAMIC wvw_sbSetText
DYNAMIC wvw_SetAltF4Close
DYNAMIC wvw_SetAsNormal
DYNAMIC wvw_SetBkMode
DYNAMIC wvw_SetBrush
DYNAMIC wvw_SetClipboard
DYNAMIC wvw_SetCodepage
DYNAMIC WVW_SETCONTROLTEXT
DYNAMIC WVW_SETDEFCENTREWINDOW
DYNAMIC WVW_SETDEFHCENTREWINDOW
DYNAMIC WVW_SETDEFLINESPACING
DYNAMIC WVW_SETDEFLSPACECOLOR
DYNAMIC WVW_SETDEFVCENTREWINDOW
DYNAMIC wvw_SetControlText
DYNAMIC wvw_SetDefCentreWindow
DYNAMIC wvw_SetDefHCentreWindow
DYNAMIC wvw_SetDefLineSpacing
DYNAMIC wvw_SetDefLSpaceColor
DYNAMIC wvw_SetDefVCentreWindow
DYNAMIC wvw_SetFont
DYNAMIC wvw_SetIcon
DYNAMIC wvw_SetLastMenuEvent
DYNAMIC WVW_SETLINESPACING
DYNAMIC WVW_SETLSPACECOLOR
DYNAMIC WVW_SETMAINCOORD
DYNAMIC WVW_SETMAXBMCACHE
DYNAMIC wvw_SetLineSpacing
DYNAMIC wvw_SetLSpaceColor
DYNAMIC wvw_SetMainCoord
DYNAMIC wvw_SetMaxBMCache
DYNAMIC wvw_SetMenu
DYNAMIC wvw_SetMenuKeyEvent
DYNAMIC wvw_SetMouseMove
DYNAMIC wvw_SetMousePos
DYNAMIC wvw_SetOnTop
DYNAMIC WVW_SETPAINTREFRESH
DYNAMIC wvw_SetPaintRefresh
DYNAMIC wvw_SetPalette
DYNAMIC wvw_SetPen
DYNAMIC wvw_SetPointer
DYNAMIC wvw_SetPopupMenu
DYNAMIC wvw_SetTimer
DYNAMIC wvw_SetTitle
DYNAMIC WVW_SETVERTCARET
DYNAMIC WVW_SETWINDOWCENTRE
DYNAMIC wvw_SetVertCaret
DYNAMIC wvw_SetWindowCentre
DYNAMIC wvw_SetWindowPos
DYNAMIC WVW_SETWINSTYLE
DYNAMIC wvw_SetWinStyle
DYNAMIC wvw_ShowWindow
DYNAMIC WVW_SIZE_READY
DYNAMIC WVW_STCREATE
DYNAMIC WVW_STSETFONT
DYNAMIC WVW_STSETTEXT
DYNAMIC WVW_TBADDBUTTON
DYNAMIC WVW_TBBUTTONCOUNT
DYNAMIC WVW_TBCMD2INDEX
DYNAMIC WVW_TBCREATE
DYNAMIC WVW_TBDELBUTTON
DYNAMIC WVW_TBDESTROY
DYNAMIC WVW_TBENABLEBUTTON
DYNAMIC WVW_TBGETBUTTONRECT
DYNAMIC WVW_TBINDEX2CMD
DYNAMIC wvw_Size_Ready
DYNAMIC wvw_stCreate
DYNAMIC wvw_stSetFont
DYNAMIC wvw_stSetText
DYNAMIC wvw_tbAddButton
DYNAMIC wvw_tbButtonCount
DYNAMIC wvw_tbCmd2Index
DYNAMIC wvw_tbCreate
DYNAMIC wvw_tbDelButton
DYNAMIC wvw_tbDestroy
DYNAMIC wvw_tbEnableButton
DYNAMIC wvw_tbGetButtonRect
DYNAMIC wvw_tbIndex2Cmd
DYNAMIC wvw_TrackPopupMenu
DYNAMIC WVW_UNREACHEDBR
DYNAMIC wvw_UnreachedBr
DYNAMIC wvw_UpdateWindow
DYNAMIC WVW_XBCREATE
DYNAMIC WVW_XBDESTROY
DYNAMIC WVW_XBENABLE
DYNAMIC WVW_XBINFO
DYNAMIC WVW_XBSHOW
DYNAMIC WVW_XBUPDATE
DYNAMIC WVW_XBVISIBLE
DYNAMIC WVW_XREPOSWINDOW
DYNAMIC WVW_YESCLOSE
DYNAMIC wvw_xbCreate
DYNAMIC wvw_xbDestroy
DYNAMIC wvw_xbEnable
DYNAMIC wvw_xbInfo
DYNAMIC wvw_xbShow
DYNAMIC wvw_xbUpdate
DYNAMIC wvw_xbVisible
DYNAMIC wvw_XReposWindow
DYNAMIC wvw_YesClose
DYNAMIC wvw__MakeDlgTemplate
#if defined( __HBEXTREQ__ ) .OR. defined( __HBEXTERN__GTWVW__REQUEST )

View File

@@ -61,14 +61,16 @@ STATIC s_nrepeatdelay := 0.5
#define _BUTTON_NONE 2 // no sign even when mouseover or clicked
#define _BUTTON_HARD 3 // no recessed when pressed
//**************************************************************
// **************************************************************
// WVWMouseButton
//**************************************************************
// **************************************************************
CREATE CLASS WVWMouseButton
// VAR nId /* TODO */ // mouse object id
// VAR nHotKey /* TODO */ // hotkey associated with this object
#if 0
VAR nId /* TODO */ // mouse object id
VAR nHotKey /* TODO */ // hotkey associated with this object
#endif
VAR nWinId // 20040303, parent window's number
VAR lVisible // is the object visible
VAR lEnable // 20040303, is the object enable
@@ -96,9 +98,11 @@ CREATE CLASS WVWMouseButton
// METHODS
METHOD New( cCaption, nRow1, nCol1, nRow2, nCol2, bClickBlock, nType, lDraw, nWinId )
// METHOD nGetId() INLINE ::nId /* TODO */
// METHOD SetHotKey( nKey ) /* TODO */
// METHOD nGetHotKey() INLINE ::nHotKey /* TODO */
#if 0
METHOD nGetId() INLINE ::nId /* TODO */
METHOD SetHotKey( nKey ) /* TODO */
METHOD nGetHotKey() INLINE ::nHotKey /* TODO */
#endif
METHOD Enable( lEnable )
@@ -274,7 +278,7 @@ METHOD OnReleaseOut() CLASS WVWMouseButton
::Draw()
// NOTE: no need to do SetKeyRepeater( .F. ),
// because it was already handled by onMouseOut
// because it was already handled by onMouseOut
RETURN Self
@@ -316,12 +320,11 @@ METHOD OnMouseOver() CLASS WVWMouseButton
METHOD DRAW( nWinNum ) CLASS WVWMouseButton
LOCAL nROw := Row(), nCol := Col()
LOCAL nOldCursor := SetCursor( SC_NONE )
LOCAL lMouseOver := ::lHover // 20040303,was: ( MRow() >= ::nrow1 .AND. MRow() <= ::nrow2 .AND. MCol() >= ::ncol1 .AND. MCol() <= ::ncol2 )
LOCAL lPressed := ::lPressed .AND. lMouseOver
LOCAL aFontInfo := iif( ::nCaptionHeight == NIL, wvw_getFontInfo( nWinNum ), NIL )
LOCAL nLabelColor := iif( ! lPressed, rgb( 0, 0, 0 ), rgb( 96, 96, 96 ) )
LOCAL aFontInfo := iif( ::nCaptionHeight == NIL, wvw_GetFontInfo( nWinNum ), NIL )
LOCAL nLabelColor := iif( ! lPressed, RGB( 0, 0, 0 ), RGB( 96, 96, 96 ) )
LOCAL lUseImage := HB_ISSTRING( ::cImage ) // 20040325
IF ! ::lVisible .OR. ::nType == _BUTTON_NONE
@@ -338,45 +341,45 @@ METHOD DRAW( nWinNum ) CLASS WVWMouseButton
IF lPressed // ::lPressed
IF ::nType != _BUTTON_HARD
WVW_FillRectangle( nWinNum, ::nrow1, ::nCol1, ::nrow2, ::nCol2, WVW_GetRGBcolor( hb_ColorToN( ::cPressedColor ) ), ::lTight )
Wvw_DrawBoxRecessed( nWinNum, ::nRow1, ::nCol1, ::nRow2, ::nCol2, ::lTight ) // wvw
wvw_FillRectangle( nWinNum, ::nrow1, ::nCol1, ::nrow2, ::nCol2, wvw_GetRGBColor( hb_ColorToN( ::cPressedColor ) ), ::lTight )
wvw_DrawBoxRecessed( nWinNum, ::nRow1, ::nCol1, ::nRow2, ::nCol2, ::lTight ) // wvw
ELSE
WVW_FillRectangle( nWinNum, ::nrow1, ::nCol1, ::nrow2, ::nCol2, WVW_GetRGBcolor( hb_ColorToN( ::cNormalColor ) ), ::lTight )
Wvw_DrawBoxRaised( nWinNum, ::nRow1, ::nCol1, ::nRow2, ::nCol2, ::lTight )
wvw_FillRectangle( nWinNum, ::nrow1, ::nCol1, ::nrow2, ::nCol2, wvw_GetRGBColor( hb_ColorToN( ::cNormalColor ) ), ::lTight )
wvw_DrawBoxRaised( nWinNum, ::nRow1, ::nCol1, ::nRow2, ::nCol2, ::lTight )
ENDIF
IF lUseImage .AND. ::nType != _BUTTON_NONE
IF ! Wvw_DrawImage( nWinNum, ::nRow1, ::nCol1, ::nRow2, ::nCol2, ::cImage, ::lTight )
win_messagebox( NIL, "Button Failed Wvw_DrawImage(" + ::cImage + ")" )
IF ! wvw_DrawImage( nWinNum, ::nRow1, ::nCol1, ::nRow2, ::nCol2, ::cImage, ::lTight )
win_MessageBox( NIL, "Button Failed Wvw_DrawImage(" + ::cImage + ")" )
ENDIF
ENDIF
IF ! Empty( ::cCaption )
Wvw_DrawLabel( nWinNum, ::nRow1, nCeiling( ( ::nCol2 + ::nCol1 ) / 2 ), ::cCaption, 6, , nLabelColor, rgb( 198, 198, 198 ), ::cCaptionFont, iif( HB_ISARRAY( afontinfo ), afontinfo[ 2 ], ::nCaptionHeight ), 0, , , , .F., .F. )
wvw_DrawLabel( nWinNum, ::nRow1, _nCeiling( ( ::nCol2 + ::nCol1 ) / 2 ), ::cCaption, 6, , nLabelColor, RGB( 198, 198, 198 ), ::cCaptionFont, iif( HB_ISARRAY( afontinfo ), afontinfo[ 2 ], ::nCaptionHeight ), 0, , , , .F., .F. )
ENDIF
ELSE
IF lMouseOver .OR. ::nType == _BUTTON_NORMAL .OR. ::nType == _BUTTON_HARD
WVW_FillRectangle( nWinNum, ::nrow1, ::nCol1, ::nrow2, ::nCol2, WVW_GetRGBcolor( hb_ColorToN( ::cNormalColor ) ), ::lTight )
Wvw_DrawBoxRaised( nWinNum, ::nRow1, ::nCol1, ::nRow2, ::nCol2, ::lTight )
wvw_FillRectangle( nWinNum, ::nrow1, ::nCol1, ::nrow2, ::nCol2, wvw_GetRGBColor( hb_ColorToN( ::cNormalColor ) ), ::lTight )
wvw_DrawBoxRaised( nWinNum, ::nRow1, ::nCol1, ::nRow2, ::nCol2, ::lTight )
ELSE
// must undraw the box. ideally GTWVW has this function
Wvw_DrawBoxGroup( nWinNum, ::nRow1, ::nCol1, ::nRow2, ::nCol2 )
wvw_DrawBoxGroup( nWinNum, ::nRow1, ::nCol1, ::nRow2, ::nCol2 )
ENDIF
IF lUseImage .AND. ::nType != _BUTTON_NONE
IF ! Wvw_DrawImage( nWinNum, ::nRow1, ::nCol1, ::nRow2, ::nCol2, ::cImage, ::lTight )
win_messagebox( NIL, "Button Failed Wvw_DrawImage(" + ::cImage + ")" )
IF ! wvw_DrawImage( nWinNum, ::nRow1, ::nCol1, ::nRow2, ::nCol2, ::cImage, ::lTight )
win_MessageBox( NIL, "Button Failed Wvw_DrawImage(" + ::cImage + ")" )
ENDIF
ENDIF
IF ! ::lEnable
nLabelColor := rgb( 96, 96, 96 )
nLabelColor := RGB( 96, 96, 96 )
ELSEIF lMouseOver
nLabelColor := rgb( 255, 0, 0 )
nLabelColor := RGB( 255, 0, 0 )
ENDIF
IF ! Empty( ::cCaption )
Wvw_DrawLabel( nWinNum, ::nRow1, nCeiling( ( ::nCol2 + ::nCol1 ) / 2 ), ::cCaption, 6, , nLabelColor, rgb( 198, 198, 198 ), ::cCaptionFont, iif( HB_ISARRAY( afontinfo ), afontinfo[ 2 ], ::nCaptionHeight ), 0, , , , .F., .F. )
wvw_DrawLabel( nWinNum, ::nRow1, _nCeiling( ( ::nCol2 + ::nCol1 ) / 2 ), ::cCaption, 6, , nLabelColor, RGB( 198, 198, 198 ), ::cCaptionFont, iif( HB_ISARRAY( afontinfo ), afontinfo[ 2 ], ::nCaptionHeight ), 0, , , , .F., .F. )
ENDIF
ENDIF
SetCursor( nOldCursor )
@@ -448,7 +451,6 @@ STATIC FUNCTION nButtonChecker( nkey, oMouseObj )
LOCAL nrow := MRow(), ncol := MCol()
LOCAL lMouseOver
LOCAL i
lMouseOver := ( nrow >= oMouseObj:nrow1 .AND. nrow <= oMouseObj:nrow2 .AND. ncol >= oMouseObj:ncol1 .AND. ncol <= oMouseObj:ncol2 )
IF ! lMouseOver
@@ -489,17 +491,19 @@ STATIC FUNCTION nButtonChecker( nkey, oMouseObj )
RETURN nkey // nButtonChecker(nkey)
STATIC FUNCTION nScrollChecker( nkey, cType, oMouseObj )
STATIC FUNCTION nScrollChecker( nKey, cType, oMouseObj )
// cType == "H" or "V"
HB_SYMBOL_UNUSED( cType )
nButtonChecker( nkey, oMouseObj:oFirstButton )
nButtonChecker( nkey, oMouseObj:oRail1Button )
nButtonChecker( nkey, oMouseObj:oMidButton )
nButtonChecker( nkey, oMouseObj:oRail2Button )
nButtonChecker( nkey, oMouseObj:oSecondButton )
RETURN nkey // nHScrollChecker(nkey)
RETURN nKey // nHScrollChecker( nkey )
/* HANDLING MULTIPLE MOUSE OBJECTS */
/* called by SETKEYAFTERBLOCK() function */
@@ -513,7 +517,7 @@ FUNCTION wvwm_nMouseChecker( nkey )
LOCAL i, oMouseObj
LOCAL nCurWindow
nCurWindow := WVW_nNumWindows() - 1
nCurWindow := wvw_nNumWindows() - 1
IF Len( s_amouseobjlist ) < nCurWindow + 1
RETURN nkey
@@ -585,7 +589,7 @@ STATIC PROCEDURE xKeyRepeater( lInit )
// *************************** supporters
STATIC FUNCTION nCeiling( nNumber )
STATIC FUNCTION _nCeiling( nNumber )
LOCAL nTemp

View File

@@ -41,13 +41,15 @@ PROCEDURE Main()
#endif
SetColor( "N/W" )
WVW_SetTitle( NIL, "Quick Survey" )
WVW_NoClose( NIL )
WVW_SetAltF4Close( .F. )
WVW_SetLineSpacing( NIL, 4 )
// WVW_SetLSpaceColor( NIL, 7 )
WVW_cbSetFont( NIL, "Arial", 16 )
WVW_pbSetFont( NIL, "Arial", 16 )
wvw_SetTitle( NIL, "Quick Survey" )
wvw_NoClose( NIL )
wvw_SetAltF4Close( .F. )
wvw_SetLineSpacing( NIL, 4 )
#if 0
wvw_SetLSpaceColor( NIL, 7 )
#endif
wvw_cbSetFont( NIL, "Arial", 16 )
wvw_pbSetFont( NIL, "Arial", 16 )
nMaxWidth := 0
AEval( s_aAnswers, {| x | nMaxWIdth := Max( nMaxWidth, Len( x ) ) } )

View File

@@ -35,7 +35,7 @@ STATIC s_aComboList := {}
// create these two as local, otherwise it will be assumed PRIVATE
MEMVAR __nCBid__, __temp__
#xcommand @ <row>, <col> COMBOBOX <var> ;
#xcommand @ <row>, <col> COMBOBOX <var> ;
OPTIONS <aOptions> ;
WIDTH <nWidth> => ;
;
@@ -43,7 +43,7 @@ MEMVAR __nCBid__, __temp__
__nCBid__ := wvw_cbCreate( NIL, <row>, <col>, <nWidth>, ;
<aOptions>, ;
{| nWinNum, nId, nEvent, nIndex, temp | ;
CBhandler( nWinNum, nId, nEvent, nIndex, <"var">, GetList );
CBhandler( nWinNum, nId, nEvent, nIndex, <"var">, GetList ), HB_SYMBOL_UNUSED( temp );
}, ;
NIL, NIL, s_nCB_Kbd, NIL ); ;
AAdd( s_aComboList, { __nCBid__, <"var"> } ); ;
@@ -64,13 +64,15 @@ PROCEDURE Main()
hbshell_gtSelect( "GTWVW" )
#endif
WVW_SetCodePage( NIL, 255 )
WVW_SetLineSpacing( NIL, 4 )
WVW_SetLSpaceColor( NIL, 0 )
WVW_cbSetFont( NIL, "Arial", 14 ) // std: 20-2
// Set( _SET_TRACESTACK, 0 )
wvw_SetCodepage( NIL, 255 )
wvw_SetLineSpacing( NIL, 4 )
wvw_SetLSpaceColor( NIL, 0 )
wvw_cbSetFont( NIL, "Arial", 14 ) // std: 20-2
#if 0
Set( _SET_TRACESTACK, 0 )
// wvw_setmousemove( , .T. )
wvw_SetMouseMove( , .T. )
#endif
CLS
@@ -86,7 +88,7 @@ PROCEDURE Main()
READ
// disable all comboboxes:
AEval( s_aComboList, {| x | wvw_cbenable( NIL, x[ 1 ], .F. ) } )
AEval( s_aComboList, {| x | wvw_cbEnable( NIL, x[ 1 ], .F. ) } )
DevPos( 5, 0 )
? "name: '" + mname + "'"
@@ -97,7 +99,7 @@ PROCEDURE Main()
Inkey( 0 )
// destroy all comboboxes:
AEval( s_aComboList, {| x | wvw_cbdestroy( NIL, x[ 1 ] ) } )
AEval( s_aComboList, {| x | wvw_cbDestroy( NIL, x[ 1 ] ) } )
s_aComboList := {}
?
@@ -130,9 +132,10 @@ PROCEDURE Main()
FUNCTION CBhandler( nWinNum, nId, nEvent, nIndex, cVar, GetList )
LOCAL i, ccursel
LOCAL oGetList := __GetListActive()
LOCAL oGet := GetActive()
HB_SYMBOL_UNUSED( nIndex )
/* if GetList is empty, then READ session is already ended
* this should not be happenning!
*/
@@ -206,7 +209,6 @@ FUNCTION CBhandler( nWinNum, nId, nEvent, nIndex, cVar, GetList )
FUNCTION CBreader( oGet )
LOCAL nKey, bKeyBlock
LOCAL nSelected, cSelected
LOCAL oGetList := __GetListActive()
IF ! wvw_cbIsFocused( NIL, oGet:cargo )
@@ -301,17 +303,17 @@ STATIC FUNCTION MoveToGet( GetList, nPos )
// Set FOCUS to window nWinNum
STATIC FUNCTION SetWinFocus( nWinNum )
LOCAL hWnd := wvw_getWindowHandle( nWinNum )
LOCAL hWnd := wvw_GetWindowHandle( nWinNum )
WIN_SETFOCUS( hWnd )
win_SetFocus( hWnd )
RETURN NIL
STATIC FUNCTION MyAlert( cMsg, par2, par3, par4, par5, par6 )
LOCAL nLineSpacing := WVW_SetLineSpacing( NIL, 0 )
LOCAL nLineSpacing := wvw_SetLineSpacing( NIL, 0 )
LOCAL retval := Alert( cMsg, par2, par3, par4, par5, par6 )
WVW_SetLineSpacing( NIL, nLineSpacing )
wvw_SetLineSpacing( NIL, nLineSpacing )
RETURN retval

View File

@@ -94,10 +94,10 @@ PROCEDURE Main()
hbshell_gtSelect( "GTWVW" )
#endif
nMaxCache := wvw_SetMaxBMcache()
nMaxCache := wvw_SetMaxBMCache()
SetColor( "N/W,N/GR*,,,N/W*" )
wvw_setcodepage( , 255 )
wvw_SetCodepage( , 255 )
wg_ResetWPaintObj( 0 )
DO WHILE .T.
CLS
@@ -106,15 +106,15 @@ PROCEDURE Main()
@ 0, 0 SAY "FileName :" GET cpict PICT "@K" VALID hb_FileExists( AllTrim( cpict ) )
@ 1, 0 SAY "Transpar? :" GET ltransp PICT "Y"
@ 2, 0 SAY "Max Cache :" GET nMaxCache PICT "999"
@ 3, 0 SAY "NumOfCache=" + Transform( wvw_numBMcache(), "999" ) + ;
", Max NumOfCache=" + Transform( wvw_SetMaxBMcache(), "999" )
@ 3, 0 SAY "NumOfCache=" + Transform( wvw_NumBMCache(), "999" ) + ;
", Max NumOfCache=" + Transform( wvw_SetMaxBMCache(), "999" )
READ
IF LastKey() == K_ESC
EXIT
ENDIF
wvw_SetMaxBMcache( nMaxCache )
@ 3, 0 SAY "NumOfCache=" + Transform( wvw_numBMcache(), "999" ) + ;
", Max NumOfCache=" + Transform( wvw_SetMaxBMcache(), "999" )
wvw_SetMaxBMCache( nMaxCache )
@ 3, 0 SAY "NumOfCache=" + Transform( wvw_NumBMCache(), "999" ) + ;
", Max NumOfCache=" + Transform( wvw_SetMaxBMCache(), "999" )
@ 5, 0 SAY "TOPLEFT: stretched image TOPRIGHT: fit vertically (proportional)"
@ 6, 0 SAY "BOTLEFT: fit horizontally (proportional) BOTRIGHT: actual image size"
@@ -187,7 +187,7 @@ CREATE CLASS wPaintObj FROM wGUIObj
VAR cImage
VAR lTransp
METHOD New()
METHOD New( nWinNum, nType, cId, nRow1, nCol1, nRow2, nCol2, aOffTLBR, lTransp )
METHOD Draw()
METHOD Undraw()
METHOD Hide()
@@ -229,7 +229,7 @@ METHOD Draw() CLASS wPaintObj
DO CASE
case ::nType == WPAINTOBJ_IMAGE
IF ! Empty( ::cImage )
WVW_DRAWIMAGE( ::nWinNum, ::nRow1, ::nCol1, ::nRow2, ::nCol2, ;
wvw_DrawImage( ::nWinNum, ::nRow1, ::nCol1, ::nRow2, ::nCol2, ;
::cImage, ::aOffTLBR, ::lTransp )
ENDIF
@@ -293,8 +293,6 @@ METHOD Show() CLASS wPaintObj
// if nObjNum specified, clears object >= nObjNum
FUNCTION wg_ResetWPaintObj( nWinNum, nObjNum, lStrict )
LOCAL i
hb_default( @nObjNum, 0 )
hb_default( @lStrict, .F. )
@@ -311,7 +309,6 @@ FUNCTION wg_ResetWPaintObj( nWinNum, nObjNum, lStrict )
FUNCTION wg_AddWPaintObj( nWinNum, oWPaint, lStrict, nOperation )
LOCAL i
LOCAL nLen, aRect // 20050720
hb_default( @lStrict, .F. )
hb_default( @nOperation, WOBJ_ADD_OVERWRITE )
@@ -357,7 +354,6 @@ FUNCTION wg_DelWPaintObj( nWinNum, nType, cId, lStrict )
LOCAL lDelAll := ( cId == NIL )
LOCAL nDeleted := 0
LOCAL nLen
LOCAL cCurId
hb_default( @lStrict, .F. )
@@ -371,13 +367,12 @@ FUNCTION wg_DelWPaintObj( nWinNum, nType, cId, lStrict )
nLen := Len( s_aPObjList[ nWinNum + 1 ] )
DO WHILE i <= nLen
IF s_aPObjList[ nWinNum + 1 ][ i ]:nType == nType .AND. ;
( lDelAll .OR. s_aPObjList[ nWinNum + 1 ][ i ]:cId == cId )
( lDelAll .OR. s_aPObjList[ nWinNum + 1 ][ i ]:cId == cId )
IF lStrict
s_aPObjList[ nWinNum + 1 ][ i ]:Hide()
ELSE
s_aPObjList[ nWinNum + 1 ][ i ]:lVisible := .F.
ENDIF
cCurId := s_aPObjList[ nWinNum + 1 ][ i ]:cId
ADel( s_aPObjList[ nWinNum + 1 ], i )
ASize( s_aPObjList[ nWinNum + 1 ], --nLen )
nDeleted++

View File

@@ -58,7 +58,6 @@
PROCEDURE Main()
LOCAL nOpen, nClose
LOCAL lClosepermitted := .F.
LOCAL bSetKey := SetKey( K_F8, {|| MyHelp() } )
@@ -71,14 +70,14 @@ PROCEDURE Main()
SET CENTURY ON
SetMode( 4, 54 ) // a small window
SetColor( "N/W" )
Wvw_SetFont( 0, "Courier New", 16, - 7 )
WVW_EBSetFont( 0, "Arial" ) // font for editbox
WVW_PBSetFont( 0, "Arial" ) // font for pushbuttons
wvw_SetFont( 0, "Courier New", 16, - 7 )
wvw_ebSetFont( 0, "Arial" ) // font for editbox
wvw_pbSetFont( 0, "Arial" ) // font for pushbuttons
Wvw_SetCodePage( 0, 255 )
wvw_allownontopEvent( .T. ) // this will make pushbuttons to work
wvw_SetCodepage( 0, 255 )
wvw_AllowNonTopEvent( .T. ) // this will make pushbuttons to work
// even on non-topmost window
wvw_recurseCblock( .T. ) // this will allow recursed execution
wvw_RecurseCBlock( .T. ) // this will allow recursed execution
// of control's codeblocks
// eg. multiple executions of pushbutton's codeblock
// invoking "GetSession()"
@@ -87,11 +86,11 @@ PROCEDURE Main()
CLS
@ 0, 1 SAY "Click NEW to open a new GET session, CLOSE when done"
nOpen := wvw_pbcreate( 0, 2, 1, 2, 10, "New", NIL, {|| GetSession() } )
nClose := wvw_pbcreate( 0, 2, 12, 2, 22, "Close", NIL, {|| ToCloseWindow( 0, @lClosepermitted ) } )
wvw_pbCreate( 0, 2, 1, 2, 10, "New", NIL, {|| GetSession() } )
wvw_pbCreate( 0, 2, 12, 2, 22, "Close", NIL, {|| ToCloseWindow( 0, @lClosepermitted ) } )
// activate/show the main window
wvw_showwindow( 0 )
wvw_ShowWindow( 0 )
// wait until user click the close button
DO WHILE ! lClosepermitted
@@ -151,7 +150,7 @@ PROCEDURE GetSession()
cdebugreport += "cRemark:" + cRemark
MyMessageBox( nwinnum, cdebugreport )
wvw_lclosewindow()
wvw_lCloseWindow()
s_nsession--
@@ -176,8 +175,10 @@ FUNCTION MyHelp()
FUNCTION WVW_SETFOCUS( nWinNum, hWnd )
HB_SYMBOL_UNUSED( hWnd )
IF nwinnum != 0
wvw_nsetcurwindow( nwinnum )
wvw_nSetCurWindow( nwinnum )
ENDIF
RETURN NIL
@@ -246,7 +247,7 @@ PROCEDURE EBReadGets( nwinnum, aEBGets )
LOCAL nmaxrow, nmincol
LOCAL i, nlen, lmultiline, clabel, ;
nrow1, ncol1, nrow2, ncol2
LOCAL creport, nOKbutton, nCancelbutton, nClosebutton, ldone := .F.
LOCAL nOKbutton, nCancelbutton, nClosebutton, ldone := .F.
LOCAL lclosePermitted := .F.
LOCAL nNumGets := Len( aEBGets )
LOCAL ch
@@ -256,7 +257,7 @@ PROCEDURE EBReadGets( nwinnum, aEBGets )
RETURN
ENDIF
wvw_nsetcurwindow( nwinnum )
wvw_nSetCurWindow( nwinnum )
nmaxrow := 0
nmincol := 99999
FOR i := 1 TO nNumGets
@@ -274,7 +275,7 @@ PROCEDURE EBReadGets( nwinnum, aEBGets )
@ nrow1, ncol1 - Len( clabel ) - 1 SAY clabel
aEBGets[ i ][ __GET_NEBID ] := wvw_ebcreate( nwinnum, nrow1, ncol1, nrow2, ncol2, ;
aEBGets[ i ][ __GET_NEBID ] := wvw_ebCreate( nwinnum, nrow1, ncol1, nrow2, ncol2, ;
Transform( aEBGets[ i ][ __GET_XINIT ], aEBGets[ i ][ __GET_CPICT ] ), ;
{| nWinNum, nId, nEvent | MaskEditBox( nWinNum, nId, nEvent, @aEBGets ) }, ;
aEBGets[ i ][ __GET_LMULTILINE ], ; // EBtype
@@ -287,27 +288,26 @@ PROCEDURE EBReadGets( nwinnum, aEBGets )
NEXT
nrow1 := nmaxrow + 2 // min(nmaxrow+2, maxrow())
ncol1 := nmincol // min(nmincol, maxcol()-33)
nOKbutton := wvw_pbcreate( nwinnum, nrow1, ncol1, nrow1, ncol1 + 10 - 1, "OK", NIL, ;
nOKbutton := wvw_pbCreate( nwinnum, nrow1, ncol1, nrow1, ncol1 + 10 - 1, "OK", NIL, ;
{|| SaveVar( nwinnum, @aEBGets, @lDone ), ;
EndGets( nwinnum, @aEBGets, nOKbutton, nCancelbutton, nCloseButton );
} )
ncol1 := ncol1 + 10 + 1
nCancelbutton := wvw_pbcreate( nwinnum, nrow1, ncol1, nrow1, ncol1 + 10 - 1, "Cancel", NIL, ;
nCancelbutton := wvw_pbCreate( nwinnum, nrow1, ncol1, nrow1, ncol1 + 10 - 1, "Cancel", NIL, ;
{|| CancelVar( nwinnum, @aEBGets, @lDone ), ;
EndGets( nwinnum, @aEBGets, nOKbutton, nCancelbutton, nCloseButton );
} )
ncol1 := ncol1 + 10 + 1
nClosebutton := wvw_pbcreate( nwinnum, nrow1, ncol1, nrow1, ncol1 + 10 - 1, "Close", NIL, ;
nClosebutton := wvw_pbCreate( nwinnum, nrow1, ncol1, nrow1, ncol1 + 10 - 1, "Close", NIL, ;
{|| ToCloseWindow( nwinnum, @lClosepermitted ) } )
wvw_pbenable( nwinnum, nclosebutton, .F. )
wvw_pbEnable( nwinnum, nclosebutton, .F. )
// register a keyhandler for WVW_INPFOCUS
inp_handler( nwinnum, {| n, ch | InpKeyHandler( n, ch, aEBGets, nOKbutton, nCancelbutton ) } )
i := 1
wvw_ebsetfocus( nwinnum, aEBGets[ 1 ][ __GET_NEBID ] )
wvw_ebSetFocus( nwinnum, aEBGets[ 1 ][ __GET_NEBID ] )
nFocus := 1
ch := Inkey( 0.5 )
DO WHILE ! lDone
@@ -333,17 +333,17 @@ PROCEDURE EBReadGets( nwinnum, aEBGets )
ENDCASE
IF lchangefocus
IF nFocus <= nNumGets
wvw_ebsetfocus( nwinnum, aEBGets[ nFocus ][ __GET_NEBID ] )
wvw_ebSetFocus( nwinnum, aEBGets[ nFocus ][ __GET_NEBID ] )
ELSEIF nFocus == nNumGets + 1
wvw_pbsetfocus( nwinnum, nOKbutton )
wvw_pbSetFocus( nwinnum, nOKbutton )
ELSEIF nFocus == nNumGets + 2
wvw_pbsetfocus( nwinnum, nCancelbutton )
wvw_pbSetFocus( nwinnum, nCancelbutton )
ENDIF
ENDIF
ENDIF
IF wvw_pbisfocused( nwinnum, nOKbutton )
IF wvw_pbIsFocused( nwinnum, nOKbutton )
nFocus := nNumGets + 1
ELSEIF wvw_pbisfocused( nwinnum, nCancelbutton )
ELSEIF wvw_pbIsFocused( nwinnum, nCancelbutton )
nFocus := nNumGets + 2
ELSE
nFocus := nFocused( aEBGets )
@@ -353,7 +353,7 @@ PROCEDURE EBReadGets( nwinnum, aEBGets )
// session ended (already ended by OK or Cancel)
lClosepermitted := ( nwinnum == wvw_nnumwindows() - 1 )
lClosepermitted := ( nwinnum == wvw_nNumWindows() - 1 )
// wait until user click the close button
DO WHILE ! lClosepermitted
Inkey( 0.5 )
@@ -374,9 +374,9 @@ STATIC PROCEDURE InpKeyHandler( nwinnum, ch, aEBGets, nOKbutton, nCancelbutton )
ELSEIF ch == 0
RETURN
ENDIF
IF wvw_pbisfocused( nwinnum, nOKbutton )
IF wvw_pbIsFocused( nwinnum, nOKbutton )
nFocus := nNumGets + 1
ELSEIF wvw_pbisfocused( nwinnum, nCancelbutton )
ELSEIF wvw_pbIsFocused( nwinnum, nCancelbutton )
nFocus := nNumGets + 2
ELSE
nFocus := nFocused( aEBGets )
@@ -400,11 +400,11 @@ STATIC PROCEDURE InpKeyHandler( nwinnum, ch, aEBGets, nOKbutton, nCancelbutton )
ENDCASE
IF lchangefocus
IF nFocus <= nNumGets
wvw_ebsetfocus( nwinnum, aEBGets[ nFocus ][ __GET_NEBID ] )
wvw_ebSetFocus( nwinnum, aEBGets[ nFocus ][ __GET_NEBID ] )
ELSEIF nFocus == nNumGets + 1
wvw_pbsetfocus( nwinnum, nOKbutton )
wvw_pbSetFocus( nwinnum, nOKbutton )
ELSEIF nFocus == nNumGets + 2
wvw_pbsetfocus( nwinnum, nCancelbutton )
wvw_pbSetFocus( nwinnum, nCancelbutton )
ENDIF
ENDIF
@@ -416,16 +416,16 @@ STATIC PROCEDURE EndGets( nwinnum, aEBGets, nOKbutton, nCancelbutton, nCloseButt
// session ended
FOR i := 1 TO Len( aEBGets )
wvw_ebenable( nwinnum, aEBGets[ i ][ __GET_NEBID ], .F. )
wvw_ebEnable( nwinnum, aEBGets[ i ][ __GET_NEBID ], .F. )
NEXT
wvw_pbenable( nwinnum, nOKbutton, .F. )
wvw_pbenable( nwinnum, nCancelbutton, .F. )
wvw_pbEnable( nwinnum, nOKbutton, .F. )
wvw_pbEnable( nwinnum, nCancelbutton, .F. )
// clear the getlist
ASize( aEBGets, 0 )
// wait until user click the close button
wvw_pbenable( nwinnum, nclosebutton, .T. )
wvw_pbEnable( nwinnum, nclosebutton, .T. )
RETURN
@@ -437,7 +437,7 @@ STATIC PROCEDURE SaveVar( nwinnum, aEBGets, lDone )
FOR i := 1 TO Len( aEBGets )
// do some validation if necessary
Eval( aEBGets[ i ][ __GET_BASSIGN ], ;
GetValFromText( wvw_ebgettext( nwinnum, aEBGets[ i ][ __GET_NEBID ] ), aEBGets[ i ][ __GET_CVALTYPE ] ) )
GetValFromText( wvw_ebGetText( nwinnum, aEBGets[ i ][ __GET_NEBID ] ), aEBGets[ i ][ __GET_CVALTYPE ] ) )
NEXT
lDone := .T.
@@ -469,10 +469,10 @@ STATIC PROCEDURE CancelVar( nwinnum, aEBGets, lDone )
STATIC PROCEDURE ToCloseWindow( nwinnum, lPermitted )
// allow to close topmost window only
lPermitted := ( nwinnum == wvw_nnumwindows() - 1 )
lPermitted := ( nwinnum == wvw_nNumWindows() - 1 )
IF ! lpermitted
MyMessageBox( nwinnum, "Window " + hb_ntos( nwinnum ) + " is not allowed to be closed, yet" + hb_eol() + ;
"Please close window " + hb_ntos( wvw_nnumwindows() - 1 ) + " first" )
"Please close window " + hb_ntos( wvw_nNumWindows() - 1 ) + " first" )
ENDIF
RETURN
@@ -570,20 +570,20 @@ STATIC FUNCTION MaskEditBox( nWinNum, nId, nEvent, aEBGets )
DO CASE
CASE nEvent == EN_KILLFOCUS
IF ! mlmultiline .AND. mcvaltype $ "ND"
ctext := wvw_ebgettext( nwinnum, nid )
ctext := wvw_ebGetText( nwinnum, nid )
IF mcvaltype == "D" .AND. IsBadDate( ctext )
// don't leave it in an invalid state
wvw_ebsetfocus( nwinnum, nid )
wvw_ebSetFocus( nwinnum, nid )
ELSE
wvw_ebsettext( nwinnum, nId, Transform( GetValFromText( ctext, mcvaltype ), mcpict ) )
wvw_ebSetText( nwinnum, nId, Transform( GetValFromText( ctext, mcvaltype ), mcpict ) )
ENDIF
ENDIF
CASE nEvent == EN_SETFOCUS
IF ! mlmultiline .AND. mcvaltype == "N"
ctext := wvw_ebgettext( nwinnum, nid )
wvw_ebsettext( nwinnum, nId, Transform( GetValFromText( ctext, mcvaltype ), GetNumMask( mcpict, mcvaltype ) ) )
ctext := wvw_ebGetText( nwinnum, nid )
wvw_ebSetText( nwinnum, nId, Transform( GetValFromText( ctext, mcvaltype ), GetNumMask( mcpict, mcvaltype ) ) )
ENDIF
wvw_ebsetsel( nwinnum, nid, 0, -1 )
wvw_ebSetSel( nwinnum, nid, 0, -1 )
nwasFocus := nFocused( aEBGets )
IF nwasFocus != 0
aEBGets[ nwasFocus ][ __GET_LFOCUSED ] := .F.
@@ -604,15 +604,15 @@ STATIC FUNCTION MaskEditBox( nWinNum, nId, nEvent, aEBGets )
STATIC PROCEDURE ProcessCharMask( mnwinnum, mnebid, mcvaltype, mcpict )
LOCAL InBuffer, OutBuffer := "", icp, x, CB, CM, BadEntry := .F., InBufferLeft, InBufferRight, Mask, OldChar, BackInbuffer
LOCAL pc := 0
LOCAL InBuffer, OutBuffer := "", icp, x, CB, CM, BadEntry, InBufferLeft, InBufferRight, Mask, OldChar, BackInbuffer
LOCAL pc
LOCAL fnb := 0
LOCAL dc := 0
LOCAL pFlag := .F.
LOCAL ncp := 0
LOCAL pFlag
LOCAL ncp
LOCAL NegativeZero := .F.
LOCAL Output := ""
LOCAL ol := 0
LOCAL Output
LOCAL ol
IF mcvaltype == "N"
Mask := GetNumMask( mcpict, mcvaltype )
@@ -623,10 +623,10 @@ STATIC PROCEDURE ProcessCharMask( mnwinnum, mnebid, mcvaltype, mcpict )
ENDIF
// Store Initial CaretPos
wvw_ebgetsel( mnwinnum, mnebid, NIL, @icp )
wvw_ebGetSel( mnwinnum, mnebid, NIL, @icp )
// Get Current Content
InBuffer := wvw_ebgettext( mnwinnum, mnebid )
InBuffer := wvw_ebGetText( mnwinnum, mnebid )
pc := 0 // x for clarity
pFlag := .F. // x for clarity
@@ -751,7 +751,7 @@ STATIC PROCEDURE ProcessCharMask( mnwinnum, mnebid, mcvaltype, mcpict )
// Replace Content
IF ! ( BackInBuffer == OutBuffer )
wvw_ebsettext( mnwinnum, mnebid, OutBuffer )
wvw_ebSetText( mnwinnum, mnebid, OutBuffer )
ENDIF
IF pc > 1
@@ -759,31 +759,31 @@ STATIC PROCEDURE ProcessCharMask( mnwinnum, mnebid, mcvaltype, mcpict )
// RL 104
IF NegativeZero
Output := Transform( GetValFromText( wvw_ebgettext( mnwinnum, mnebid ), mcvaltype ), Mask )
Output := Transform( GetValFromText( wvw_ebGetText( mnwinnum, mnebid ), mcvaltype ), Mask )
// x better:
ol := Len( Output )
Output := PadL( "-" + SubStr( Output, At( ".", OutBuffer ) - 1 ), ol )
// Replace Text
wvw_ebsettext( mnwinnum, mnebid, Output )
wvw_ebsetsel( mnwinnum, mnebid, At( ".", OutBuffer ) + dc, At( ".", OutBuffer ) + dc )
wvw_ebSetText( mnwinnum, mnebid, Output )
wvw_ebSetSel( mnwinnum, mnebid, At( ".", OutBuffer ) + dc, At( ".", OutBuffer ) + dc )
ELSE
wvw_ebsettext( mnwinnum, mnebid, Transform( GetValFromText( wvw_ebgettext( mnwinnum, mnebid ), mcvaltype ), Mask ) )
wvw_ebsetsel( mnwinnum, mnebid, At( ".", OutBuffer ) + dc, At( ".", OutBuffer ) + dc )
wvw_ebSetText( mnwinnum, mnebid, Transform( GetValFromText( wvw_ebGetText( mnwinnum, mnebid ), mcvaltype ), Mask ) )
wvw_ebSetSel( mnwinnum, mnebid, At( ".", OutBuffer ) + dc, At( ".", OutBuffer ) + dc )
ENDIF
ELSE
IF pFlag
ncp := At( ".", wvw_ebgettext( mnwinnum, mnebid ) )
wvw_ebsetsel( mnwinnum, mnebid, ncp, ncp )
ncp := At( ".", wvw_ebGetText( mnwinnum, mnebid ) )
wvw_ebSetSel( mnwinnum, mnebid, ncp, ncp )
ELSE
// Restore Initial CaretPos
IF BadEntry
icp--
ENDIF
wvw_ebsetsel( mnwinnum, mnebid, icp, icp )
wvw_ebSetSel( mnwinnum, mnebid, icp, icp )
// Skip Protected Characters
FOR x := 1 TO Len( OutBuffer )
@@ -792,7 +792,7 @@ STATIC PROCEDURE ProcessCharMask( mnwinnum, mnebid, mcvaltype, mcpict )
IF ! IsDigit( CB ) .AND. ! IsAlpha( CB ) .AND. ;
( !( CB == " " ) .OR. ( CB == " " .AND. CM == " " ) )
wvw_ebsetsel( mnwinnum, mnebid, icp + x, icp + x )
wvw_ebSetSel( mnwinnum, mnebid, icp + x, icp + x )
ELSE
EXIT
ENDIF
@@ -806,7 +806,8 @@ STATIC PROCEDURE ProcessCharMask( mnwinnum, mnebid, mcvaltype, mcpict )
STATIC FUNCTION CharMaskTekstOK( cString, cvaltype, cMask )
LOCAL lPassed := .T., CB, CM, x
// LOCAL lPassed := .T.
LOCAL CB, CM, x
IF cvaltype == "D"
FOR x := 1 TO Min( Len( cString ), Len( cMask ) )
@@ -925,9 +926,11 @@ STATIC FUNCTION IsBadDate( cBuffer ) // , cPicFunc )
RETURN .F.
ENDIF
// IF "E" $ cPicFunc
// cBuffer := InvertDwM( cBuffer )
// ENDIF
#if 0
IF "E" $ cPicFunc
cBuffer := InvertDwM( cBuffer )
ENDIF
#endif
cBuffer2 := StrTran( cBuffer, "/" )
cBuffer2 := StrTran( cBuffer2, "-" )
@@ -950,15 +953,19 @@ STATIC FUNCTION IsBadDate( cBuffer ) // , cPicFunc )
// only handles WM_CHAR, thus not all input characters are accepted
FUNCTION WVW_INPUTFOCUS( nWinNum, hWnd, message, wParam, lParam )
LOCAL wParamLow := WVW_LOWORD( wParam )
LOCAL wParamHi := WVW_HIWORD( wParam )
LOCAL nCommand, ch
LOCAL ch
LOCAL bhandler
HB_SYMBOL_UNUSED( hWnd )
HB_SYMBOL_UNUSED( wParam )
HB_SYMBOL_UNUSED( lParam )
// did user perform a menu/toolbar action on Main Window?
// IF message == WM_COMMAND .AND. nWinNum == 0 //menu,toolbar,pushbutton
// RETURN .F.
// ENDIF
#if 0
IF message == WM_COMMAND .AND. nWinNum == 0 // menu,toolbar,pushbutton
RETURN .F.
ENDIF
#endif
// now we handle input on other non-topmost windows
@@ -982,7 +989,6 @@ FUNCTION WVW_INPUTFOCUS( nWinNum, hWnd, message, wParam, lParam )
FUNCTION inp_handler( nwinnum, bhandler )
STATIC s_bhandlers := {}
LOCAL i
LOCAL retval := iif( Len( s_bhandlers ) >= nwinnum + 1, s_bhandlers[ nwinnum + 1 ], NIL )
IF HB_ISBLOCK( bhandler )
@@ -1001,12 +1007,11 @@ STATIC FUNCTION MyMessageBox( nwinnum, cMessage, cCaption, nFlags )
LOCAL nParent
hb_default( @cCaption, "Debug Message" )
nParent := wvw_getwindowhandle( nwinnum )
nParent := wvw_GetWindowHandle( nwinnum )
RETURN win_messagebox( nParent, cMessage, cCaption, nFlags )
RETURN win_MessageBox( nParent, cMessage, cCaption, nFlags )
#define VK_SHIFT 16
STATIC FUNCTION lShiftPressed()
// #define VK_SHIFT 16
RETURN wvw_GETKEYSTATE( 16 ) < 0
RETURN wvw_GetKeyState( VK_SHIFT ) < 0

View File

@@ -4,6 +4,4 @@
gtwvw.hbc
# NOTE: Disabled until test code is cleaned/fixed.
#-w3 -es2
-w1
-w3 -es2

View File

@@ -56,7 +56,7 @@ PROCEDURE Main()
#endif
IF ! SetMode( 25, 80 )
wvw_messagebox( 0, "Cannot set to (25,80) screen", "Warning", MB_OK + MB_ICONEXCLAMATION )
wvw_MessageBox( 0, "Cannot set to (25,80) screen", "Warning", MB_OK + MB_ICONEXCLAMATION )
ENDIF
SetColor( "W*/N+" )
CLS
@@ -69,13 +69,13 @@ PROCEDURE Main()
ch := Inkey( 0 )
DO WHILE ch != K_ESC
IF ch == wvw_setMenuKeyEvent( 0 )
IF ch == wvw_SetMenuKeyEvent( 0 )
MenuAction( 0, wvw_GetLastMenuEvent( 0 ) )
ENDIF
ch := Inkey( 0 )
ENDDO
wvw_messagebox( 0, "Thanks for trying this program", "Goodbye", MB_OK )
wvw_MessageBox( 0, "Thanks for trying this program", "Goodbye", MB_OK )
// let toolbar and statusbar be autodestroyed
@@ -87,14 +87,13 @@ STATIC FUNCTION CreateToolbar( nWinNum )
LOCAL nSysBitmap := 1 // 0:none 1:small 2:large
LOCAL lDisplayText := .F. // text will be displayed as tooltip instead
LOCAL hWndTB
LOCAL ldefault
wvw_tbdestroy( nWinNum ) // just in case
wvw_tbDestroy( nWinNum ) // just in case
hWndTB := wvw_tbcreate( nWinNum, lDisplayText, NIL, nSysBitmap )
hWndTB := wvw_tbCreate( nWinNum, lDisplayText, NIL, nSysBitmap )
IF hWndTB == 0
wvw_messagebox( nWinNum, "FAILED to create toolbar", "Error", MB_OK + MB_ICONEXCLAMATION )
wvw_MessageBox( nWinNum, "FAILED to create toolbar", "Error", MB_OK + MB_ICONEXCLAMATION )
RETURN .F.
ENDIF
@@ -108,12 +107,11 @@ STATIC FUNCTION CreateToolbar( nWinNum )
STATIC FUNCTION CreateStatusbar( nWinNum )
LOCAL hWndSB
LOCAL ldefault
wvw_sbdestroy( nWinNum ) // just in case
hWndSB := wvw_sbcreate( nWinNum )
wvw_sbDestroy( nWinNum ) // just in case
hWndSB := wvw_sbCreate( nWinNum )
IF hWndSB == 0
wvw_messagebox( nWinNum, "FAILED to create statusbar", "Error", MB_OK + MB_ICONEXCLAMATION )
wvw_MessageBox( nWinNum, "FAILED to create statusbar", "Error", MB_OK + MB_ICONEXCLAMATION )
RETURN .F.
ENDIF
@@ -129,9 +127,9 @@ STATIC FUNCTION MenuAction( nWinNum, nCommand )
CASE nCommand == IDM_CLOSEWIN
CloseLastWindow()
CASE nCommand == IDM_ARRANGEWIN
wvw_xReposWindow()
wvw_XReposWindow()
OTHERWISE
wvw_messagebox( nWinNum, "Unknown menu command", "Internal Error", MB_OK + MB_ICONEXCLAMATION )
wvw_MessageBox( nWinNum, "Unknown menu command", "Internal Error", MB_OK + MB_ICONEXCLAMATION )
ENDCASE
RETURN NIL
@@ -144,7 +142,7 @@ STATIC FUNCTION OpenNewWindow()
LOCAL ch
IF nWinNum > _MAX_WINNUM
wvw_messagebox( nWinNum - 1, "Sorry, I don't think you can handle that many of windows :-)", ;
wvw_MessageBox( nWinNum - 1, "Sorry, I don't think you can handle that many of windows :-)", ;
"Sorry", MB_OK + MB_ICONASTERISK )
RETURN .F.
ENDIF
@@ -160,11 +158,11 @@ STATIC FUNCTION OpenNewWindow()
SetColor( "W+/N" )
IF wvw_nOpenWindow( ctitle, nrow1, ncol1, nrow2, ncol2, NIL, 0 ) != nWinNum
// currently wvw_nOpenWindow() will always return sequentially numbered window
wvw_messagebox( 0, "Something horrible has happened, program aborted", ;
wvw_MessageBox( 0, "Something horrible has happened, program aborted", ;
"Internal Error", MB_OK + MB_ICONHAND )
QUIT
ENDIF
wvw_noclose( nWinNum ) // disable close button
wvw_NoClose( nWinNum ) // disable close button
// assign the key handler for previous window
IF nWinNum > 1
@@ -180,7 +178,7 @@ STATIC FUNCTION OpenNewWindow()
ENDDO
// close current window
wvw_lclosewindow()
wvw_lCloseWindow()
// release keyhandler for previous window, we're going back there
IF nWinNum > 1
@@ -246,10 +244,12 @@ STATIC FUNCTION typing( ch )
FUNCTION WVW_INPUTFOCUS( nWinNum, hWnd, message, wParam, lParam )
LOCAL wParamLow := WVW_LOWORD( wParam )
LOCAL wParamHi := WVW_HIWORD( wParam )
LOCAL wParamLow := wvw_LOWORD( wParam )
LOCAL nCommand, ch
HB_SYMBOL_UNUSED( hWnd )
HB_SYMBOL_UNUSED( lParam )
#if 0
LOCAL cdebug
#endif
@@ -289,7 +289,7 @@ FUNCTION WVW_INPUTFOCUS( nWinNum, hWnd, message, wParam, lParam )
"wParamLow == " + hb_ntos( wParamLow ) + hb_eol() + ;
"wParamHi == " + hb_ntos( wParamHi )
wvw_messagebox( 0, cdebug, "Debug", MB_OK )
wvw_MessageBox( 0, cdebug, "Debug", MB_OK )
#endif
RETURN .F. // WVW_INPUTFOCUS()
@@ -301,7 +301,7 @@ FUNCTION WVW_INPUTFOCUS( nWinNum, hWnd, message, wParam, lParam )
// returns maxrow() of window nWinNum
STATIC FUNCTION winMaxRow( nWinNum )
LOCAL nOldWin := wvw_nsetCurWindow( nWinNum )
LOCAL nOldWin := wvw_nSetCurWindow( nWinNum )
LOCAL nmaxrow := MaxRow()
wvw_nSetCurWindow( nOldWin )
@@ -311,7 +311,7 @@ STATIC FUNCTION winMaxRow( nWinNum )
// returns maxCol() of window nWinNum
STATIC FUNCTION winMaxCol( nWinNum )
LOCAL nOldWin := wvw_nsetCurWindow( nWinNum )
LOCAL nOldWin := wvw_nSetCurWindow( nWinNum )
LOCAL nmaxCol := MaxCol()
wvw_nSetCurWindow( nOldWin )

View File

@@ -21,10 +21,10 @@ PROCEDURE Main()
SetColor( "N/W" )
WVW_SetMainCoord( .F. ) // Standard Mode
wvw_SetMainCoord( .F. ) // Standard Mode
fillscreen()
WVW_SetMainCoord( .T. ) // MainCoord Mode
wvw_SetMainCoord( .T. ) // MainCoord Mode
fillscreen()
RETURN
@@ -34,8 +34,8 @@ PROCEDURE fillscreen()
LOCAL i, j
hb_Scroll()
WVW_nOpenWindow( "Win2", 10, 10, 19, 69 )
WVW_nOpenWindow( "Win3", 15, 15, 22, 75 )
wvw_nOpenWindow( "Win2", 10, 10, 19, 69 )
wvw_nOpenWindow( "Win3", 15, 15, 22, 75 )
DevPos( 0, 0 )
?? "I'm gonna fill this (" + hb_ntos( MaxRow() + 1 ) + "x" + hb_ntos( MaxCol() + 1 ) + ") screen"
DevPos( 1, 0 )
@@ -47,7 +47,7 @@ PROCEDURE fillscreen()
?? "Done. Press ESC to exit."
DO WHILE Inkey( 0 ) != K_ESC
ENDDO
WVW_lCloseWindow()
WVW_lCloseWindow()
wvw_lCloseWindow()
wvw_lCloseWindow()
RETURN

View File

@@ -19,8 +19,6 @@ STATIC s_lSizeReady := .F.
PROCEDURE Main()
LOCAL ch
#if defined( __HBSCRIPT__HBSHELL ) .AND. defined( __PLATFORM__WINDOWS )
hbshell_gtSelect( "GTWVW" )
#endif
@@ -30,16 +28,16 @@ PROCEDURE Main()
// the biggest possible window
SetColor( "N/W" )
SetMode( wvw_maxmaxrow() + 1, wvw_maxmaxcol() + 1 )
SetMode( wvw_MaxMaxRow() + 1, wvw_MaxMaxCol() + 1 )
// enable MAXIMIZE button
wvw_enablemaximize( 0, .T. )
wvw_EnableMaximize( 0, .T. )
// set the window to MAXIMIZED state
wvw_maximize( 0 )
wvw_Maximize( 0 )
updatescr()
DO WHILE ( ch := Inkey( 0 ) ) != K_ESC
DO WHILE Inkey( 0 ) != K_ESC
// refresh screen, probably in a new dimension
// (You may alternatively call updatescr() from WVW_SIZE instead)
updatescr()
@@ -66,7 +64,9 @@ PROCEDURE updatescr()
NEXT
FOR i := 0 TO MaxCol()
@ MaxRow(), i SAY "B"
// @ Maxrow() - 1, i SAY Right( Transform( i, "999" ), 1 )
#if 0
@ MaxRow() - 1, i SAY Right( Transform( i, "999" ), 1 )
#endif
NEXT
FOR i := 0 TO MaxRow()
@ i, MaxCol() SAY "R"
@@ -84,8 +84,12 @@ PROCEDURE updatescr()
FUNCTION WVW_SIZE( nWinNum, hWnd, message, wParam, lParam )
LOCAL cScreen
LOCAL lNeedReset := .F., ;
maxsavedscrrow, maxsavedscrcol
LOCAL lNeedReset
LOCAL maxsavedscrrow, maxsavedscrcol
HB_SYMBOL_UNUSED( message )
HB_SYMBOL_UNUSED( hWnd )
HB_SYMBOL_UNUSED( lParam )
IF ! s_lSizeReady
// program is not ready to handle window resizing
@@ -104,14 +108,14 @@ FUNCTION WVW_SIZE( nWinNum, hWnd, message, wParam, lParam )
CASE wParam == 2 // SIZE_MAXIMIZED
// Alert( "MAXIMIZE" )
// reset is required only if we are changing size
lNeedReset := MaxCol() != wvw_maxmaxcol();
.OR. MaxRow() != wvw_maxmaxrow()
lNeedReset := MaxCol() != wvw_MaxMaxCol();
.OR. MaxRow() != wvw_MaxMaxRow()
IF lNeedReset
maxsavedscrrow := Min( Min( s_nNormalMaxrow, wvw_maxmaxrow() ), MaxRow() )
maxsavedscrcol := Min( Min( s_nNormalMaxcol, wvw_maxmaxcol() ), MaxCol() )
maxsavedscrrow := Min( Min( s_nNormalMaxrow, wvw_MaxMaxRow() ), MaxRow() )
maxsavedscrcol := Min( Min( s_nNormalMaxcol, wvw_MaxMaxCol() ), MaxCol() )
cScreen := SaveScreen( 0, 0, maxsavedscrrow, maxsavedscrcol )
IF SetMode( wvw_maxmaxrow() + 1, wvw_maxmaxcol() + 1 ) // adjust maxrow() & maxcol()
IF SetMode( wvw_MaxMaxRow() + 1, wvw_MaxMaxCol() + 1 ) // adjust maxrow() & maxcol()
RestScreen( 0, 0, maxsavedscrrow, maxsavedscrcol, cScreen )
ENDIF
diminfo() // updatescr()

View File

@@ -58,7 +58,6 @@ PROCEDURE Main()
PROCEDURE xGet1()
LOCAL nWin
LOCAL cName := PadR( "Name", 20 )
LOCAL cAddr := PadR( "Address", 25 )
LOCAL cPhone := PadR( "Phone", 15 )
@@ -67,10 +66,12 @@ PROCEDURE xGet1()
LOCAL getlist := {}
LOCAL oldCurs := SetCursor( SC_NORMAL )
nWin := znewwindow( hb_UTF8ToStrBox( "┌─┐│┘─└│" ), 10, 20, 22, 59, "Some Window" )
znewwindow( hb_UTF8ToStrBox( "┌─┐│┘─└│" ), 10, 20, 22, 59, "Some Window" )
// @ 21,21 SAY "Inside the window" COLOR "R/W"
// @ 23,0 SAY "Outside the window" COLOR "R/W"
#if 0
@ 21, 21 SAY "Inside the window" COLOR "R/W"
@ 23, 0 SAY "Outside the window" COLOR "R/W"
#endif
DO WHILE ! lDone
@ 12, 22 SAY "Name : " GET cName PICT "@!K" WHEN lMessage( "Please enter your name" )
@@ -96,13 +97,12 @@ FUNCTION xBrowse1()
LOCAL nKey, bBlock, oBrowse, i
LOCAL lEnd := .F.
LOCAL info_ := {}
LOCAL info_
LOCAL nTop := 6
LOCAL nLeft := 3
LOCAL nBottom := MaxRow() - 2
LOCAL nRight := MaxCol() - 3
LOCAL nCursor := SetCursor( SC_NONE )
LOCAL nWin
USE "..\..\..\tests\test" NEW
IF NetErr()
@@ -126,7 +126,7 @@ FUNCTION xBrowse1()
oBrowse:configure()
nWin := znewwindow( hb_UTF8ToStrBox( "┌─┐│┘─└│" ), nTop, nLeft, nBottom, nRight, "test.dbf" )
znewwindow( hb_UTF8ToStrBox( "┌─┐│┘─└│" ), nTop, nLeft, nBottom, nRight, "test.dbf" )
WHILE ! lEnd
oBrowse:ForceStable()
@@ -186,6 +186,8 @@ STATIC FUNCTION DbSkipBlock( n, oTbr )
LOCAL nSkipped := 0
HB_SYMBOL_UNUSED( oTbr )
IF n == 0
dbSkip( 0 )
ELSEIF n > 0
@@ -207,6 +209,8 @@ STATIC FUNCTION TBNext( oTbr )
LOCAL nSaveRecNum := RecNo()
LOCAL lMoved := .T.
HB_SYMBOL_UNUSED( oTbr )
IF Eof()
lMoved := .F.
ELSE
@@ -226,7 +230,9 @@ STATIC FUNCTION TBPrev( oTbr )
LOCAL nSaveRecNum := RecNo()
LOCAL lMoved := .T.
dbSkip( - 1 )
HB_SYMBOL_UNUSED( oTbr )
dbSkip( -1 )
IF Bof()
dbGoto( nSaveRecNum )
lMoved := .F.
@@ -259,7 +265,7 @@ FUNCTION lYesNo( cMsg )
nLeft := 5, ;
nBotLine := MaxRow() - 2, ;
nRight := MaxCol() - 5
LOCAL nChoice, nWidth, nWinNum
LOCAL nChoice, nWidth
LOCAL oldCurs := SetCursor( SC_NONE )
LOCAL oldColor := SetColor( s_cStdColor )
@@ -273,7 +279,7 @@ FUNCTION lYesNo( cMsg )
nRight := nLeft + nWidth + 1
// open window
nWinNum := znewwindow( hb_UTF8ToStrBox( "┌─┐│┘─└│" ), nTopLine, nLeft, nBotLine, nRight, cMsg )
znewwindow( hb_UTF8ToStrBox( "┌─┐│┘─└│" ), nTopLine, nLeft, nBotLine, nRight, cMsg )
@ nTopLine + 1, nLeft + 1 PROMPT PadR( "Yes", nWidth )
@ nTopLine + 2, nLeft + 1 PROMPT PadR( "No", nWidth )
@@ -293,7 +299,7 @@ FUNCTION lBoxMessage( cMsg, cTitle )
nLeft := 5, ;
nBotLine := MaxRow() - 2, ;
nRight := MaxCol() - 5
LOCAL nwidth, nmaxwidth, i, nNumLines, cAline, nWinNum
LOCAL nwidth, nmaxwidth, i, nNumLines, cAline
LOCAL oldCurs := SetCursor( SC_NONE )
LOCAL oldColor := SetColor( s_cStdColor )
@@ -317,7 +323,7 @@ FUNCTION lBoxMessage( cMsg, cTitle )
nRight := nLeft + nMaxWidth + 1
// open window
nWinNum := znewwindow( hb_UTF8ToStrBox( "┌─┐│┘─└│" ), nTopLine, nLeft, nBotLine, nRight, cTitle )
znewwindow( hb_UTF8ToStrBox( "┌─┐│┘─└│" ), nTopLine, nLeft, nBotLine, nRight, cTitle )
DispBegin()
FOR i := 1 TO nNumLines
cAline := MemoLine( cMsg, nWidth, i )

View File

@@ -31,26 +31,22 @@
#include "inkey.ch"
#include "setcurs.ch"
#ifdef __XHARBOUR__
#define __GTWVW__
#endif
STATIC s_zwin := {}
STATIC s_cStdColor := "N/W,N/GR*,,,N/W*"
PROCEDURE Main()
LOCAL i, j
#ifdef __GTWVW__
LOCAL lMainCoord := WVW_SetMainCoord( .T. )
WVW_SetCodePage( , 255 )
#endif
LOCAL lMainCoord
#if defined( __HBSCRIPT__HBSHELL ) .AND. defined( __PLATFORM__WINDOWS )
hbshell_gtSelect( "GTWVW" )
#endif
lMainCoord := wvw_SetMainCoord( .T. )
wvw_SetCodepage( , 255 )
SET SCOREBOARD OFF
SetColor( s_cStdColor )
SetCursor( SC_NONE )
@@ -80,7 +76,6 @@ PROCEDURE Main()
PROCEDURE xGet1()
LOCAL nWin
LOCAL cName := PadR( "Name", 20 )
LOCAL cAddr := PadR( "Address", 25 )
LOCAL cPhone := PadR( "Phone", 15 )
@@ -89,10 +84,12 @@ PROCEDURE xGet1()
LOCAL getlist := {}
LOCAL oldCurs := SetCursor( SC_NORMAL )
nWin := znewwindow( hb_UTF8ToStrBox( "┌─┐│┘─└│" ), 10, 20, 22, 59, "Some Window" )
znewwindow( hb_UTF8ToStrBox( "┌─┐│┘─└│" ), 10, 20, 22, 59, "Some Window" )
// @ 21,21 SAY "Inside the window" COLOR "R/W"
// @ 23,0 SAY "Outside the window" COLOR "R/W"
#if 0
@ 21, 21 SAY "Inside the window" COLOR "R/W"
@ 23, 0 SAY "Outside the window" COLOR "R/W"
#endif
DO WHILE ! lDone
@ 12, 22 SAY "Name : " GET cName PICT "@!K" WHEN lMessage( "Please enter your name" )
@@ -118,13 +115,12 @@ FUNCTION xBrowse1()
LOCAL nKey, bBlock, oBrowse, i
LOCAL lEnd := .F.
LOCAL info_ := {}
LOCAL info_
LOCAL nTop := 6
LOCAL nLeft := 3
LOCAL nBottom := MaxRow() - 2
LOCAL nRight := MaxCol() - 3
LOCAL nCursor := SetCursor( SC_NONE )
LOCAL nWin
USE "..\..\..\tests\test" NEW
IF NetErr()
@@ -148,7 +144,7 @@ FUNCTION xBrowse1()
oBrowse:configure()
nWin := znewwindow( hb_UTF8ToStrBox( "┌─┐│┘─└│" ), nTop, nLeft, nBottom, nRight, "test.dbf" )
znewwindow( hb_UTF8ToStrBox( "┌─┐│┘─└│" ), nTop, nLeft, nBottom, nRight, "test.dbf" )
WHILE ! lEnd
oBrowse:ForceStable()
@@ -208,6 +204,8 @@ STATIC FUNCTION DbSkipBlock( n, oTbr )
LOCAL nSkipped := 0
HB_SYMBOL_UNUSED( oTbr )
IF n == 0
dbSkip( 0 )
ELSEIF n > 0
@@ -229,6 +227,8 @@ STATIC FUNCTION TBNext( oTbr )
LOCAL nSaveRecNum := RecNo()
LOCAL lMoved := .T.
HB_SYMBOL_UNUSED( oTbr )
IF Eof()
lMoved := .F.
ELSE
@@ -248,7 +248,9 @@ STATIC FUNCTION TBPrev( oTbr )
LOCAL nSaveRecNum := RecNo()
LOCAL lMoved := .T.
dbSkip( - 1 )
HB_SYMBOL_UNUSED( oTbr )
dbSkip( -1 )
IF Bof()
dbGoto( nSaveRecNum )
lMoved := .F.
@@ -280,7 +282,7 @@ FUNCTION lYesNo( cMsg )
nLeft := 5, ;
nBotLine := MaxRow() - 2, ;
nRight := MaxCol() - 5
LOCAL nChoice, nWidth, nWinNum
LOCAL nChoice, nWidth
LOCAL oldCurs := SetCursor( SC_NONE )
LOCAL oldColor := SetColor( s_cStdColor )
@@ -294,7 +296,7 @@ FUNCTION lYesNo( cMsg )
nRight := nLeft + nWidth + 1
// open window
nWinNum := znewwindow( hb_UTF8ToStrBox( "┌─┐│┘─└│" ), nTopLine, nLeft, nBotLine, nRight, cMsg )
znewwindow( hb_UTF8ToStrBox( "┌─┐│┘─└│" ), nTopLine, nLeft, nBotLine, nRight, cMsg )
@ nTopLine + 1, nLeft + 1 PROMPT PadR( "Yes", nWidth )
@ nTopLine + 2, nLeft + 1 PROMPT PadR( "No", nWidth )
@@ -314,7 +316,7 @@ FUNCTION lBoxMessage( cMsg, cTitle )
nLeft := 5, ;
nBotLine := MaxRow() - 2, ;
nRight := MaxCol() - 5
LOCAL nwidth, nmaxwidth, i, nNumLines, cAline, nWinNum
LOCAL nwidth, nmaxwidth, i, nNumLines, cAline
LOCAL oldCurs := SetCursor( SC_NONE )
LOCAL oldColor := SetColor( s_cStdColor )
@@ -338,7 +340,7 @@ FUNCTION lBoxMessage( cMsg, cTitle )
nRight := nLeft + nMaxWidth + 1
// open window
nWinNum := znewwindow( hb_UTF8ToStrBox( "┌─┐│┘─└│" ), nTopLine, nLeft, nBotLine, nRight, cTitle )
znewwindow( hb_UTF8ToStrBox( "┌─┐│┘─└│" ), nTopLine, nLeft, nBotLine, nRight, cTitle )
DispBegin()
FOR i := 1 TO nNumLines
cAline := MemoLine( cMsg, nWidth, i )
@@ -372,9 +374,7 @@ FUNCTION ZNEWWINDOW( wtype, r1, c1, r2, c2, ctitle, ccolor )
SetColor( ccolor )
#ifdef __GTWVW__
WVW_nOpenWindow( ctitle, r1, c1, r2, c2 )
#endif
wvw_nOpenWindow( ctitle, r1, c1, r2, c2 )
AAdd( s_zwin, { i + 1, r1, c1, r2, c2, cScreen, ctitle, nrow, ncol, coldcolor } )
@@ -382,14 +382,12 @@ FUNCTION ZNEWWINDOW( wtype, r1, c1, r2, c2, ctitle, ccolor )
hb_Scroll( r1, c1, r2, c2 )
#ifndef __GTWVW__
// GTWVW doesn't need box or textual title
hb_DispBox( r1, c1, r2, c2, wtype )
IF ! Empty( ctitle )
cTitle := " " + AllTrim( ctitle ) + " "
hb_DispOutAt( r1, nCeiling( ( c2 + c1 - Len( cTitle ) ) / 2 ), cTitle )
ENDIF
#endif
SetColor( cOldColor )
@@ -405,9 +403,7 @@ FUNCTION ZREVWINDOW()
RETURN NIL
ENDIF
#ifdef __GTWVW__
WVW_lCloseWindow()
#endif
wvw_lCloseWindow()
// restore states
RestScreen( s_zwin[ i ][ 2 ], s_zwin[ i ][ 3 ], s_zwin[ i ][ 4 ], s_zwin[ i ][ 5 ], s_zwin[ i ][ 6 ] )

View File

@@ -18,7 +18,7 @@
#include "inkey.ch"
#include "setcurs.ch"
#ifdef __XHARBOUR__
#ifdef __HARBOUR__
#define __GTWVW__
#endif
@@ -33,18 +33,25 @@ PROCEDURE Main()
LOCAL i, j
#ifdef __GTWVW__
LOCAL lMainCoord := WVW_SetMainCoord( .T. )
LOCAL nMaxRow := MaxRow(), nMaxCol := MaxCol()
WVW_SetFont( , "Lucida Console", 16, - 8 )
WVW_SetCodePage( , 255 )
WVW_SBcreate()
LOCAL lMainCoord
LOCAL nMaxRow
LOCAL nMaxCol
#endif
#if defined( __HBSCRIPT__HBSHELL ) .AND. defined( __PLATFORM__WINDOWS )
hbshell_gtSelect( "GTWVW" )
#endif
#ifdef __GTWVW__
lMainCoord := wvw_SetMainCoord( .T. )
nMaxRow := MaxRow()
nMaxCol := MaxCol()
wvw_SetFont( , "Lucida Console", 16, - 8 )
wvw_SetCodepage( , 255 )
wvw_sbCreate()
#endif
SET SCOREBOARD OFF
SetColor( s_cStdColor )
SetCursor( SC_NONE )
@@ -62,7 +69,7 @@ PROCEDURE Main()
DispEnd()
#else
ResetMiscObjects( 0 ) // make sure we start with no GUI objects
AddMiscObjects( 0, {| nWindow | WVW_DrawImage( nWindow, 1, 0, nmaxrow, nmaxcol, "vouch1.bmp" ) } )
AddMiscObjects( 0, {| nWindow | wvw_DrawImage( nWindow, 1, 0, nmaxrow, nmaxcol, "vouch1.bmp" ) } )
#endif
lboxmessage( "Welcome to our test program." + hb_eol() + ;
@@ -79,7 +86,6 @@ PROCEDURE Main()
PROCEDURE xGet1()
LOCAL nWin
LOCAL cName := PadR( "Name", 20 )
LOCAL cAddr := PadR( "Address", 25 )
LOCAL cPhone := PadR( "Phone", 15 )
@@ -88,17 +94,22 @@ PROCEDURE xGet1()
LOCAL getlist := {}
LOCAL oldCurs := SetCursor( SC_NORMAL )
#ifdef __GTWVW__
LOCAL nWin
MEMVAR __temp__
#endif
#ifdef __GTWVW__
nWin := znewwindow( hb_UTF8ToStrBox( "┌─┐│┘─└│" ), 10, 20, 22, 59, "Some Window" )
#ifdef __GTWVW__
AddMiscObjects( nWin, {| nWindow | __temp__ := nWindow, AEval( GetList, {| oGet | WVW_DrawBoxGet( __temp__, oGet:Row, oGet:Col, Len( Transform( oGet:VarGet(), oGet:Picture ) ) ) } ) } )
AddMiscObjects( nWin, {| nWindow | __temp__ := nWindow, AEval( GetList, {| oGet | wvw_DrawBoxGet( __temp__, oGet:Row, oGet:Col, Len( Transform( oGet:VarGet(), oGet:Picture ) ) ) } ) } )
#else
znewwindow( hb_UTF8ToStrBox( "┌─┐│┘─└│" ), 10, 20, 22, 59, "Some Window" )
#endif
//@ 21,21 say "Inside the window" color "R/W"
//@ 23,0 say "Outside the window" color "R/W"
#if 0
@ 21, 21 say "Inside the window" color "R/W"
@ 23, 0 say "Outside the window" color "R/W"
#endif
DO WHILE ! lDone
@ 12, 22 SAY "Name : " GET cName PICT "@!K" WHEN lMessage( "Please enter your name" )
@@ -124,7 +135,7 @@ FUNCTION xBrowse1()
LOCAL nKey, bBlock, oBrowse, i
LOCAL lEnd := .F.
LOCAL info_ := {}
LOCAL info_
LOCAL nTop := 6
LOCAL nLeft := 3
LOCAL nBottom := MaxRow() - 2
@@ -166,16 +177,16 @@ FUNCTION xBrowse1()
nWin := znewwindow( hb_UTF8ToStrBox( "┌─┐│┘─└│" ), nTop, nLeft, nBottom, nRight, "test.dbf" )
#ifdef __GTWVW__
Wvw_SetPen( 0, 0, rgb( 210, 1210, 210 ) )
wvw_SetPen( 0, 0, RGB( 210, 1210, 210 ) )
aColumnsSep := Array( oBrowse:colCount )
FOR EACH tmp IN aColumnsSep
tmp := oBrowse:getColumn( tmp:__enumIndex() ):colSep
NEXT
AddMiscObjects( nWin, {| nWindow | WVW_DrawBoxRecessed( nWindow, nTop + 1, nLeft + 1, nBottom - 1, nRight - 1 ) } )
AddMiscObjects( nWin, {| nWindow | WVW_DrawGridHorz( nWindow, oBrowse:nTop + 3, oBrowse:nLeft, oBrowse:nRight, oBrowse:nBottom - oBrowse:nTop - 2 ) } )
AddMiscObjects( nWin, {| nWindow | WVW_DrawGridVert( nWindow, oBrowse:nTop, oBrowse:nBottom, aColumnsSep, Len( aColumnsSep ) ) } )
AddMiscObjects( nWin, {| nWindow | wvw_DrawBoxRecessed( nWindow, nTop + 1, nLeft + 1, nBottom - 1, nRight - 1 ) } )
AddMiscObjects( nWin, {| nWindow | wvw_DrawGridHorz( nWindow, oBrowse:nTop + 3, oBrowse:nLeft, oBrowse:nRight, oBrowse:nBottom - oBrowse:nTop - 2 ) } )
AddMiscObjects( nWin, {| nWindow | wvw_DrawGridVert( nWindow, oBrowse:nTop, oBrowse:nBottom, aColumnsSep, Len( aColumnsSep ) ) } )
#endif
WHILE ! lEnd
@@ -276,7 +287,7 @@ STATIC FUNCTION TBPrev( oTbr )
LOCAL nSaveRecNum := RecNo()
LOCAL lMoved := .T.
dbSkip( - 1 )
dbSkip( -1 )
IF Bof()
dbGoto( nSaveRecNum )
lMoved := .F.
@@ -305,7 +316,7 @@ FUNCTION lMessage( cMsg )
#else
// displays a message on status bar of Main Window and returns .T.
wvw_SBsettext( 0, 0, cMsg )
wvw_sbSetText( 0, 0, cMsg )
#endif
@@ -412,7 +423,7 @@ FUNCTION ZNEWWINDOW( wtype, r1, c1, r2, c2, ctitle, ccolor )
SetColor( ccolor )
#ifdef __GTWVW__
WVW_nOpenWindow( ctitle, r1, c1, r2, c2 )
wvw_nOpenWindow( ctitle, r1, c1, r2, c2 )
ResetMiscObjects( NIL ) // make sure we start with no GUI objects
#endif
@@ -447,7 +458,7 @@ FUNCTION ZREVWINDOW()
#ifdef __GTWVW__
ResetMiscObjects( NIL ) // clear all GUI objects, if any
WVW_lCloseWindow()
wvw_lCloseWindow()
#endif
// restore states
@@ -491,7 +502,7 @@ FUNCTION WVW_Paint( nWinNum )
FUNCTION ResetMiscObjects( nWinNum )
hb_default( @nWinNum, WVW_nNumWindows() - 1 )
hb_default( @nWinNum, wvw_nNumWindows() - 1 )
DO WHILE Len( s_amiscobjlist ) < nWinNum + 1
AAdd( s_amiscobjlist, {} )

View File

@@ -165,9 +165,8 @@ STATIC s_afontinfo := {} // x current font info
PROCEDURE Main()
LOCAL nCurWindow
LOCAL hWnd, hMenu, hPopupmenu, hPopupmenu2
LOCAL hMenu, hPopupmenu
LOCAL cLabel := "This is the Main Window"
LOCAL nMaxRow, nMaxCol
LOCAL nCursor
LOCAL kF1, kF2, kF3
LOCAL kF9, kF10, kF11
@@ -193,69 +192,67 @@ PROCEDURE Main()
ELSE
ldebug( "Successfully setDefaultWindowSize()" )
ENDIF
nMaxRow := MaxRow(); nMaxCol := MaxCol()
IF wvw_SBcreate() > 0 .AND. ;
wvw_SBaddPart( , "99:99:99" ) > 0
IF wvw_sbCreate() > 0 .AND. ;
wvw_sbAddPart( , "99:99:99" ) > 0
wvw_SetTimer( , 1000 )
ENDIF
s_afontinfo := WVW_getfontinfo()
s_afontinfo := wvw_GetFontInfo()
hb_gtInfo( HB_GTI_INKEYFILTER, {| nkey | nAfterInkey( nkey ) } )
WVW_SETMOUSEMOVE( , .T. ) // required by wvwmouse
wvw_SetMouseMove( , .T. ) // required by wvwmouse
kF1 := SetKey( K_F1, {|| xHelp() } )
kF2 := SetKey( K_F2, {|| xDebugInfo() } )
kF3 := SetKey( K_F3, {|| Demo_Console() } )
kF9 := SetKey( K_F9, {|| WVW_SetLineSpacing( NIL, WVW_SetLineSpacing() - 2 ) } )
kF10 := SetKey( K_F10, {|| WVW_SetLineSpacing( NIL, WVW_SetLineSpacing() + 2 ) } )
kF11 := SetKey( K_F11, {|| WVW_SetDefLineSpacing( WVW_SetLineSpacing() ) } )
kF9 := SetKey( K_F9, {|| wvw_SetLineSpacing( NIL, wvw_SetLineSpacing() - 2 ) } )
kF10 := SetKey( K_F10, {|| wvw_SetLineSpacing( NIL, wvw_SetLineSpacing() + 2 ) } )
kF11 := SetKey( K_F11, {|| wvw_SetDefLineSpacing( wvw_SetLineSpacing() ) } )
// start menu definitions *************************************
hWnd := WVW_GETWINDOWHANDLE()
hMenu := WVW_CreateMenu()
hPopupMenu := WVW_CreateMenu()
WVW_AppendMenu( hPopupMenu, MF_ENABLED + MF_STRING, IDM_DEMO_GET, "~GET demo" )
WVW_AppendMenu( hPopupMenu, MF_ENABLED + MF_STRING, IDM_DEMO_BROWSE, "~BROWSE demo" )
WVW_AppendMenu( hPopupMenu, MF_ENABLED + MF_STRING, IDM_DEMO_CONSOLE, "~CONSOLE demo (F3)" )
hMenu := wvw_CreateMenu()
hPopupMenu := wvw_CreateMenu()
wvw_AppendMenu( hPopupMenu, MF_ENABLED + MF_STRING, IDM_DEMO_GET, "~GET demo" )
wvw_AppendMenu( hPopupMenu, MF_ENABLED + MF_STRING, IDM_DEMO_BROWSE, "~BROWSE demo" )
wvw_AppendMenu( hPopupMenu, MF_ENABLED + MF_STRING, IDM_DEMO_CONSOLE, "~CONSOLE demo (F3)" )
// WVW_AppendMenu( hPopupMenu, MF_ENABLED + MF_STRING, IDM_DEMO_COLOR, "~COLOR demo" )
WVW_AppendMenu( hPopupMenu, MF_SEPARATOR )
WVW_AppendMenu( hPopupMenu, MF_ENABLED + MF_STRING, IDM_DEMO_EXIT, "E~xit" )
WVW_AppendMenu( hMenu, MF_ENABLED + MF_POPUP, hPopupMenu, "~Demos", )
wvw_AppendMenu( hPopupMenu, MF_SEPARATOR )
wvw_AppendMenu( hPopupMenu, MF_ENABLED + MF_STRING, IDM_DEMO_EXIT, "E~xit" )
wvw_AppendMenu( hMenu, MF_ENABLED + MF_POPUP, hPopupMenu, "~Demos", )
hPopupMenu := WVW_CreateMenu()
WVW_AppendMenu( hPopupMenu, MF_ENABLED + MF_STRING, IDM_TOOLBAR_ENABLE, "~Enable Toolbar" )
WVW_AppendMenu( hPopupMenu, MF_ENABLED + MF_STRING, IDM_TOOLBAR_DISABLE, "~Disable Toolbar" )
WVW_AppendMenu( hPopupMenu, MF_SEPARATOR )
WVW_AppendMenu( hPopupMenu, MF_ENABLED + MF_STRING, IDM_TOOLBAR_RESET, "~Reset Toolbar" )
WVW_AppendMenu( hPopupMenu, MF_ENABLED + MF_STRING, IDM_TOOLBAR_DELETE, "~Delete Toolbar" )
WVW_AppendMenu( hMenu, MF_ENABLED + MF_POPUP, hPopupMenu, "~Toolbar", )
hPopupMenu := wvw_CreateMenu()
wvw_AppendMenu( hPopupMenu, MF_ENABLED + MF_STRING, IDM_TOOLBAR_ENABLE, "~Enable Toolbar" )
wvw_AppendMenu( hPopupMenu, MF_ENABLED + MF_STRING, IDM_TOOLBAR_DISABLE, "~Disable Toolbar" )
wvw_AppendMenu( hPopupMenu, MF_SEPARATOR )
wvw_AppendMenu( hPopupMenu, MF_ENABLED + MF_STRING, IDM_TOOLBAR_RESET, "~Reset Toolbar" )
wvw_AppendMenu( hPopupMenu, MF_ENABLED + MF_STRING, IDM_TOOLBAR_DELETE, "~Delete Toolbar" )
wvw_AppendMenu( hMenu, MF_ENABLED + MF_POPUP, hPopupMenu, "~Toolbar", )
hPopupMenu := WVW_CreateMenu()
WVW_AppendMenu( hPopupMenu, MF_ENABLED + MF_STRING, IDM_WINDOW_SPACING_DECREASE, "~Decrease Line Spacing (F9)" )
WVW_AppendMenu( hPopupMenu, MF_ENABLED + MF_STRING, IDM_WINDOW_SPACING_INCREASE, "~Increase Line Spacing (F10)" )
WVW_AppendMenu( hPopupMenu, MF_SEPARATOR )
WVW_AppendMenu( hPopupMenu, MF_ENABLED + MF_STRING, IDM_WINDOW_SPACING_DEFAULT, "~Set As Default Line Spacing (F11)" )
WVW_AppendMenu( hMenu, MF_ENABLED + MF_POPUP, hPopupMenu, "~Window", )
hPopupMenu := wvw_CreateMenu()
wvw_AppendMenu( hPopupMenu, MF_ENABLED + MF_STRING, IDM_WINDOW_SPACING_DECREASE, "~Decrease Line Spacing (F9)" )
wvw_AppendMenu( hPopupMenu, MF_ENABLED + MF_STRING, IDM_WINDOW_SPACING_INCREASE, "~Increase Line Spacing (F10)" )
wvw_AppendMenu( hPopupMenu, MF_SEPARATOR )
wvw_AppendMenu( hPopupMenu, MF_ENABLED + MF_STRING, IDM_WINDOW_SPACING_DEFAULT, "~Set As Default Line Spacing (F11)" )
wvw_AppendMenu( hMenu, MF_ENABLED + MF_POPUP, hPopupMenu, "~Window", )
hPopupMenu := WVW_CreateMenu()
WVW_AppendMenu( hPopupMenu, MF_ENABLED + MF_STRING, IDM_HELP_HELP, "~Help (F1)" )
WVW_AppendMenu( hPopupMenu, MF_SEPARATOR )
WVW_AppendMenu( hPopupMenu, MF_ENABLED + MF_STRING, IDM_HELP_INFO, "~Info (F2)" )
WVW_AppendMenu( hMenu, MF_ENABLED + MF_POPUP, hPopupMenu, "~Help", )
hPopupMenu := wvw_CreateMenu()
wvw_AppendMenu( hPopupMenu, MF_ENABLED + MF_STRING, IDM_HELP_HELP, "~Help (F1)" )
wvw_AppendMenu( hPopupMenu, MF_SEPARATOR )
wvw_AppendMenu( hPopupMenu, MF_ENABLED + MF_STRING, IDM_HELP_INFO, "~Info (F2)" )
wvw_AppendMenu( hMenu, MF_ENABLED + MF_POPUP, hPopupMenu, "~Help", )
WVW_SetMenu( , hMenu )
wvw_SetMenu( , hMenu )
// end menu definitions *************************************
nCurWindow := WVW_nNumWindows() - 1 // == 0, Main Window
nCurWindow := wvw_nNumWindows() - 1 // == 0, Main Window
CreateToolbar( nCurWindow )
ResetMiscObjects( nCurWindow )
AddMiscObjects( nCurWindow, {| nWindow | WVW_DrawLabel( nWindow, 1, 40, cLabel, 6,, rgb( 255, 255, 255 ), rgb( 198, 198, 198 ), "Arial", s_afontinfo[ 2 ], , , , , .T., .T. ) } )
AddMiscObjects( nCurWindow, {| nWindow | wvw_DrawLabel( nWindow, 1, 40, cLabel, 6,, RGB( 255, 255, 255 ), RGB( 198, 198, 198 ), "Arial", s_afontinfo[ 2 ], , , , , .T., .T. ) } )
wvwm_ResetMouseObjects( nCurWindow )
wvwm_AddMouseObjects( nCurWindow, WVWMouseButton():New( "Info!", MaxRow() - 2, 67, , , {|| xDebugInfo() } ) )
@@ -279,7 +276,7 @@ PROCEDURE Main()
wvwm_AddMouseObjects( nCurWindow, oMouse )
// 20070525 the real pushbutton, easier and better looking. Nothing to do with wvwmouse.prg.
WVW_PBcreate( nCurWindow, MaxRow() - 4, 67 - 11 - 11 - 11 - 11 - 11, MaxRow() - 4, 67 + 9 - 11 - 11 - 11 - 11 - 11, "native", NIL, {|| lboxmessage( "native pushbutton" ) }, NIL )
wvw_pbCreate( nCurWindow, MaxRow() - 4, 67 - 11 - 11 - 11 - 11 - 11, MaxRow() - 4, 67 + 9 - 11 - 11 - 11 - 11 - 11, "native", NIL, {|| lboxmessage( "native pushbutton" ) }, NIL )
SetColor( "N/W,N/GR*,,,N/W*" )
CLS
@@ -290,21 +287,19 @@ PROCEDURE Main()
DO WHILE ( ch := Inkey( 0 ) ) != K_ESC
// experiment with different paintrefresh interval:
#if 0
DO CASE
CASE ch == hb_keyCode( "<" )
wvw_setPaintRefresh( Int( wvw_setPaintRefresh() / 2 ) )
Alert( wvw_setPaintRefresh() )
wvw_SetPaintRefresh( Int( wvw_SetPaintRefresh() / 2 ) )
Alert( wvw_SetPaintRefresh() )
CASE ch == hb_keyCode( ">" )
wvw_setPaintRefresh( Int( wvw_setPaintRefresh() * 2 ) )
Alert( wvw_setPaintRefresh() )
wvw_SetPaintRefresh( Int( wvw_SetPaintRefresh() * 2 ) )
Alert( wvw_SetPaintRefresh() )
CASE ch == hb_keyCode( "0" )
wvw_setPaintRefresh( 0 )
Alert( wvw_setPaintRefresh() )
wvw_SetPaintRefresh( 0 )
Alert( wvw_SetPaintRefresh() )
OTHERWISE
// do nothing. inkey() has been handled by nAfterInket()
ENDCASE
#endif
ENDDO
lboxmessage( "Thanks for trying this program." + hb_eol() + ;
@@ -317,7 +312,7 @@ PROCEDURE Main()
SetKey( K_F10, kF10 )
SetKey( K_F9, kF9 )
// SetKey( K_F4, kF4 )
// SetKey( K_F4, kF4 )
SetKey( K_F3, kF3 )
SetKey( K_F2, kF2 )
SetKey( K_F1, kF1 )
@@ -331,22 +326,23 @@ STATIC PROCEDURE xDisableMenus( nWinNum, nNumItem )
// disables all Menu Items of window nWinNum
LOCAL i
LOCAL hMenu := WVW_GetMenu( nWinNum )
LOCAL hMenu := wvw_GetMenu( nWinNum )
FOR i := 0 TO nNumItem - 1
WVW_EnableMenuItem( hMenu, i, MF_BYPOSITION + MF_GRAYED )
wvw_EnableMenuItem( hMenu, i, MF_BYPOSITION + MF_GRAYED )
NEXT
RETURN
// enables all Menu Items of window nWinNum
STATIC PROCEDURE xEnableMenus( nWinNum, nNumItem )
// enables all Menu Items of window nWinNum
LOCAL i
LOCAL hMenu := WVW_GetMenu( nWinNum )
LOCAL hMenu := wvw_GetMenu( nWinNum )
FOR i := 0 TO nNumItem - 1
WVW_EnableMenuItem( hMenu, i, MF_BYPOSITION + MF_ENABLED )
wvw_EnableMenuItem( hMenu, i, MF_BYPOSITION + MF_ENABLED )
NEXT
WVW_DrawMenuBar( nWinNum ) // to force redraw of menu
wvw_DrawMenuBar( nWinNum ) // to force redraw of menu
RETURN
@@ -355,7 +351,6 @@ STATIC PROCEDURE xEnableMenus( nWinNum, nNumItem )
PROCEDURE Demo_Console( nTop, nLeft, nBottom, nRight )
LOCAL cWinName, nCurWindow
LOCAL nMaxrow, nMaxCol
LOCAL nCursor
LOCAL cColor
LOCAL ch
@@ -367,10 +362,10 @@ PROCEDURE Demo_Console( nTop, nLeft, nBottom, nRight )
hb_default( @nBottom, nTop + 10 )
hb_default( @nRight, nLeft + 45 )
cWinName := "Typewriter (Win#" + hb_ntos( WVW_nNumWindows() ) + "); CtrlW: New Window; ESC: Exit"
cWinName := "Typewriter (Win#" + hb_ntos( wvw_nNumWindows() ) + "); CtrlW: New Window; ESC: Exit"
// x init window
nCurWindow := WVW_nOpenWindow( cWinName, nTop, nLeft, nBottom, nRight )
nCurWindow := wvw_nOpenWindow( cWinName, nTop, nLeft, nBottom, nRight )
IF nCurWindow == 0
lboxmessage( "Failed Opening new window!" )
RETURN
@@ -378,8 +373,7 @@ PROCEDURE Demo_Console( nTop, nLeft, nBottom, nRight )
nCursor := SetCursor( SC_NORMAL )
cColor := SetColor( "W+/N" )
lMouseMove := WVW_SETMOUSEMOVE( , .F. )
nMaxrow := MaxRow(); nMaxcol := MaxCol()
lMouseMove := wvw_SetMouseMove( , .F. )
ResetMiscObjects( nCurWindow )
wvwm_ResetMouseObjects( nCurWindow )
@@ -395,9 +389,9 @@ PROCEDURE Demo_Console( nTop, nLeft, nBottom, nRight )
?? hb_keyChar( ch ) + Chr( 10 )
IF lEchoing
// write the same thing to previous window
WVW_nSetCurWindow( nCurWindow - 1 )
wvw_nSetCurWindow( nCurWindow - 1 )
?? hb_keyChar( ch ) + Chr( 10 )
WVW_nSetCurWindow( nCurWindow )
wvw_nSetCurWindow( nCurWindow )
ENDIF
ELSEIF ch == K_CTRL_W
// Recursively call (another) typewriter, bigger one
@@ -410,9 +404,9 @@ PROCEDURE Demo_Console( nTop, nLeft, nBottom, nRight )
?? hb_keyChar( ch )
IF lEchoing
// write the same thing to previous window
WVW_nSetCurWindow( nCurWindow - 1 )
wvw_nSetCurWindow( nCurWindow - 1 )
?? hb_keyChar( ch )
WVW_nSetCurWindow( nCurWindow )
wvw_nSetCurWindow( nCurWindow )
ENDIF
ENDIF
ch := Inkey( 0 )
@@ -421,14 +415,14 @@ PROCEDURE Demo_Console( nTop, nLeft, nBottom, nRight )
// *********** end typewriter mode ***************
// epilogue
WVW_lCloseWindow()
wvw_lCloseWindow()
// restore state
wvwm_ResetMouseObjects( nCurWindow )
ResetMiscObjects( nCurWindow )
SetCursor( nCursor )
SetColor( cColor )
WVW_SETMOUSEMOVE( , lMouseMove )
wvw_SetMouseMove( , lMouseMove )
RETURN // Demo_Console()
@@ -453,29 +447,29 @@ PROCEDURE Demo_Get()
MEMVAR x
// x init window
nCurWindow := WVW_nOpenWindow( "GET Demo", nTop, nLeft, nBottom, nRight )
nCurWindow := wvw_nOpenWindow( "GET Demo", nTop, nLeft, nBottom, nRight )
IF nCurWindow == 0
lboxmessage( "Failed Opening new window!" )
RETURN
ENDIF
WVW_SetIcon( , "vr_1.ico" )
wvw_SetIcon( , "vr_1.ico" )
ResetMiscObjects( nCurWindow )
AddMiscObjects( nCurWindow, {| nWindow | WVW_DrawLabel( nWindow, 1, nRight - nLeft, cLabel, 2,, rgb( 255, 255, 255 ), rgb( 198, 198, 198 ), "Arial", s_afontinfo[ 2 ], , , , , .T., .T. ) } )
AddMiscObjects( nCurWindow, {| nWindow | WVW_DrawBoxRecessed( nWindow, 7 - nTop, 61 - nLeft, 13 - nTop, 70 - nLeft ) } )
AddMiscObjects( nCurWindow, {| nWindow | WVW_DrawBoxGroup( nWindow, 15 - nTop, 59 - nLeft, 18 - nTop, 72 - nLeft ) } )
AddMiscObjects( nCurWindow, {| nWindow | WVW_DrawBoxGroup( nWindow, 5 - nTop, 6 - nLeft, 19 - nTop, 44 - nLeft ) } )
AddMiscObjects( nCurWindow, {| nWindow | WVW_DrawImage( nWindow, 8 - nTop, 62 - nLeft, 12 - nTop, 69 - nLeft, "vouch1.bmp" ) } )
AddMiscObjects( nCurWindow, {| nWindow | WVW_DrawBoxRecessed( nWindow, 7 - nTop, 48 - nLeft, 13 - nTop, 55 - nLeft ) } )
AddMiscObjects( nCurWindow, {| nWindow | x := nWindow, AEval( GetList, {| oGet | WVW_DrawBoxGet( x, oGet:Row, oGet:Col, Len( Transform( oGet:VarGet(), oGet:Picture ) ) ) } ) } )
AddMiscObjects( nCurWindow, {| nWindow | wvw_DrawLabel( nWindow, 1, nRight - nLeft, cLabel, 2,, RGB( 255, 255, 255 ), RGB( 198, 198, 198 ), "Arial", s_afontinfo[ 2 ], , , , , .T., .T. ) } )
AddMiscObjects( nCurWindow, {| nWindow | wvw_DrawBoxRecessed( nWindow, 7 - nTop, 61 - nLeft, 13 - nTop, 70 - nLeft ) } )
AddMiscObjects( nCurWindow, {| nWindow | wvw_DrawBoxGroup( nWindow, 15 - nTop, 59 - nLeft, 18 - nTop, 72 - nLeft ) } )
AddMiscObjects( nCurWindow, {| nWindow | wvw_DrawBoxGroup( nWindow, 5 - nTop, 6 - nLeft, 19 - nTop, 44 - nLeft ) } )
AddMiscObjects( nCurWindow, {| nWindow | wvw_DrawImage( nWindow, 8 - nTop, 62 - nLeft, 12 - nTop, 69 - nLeft, "vouch1.bmp" ) } )
AddMiscObjects( nCurWindow, {| nWindow | wvw_DrawBoxRecessed( nWindow, 7 - nTop, 48 - nLeft, 13 - nTop, 55 - nLeft ) } )
AddMiscObjects( nCurWindow, {| nWindow | x := nWindow, AEval( GetList, {| oGet | wvw_DrawBoxGet( x, oGet:Row, oGet:Col, Len( Transform( oGet:VarGet(), oGet:Picture ) ) ) } ) } )
wvwm_ResetMouseObjects( nCurWindow )
/* we now use native push button
wvwm_AddMouseObjects( nCurWindow, WVWMouseButton():New("Info", maxrow() - 1, maxcol() - 15, , , {|| xDebugInfo() } ))
*/
WVW_PBcreate( nCurWindow, MaxRow() - 1, MaxCol() - 15, MaxRow() - 1, MaxCol() - 5, "Info", NIL, {|| xDebugInfo() }, NIL )
wvw_pbCreate( nCurWindow, MaxRow() - 1, MaxCol() - 15, MaxRow() - 1, MaxCol() - 5, "Info", NIL, {|| xDebugInfo() }, NIL )
CLS
@@ -495,7 +489,7 @@ PROCEDURE Demo_Get()
// epilogue
// lboxmessage( "Thanks for trying the GET Demo!" )
WVW_lCloseWindow()
wvw_lCloseWindow()
// restore state
wvwm_ResetMouseObjects( nCurWindow )
@@ -510,28 +504,26 @@ FUNCTION DEMO_Browse()
LOCAL nKey, bBlock, oBrowse, i
LOCAL lEnd := .F.
LOCAL info_ := {} // WVW_nOpenWindow() has not been performed, so...
LOCAL info_ // WVW_nOpenWindow() has not been performed, so...
LOCAL nTop := 3 // pls notice that this is relative to PARENT window!
LOCAL nLeft := 3 // pls notice that this is relative to PARENT window!
LOCAL nBottom := MaxRow() - 2 // pls notice that this is relative to PARENT window!
LOCAL nRight := MaxCol() - 3 // pls notice that this is relative to PARENT window!
LOCAL cColor
LOCAL nMaxRow, nMaxCol
LOCAL nStyle := 0
LOCAL nCurWindow
LOCAL oMouse, nHScrollBar, nVScrollBar
LOCAL nHScrollBar, nVScrollBar
LOCAL aColumnsSep, tmp
// x init window
nCurWindow := WVW_nOpenWindow( "BROWSE Demo", nTop, nLeft, nBottom, nRight )
nCurWindow := wvw_nOpenWindow( "BROWSE Demo", nTop, nLeft, nBottom, nRight )
IF nCurWindow == 0
lboxmessage( "Failed Opening new window!" )
RETURN NIL
ENDIF
nMaxRow := MaxRow(); nMaxCol := MaxCol()
ResetMiscObjects( nCurWindow )
wvwm_ResetMouseObjects( nCurWindow )
@@ -542,11 +534,11 @@ FUNCTION DEMO_Browse()
USE "..\..\..\tests\test" NEW
IF NetErr()
WVW_lCloseWindow()
wvw_lCloseWindow()
RETURN NIL
ENDIF
INDEX ON FIELD->LAST TO TEST1 // 20040707
INDEX ON FIELD->LAST TO test1 // 20040707
info_ := dbStruct()
@@ -565,25 +557,25 @@ FUNCTION DEMO_Browse()
oBrowse:configure()
WVW_SetPen( nStyle, 0, rgb( 210, 1210, 210 ) )
WVW_SetIcon( , "dia_excl.ico" )
wvw_SetPen( nStyle, 0, RGB( 210, 1210, 210 ) )
wvw_SetIcon( , "dia_excl.ico" )
aColumnsSep := Array( oBrowse:colCount )
FOR EACH tmp IN aColumnsSep
tmp := oBrowse:getColumn( tmp:__enumIndex() ):colSep
NEXT
AddMiscObjects( nCurWindow, {| nWindow | WVW_DrawBoxRecessed( nWindow, oBrowse:nTop, oBrowse:nLeft, oBrowse:nBottom, oBrowse:nRight ) } )
AddMiscObjects( nCurWindow, {| nWindow | WVW_DrawGridHorz( nWindow, oBrowse:nTop + 3, oBrowse:nLeft, oBrowse:nRight, oBrowse:nBottom - oBrowse:nTop - 2 ) } )
AddMiscObjects( nCurWindow, {| nWindow | WVW_DrawGridVert( nWindow, oBrowse:nTop, oBrowse:nBottom, aColumnsSep, Len( aColumnsSep ) ) } )
AddMiscObjects( nCurWindow, {| nWindow | wvw_DrawBoxRecessed( nWindow, oBrowse:nTop, oBrowse:nLeft, oBrowse:nBottom, oBrowse:nRight ) } )
AddMiscObjects( nCurWindow, {| nWindow | wvw_DrawGridHorz( nWindow, oBrowse:nTop + 3, oBrowse:nLeft, oBrowse:nRight, oBrowse:nBottom - oBrowse:nTop - 2 ) } )
AddMiscObjects( nCurWindow, {| nWindow | wvw_DrawGridVert( nWindow, oBrowse:nTop, oBrowse:nBottom, aColumnsSep, Len( aColumnsSep ) ) } )
/* we now use native push button
wvwm_AddMouseObjects( nCurWindow, WVWMouseButton():New("Info", maxrow(), maxcol() - 15, , , {|| xDebugInfo() } ))
*/
WVW_PBcreate( nCurWindow, MaxRow(), MaxCol() - 15, MaxRow(), MaxCol() - 5, "Info", NIL, {|| xDebugInfo() }, NIL )
wvw_pbCreate( nCurWindow, MaxRow(), MaxCol() - 15, MaxRow(), MaxCol() - 5, "Info", NIL, {|| xDebugInfo() }, NIL )
nHScrollBar := wvw_xbCreate( nCurWindow, 0, oBrowse:nBottom + 1, oBrowse:nLeft, oBrowse:nRight - oBrowse:nLeft + 1, /*aBlock*/ {| nWinNum, nXBid, nXBmsg, nXBpos | HXBscroller( oBrowse, nWinNum, nXBid, nXBmsg ) }, /*aOffset*/ NIL )
nVScrollBar := wvw_xbCreate( nCurWindow, 1, oBrowse:nTop, oBrowse:nRight + 1, oBrowse:nBottom - oBrowse:nTop + 1, /*aBlock*/ {| nWinNum, nXBid, nXBmsg, nXBpos | VXBscroller( oBrowse, nWinNum, nXBid, nXBmsg ) }, /*aOffset*/ NIL )
nHScrollBar := wvw_xbCreate( nCurWindow, 0, oBrowse:nBottom + 1, oBrowse:nLeft, oBrowse:nRight - oBrowse:nLeft + 1, /*aBlock*/ {| nWinNum, nXBid, nXBmsg, nXBpos | HB_SYMBOL_UNUSED( nXBpos ), HXBscroller( oBrowse, nWinNum, nXBid, nXBmsg ) }, /*aOffset*/ NIL )
nVScrollBar := wvw_xbCreate( nCurWindow, 1, oBrowse:nTop, oBrowse:nRight + 1, oBrowse:nBottom - oBrowse:nTop + 1, /*aBlock*/ {| nWinNum, nXBid, nXBmsg, nXBpos | HB_SYMBOL_UNUSED( nXBpos ), VXBscroller( oBrowse, nWinNum, nXBid, nXBmsg ) }, /*aOffset*/ NIL )
hb_DispOutAt( nTop + 1 - nTop, nleft - nleft, PadC( hb_CurDrive() + ":" + hb_ps() + CurDir() + hb_ps() + "test.dbf", nRight - nLeft + 1 ), "W+/W" )
@@ -667,13 +659,13 @@ FUNCTION DEMO_Browse()
// epilogue
// lboxmessage("Thanks for trying the BROWSE Demo!")
WVW_lCloseWindow()
wvw_lCloseWindow()
// restore state
wvwm_ResetMouseObjects( nCurWindow )
ResetMiscObjects( nCurWindow )
WVW_SetPen( 0 )
wvw_SetPen( 0 )
SetColor( cColor )
// SetCursor( nCursor )
@@ -785,7 +777,6 @@ STATIC FUNCTION RefreshVXB( oBrowse, nWinNum, XBid )
// recalc the pos
IF ordKeyCount() < 30000
nRatio := 1
nMin := 1
nMax := ordKeyCount()
nPage := oBrowse:RowCount // ordKeyCount()
@@ -802,14 +793,13 @@ STATIC FUNCTION RefreshVXB( oBrowse, nWinNum, XBid )
nPos := Round( ( ordKeyNo() - oBrowse:RowPos + 1 ) / nRatio, 0 )// ordKeyCount()
ENDIF
WVW_XBupdate( nWinNum, XBid, nPos, nPage, nMin, nMax )
wvw_xbUpdate( nWinNum, XBid, nPos, nPage, nMin, nMax )
RETURN NIL
STATIC FUNCTION RefreshHXB( oBrowse, nWinNum, XBid )
LOCAL nMin, nMax, nPage, nPos
LOCAL nRatio
// recalc the pos
nMin := 1
@@ -817,7 +807,7 @@ STATIC FUNCTION RefreshHXB( oBrowse, nWinNum, XBid )
nPage := oBrowse:RightVisible - oBrowse:LeftVisible + 1
nPos := iif( oBrowse:RightVisible == oBrowse:ColCount, nMax, oBrowse:LeftVisible )
WVW_XBupdate( nWinNum, XBid, nPos, nPage, nMin, nMax )
wvw_xbUpdate( nWinNum, XBid, nPos, nPage, nMin, nMax )
RETURN NIL
@@ -827,6 +817,8 @@ STATIC FUNCTION DbSkipBlock( n, oTbr )
LOCAL nSkipped := 0
HB_SYMBOL_UNUSED( oTbr )
IF n == 0
dbSkip( 0 )
@@ -849,6 +841,8 @@ STATIC FUNCTION TBNext( oTbr )
LOCAL nSaveRecNum := RecNo()
LOCAL lMoved := .T.
HB_SYMBOL_UNUSED( oTbr )
IF Eof()
lMoved := .F.
ELSE
@@ -868,7 +862,9 @@ STATIC FUNCTION TBPrev( oTbr )
LOCAL nSaveRecNum := RecNo()
LOCAL lMoved := .T.
dbSkip( - 1 )
HB_SYMBOL_UNUSED( oTbr )
dbSkip( -1 )
IF Bof()
dbGoto( nSaveRecNum )
@@ -923,20 +919,26 @@ FUNCTION WVW_SetFocus( hWnd, nWinNum )
ENDIF
RETURN NIL
#endif
//
// WVW_KillFocus() must be a FUNCTION in your application
// needs to process messages sent through WM_KILLFOCUS message
// received by the window.
//
// FUNCTION WVW_KillFocus( hWnd )
// RETURN NIL
FUNCTION WVW_KillFocus( hWnd )
RETURN NIL
#endif
FUNCTION WVW_TIMER( nWinNum, hWnd, message, wParam, lParam )
HB_SYMBOL_UNUSED( nWinNum )
HB_SYMBOL_UNUSED( hWnd )
HB_SYMBOL_UNUSED( message )
HB_SYMBOL_UNUSED( wParam )
HB_SYMBOL_UNUSED( lParam )
// this function is called every certain interval, by GTWVW gtwndproc
WVW_SBsetText( 0, 1, Time() )
wvw_sbSetText( 0, 1, Time() )
RETURN NIL
@@ -948,7 +950,7 @@ FUNCTION CreateToolbar( nWinNum )
LOCAL hWndTB
LOCAL ldefault
wvw_tbdestroy( nWinNum )
wvw_tbDestroy( nWinNum )
ldefault := lYesNo( "would you like to use default toolbar setting?" )
@@ -958,7 +960,7 @@ FUNCTION CreateToolbar( nWinNum )
lDisplayText := Alert( "Display text in toolbar?", { "Yes", "No" } ) == 1
ENDIF
hWndTB := wvw_tbcreate( nWinNum, lDisplayText, NIL, nSysBitmap )
hWndTB := wvw_tbCreate( nWinNum, lDisplayText, NIL, nSysBitmap )
IF hWndTB == 0
lboxmessage( "FAILED create toolbar" )
@@ -997,7 +999,7 @@ FUNCTION xDisableToolbar( nWinNum )
LOCAL i
FOR i := 0 TO wvw_tbButtonCount( nWinNum ) - 1
WVW_TBEnableButton( nWinNum, i, .F. )
wvw_tbEnableButton( nWinNum, i, .F. )
NEXT
RETURN NIL
@@ -1007,7 +1009,7 @@ FUNCTION xEnableToolbar( nWinNum )
LOCAL i
FOR i := 0 TO wvw_tbButtonCount( nWinNum ) - 1
WVW_TBEnableButton( nWinNum, i, .T. )
wvw_tbEnableButton( nWinNum, i, .T. )
NEXT
RETURN NIL
@@ -1041,7 +1043,7 @@ FUNCTION nAfterInkey( nkey )
LOCAL bAction
IF nkey == WVW_DEFAULT_MENUKEYEVENT
// MenuKeyEvent
RETURN nMenuChecker( WVW_GETLASTMENUEVENT() )
RETURN nMenuChecker( wvw_GetLastMenuEvent() )
// was: elseif ASCAN({K_LBUTTONDOWN, K_LBUTTONUP, K_MOUSEMOVE}, nKey) > 0
ELSEIF AScan( { K_LBUTTONDOWN, K_LBUTTONUP, K_MOUSEMOVE, K_MMLEFTDOWN, ;
K_LDBLCLK }, nKey ) > 0
@@ -1073,19 +1075,21 @@ FUNCTION nMenuChecker( nMenuEvent )
CASE nMenuEvent == IDM_DEMO_CONSOLE
// lboxmessage( "Demo CONSOLE" )
Demo_Console()
// CASE nMenuEvent == IDM_DEMO_COLOR
// // lboxmessage( "Demo COLOR" )
// Demo_Color()
#if 0
CASE nMenuEvent == IDM_DEMO_COLOR
// lboxmessage( "Demo COLOR" )
Demo_Color()
#endif
CASE nMenuEvent == IDM_DEMO_EXIT
// lboxmessage( "should EXIT!" )
nkey := K_ESC
CASE nMenuEvent == IDM_WINDOW_SPACING_INCREASE
WVW_SetLineSpacing( NIL, WVW_SetLineSpacing() + 2 )
wvw_SetLineSpacing( NIL, wvw_SetLineSpacing() + 2 )
CASE nMenuEvent == IDM_WINDOW_SPACING_DECREASE
WVW_SetLineSpacing( NIL, WVW_SetLineSpacing() - 2 )
wvw_SetLineSpacing( NIL, wvw_SetLineSpacing() - 2 )
CASE nMenuEvent == IDM_WINDOW_SPACING_DEFAULT
WVW_SetDefLineSpacing( WVW_SetLineSpacing() )
wvw_SetDefLineSpacing( wvw_SetLineSpacing() )
CASE nMenuEvent == IDM_TOOLBAR_ENABLE
xEnableToolbar( 0 )
@@ -1094,7 +1098,7 @@ FUNCTION nMenuChecker( nMenuEvent )
CASE nMenuEvent == IDM_TOOLBAR_RESET
CreateToolbar( 0 )
CASE nMenuEvent == IDM_TOOLBAR_DELETE
WVW_TBdestroy( 0 )
wvw_tbDestroy( 0 )
CASE nMenuEvent == IDM_HELP_HELP
xHelp()
@@ -1114,7 +1118,7 @@ FUNCTION nMenuChecker( nMenuEvent )
FUNCTION lBoxMessage( cMsg, cTitle )
hb_default( @cTitle, "Info" )
win_messagebox( WVW_GETWINDOWHANDLE(), cMsg, cTitle, MB_OK + MB_ICONINFORMATION + MB_SYSTEMMODAL )
win_MessageBox( wvw_GetWindowHandle(), cMsg, cTitle, MB_OK + MB_ICONINFORMATION + MB_SYSTEMMODAL )
RETURN .T.
@@ -1122,7 +1126,7 @@ FUNCTION lYesNo( cMsg, cTitle )
hb_default( @cTitle, "Konfirmasi" )
RETURN win_messagebox( WVW_GETWINDOWHANDLE(), cMsg, cTitle, MB_YESNO + MB_ICONQUESTION + MB_SYSTEMMODAL ) == IDYES
RETURN win_MessageBox( wvw_GetWindowHandle(), cMsg, cTitle, MB_YESNO + MB_ICONQUESTION + MB_SYSTEMMODAL ) == IDYES
FUNCTION lDebug( cMsg )
@@ -1145,9 +1149,9 @@ FUNCTION xDebugInfo()
"Current Window is Window #" + hb_ntos( wvw_nSetCurWindow() ) + hb_eol() + ;
"MaxRow() = " + hb_ntos( MaxRow() ) + ", MaxCol() = " + hb_ntos( MaxCol() ) + hb_eol() + ;
"Row() = " + hb_ntos( Row() ) + ", Col() = " + hb_ntos( Col() ) + hb_eol() + ;
"WVW_RowOfs() = " + hb_ntos( wvw_nrowofs() ) + ", WVW_ColOfs() = " + hb_ntos( wvw_ncolofs() ) + hb_eol() + ;
"Line Spacing = " + hb_ntos( WVW_SetLineSpacing() ) + hb_eol() + ;
"Default Line Spacing = " + hb_ntos( WVW_SetDefLineSpacing() ) + hb_eol() + ;
"WVW_RowOfs() = " + hb_ntos( wvw_nRowOfs() ) + ", WVW_ColOfs() = " + hb_ntos( wvw_nColOfs() ) + hb_eol() + ;
"Line Spacing = " + hb_ntos( wvw_SetLineSpacing() ) + hb_eol() + ;
"Default Line Spacing = " + hb_ntos( wvw_SetDefLineSpacing() ) + hb_eol() + ;
hb_eol() + ;
"Font Face = '" + s_aFontInfo[ 1 ] + "'" + hb_eol() + ;
"Font Height = " + hb_ntos( s_aFontInfo[ 2 ] ) + hb_eol() + ;
@@ -1200,7 +1204,7 @@ FUNCTION nCeiling( nNumber, nRoundDec )
ENDIF
// geser kanan
FOR i := nRoundDec to ( 0 - 1 ) // artinya kalau SATUAN gak usah
FOR i := nRoundDec TO -1 // artinya kalau SATUAN gak usah
nNumber := nNumber / 10
NEXT
@@ -1212,7 +1216,7 @@ FUNCTION nCeiling( nNumber, nRoundDec )
ENDIF
// geser kiri
FOR i := nRoundDec to ( 0 - 1 ) // artinya kalau SATUAN gak usah
FOR i := nRoundDec TO -1 // artinya kalau SATUAN gak usah
nNumber := nNumber * 10
NEXT
@@ -1225,38 +1229,31 @@ FUNCTION SetDefaultWindowSize()
// x was: LOCAL Result:= SetMode(32,98), ScreenWidth
LOCAL Result := .T., ScreenWidth
SetMode( 25, 80 )
IF Result
screenWidth := Wvw_GetScreenWidth()
screenWidth := wvw_GetScreenWidth()
DO CASE
CASE screenWidth >= 1024
Result := Wvw_SetFont( , "Terminal", 20, 10 )
Result := wvw_SetFont( , "Terminal", 20, 10 )
CASE screenWidth >= 800
IF hb_osIsWinNT()
Result := Wvw_SetFont( , "Lucida Console", 16, - 8 )
Result := wvw_SetFont( , "Lucida Console", 16, - 8 )
ELSE
Result := Wvw_SetFont( , "System", 16, - 8 )
Result := wvw_SetFont( , "System", 16, - 8 )
ENDIF
OTHERWISE
Result := Wvw_SetFont( , "Terminal", 12, 6 )
Result := wvw_SetFont( , "Terminal", 12, 6 )
ENDCASE
IF Result
Wvw_SetCodePage( , 255 ) // #define OEM_CHARSET 255 - from wingdi.h
wvw_SetCodepage( , 255 ) // #define OEM_CHARSET 255 - from wingdi.h
CLS
ENDIF
ENDIF
RETURN Result
#if 0
STATIC FUNCTION isWinNT()
RETURN lYesNo( "I am preparing the 'best' font for you..." + hb_eol() + ;
"Sorry, is it Windows NT?" )
#endif
// ERROR handler *******************************************************
PROCEDURE ErrorSys()
@@ -1267,7 +1264,7 @@ PROCEDURE ErrorSys()
STATIC PROCEDURE MyError( e )
LOCAL cTrace := "", i := 1, cErr
LOCAL i := 1, cErr
cErr := "Runtime error" + hb_eol() + ;
hb_eol() + ;
@@ -1292,6 +1289,8 @@ STATIC PROCEDURE MyError( e )
PROCEDURE debugging( cMsg, nRow, nCol, nWinNum )
HB_SYMBOL_UNUSED( nWinNum )
? cmsg + hb_ntos( nrow ) + ", " + hb_ntos( ncol )
RETURN

View File

@@ -141,8 +141,8 @@ HB_FUNC( WVW_DRAWLABELOBJ )
iBottom = xy.y - 1 + 1 + iOffBottom;
iRight = xy.x - 1 + 1 + iOffRight;
iAlignHorz = ( HB_ISNIL( 7 ) ? 0 : hb_parni( 7 ) );
iAlignVert = ( HB_ISNIL( 8 ) ? 0 : hb_parni( 8 ) );
iAlignHorz = HB_ISNIL( 7 ) ? 0 : hb_parni( 7 );
iAlignVert = HB_ISNIL( 8 ) ? 0 : hb_parni( 8 );
oldTextColor = SetTextColor( pWindowData->hdc, HB_ISNIL( 9 ) ? pWindowData->foreground : ( COLORREF ) hb_parnl( 9 ) );
oldBkColor = SetBkColor( pWindowData->hdc, HB_ISNIL( 10 ) ? pWindowData->background : ( COLORREF ) hb_parnl( 10 ) );
@@ -573,7 +573,7 @@ HB_FUNC( WVW_DRAWTEXTBOX )
POINT xy = { 0 };
int iTop, iLeft, iBottom, iRight;
int iAlignHorz = ( HB_ISNIL( 8 ) ? 0 : hb_parni( 8 ) );
int iAlignHorz = HB_ISNIL( 8 ) ? 0 : hb_parni( 8 ) ;
int iAlignH = 0;
@@ -1224,9 +1224,9 @@ HB_FUNC( WVW_DRAWIMAGE )
usBottom = ( USHORT ) hb_parni( 4 ),
usRight = ( USHORT ) hb_parni( 5 );
BOOL bTight = ( HB_ISARRAY( 7 ) || HB_ISNIL( 7 ) ? FALSE : hb_parl( 7 ) );
BOOL bTight = HB_ISARRAY( 7 ) || HB_ISNIL( 7 ) ? FALSE : hb_parl( 7 );
BOOL bUseArray = HB_ISARRAY( 7 );
BOOL bTransparent = ( HB_ISNIL( 8 ) ? FALSE : hb_parl( 8 ) );
BOOL bTransparent = HB_ISNIL( 8 ) ? FALSE : hb_parl( 8 );
int iOLeft, iOTop, iORight, iOBottom;
BOOL bResult;
@@ -1354,9 +1354,9 @@ HB_FUNC( WVW_DRAWIMAGE_RESOURCE )
usBottom = ( USHORT ) hb_parni( 4 ),
usRight = ( USHORT ) hb_parni( 5 );
BOOL bTight = ( HB_ISARRAY( 7 ) || HB_ISNIL( 7 ) ? FALSE : hb_parl( 7 ) );
BOOL bTight = HB_ISARRAY( 7 ) || HB_ISNIL( 7 ) ? FALSE : hb_parl( 7 );
BOOL bUseArray = HB_ISARRAY( 7 );
BOOL bTransparent = ( HB_ISNIL( 8 ) ? FALSE : hb_parl( 8 ) );
BOOL bTransparent = HB_ISNIL( 8 ) ? FALSE : hb_parl( 8 );
int iOLeft, iOTop, iORight, iOBottom;
BOOL bResult = FALSE;
IPicture * pPic;
@@ -1483,19 +1483,19 @@ HB_FUNC( WVW_DRAWLABEL )
if( hb_gt_wvw_GetMainCoordMode() )
hb_wvw_HBFUNCPrologue( usWinNum, &usRow, &usCol, NULL, NULL );
logfont.lfEscapement = ( HB_ISNIL( 6 ) ? 0 : ( hb_parni( 6 ) * 10 ) );
logfont.lfEscapement = HB_ISNIL( 6 ) ? 0 : ( hb_parni( 6 ) * 10 );
logfont.lfOrientation = 0;
logfont.lfWeight = ( HB_ISNIL( 12 ) ? 0 : hb_parni( 12 ) );
logfont.lfItalic = ( HB_ISNIL( 15 ) ? 0 : ( BYTE ) hb_parl( 15 ) );
logfont.lfUnderline = ( HB_ISNIL( 16 ) ? 0 : ( BYTE ) hb_parl( 16 ) );
logfont.lfStrikeOut = ( HB_ISNIL( 17 ) ? 0 : ( BYTE ) hb_parl( 17 ) );
logfont.lfCharSet = ( HB_ISNIL( 14 ) ? ( BYTE ) pWindowData->CodePage : ( BYTE ) hb_parni( 14 ) );
logfont.lfWeight = HB_ISNIL( 12 ) ? 0 : hb_parni( 12 );
logfont.lfItalic = HB_ISNIL( 15 ) ? 0 : ( BYTE ) hb_parl( 15 );
logfont.lfUnderline = HB_ISNIL( 16 ) ? 0 : ( BYTE ) hb_parl( 16 );
logfont.lfStrikeOut = HB_ISNIL( 17 ) ? 0 : ( BYTE ) hb_parl( 17 );
logfont.lfCharSet = HB_ISNIL( 14 ) ? ( BYTE ) pWindowData->CodePage : ( BYTE ) hb_parni( 14 );
logfont.lfOutPrecision = 0;
logfont.lfClipPrecision = 0;
logfont.lfQuality = ( HB_ISNIL( 13 ) ? DEFAULT_QUALITY : ( BYTE ) hb_parni( 13 ) );
logfont.lfQuality = HB_ISNIL( 13 ) ? DEFAULT_QUALITY : ( BYTE ) hb_parni( 13 );
logfont.lfPitchAndFamily = FF_DONTCARE;
logfont.lfHeight = ( HB_ISNIL( 10 ) ? pWindowData->fontHeight : hb_parni( 10 ) );
logfont.lfWidth = ( HB_ISNIL( 11 ) ? ( pWindowData->fontWidth < 0 ? -pWindowData->fontWidth : pWindowData->fontWidth ) : hb_parni( 11 ) );
logfont.lfHeight = HB_ISNIL( 10 ) ? pWindowData->fontHeight : hb_parni( 10 );
logfont.lfWidth = HB_ISNIL( 11 ) ? ( pWindowData->fontWidth < 0 ? -pWindowData->fontWidth : pWindowData->fontWidth ) : hb_parni( 11 );
strcpy( logfont.lfFaceName, ( HB_ISNIL( 9 ) ? pWindowData->fontFace : hb_parcx( 9 ) ) );
@@ -1808,7 +1808,7 @@ HB_FUNC( WVW_DRAWRECTANGLE )
usBottom = ( USHORT ) hb_parni( 4 ),
usRight = ( USHORT ) hb_parni( 5 );
// Ref.: 28454 - Marson de Paula - 11/27/2007
BOOL bUsaCurrentPen = ( HB_ISNIL( 7 ) ? TRUE : hb_parl( 7 ) );
BOOL bUsaCurrentPen = HB_ISNIL( 7 ) ? TRUE : hb_parl( 7 );
iOffTop = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 1 ) : 0;
iOffLeft = ! HB_ISNIL( 6 ) ? hb_parvni( 6, 2 ) : 0;
@@ -2362,7 +2362,7 @@ HB_FUNC( WVW_DRAWPICTURE )
usBottom = ( USHORT ) hb_parni( 4 ),
usRight = ( USHORT ) hb_parni( 5 );
BOOL bTight = ( HB_ISARRAY( 7 ) || HB_ISNIL( 7 ) ? FALSE : hb_parl( 7 ) ); /* <-- none in gtwvt */
BOOL bTight = HB_ISARRAY( 7 ) || HB_ISNIL( 7 ) ? FALSE : hb_parl( 7 );
BOOL bUseArray = HB_ISARRAY( 7 );
int iOLeft, iOTop, iORight, iOBottom;

View File

@@ -136,7 +136,7 @@ HB_FUNC( WVW_EBCREATE )
usRight = ( USHORT ) hb_parni( 5 );
LPTSTR lpszText = ( LPTSTR ) hb_parcx( 6 );
BOOL bMultiline = ( HB_ISLOG( 8 ) ? hb_parl( 8 ) : FALSE );
BOOL bMultiline = HB_ISLOG( 8 ) ? hb_parl( 8 ) : FALSE;
BYTE bEBType = ( BYTE ) ( bMultiline ? WVW_EB_MULTILINE : WVW_EB_SINGLELINE );
DWORD dwMoreStyle = ( DWORD ) ( HB_ISNUM( 9 ) ? hb_parnl( 9 ) : 0 );
@@ -522,7 +522,7 @@ HB_FUNC( WVW_EBGETTEXT )
UINT usWinNum = WVW_WHICH_WINDOW;
UINT uiEBid = hb_parni( 2 );
CONTROL_DATA * pcd = GetControlData( usWinNum, WVW_CONTROL_EDITBOX, NULL, uiEBid );
BOOL bSoftBreak = ( HB_ISLOG( 3 ) ? hb_parl( 3 ) : FALSE );
BOOL bSoftBreak = HB_ISLOG( 3 ) ? hb_parl( 3 ) : FALSE;
USHORT usLen;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
LPTSTR lpszTextANSI;

View File

@@ -576,10 +576,15 @@ HB_FUNC( WVW_MOUSE_COL )
{
WVW_DATA * pData = hb_getWvwData();
if( hb_gt_wvw_GetMainCoordMode() )
hb_retni( hb_gt_wvwGetMouseX( pData->s_pWindows[ pData->s_usNumWindows - 1 ] ) + hb_gt_wvwColOfs( pData->s_usNumWindows - 1 ) );
if( pData )
{
if( hb_gt_wvw_GetMainCoordMode() )
hb_retni( hb_gt_wvwGetMouseX( pData->s_pWindows[ pData->s_usNumWindows - 1 ] ) + hb_gt_wvwColOfs( pData->s_usNumWindows - 1 ) );
else
hb_retni( hb_gt_wvwGetMouseX( pData->s_pWindows[ pData->s_usCurWindow ] ) );
}
else
hb_retni( hb_gt_wvwGetMouseX( pData->s_pWindows[ pData->s_usCurWindow ] ) );
hb_retni( 0 );
}
@@ -587,10 +592,15 @@ HB_FUNC( WVW_MOUSE_ROW )
{
WVW_DATA * pData = hb_getWvwData();
if( hb_gt_wvw_GetMainCoordMode() )
hb_retni( hb_gt_wvwGetMouseY( pData->s_pWindows[ pData->s_usNumWindows - 1 ] ) + hb_gt_wvwRowOfs( pData->s_usNumWindows - 1 ) );
if( pData )
{
if( hb_gt_wvw_GetMainCoordMode() )
hb_retni( hb_gt_wvwGetMouseY( pData->s_pWindows[ pData->s_usNumWindows - 1 ] ) + hb_gt_wvwRowOfs( pData->s_usNumWindows - 1 ) );
else
hb_retni( hb_gt_wvwGetMouseY( pData->s_pWindows[ pData->s_usCurWindow ] ) );
}
else
hb_retni( hb_gt_wvwGetMouseY( pData->s_pWindows[ pData->s_usCurWindow ] ) );
hb_retni( 0 );
}
HB_FUNC( SENDMESSAGE )
@@ -607,8 +617,8 @@ HB_FUNC( SENDMESSAGE )
HB_FUNC( SETPARENT )
{
UINT usWinNum = WVW_WHICH_WINDOW; // filho
UINT usWinNum1 = ( HB_ISNIL( 2 ) ? ( hb_gt_wvw_GetMainCoordMode() ? ( ( hb_gt_wvw_GetNumWindows() ) - 1 ) : hb_gt_wvw_GetCurWindow() ) : ( ( USHORT ) hb_parni( 2 ) ) ); //pai
UINT usWinNum = WVW_WHICH_WINDOW;
UINT usWinNum1 = HB_ISNIL( 2 ) ? ( hb_gt_wvw_GetMainCoordMode() ? ( ( hb_gt_wvw_GetNumWindows() ) - 1 ) : hb_gt_wvw_GetCurWindow() ) : ( ( USHORT ) hb_parni( 2 ) );
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
WIN_DATA * pWindowData1 = hb_gt_wvw_GetWindowsData( usWinNum1 );
HWND hWndParent = pWindowData->hWnd;
@@ -645,7 +655,7 @@ HB_FUNC( ISWINDOW )
HB_FUNC( ADDTOOLTIPEX ) // changed by MAG
{
// HWND hWnd = (HWND) hb_parnl( 1 );
// HWND hWnd = ( HWND ) hb_parnl( 1 );
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
WVW_DATA * pData = hb_getWvwData();
@@ -663,10 +673,10 @@ HB_FUNC( ADDTOOLTIPEX ) // changed by MAG
{
}
// if ( lToolTipBalloon )
// {
// if( lToolTipBalloon )
// {
iStyle = iStyle | TTS_BALLOON;
// }
// }
if( ! pData->hWndTT )
pData->hWndTT = CreateWindow( TOOLTIPS_CLASS, ( LPSTR ) NULL, iStyle,
@@ -680,7 +690,7 @@ HB_FUNC( ADDTOOLTIPEX ) // changed by MAG
ti.uFlags = TTF_SUBCLASS | TTF_IDISHWND;
ti.hwnd = pWindowData->hWnd;
ti.uId = ( UINT ) hb_parnl( 2 );
// ti.uId = (UINT) GetDlgItem( hWnd, hb_parni( 2 ) );
// ti.uId = ( UINT ) GetDlgItem( hWnd, hb_parni( 2 ) );
ti.hinst = GetModuleHandle( NULL );
ti.lpszText = ( LPSTR ) hb_parc( 3 );
@@ -694,7 +704,7 @@ HB_FUNC( ADDTOOLTIPEX ) // changed by MAG
HB_FUNC( CREATEIMAGELIST )
{
PHB_ITEM pArray = hb_param( 1, HB_IT_ARRAY );
UINT flags = ( HB_ISNIL( 5 ) ) ? ILC_COLOR : hb_parni( 5 );
UINT flags = HB_ISNIL( 5 ) ? ILC_COLOR : hb_parni( 5 );
HIMAGELIST himl;
ULONG ul, ulLen = hb_arrayLen( pArray );
HBITMAP hbmp;
@@ -809,7 +819,7 @@ HB_FUNC( LOADBITMAPEX )
HB_FUNC( OPENIMAGE )
{
const char * cFileName = hb_parc( 1 );
BOOL lString = ( HB_ISNIL( 2 ) ) ? 0 : hb_parl( 2 );
BOOL lString = HB_ISNIL( 2 ) ? 0 : hb_parl( 2 );
int iFileSize;
FILE * fp;
// IPicture * pPic;
@@ -1048,11 +1058,11 @@ HB_FUNC( REDRAWWINDOW )
HB_FUNC( CREATEFONT )
{
HFONT hFont;
int fnWeight = ( HB_ISNIL( 4 ) ) ? 0 : hb_parni( 4 );
DWORD fdwCharSet = ( HB_ISNIL( 5 ) ) ? 0 : hb_parnl( 5 );
DWORD fdwItalic = ( HB_ISNIL( 6 ) ) ? 0 : hb_parnl( 6 );
DWORD fdwUnderline = ( HB_ISNIL( 7 ) ) ? 0 : hb_parnl( 7 );
DWORD fdwStrikeOut = ( HB_ISNIL( 8 ) ) ? 0 : hb_parnl( 8 );
int fnWeight = HB_ISNIL( 4 ) ? 0 : hb_parni( 4 );
DWORD fdwCharSet = HB_ISNIL( 5 ) ? 0 : hb_parnl( 5 );
DWORD fdwItalic = HB_ISNIL( 6 ) ? 0 : hb_parnl( 6 );
DWORD fdwUnderline = HB_ISNIL( 7 ) ? 0 : hb_parnl( 7 );
DWORD fdwStrikeOut = HB_ISNIL( 8 ) ? 0 : hb_parnl( 8 );
hFont = CreateFont(
hb_parni( 3 ), // logical height of font
@@ -1080,7 +1090,7 @@ HB_FUNC( SELECTFONT )
CHOOSEFONT cf;
LOGFONT lf;
HFONT hfont;
PHB_ITEM pObj = ( HB_ISNIL( 1 ) ) ? NULL : hb_param( 1, HB_IT_OBJECT );
PHB_ITEM pObj = HB_ISNIL( 1 ) ? NULL : hb_param( 1, HB_IT_OBJECT );
//PHB_ITEM temp1;
PHB_ITEM aMetr = hb_itemArrayNew( 9 );
@@ -1270,7 +1280,7 @@ HB_FUNC( DRAWBITMAP )
{
HDC hDC = ( HDC ) HB_PARHANDLE( 1 );
HDC hDCmem = CreateCompatibleDC( hDC );
DWORD dwraster = ( HB_ISNIL( 3 ) ) ? SRCCOPY : hb_parnl( 3 );
DWORD dwraster = HB_ISNIL( 3 ) ? SRCCOPY : hb_parnl( 3 );
HBITMAP hBitmap = ( HBITMAP ) HB_PARHANDLE( 2 );
BITMAP bitmap;
int nWidthDest = ( hb_pcount() >= 5 && ! HB_ISNIL( 6 ) ) ? hb_parni( 6 ) : 0;
@@ -1289,8 +1299,8 @@ HB_FUNC( DRAWBITMAP )
HB_FUNC( WINDOW2BITMAP )
{
HWND hWnd = ( HWND ) HB_PARHANDLE( 1 );
BOOL lFull = ( HB_ISNIL( 2 ) ) ? 0 : ( BOOL ) hb_parl( 2 );
HDC hDC = ( lFull ) ? GetWindowDC( hWnd ) : GetDC( hWnd );
BOOL lFull = HB_ISNIL( 2 ) ? 0 : ( BOOL ) hb_parl( 2 );
HDC hDC = lFull ? GetWindowDC( hWnd ) : GetDC( hWnd );
HDC hDCmem = CreateCompatibleDC( hDC );
HBITMAP hBitmap;
RECT rc;
@@ -1334,10 +1344,15 @@ HB_FUNC( WINDOW2BITMAP )
HB_FUNC( WVW_SETMAXBMCACHE )
{
WVW_DATA * p = hb_getWvwData();
UINT uiOldMaxBMcache = p->s_sApp->uiMaxBMcache;
UINT uiOldMaxBMcache = 0;
if( ! HB_ISNIL( 1 ) )
p->s_sApp->uiMaxBMcache = ( UINT ) hb_parni( 1 );
if( p )
{
uiOldMaxBMcache = p->s_sApp->uiMaxBMcache;
if( ! HB_ISNIL( 1 ) )
p->s_sApp->uiMaxBMcache = ( UINT ) hb_parni( 1 );
}
hb_retni( uiOldMaxBMcache );
}
@@ -1349,7 +1364,7 @@ HB_FUNC( WVW_NUMBMCACHE )
{
WVW_DATA * p = hb_getWvwData();
hb_retni( p->s_sApp->uiBMcache );
hb_retni( p ? p->s_sApp->uiBMcache : 0 );
}
@@ -1371,12 +1386,13 @@ HB_FUNC( WVW_NUMBMCACHE )
/*20040602: WARNING: WVT is slightly different*/
HB_FUNC( WVW_SETTIMER )
{
WVW_DATA * p = hb_getWvwData();
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
WVW_DATA * p = hb_getWvwData();
if( p->s_sApp->pSymWVW_TIMER )
if( p && p->s_sApp->pSymWVW_TIMER )
{
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
SetTimer( pWindowData->hWnd, WVW_ID_BASE_TIMER + usWinNum, ( UINT ) hb_parni( 2 ), NULL );
hb_retl( TRUE );
@@ -1392,12 +1408,13 @@ HB_FUNC( WVW_SETTIMER )
/*20040602: WARNING: WVT is slightly different */
HB_FUNC( WVW_KILLTIMER )
{
WVW_DATA * p = hb_getWvwData();
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
WVW_DATA * p = hb_getWvwData();
if( p->s_sApp->pSymWVW_TIMER )
if( p && p->s_sApp->pSymWVW_TIMER )
{
UINT usWinNum = WVW_WHICH_WINDOW;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
KillTimer( pWindowData->hWnd, WVW_ID_BASE_TIMER + usWinNum );
hb_retl( TRUE );
}
@@ -1440,31 +1457,31 @@ HB_FUNC( WVW_SETPOINTER )
switch( iCursor )
{
case 1:
hCursor = LoadCursor( NULL, IDC_ARROW );
hCursor = LoadCursor( NULL, IDC_ARROW );
break;
case 2:
hCursor = LoadCursor( NULL, IDC_IBEAM );
hCursor = LoadCursor( NULL, IDC_IBEAM );
break;
case 3:
hCursor = LoadCursor( NULL, IDC_WAIT );
hCursor = LoadCursor( NULL, IDC_WAIT );
break;
case 4:
hCursor = LoadCursor( NULL, IDC_CROSS );
hCursor = LoadCursor( NULL, IDC_CROSS );
break;
case 5:
hCursor = LoadCursor( NULL, IDC_UPARROW );
hCursor = LoadCursor( NULL, IDC_UPARROW );
break;
case 6:
hCursor = LoadCursor( NULL, IDC_SIZE );
hCursor = LoadCursor( NULL, IDC_SIZE );
break;
case 7:
hCursor = LoadCursor( NULL, IDC_ICON );
hCursor = LoadCursor( NULL, IDC_ICON );
break;
case 8:
@@ -1476,23 +1493,23 @@ HB_FUNC( WVW_SETPOINTER )
break;
case 10:
hCursor = LoadCursor( NULL, IDC_SIZEWE );
hCursor = LoadCursor( NULL, IDC_SIZEWE );
break;
case 11:
hCursor = LoadCursor( NULL, IDC_SIZENS );
hCursor = LoadCursor( NULL, IDC_SIZENS );
break;
case 12:
hCursor = LoadCursor( NULL, IDC_SIZEALL );
hCursor = LoadCursor( NULL, IDC_SIZEALL );
break;
case 13:
hCursor = LoadCursor( NULL, IDC_NO );
hCursor = LoadCursor( NULL, IDC_NO );
break;
case 14:
hCursor = LoadCursor( NULL, IDC_HAND );
hCursor = LoadCursor( NULL, IDC_HAND );
break;
case 15:
@@ -1500,11 +1517,11 @@ HB_FUNC( WVW_SETPOINTER )
break;
case 16:
hCursor = LoadCursor( NULL, IDC_HELP );
hCursor = LoadCursor( NULL, IDC_HELP );
break;
default:
hCursor = LoadCursor( NULL, IDC_ARROW );
hCursor = LoadCursor( NULL, IDC_ARROW );
break;
}
@@ -1517,19 +1534,23 @@ HB_FUNC( WVW_SETPOINTER )
/* */
HB_FUNC( WVW_LOADPICTURE )
{
BOOL bResult = FALSE;
WVW_DATA * p = hb_getWvwData();
IPicture * iPicture = hb_gt_wvwLoadPicture( hb_parcx( 2 ) );
BOOL bResult = FALSE;
int iSlot = hb_parni( 1 ) - 1;
if( iPicture )
if( p && iPicture )
{
int iSlot = hb_parni( 1 ) - 1;
if( p->s_sApp->iPicture[ iSlot ] )
hb_gt_wvwDestroyPicture( p->s_sApp->iPicture[ iSlot ] );
p->s_sApp->iPicture[ iSlot ] = iPicture;
bResult = TRUE;
}
hb_retl( bResult );
}
@@ -1540,35 +1561,39 @@ HB_FUNC( WVW_LOADPICTURE )
/* */
HB_FUNC( WVW_LOADFONT )
{
WVW_DATA * p = hb_getWvwData();
UINT usWinNum = p->s_usNumWindows - 1;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
LOGFONT logfont;
int iSlot = hb_parni( 1 ) - 1;
HFONT hFont;
WVW_DATA * p = hb_getWvwData();
logfont.lfEscapement = ( HB_ISNIL( 11 ) ? 0 : ( hb_parni( 11 ) * 10 ) );
logfont.lfOrientation = 0;
logfont.lfWeight = ( HB_ISNIL( 5 ) ? 0 : hb_parni( 5 ) );
logfont.lfItalic = ( HB_ISNIL( 6 ) ? 0 : ( BYTE ) hb_parl( 6 ) );
logfont.lfUnderline = ( HB_ISNIL( 7 ) ? 0 : ( BYTE ) hb_parl( 7 ) );
logfont.lfStrikeOut = ( HB_ISNIL( 8 ) ? 0 : ( BYTE ) hb_parl( 8 ) );
logfont.lfCharSet = ( HB_ISNIL( 9 ) ? ( BYTE ) pWindowData->CodePage : ( BYTE ) hb_parni( 9 ) );
logfont.lfOutPrecision = 0;
logfont.lfClipPrecision = 0;
logfont.lfQuality = ( HB_ISNIL( 10 ) ? ( BYTE ) DEFAULT_QUALITY : ( BYTE ) hb_parni( 10 ) );
logfont.lfPitchAndFamily = FF_DONTCARE;
logfont.lfHeight = ( HB_ISNIL( 3 ) ? pWindowData->fontHeight : hb_parni( 3 ) );
logfont.lfWidth = ( HB_ISNIL( 4 ) ? ( pWindowData->fontWidth < 0 ? -pWindowData->fontWidth : pWindowData->fontWidth ) : hb_parni( 4 ) );
strcpy( logfont.lfFaceName, ( HB_ISNIL( 2 ) ? pWindowData->fontFace : hb_parcx( 2 ) ) );
hFont = CreateFontIndirect( &logfont );
if( hFont )
if( p )
{
if( p->s_sApp->hUserFonts[ iSlot ] )
DeleteObject( ( HFONT ) p->s_sApp->hUserFonts[ iSlot ] );
p->s_sApp->hUserFonts[ iSlot ] = hFont;
UINT usWinNum = p->s_usNumWindows - 1;
WIN_DATA * pWindowData = hb_gt_wvw_GetWindowsData( usWinNum );
LOGFONT logfont;
int iSlot = hb_parni( 1 ) - 1;
HFONT hFont;
logfont.lfEscapement = HB_ISNIL( 11 ) ? 0 : ( hb_parni( 11 ) * 10 );
logfont.lfOrientation = 0;
logfont.lfWeight = HB_ISNIL( 5 ) ? 0 : hb_parni( 5 );
logfont.lfItalic = HB_ISNIL( 6 ) ? 0 : ( BYTE ) hb_parl( 6 );
logfont.lfUnderline = HB_ISNIL( 7 ) ? 0 : ( BYTE ) hb_parl( 7 );
logfont.lfStrikeOut = HB_ISNIL( 8 ) ? 0 : ( BYTE ) hb_parl( 8 );
logfont.lfCharSet = HB_ISNIL( 9 ) ? ( BYTE ) pWindowData->CodePage : ( BYTE ) hb_parni( 9 );
logfont.lfOutPrecision = 0;
logfont.lfClipPrecision = 0;
logfont.lfQuality = HB_ISNIL( 10 ) ? ( BYTE ) DEFAULT_QUALITY : ( BYTE ) hb_parni( 10 );
logfont.lfPitchAndFamily = FF_DONTCARE;
logfont.lfHeight = HB_ISNIL( 3 ) ? pWindowData->fontHeight : hb_parni( 3 );
logfont.lfWidth = HB_ISNIL( 4 ) ? ( pWindowData->fontWidth < 0 ? -pWindowData->fontWidth : pWindowData->fontWidth ) : hb_parni( 4 );
strcpy( logfont.lfFaceName, HB_ISNIL( 2 ) ? pWindowData->fontFace : hb_parcx( 2 ) );
hFont = CreateFontIndirect( &logfont );
if( hFont )
{
if( p->s_sApp->hUserFonts[ iSlot ] )
DeleteObject( ( HFONT ) p->s_sApp->hUserFonts[ iSlot ] );
p->s_sApp->hUserFonts[ iSlot ] = hFont;
}
}
}
@@ -1709,7 +1734,7 @@ HB_FUNC( WVW_CHOOSECOLOR )
WVW_DATA * p = hb_getWvwData();
for( i = 0; i < 16; i++ )
crCustClr[ i ] = ( HB_ISARRAY( 2 ) ? ( COLORREF ) hb_parvnl( 2, i + 1 ) : GetSysColor( COLOR_BTNFACE ) );
crCustClr[ i ] = HB_ISARRAY( 2 ) ? ( COLORREF ) hb_parvnl( 2, i + 1 ) : GetSysColor( COLOR_BTNFACE );
cc.lStructSize = sizeof( CHOOSECOLOR );
cc.hwndOwner = p->s_pWindows[ p->s_usNumWindows - 1 ]->hWnd;
@@ -1779,9 +1804,9 @@ HB_FUNC( WVW_FILLRECTANGLE )
usLeft = ( USHORT ) hb_parni( 3 ),
usBottom = ( USHORT ) hb_parni( 4 ),
usRight = ( USHORT ) hb_parni( 5 );
COLORREF crRGBcolor = ( HB_ISNIL( 6 ) ? 0 : hb_parnl( 6 ) );
BOOL bTight = ( HB_ISNIL( 7 ) ? FALSE : hb_parl( 7 ) );
BOOL bUseBrush = ( HB_ISNIL( 8 ) ? FALSE : hb_parl( 8 ) );
COLORREF crRGBcolor = HB_ISNIL( 6 ) ? 0 : hb_parnl( 6 );
BOOL bTight = HB_ISNIL( 7 ) ? FALSE : hb_parl( 7 );
BOOL bUseBrush = HB_ISNIL( 8 ) ? FALSE : hb_parl( 8 );
LOGBRUSH lb = { 0 };
HBRUSH hBrush;
RECT xyRect = { 0 };
@@ -2487,21 +2512,21 @@ HB_FUNC( WVW_CREATEFONT )
LOGFONT logfont;
HFONT hFont;
logfont.lfEscapement = ( HB_ISNIL( 10 ) ? 0 : ( hb_parni( 10 ) * 10 ) );
logfont.lfEscapement = HB_ISNIL( 10 ) ? 0 : ( hb_parni( 10 ) * 10 );
logfont.lfOrientation = 0;
logfont.lfWeight = ( HB_ISNIL( 4 ) ? 0 : hb_parni( 4 ) );
logfont.lfItalic = ( HB_ISNIL( 5 ) ? 0 : ( BYTE ) hb_parl( 5 ) );
logfont.lfUnderline = ( HB_ISNIL( 6 ) ? 0 : ( BYTE ) hb_parl( 6 ) );
logfont.lfStrikeOut = ( HB_ISNIL( 7 ) ? 0 : ( BYTE ) hb_parl( 7 ) );
logfont.lfCharSet = ( HB_ISNIL( 8 ) ? ( BYTE ) pWindowData->CodePage : ( BYTE ) hb_parni( 8 ) );
logfont.lfWeight = HB_ISNIL( 4 ) ? 0 : hb_parni( 4 );
logfont.lfItalic = HB_ISNIL( 5 ) ? 0 : ( BYTE ) hb_parl( 5 );
logfont.lfUnderline = HB_ISNIL( 6 ) ? 0 : ( BYTE ) hb_parl( 6 );
logfont.lfStrikeOut = HB_ISNIL( 7 ) ? 0 : ( BYTE ) hb_parl( 7 );
logfont.lfCharSet = HB_ISNIL( 8 ) ? ( BYTE ) pWindowData->CodePage : ( BYTE ) hb_parni( 8 );
logfont.lfOutPrecision = 0;
logfont.lfClipPrecision = 0;
logfont.lfQuality = ( HB_ISNIL( 9 ) ? ( BYTE ) DEFAULT_QUALITY : ( BYTE ) hb_parni( 9 ) );
logfont.lfQuality = HB_ISNIL( 9 ) ? ( BYTE ) DEFAULT_QUALITY : ( BYTE ) hb_parni( 9 );
logfont.lfPitchAndFamily = FF_DONTCARE;
logfont.lfHeight = ( HB_ISNIL( 2 ) ? pWindowData->fontHeight : hb_parni( 2 ) );
logfont.lfWidth = ( HB_ISNIL( 3 ) ? ( pWindowData->fontWidth < 0 ? -pWindowData->fontWidth : pWindowData->fontWidth ) : hb_parni( 3 ) );
logfont.lfHeight = HB_ISNIL( 2 ) ? pWindowData->fontHeight : hb_parni( 2 );
logfont.lfWidth = HB_ISNIL( 3 ) ? ( pWindowData->fontWidth < 0 ? -pWindowData->fontWidth : pWindowData->fontWidth ) : hb_parni( 3 );
strcpy( logfont.lfFaceName, ( HB_ISNIL( 1 ) ? pWindowData->fontFace : hb_parcx( 1 ) ) );
strcpy( logfont.lfFaceName, HB_ISNIL( 1 ) ? pWindowData->fontFace : hb_parcx( 1 ) );
hFont = CreateFontIndirect( &logfont );
if( hFont )