2008-06-15 15:16 UTC+0800 Pritpal Bedi (pritpal@vouchcac.com)

* contrib/gtwvg/gtwvg.c
   * contrib/gtwvg/wvtutils.c
   * contrib/gtwvg/wvtcore.c
   * contrib/gtwvg/wvtpaint.prg
   * contrib/gtwvg/gtwvg.h
   + contrib/gtwvg/hbgtwvg.ch
     ! Syntactically and parameters wise GTWVG matches GTWVT.
     ! More functions ported to Hb_GtInfo().
     ! wvtcore.c and wvtutils.c are now based on function call 
          instead of static variables.
     + Separate hbgtwvg.ch included containg GTI_ constants 
          proprietory to GTWVG only.
     ! Organizing, formatting and code clean ups.
   ; TODO: Separate HB_GTWVT structure in 3 units 
       1) Core GT member.
       2) WVG specif member -  per GT.
       3) GDI members
     
     Work-in-progress. Please deffer updates in GTWVG.
This commit is contained in:
Pritpal Bedi
2008-06-15 22:28:36 +00:00
parent d8654833af
commit f522bc4ac2
7 changed files with 1515 additions and 1166 deletions

View File

@@ -8,6 +8,27 @@
2008-12-31 13:59 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
2008-06-15 15:16 UTC+0800 Pritpal Bedi (pritpal@vouchcac.com)
* contrib/gtwvg/gtwvg.c
* contrib/gtwvg/wvtutils.c
* contrib/gtwvg/wvtcore.c
* contrib/gtwvg/wvtpaint.prg
* contrib/gtwvg/gtwvg.h
+ contrib/gtwvg/hbgtwvg.ch
! Syntactically and parameters wise GTWVG matches GTWVT.
! More functions ported to Hb_GtInfo().
! wvtcore.c and wvtutils.c are now based on function call
instead of static variables.
+ Separate hbgtwvg.ch included containg GTI_ constants
proprietory to GTWVG only.
! Organizing, formatting and code clean ups.
; TODO: Separate HB_GTWVT structure in 3 units
1) Core GT member.
2) WVG specif member - per GT.
3) GDI members
Work-in-progress. Please deffer updates in GTWVG.
2008-06-15 23:10 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* source/vm/memvars.c
* Minor format.
@@ -23,7 +44,7 @@
* contrib/hbtip/tests/ftpadv.prg
* Changed to compile in Harbour.
2008-06-15 11:34 UTC+0800 Pritpal Bedi (pritpal@vouchcac.com)
2008-06-14 11:34 UTC+0800 Pritpal Bedi (pritpal@vouchcac.com)
* contrib/gtwvg/gtwvg.c
* contrib/gtwvg/gtwvg.h
* contrib/gtwvg/wvtutils.c

File diff suppressed because it is too large Load Diff

View File

@@ -56,7 +56,6 @@
#define HB_GT_NAME WVG
//-------------------------------------------------------------------//
#ifndef _WIN32_IE
@@ -97,11 +96,15 @@
#include "hbvm.h"
#include "hbgfxdef.ch"
#include "hbgtwvg.ch"
//----------------------------------------------------------------------//
#define WVT_CHAR_QUEUE_SIZE 128
#define WVT_MAX_TITLE_SIZE 128
#define WVT_MAX_ROWS 256
#define WVT_MAX_COLS 256
#define WVT_MAX_WINDOWS 256
#if defined( HB_WINCE )
# define WVT_DEFAULT_ROWS 15
# define WVT_DEFAULT_COLS 50
@@ -113,7 +116,7 @@
# define WVT_DEFAULT_FONT_HEIGHT 16
# define WVT_DEFAULT_FONT_WIDTH 8
#endif
#define WVT_DEFAULT_FONT_NAME "Terminal"
#define WVT_DEFAULT_FONT_NAME "Terminal"
#define BLACK RGB( 0x0 ,0x0 ,0x0 )
#define BLUE RGB( 0x0 ,0x0 ,0x85 )
@@ -132,9 +135,9 @@
#define YELLOW RGB( 0xFF,0xFF,0x00 )
#define BRIGHT_WHITE RGB( 0xFF,0xFF,0xFF )
#define WM_MY_UPDATE_CARET ( WM_USER + 0x0101 )
#define WM_MY_UPDATE_CARET ( WM_USER + 0x0101 )
#define SYS_EV_MARK 1000
#define SYS_EV_MARK 1000
//-------------------------------------------------------------------//
#define WVT_PICTURES_MAX 50
#define WVT_FONTS_MAX 50
@@ -202,14 +205,15 @@ typedef BOOL ( WINAPI *wvtGradientFill ) (
//-------------------------------------------------------------------//
typedef struct global_data
typedef struct
{
PHB_GT pGT; /* core GT pointer */
int iHandle; /* window number */
USHORT ROWS; /* number of displayable rows in window */
USHORT COLS; /* number of displayable columns in window */
COLORREF COLORS[16]; /* colors */
COLORREF COLORS[ 16 ]; /* colors */
BOOL CaretExist; /* TRUE if a caret has been created */
BOOL CaretHidden; /* TRUE if a caret has been hiden */
@@ -245,22 +249,19 @@ typedef struct global_data
BOOL IgnoreWM_SYSCHAR;
BOOL bMaximized; /* Flag is set when window has been maximized */
BOOL bBeingMarked; /* Flag to control DOS window like copy operation */
BOOL bBeginMarked;
BOOL bMaximized; /* Flag is set when window has been maximized */
BOOL bBeingMarked; /* Flag to control DOS window like copy operation */
BOOL bBeginMarked;
char * pszSelectCopy;
BOOL bResizable;
BOOL bSelectCopy;
BOOL bClosable;
BOOL bResizable;
BOOL bSelectCopy;
char * pszSelectCopy;
BOOL bClosable;
// To Be Split in 2 Structures <1 GUI dynamic> <2 GUI fixed> //
BOOL bResizing;
/* *** GUI part *** */
// int closeEvent; // command to return ( in ReadKey ) on close
// int shutdownEvent; // command to return ( in ReadKey ) on shutdown
int LastMenuEvent; // Last menu item selected
int MenuKeyEvent; // User definable event number for windows menu command
BOOL InvalidateWindow; // Flag for controlling whether to use ScrollWindowEx()
@@ -317,9 +318,9 @@ typedef struct global_data
BOOL bSetFocus;
BOOL bKillFocus;
} GLOBAL_DATA, * LPGLOBAL_DATA;
} HB_GTWVT, * PHB_GTWVT;
//-------------------------------------------------------------------//
//----------------------------------------------------------------------//
#ifndef INVALID_FILE_SIZE
#define INVALID_FILE_SIZE (DWORD)0xFFFFFFFF
@@ -341,28 +342,28 @@ typedef struct global_data
typedef enum
{
GTO_POINT = 0,
GTO_LINE = 1,
GTO_SQUARE = 3,
GTO_RECTANGLE = 4,
GTO_CIRCLE = 5,
GTO_DISK = 7,
GTO_POINT = 0,
GTO_LINE = 1,
GTO_SQUARE = 3,
GTO_RECTANGLE = 4,
GTO_CIRCLE = 5,
GTO_DISK = 7,
/* TODO: add other types */
GTO_TEXT = 100,
GTO_TEXT = 100,
} HB_gt_object_enum;
/* Event subsystem */
typedef enum
{
GTEVENT_RESIZE = 0,
GTEVENT_CLOSE = 1,
GTEVENT_ICONIZE = 2,
GTEVENT_MAXH = 3,
GTEVENT_MAXV = 4,
GTEVENT_MAXIMIZE = 5,
GTEVENT_DEICONIZE= 6,
GTEVENT_SHUTDOWN = 7
GTEVENT_RESIZE = 0,
GTEVENT_CLOSE = 1,
GTEVENT_ICONIZE = 2,
GTEVENT_MAXH = 3,
GTEVENT_MAXV = 4,
GTEVENT_MAXIMIZE = 5,
GTEVENT_DEICONIZE = 6,
GTEVENT_SHUTDOWN = 7
} HB_gt_event_enum;
typedef struct _tag_HB_GT_GCOLOR
@@ -403,35 +404,22 @@ typedef struct _tag_HB_GT_COLDEF
//----------------------------------------------------------------------//
POINT HB_EXPORT hb_wvt_gtGetXYFromColRow( USHORT col, USHORT row );
IPicture HB_EXPORT * hb_wvt_gtLoadPicture( char * image );
IPicture HB_EXPORT * hb_wvt_gtLoadPictureFromResource( LPCSTR cResource, LPCSTR cSection );
BOOL HB_EXPORT hb_wvt_gtRenderPicture( int x1, int y1, int wd, int ht, IPicture * iPicture );
BOOL HB_EXPORT hb_wvt_gtDestroyPicture( IPicture * iPicture );
BOOL HB_EXPORT hb_wvt_DrawImage( HDC hdc, int x1, int y1, int wd, int ht, char * image );
POINT HB_EXPORT hb_wvt_gtGetXYFromColRow( USHORT col, USHORT row );
IPicture HB_EXPORT * hb_wvt_gtLoadPicture( char * image );
IPicture HB_EXPORT * hb_wvt_gtLoadPictureFromResource( LPCSTR cResource, LPCSTR cSection );
BOOL HB_EXPORT hb_wvt_gtRenderPicture( int x1, int y1, int wd, int ht, IPicture * iPicture );
BOOL HB_EXPORT hb_wvt_gtDestroyPicture( IPicture * iPicture );
BOOL HB_EXPORT hb_wvt_DrawImage( HDC hdc, int x1, int y1, int wd, int ht, char * image );
LPWORD HB_EXPORT lpwAlign( LPWORD lpIn );
int HB_EXPORT nCopyAnsiToWideChar( LPWORD lpWCStr, LPSTR lpAnsiIn );
BOOL HB_EXPORT CALLBACK hb_wvt_gtDlgProcMLess( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam );
BOOL HB_EXPORT CALLBACK hb_wvt_gtDlgProcModal( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam );
LPWORD HB_EXPORT lpwAlign( LPWORD lpIn );
int HB_EXPORT nCopyAnsiToWideChar( LPWORD lpWCStr, LPSTR lpAnsiIn );
BOOL HB_EXPORT CALLBACK hb_wvt_gtDlgProcMLess( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam );
BOOL HB_EXPORT CALLBACK hb_wvt_gtDlgProcModal( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam );
void HB_EXPORT hb_wvt_wvtCore( void );
void HB_EXPORT hb_wvt_wvtUtils( void );
void HB_EXPORT hb_wvt_wvtCore( void );
void HB_EXPORT hb_wvt_wvtUtils( void );
GLOBAL_DATA HB_EXPORT * hb_wvt_gtGetGlobalData( void );
//-------------------------------------------------------------------//
//
// Candidates for inculsion in hbgtinfo.ch
//
#define HB_GTI_SETFONT 71
#define HB_GTI_USER 1000
#define HB_GTU_WINDOWHANDLE 1
#define HB_GTU_CENTERWINDOW 2
#define HB_GTU_PROCESSMESSAGES 3
#define HB_GTU_KEYBOARD 4
#define HB_GTU_RESETWINDOW 5
PHB_GTWVT HB_EXPORT hb_wvt_gtGetWVT( void );
//----------------------------------------------------------------------//

View File

@@ -0,0 +1,39 @@
//----------------------------------------------------------------------//
//----------------------------------------------------------------------//
//----------------------------------------------------------------------//
//
// Extended GT Manipulation Constants
//
// Pritpal Bedi <pritpal@vouchcac.com>
//
//----------------------------------------------------------------------//
//----------------------------------------------------------------------//
//----------------------------------------------------------------------//
#define HB_GTI_SETFONT 71
#define HB_GTI_SPEC 1000
/* Window Specifications */
#define HB_GTS_WINDOWHANDLE 1
#define HB_GTS_CENTERWINDOW 2
#define HB_GTS_PROCESSMESSAGES 3
#define HB_GTS_KEYBOARD 4
#define HB_GTS_RESETWINDOW 5
#define HB_GTS_WNDSTATE 6
#define HB_GTS_SETTIMER 7
#define HB_GTS_KILLTIMER 8
#define HB_GTS_SETPOSITION 9
#define HB_GTS_SHOWWINDOW 10
#define HB_GTS_UPDATEWINDOW 11
/* Window States */
#define WNDS_SETONTOP 1
#define WNDS_SETASNORMAL 2
#define WNDS_MINIMIZED 3
#define WNDS_MAXIMIZED 4
#define WNDS_HIDDEN 5
#define WNDS_NORMAL 6
//----------------------------------------------------------------------//

View File

@@ -80,30 +80,21 @@
#include "gtwvg.h"
static GLOBAL_DATA *_s = NULL;
static void hb_wvt_DrawBoxRaised( HDC hdc, int iTop, int iLeft, int iBottom, int iRight );
static void hb_wvt_DrawBoxRecessed( HDC hdc, int iTop, int iLeft, int iBottom, int iRight );
static void hb_wvt_DrawOutline( HDC hdc, int iTop, int iLeft, int iBottom, int iRight );
static void hb_wvt_DrawBoxGet( HDC hdc, int iTop, int iLeft, int iBottom, int iRight );
static void hb_wvt_DrawBoxGroup( HDC hdc, int iTop, int iLeft, int iBottom, int iRight );
static void hb_wvt_DrawBoxGroupRaised( HDC hdc, int iTop, int iLeft, int iBottom, int iRight );
static void hb_wvt_DrawToolButtonFlat( HDC hdc, int iTop, int iLeft, int iBottom, int iRight );
static void hb_wvt_DrawToolButtonUp( HDC hdc, int iTop, int iLeft, int iBottom, int iRight );
static void hb_wvt_DrawToolButtonDown( HDC hdc, int iTop, int iLeft, int iBottom, int iRight );
//-------------------------------------------------------------------//
void HB_EXPORT hb_wvt_wvtCore( void )
{
_s = hb_wvt_gtGetGlobalData();
}
static void hb_wvt_DrawBoxRaised ( HDC hdc, int iTop, int iLeft, int iBottom, int iRight );
static void hb_wvt_DrawBoxRecessed ( HDC hdc, int iTop, int iLeft, int iBottom, int iRight );
static void hb_wvt_DrawOutline ( HDC hdc, int iTop, int iLeft, int iBottom, int iRight );
static void hb_wvt_DrawBoxGet ( HDC hdc, int iTop, int iLeft, int iBottom, int iRight );
static void hb_wvt_DrawBoxGroup ( HDC hdc, int iTop, int iLeft, int iBottom, int iRight );
static void hb_wvt_DrawBoxGroupRaised ( HDC hdc, int iTop, int iLeft, int iBottom, int iRight );
static void hb_wvt_DrawToolButtonFlat ( HDC hdc, int iTop, int iLeft, int iBottom, int iRight );
static void hb_wvt_DrawToolButtonUp ( HDC hdc, int iTop, int iLeft, int iBottom, int iRight );
static void hb_wvt_DrawToolButtonDown ( HDC hdc, int iTop, int iLeft, int iBottom, int iRight );
//-------------------------------------------------------------------//
HB_FUNC( WVT_CORE )
{
hb_wvt_wvtCore();
// Retained for legacy code.
}
//-------------------------------------------------------------------//
@@ -236,6 +227,8 @@ HB_EXPORT IPicture * hb_wvt_gtLoadPicture( char * cImage )
BOOL HB_EXPORT hb_wvt_gtRenderPicture( int x1, int y1, int wd, int ht, IPicture * iPicture )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
LONG lWidth, lHeight;
int x, y, xe, ye;
int c = x1;
@@ -345,6 +338,8 @@ BOOL HB_EXPORT hb_wvt_gtDestroyPicture( IPicture * iPicture )
POINT HB_EXPORT hb_wvt_gtGetXYFromColRow( USHORT col, USHORT row )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
POINT xy;
xy.x = col * _s->PTEXTSIZE.x;
@@ -353,8 +348,6 @@ POINT HB_EXPORT hb_wvt_gtGetXYFromColRow( USHORT col, USHORT row )
return xy;
}
//-------------------------------------------------------------------//
//-------------------------------------------------------------------//
//
// Modeless Dialogs Implementation
@@ -363,6 +356,8 @@ POINT HB_EXPORT hb_wvt_gtGetXYFromColRow( USHORT col, USHORT row )
HB_EXPORT BOOL CALLBACK hb_wvt_gtDlgProcMLess( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
int iIndex, iType;
long int lReturn = 0;
PHB_ITEM pFunc = NULL;
@@ -467,6 +462,8 @@ HB_EXPORT BOOL CALLBACK hb_wvt_gtDlgProcMLess( HWND hDlg, UINT message, WPARAM w
HB_EXPORT BOOL CALLBACK hb_wvt_gtDlgProcModal( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
int iIndex, iType;
long int lReturn = 0;
PHB_ITEM pFunc = NULL;
@@ -681,6 +678,8 @@ HB_EXPORT BOOL hb_wvt_DrawImage( HDC hdc, int x1, int y1, int wd, int ht, char *
static void hb_wvt_DrawBoxRaised( HDC hdc, int iTop, int iLeft, int iBottom, int iRight )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
SelectObject( hdc, _s->penWhiteDim );
MoveToEx( hdc, iLeft, iTop, NULL ); // Top Inner
LineTo( hdc, iRight, iTop );
@@ -710,6 +709,8 @@ static void hb_wvt_DrawBoxRaised( HDC hdc, int iTop, int iLeft, int iBottom, int
static void hb_wvt_DrawBoxRecessed( HDC hdc, int iTop, int iLeft, int iBottom, int iRight )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
SelectObject( hdc, _s->penWhiteDim );
MoveToEx( hdc, iRight, iTop, NULL ); // Right Inner
LineTo( hdc, iRight, iBottom );
@@ -756,6 +757,8 @@ static void hb_wvt_DrawOutline( HDC hdc, int iTop, int iLeft, int iBottom, int i
static void hb_wvt_DrawBoxGet( HDC hdc, int iTop, int iLeft, int iBottom, int iRight )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
SelectObject( hdc, _s->penBlack );
MoveToEx( hdc, iLeft-1 , iTop-1, NULL ); // Top Inner
LineTo( hdc, iRight-1, iTop-1 );
@@ -773,6 +776,8 @@ static void hb_wvt_DrawBoxGet( HDC hdc, int iTop, int iLeft, int iBottom, int iR
static void hb_wvt_DrawBoxGroup( HDC hdc, int iTop, int iLeft, int iBottom, int iRight )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
SelectObject( hdc, _s->penDarkGray );
MoveToEx( hdc, iRight, iTop, NULL ); // Right Inner
@@ -807,6 +812,8 @@ static void hb_wvt_DrawBoxGroup( HDC hdc, int iTop, int iLeft, int iBottom, int
static void hb_wvt_DrawBoxGroupRaised( HDC hdc, int iTop, int iLeft, int iBottom, int iRight )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
SelectObject( hdc, _s->penWhite );
MoveToEx( hdc, iRight, iTop, NULL ); // Right Inner
@@ -840,6 +847,8 @@ static void hb_wvt_DrawBoxGroupRaised( HDC hdc, int iTop, int iLeft, int iBottom
static void hb_wvt_DrawToolButtonFlat( HDC hdc, int iTop, int iLeft, int iBottom, int iRight )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
SelectObject( hdc, _s->penGray );
MoveToEx( hdc, iRight, iTop, NULL ); // Right
@@ -859,6 +868,8 @@ static void hb_wvt_DrawToolButtonFlat( HDC hdc, int iTop, int iLeft, int iBottom
static void hb_wvt_DrawToolButtonUp( HDC hdc, int iTop, int iLeft, int iBottom, int iRight )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
SelectObject( hdc, _s->penBlack );
MoveToEx( hdc, iRight, iTop, NULL ); // Right
@@ -880,6 +891,8 @@ static void hb_wvt_DrawToolButtonUp( HDC hdc, int iTop, int iLeft, int iBottom,
static void hb_wvt_DrawToolButtonDown( HDC hdc, int iTop, int iLeft, int iBottom, int iRight )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
SelectObject( hdc, _s->penWhite );
MoveToEx( hdc, iRight, iTop, NULL ); // Right
@@ -899,6 +912,8 @@ static void hb_wvt_DrawToolButtonDown( HDC hdc, int iTop, int iLeft, int iBottom
static COLORREF hb_wvt_BgColorParam( int iParam )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
COLORREF color;
if( ISNUM( iParam ) )
@@ -916,6 +931,8 @@ static COLORREF hb_wvt_BgColorParam( int iParam )
static COLORREF hb_wvt_FgColorParam( int iParam )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
COLORREF color;
if( ISNUM( iParam ) )
@@ -937,6 +954,8 @@ static COLORREF hb_wvt_FgColorParam( int iParam )
//
HB_FUNC( WVT_SETPEN )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
int iPenWidth, iPenStyle;
COLORREF crColor;
HPEN hPen;
@@ -974,6 +993,8 @@ HB_FUNC( WVT_SETPEN )
//
HB_FUNC( WVT_SETBRUSH )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
HBRUSH hBrush;
LOGBRUSH lb = { 0,0,0 };
@@ -1010,6 +1031,8 @@ HB_FUNC( WVT_SETBRUSH )
//
HB_FUNC( WVT_DRAWBOXGET )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
POINT xy = { 0,0 };
POINT yz = { 0,0 };
@@ -1029,6 +1052,8 @@ HB_FUNC( WVT_DRAWBOXGET )
//
HB_FUNC( WVT_DRAWBOXRAISED )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parni( 5,1 );
int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parni( 5,2 );
int iBottom = ( _s->PTEXTSIZE.y * ( hb_parni( 3 ) + 1 ) ) - 1 + hb_parni( 5,3 );
@@ -1047,6 +1072,8 @@ HB_FUNC( WVT_DRAWBOXRAISED )
//
HB_FUNC( WVT_DRAWBOXRECESSED )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parni( 5,1 );
int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parni( 5,2 );
int iBottom = ( _s->PTEXTSIZE.y * ( hb_parni( 3 ) + 1 ) ) - 1 + hb_parni( 5,3 );
@@ -1065,6 +1092,8 @@ HB_FUNC( WVT_DRAWBOXRECESSED )
//
HB_FUNC( WVT_DRAWBOXGROUP )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parni( 5,1 );
int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parni( 5,2 );
int iBottom = ( _s->PTEXTSIZE.y * ( hb_parni( 3 ) + 1 ) ) - 1 + hb_parni( 5,3 );
@@ -1083,6 +1112,8 @@ HB_FUNC( WVT_DRAWBOXGROUP )
//
HB_FUNC( WVT_DRAWBOXGROUPRAISED )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parni( 5,1 );
int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parni( 5,2 );
int iBottom = ( _s->PTEXTSIZE.y * ( hb_parni( 3 ) + 1 ) ) - 1 + hb_parni( 5,3 );
@@ -1101,6 +1132,8 @@ HB_FUNC( WVT_DRAWBOXGROUPRAISED )
//
HB_FUNC( WVT_DRAWIMAGE )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
POINT xy = { 0,0 };
int iLeft, iTop, iRight, iBottom;
@@ -1135,6 +1168,8 @@ HB_FUNC( WVT_DRAWIMAGE )
//
HB_FUNC( WVT_DRAWLABEL )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
POINT xy = { 0,0 };
HFONT hFont, hOldFont, hOldFontGui;
LOGFONT logfont;// = { 0 };
@@ -1200,6 +1235,8 @@ HB_FUNC( WVT_DRAWLABEL )
//
HB_FUNC( WVT_DRAWOUTLINE )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
HPEN hPen, hOldPen, hOldPenGUI;
POINT xy = { 0,0 };
int iTop, iLeft, iBottom, iRight;
@@ -1258,6 +1295,8 @@ HB_FUNC( WVT_DRAWOUTLINE )
//
HB_FUNC( WVT_DRAWLINE )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parni( 11,1 );
int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parni( 11,2 );
int iBottom = ( _s->PTEXTSIZE.y * ( hb_parni( 3 ) + 1 ) ) - 1 + hb_parni( 11,3 );
@@ -1458,6 +1497,8 @@ HB_FUNC( WVT_DRAWLINE )
//
HB_FUNC( WVT_DRAWELLIPSE )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parni( 5,1 );
int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parni( 5,2 );
int iBottom = ( _s->PTEXTSIZE.y * ( hb_parni( 3 ) + 1 ) ) - 1 + hb_parni( 5,3 );
@@ -1479,6 +1520,8 @@ HB_FUNC( WVT_DRAWELLIPSE )
//
HB_FUNC( WVT_DRAWRECTANGLE )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parni( 5,1 );
int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parni( 5,2 );
int iBottom = ( _s->PTEXTSIZE.y * ( hb_parni( 3 ) + 1 ) ) - 1 + hb_parni( 5,3 );
@@ -1500,6 +1543,8 @@ HB_FUNC( WVT_DRAWRECTANGLE )
//
HB_FUNC( WVT_DRAWROUNDRECT )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parni( 5,1 );
int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parni( 5,2 );
int iBottom = ( _s->PTEXTSIZE.y * ( hb_parni( 3 ) + 1 ) ) - 1 + hb_parni( 5,3 );
@@ -1525,6 +1570,8 @@ HB_FUNC( WVT_DRAWROUNDRECT )
//
HB_FUNC( WVT_DRAWFOCUSRECT )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parni( 5,1 );
int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parni( 5,2 );
int iBottom = ( _s->PTEXTSIZE.y * ( hb_parni( 3 ) + 1 ) ) - 1 + hb_parni( 5,3 );
@@ -1549,6 +1596,8 @@ HB_FUNC( WVT_DRAWFOCUSRECT )
//
HB_FUNC( WVT_DRAWCOLORRECT )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parni( 5,1 );
int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parni( 5,2 );
int iBottom = ( _s->PTEXTSIZE.y * ( hb_parni( 3 ) + 1 ) ) - 1 + hb_parni( 5,3 );
@@ -1581,6 +1630,8 @@ HB_FUNC( WVT_DRAWCOLORRECT )
//
HB_FUNC( WVT_DRAWGRIDHORZ )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
int iAtRow = hb_parni( 1 );
int iRows = hb_parni( 4 );
int i, y;
@@ -1626,6 +1677,8 @@ HB_FUNC( WVT_DRAWGRIDHORZ )
//
HB_FUNC( WVT_DRAWGRIDVERT )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
int iTop, iBottom, x, i, iCharHeight, iCharWidth;
int iTabs = hb_parni( 4 );
@@ -1672,6 +1725,8 @@ HB_FUNC( WVT_DRAWGRIDVERT )
//
HB_FUNC( WVT_DRAWBUTTON )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
SIZE sz = { 0,0 };
POINT xy = { 0,0 };
RECT rc = { 0,0,0,0 };
@@ -1825,6 +1880,8 @@ HB_FUNC( WVT_DRAWBUTTON )
HB_FUNC( WVT_DRAWSTATUSBAR )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
int iPanels = hb_parni( 1 );
int i, iNext;
int iTop, iLeft, iBottom, iRight;
@@ -1893,6 +1950,8 @@ HB_FUNC( WVT_DRAWSTATUSBAR )
//
HB_FUNC( WVT_DRAWPICTURE )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
POINT xy = { 0,0 };
int iTop, iLeft, iBottom, iRight;
int iSlot = hb_parni( 5 ) - 1;
@@ -1920,6 +1979,8 @@ HB_FUNC( WVT_DRAWPICTURE )
//
HB_FUNC( WVT_DRAWLABELEX )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
POINT xy = { 0,0 };
int iSlot = hb_parni( 7 ) - 1;
@@ -1961,6 +2022,8 @@ HB_FUNC( WVT_DRAWLABELEX )
//
HB_FUNC( WVT_DRAWLINEEX )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
POINT xy = { 0,0 };
int iTop, iLeft, iBottom, iRight, iOffset ;
int iOrient, iFormat, iAlign ;
@@ -2159,6 +2222,8 @@ HB_FUNC( WVT_DRAWLINEEX )
//
HB_FUNC( WVT_DRAWOUTLINEEX )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
POINT xy = { 0,0 };
int iTop, iLeft, iBottom, iRight;
int iSlot = hb_parni( 5 ) - 1;
@@ -2186,275 +2251,14 @@ HB_FUNC( WVT_DRAWOUTLINEEX )
}
}
//-------------------------------------------------------------------//
//
// Wvt_LoadPicture( nSlot, cFilePic )
//
HB_FUNC( WVT_LOADPICTURE )
{
IPicture * iPicture = hb_wvt_gtLoadPicture( hb_parcx( 2 ) );
BOOL bResult = FALSE;
int iSlot = hb_parni( 1 ) - 1 ;
if ( iPicture )
{
if ( _s->iPicture[ iSlot ] )
{
hb_wvt_gtDestroyPicture( _s->iPicture[ iSlot ] );
}
_s->iPicture[ iSlot ] = iPicture;
bResult = TRUE;
}
hb_retl( bResult );
}
//-------------------------------------------------------------------//
HB_FUNC( WVT_LOADPICTUREFROMRESOURCE )
{
IPicture * iPicture = hb_wvt_gtLoadPictureFromResource( hb_parcx( 2 ),hb_parcx( 3 ) );
BOOL bResult = FALSE;
int iSlot = hb_parni( 1 ) - 1 ;
if ( iPicture )
{
if ( _s->iPicture[ iSlot ] )
{
hb_wvt_gtDestroyPicture( _s->iPicture[ iSlot ] );
}
_s->iPicture[ iSlot ] = iPicture;
bResult = TRUE;
}
hb_retl( bResult );
}
//-------------------------------------------------------------------//
//
// Wvt_LoadFont( nSlotFont, cFontFace, nHeight, nWidth, nWeight, lItalic, lUnderline, lStrikeout,
// nCharSet, nQuality, nEscapement )
//
HB_FUNC( WVT_LOADFONT )
{
LOGFONT logfont;// = { 0 };
int iSlot = hb_parni( 1 ) - 1;
HFONT hFont;
logfont.lfEscapement = ( ISNIL( 11 ) ? 0 : ( hb_parni( 11 ) * 10 ) );
logfont.lfOrientation = 0;
logfont.lfWeight = ( ISNIL( 5 ) ? 0 : hb_parni( 5 ) );
logfont.lfItalic = ( ISNIL( 6 ) ? 0 : hb_parl( 6 ) );
logfont.lfUnderline = ( ISNIL( 7 ) ? 0 : hb_parl( 7 ) );
logfont.lfStrikeOut = ( ISNIL( 8 ) ? 0 : hb_parl( 8 ) );
logfont.lfCharSet = ( ISNIL( 9 ) ? _s->CodePage : hb_parni( 9 ) );
logfont.lfOutPrecision = 0;
logfont.lfClipPrecision = 0;
logfont.lfQuality = ( ISNIL( 10 ) ? DEFAULT_QUALITY : hb_parni( 10 ) );
logfont.lfPitchAndFamily = FF_DONTCARE;
logfont.lfHeight = ( ISNIL( 3 ) ? _s->fontHeight : hb_parni( 3 ) );
logfont.lfWidth = ( ISNIL( 4 ) ? ( _s->fontWidth < 0 ? -_s->fontWidth : _s->fontWidth ) : hb_parni( 4 ) );
//strcpy( logfont.lfFaceName, ( ISNIL( 2 ) ? _s->fontFace : hb_parcx( 2 ) ) );
HB_TCHAR_CPTO( logfont.lfFaceName, ( ISNIL( 2 ) ? _s->fontFace : hb_parcx( 2 ) ), sizeof( logfont.lfFaceName )-1 );
hFont = CreateFontIndirect( &logfont );
if ( hFont )
{
if ( _s->hUserFonts[ iSlot ] )
{
DeleteObject( _s->hUserFonts[ iSlot ] );
}
_s->hUserFonts[ iSlot ] = hFont;
}
}
//-------------------------------------------------------------------//
//
// Wvt_LoadPen( nSlot, nStyle, nWidth, nRGBColor )
//
HB_FUNC( WVT_LOADPEN )
{
int iPenWidth, iPenStyle;
COLORREF crColor;
HPEN hPen;
int iSlot = hb_parni( 1 ) - 1;
iPenStyle = ISNIL( 2 ) ? 0 : hb_parni( 2 ) ;
iPenWidth = ISNIL( 3 ) ? 0 : hb_parni( 3 );
crColor = ISNIL( 4 ) ? RGB( 0,0,0 ) : ( COLORREF ) hb_parnl( 4 );
hPen = CreatePen( iPenStyle, iPenWidth, crColor );
if ( hPen )
{
if ( _s->hUserPens[ iSlot ] )
{
DeleteObject( _s->hUserPens[ iSlot ] );
}
_s->hUserPens[ iSlot ] = hPen;
hb_retl( TRUE );
}
else
{
hb_retl( FALSE );
}
}
//-------------------------------------------------------------------//
//
// aScr := Wvt_SaveScreen( nTop, nLeft, nBottom, nRight )
//
HB_FUNC( WVT_SAVESCREEN )
{
HBITMAP hBmp, oldBmp;
POINT xy = { 0,0 };
int iTop, iLeft, iBottom, iRight, iWidth, iHeight;
PHB_ITEM info = hb_itemArrayNew( 3 );
PHB_ITEM temp = hb_itemNew( NULL );
xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) );
iTop = xy.y;
iLeft = xy.x;
xy = hb_wvt_gtGetXYFromColRow( hb_parni( 4 ) + 1, hb_parni( 3 ) + 1 );
iBottom = xy.y-1;
iRight = xy.x-1;
iWidth = iRight - iLeft + 1;
iHeight = iBottom - iTop + 1;
hBmp = CreateCompatibleBitmap( _s->hdc, iWidth, iHeight ) ;
oldBmp = (HBITMAP) SelectObject( _s->hCompDC, hBmp );
BitBlt( _s->hCompDC, 0, 0, iWidth, iHeight, _s->hdc, iLeft, iTop, SRCCOPY );
SelectObject( _s->hCompDC, oldBmp );
hb_arraySet( info, 1, hb_itemPutNI( temp, iWidth ) );
hb_arraySet( info, 2, hb_itemPutNI( temp, iHeight ) );
hb_arraySet( info, 3, hb_itemPutNL( temp, ( ULONG ) hBmp ) );
hb_itemRelease( temp );
hb_itemReturn( info );
hb_itemRelease( info );
}
//-------------------------------------------------------------------//
//
// Wvt_RestScreen( nTop, nLeft, nBottom, nRight, aScr, lDoNotDestroyBMP )
//
HB_FUNC( WVT_RESTSCREEN )
{
POINT xy = { 0,0 };
int iTop, iLeft, iBottom, iRight, iWidth, iHeight;
HBITMAP hBmp;
BOOL bResult = FALSE;
BOOL bDoNotDestroyBMP = ISNIL( 6 ) ? FALSE : hb_parl( 6 );
xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) );
iTop = xy.y;
iLeft = xy.x;
xy = hb_wvt_gtGetXYFromColRow( hb_parni( 4 ) + 1, hb_parni( 3 ) + 1 );
iBottom = xy.y-1;
iRight = xy.x-1;
iWidth = iRight - iLeft + 1 ;
iHeight = iBottom - iTop + 1 ;
hBmp = (HBITMAP) SelectObject( _s->hCompDC, ( HBITMAP ) hb_parnl( 5,3 ) );
if ( hBmp )
{
if ( ( iWidth == hb_parni( 5,1 ) ) && ( iHeight == hb_parni( 5,2 ) ) )
{
if ( BitBlt( _s->hdc,
iLeft,
iTop,
iWidth,
iHeight,
_s->hCompDC,
0,
0,
SRCCOPY ) )
{
bResult = TRUE;
}
}
else
{
if ( StretchBlt( _s->hdc,
iLeft,
iTop,
iWidth,
iHeight,
_s->hCompDC,
0,
0,
hb_parni( 5,1 ),
hb_parni( 5,2 ),
SRCCOPY ) )
{
bResult = TRUE;
}
}
}
SelectObject( _s->hCompDC, hBmp );
if ( ! bDoNotDestroyBMP )
{
DeleteObject( ( HBITMAP ) hb_parnl( 5,3 ) );
}
hb_retl( bResult );
}
//-------------------------------------------------------------------//
//
// Wvt_CreateFont( cFontFace, nHeight, nWidth, nWeight, lItalic, lUnderline,
// lStrikeout, nCharSet, nQuality, nEscapement )
//
HB_FUNC( WVT_CREATEFONT )
{
LOGFONT logfont;// = { 0,0,0 };
HFONT hFont;
logfont.lfEscapement = ( ISNIL( 10 ) ? 0 : ( hb_parni( 10 ) * 10 ) );
logfont.lfOrientation = 0;
logfont.lfWeight = ( ISNIL( 4 ) ? 0 : hb_parni( 4 ) );
logfont.lfItalic = ( ISNIL( 5 ) ? 0 : hb_parl( 5 ) );
logfont.lfUnderline = ( ISNIL( 6 ) ? 0 : hb_parl( 6 ) );
logfont.lfStrikeOut = ( ISNIL( 7 ) ? 0 : hb_parl( 7 ) );
logfont.lfCharSet = ( ISNIL( 8 ) ? _s->CodePage : hb_parni( 8 ) );
logfont.lfOutPrecision = 0;
logfont.lfClipPrecision = 0;
logfont.lfQuality = ( ISNIL( 9 ) ? DEFAULT_QUALITY : hb_parni( 9 ) );
logfont.lfPitchAndFamily = FF_DONTCARE;
logfont.lfHeight = ( ISNIL( 2 ) ? _s->fontHeight : hb_parni( 2 ) );
logfont.lfWidth = ( ISNIL( 3 ) ? ( _s->fontWidth < 0 ? -_s->fontWidth : _s->fontWidth ) : hb_parni( 3 ) );
//strcpy( logfont.lfFaceName, ( ISNIL( 1 ) ? _s->fontFace : hb_parcx( 1 ) ) );
HB_TCHAR_CPTO( logfont.lfFaceName, ( ISNIL( 1 ) ? _s->fontFace : hb_parcx( 1 ) ), sizeof( logfont.lfFaceName )-1 );
hFont = CreateFontIndirect( &logfont );
if ( hFont )
{
hb_retnl( ( ULONG ) hFont );
}
else
{
hb_retnl( 0 );
}
}
//-------------------------------------------------------------------//
//----------------------------------------------------------------------//
//
// WVT_DRAWLABELOBJ( nTop, nLeft, nBottom, nRight, cLabel, nAlignHorz, nAlignVert, nTextColor, nBkColor, hFont )
//
HB_FUNC( WVT_DRAWLABELOBJ )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
POINT xy = { 0,0 };
RECT rect = { 0,0,0,0 };
int iTop, iLeft, iBottom, iRight, x, y;
@@ -2551,6 +2355,8 @@ HB_FUNC( WVT_DRAWLABELOBJ )
//
HB_FUNC( WVT_DRAWTOOLBUTTONSTATE )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parni( 5,1 );
int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parni( 5,2 );
int iBottom = ( _s->PTEXTSIZE.y * ( hb_parni( 3 ) + 1 ) ) - 1 + hb_parni( 5,3 );
@@ -2597,6 +2403,8 @@ HB_FUNC( WVT_DRAWTOOLBUTTONSTATE )
//
HB_FUNC( WVT_DRAWSCROLLBUTTON )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parni( 5,1 );
int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parni( 5,2 );
int iBottom = ( _s->PTEXTSIZE.y * ( hb_parni( 3 ) + 1 ) ) - 1 + hb_parni( 5,3 );
@@ -2701,6 +2509,8 @@ HB_FUNC( WVT_DRAWSCROLLBUTTON )
//
HB_FUNC( WVT_DRAWSCROLLTHUMBVERT )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parni( 5,1 );
int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parni( 5,2 );
int iBottom = ( _s->PTEXTSIZE.y * ( hb_parni( 3 ) + 1 ) ) - 1 + hb_parni( 5,3 );
@@ -2753,6 +2563,8 @@ HB_FUNC( WVT_DRAWSCROLLTHUMBVERT )
//
HB_FUNC( WVT_DRAWSCROLLTHUMBHORZ )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parni( 5,1 );
int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parni( 5,2 );
int iBottom = ( _s->PTEXTSIZE.y * ( hb_parni( 3 ) + 1 ) ) - 1 + hb_parni( 5,3 );
@@ -2804,6 +2616,8 @@ HB_FUNC( WVT_DRAWSCROLLTHUMBHORZ )
//
HB_FUNC( WVT_DRAWSHADEDRECT )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
BOOL bGF = FALSE;
if ( _s->hMSImg32 )
@@ -2853,6 +2667,8 @@ HB_FUNC( WVT_DRAWSHADEDRECT )
//
HB_FUNC( WVT_DRAWTEXTBOX )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parni( 5,1 );
int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parni( 5,2 );
int iBottom = ( _s->PTEXTSIZE.y * ( hb_parni( 3 ) + 1 ) ) - 1 + hb_parni( 5,3 );
@@ -2915,6 +2731,8 @@ HB_FUNC( WVT_DRAWTEXTBOX )
//
HB_FUNC( WVT_DRAWPROGRESSBAR )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parni( 5,1 );
int iLeft = ( _s->PTEXTSIZE.x * hb_parni( 2 ) ) + hb_parni( 5,2 );
int iBottom = ( _s->PTEXTSIZE.y * ( hb_parni( 3 ) + 1 ) ) - 1 + hb_parni( 5,3 );
@@ -3001,5 +2819,278 @@ HB_FUNC( WVT_DRAWPROGRESSBAR )
}
//-------------------------------------------------------------------//
//
// Wvt_CreateFont( cFontFace, nHeight, nWidth, nWeight, lItalic, lUnderline,
// lStrikeout, nCharSet, nQuality, nEscapement )
//
HB_FUNC( WVT_CREATEFONT )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
LOGFONT logfont;// = { 0,0,0 };
HFONT hFont;
logfont.lfEscapement = ( ISNIL( 10 ) ? 0 : ( hb_parni( 10 ) * 10 ) );
logfont.lfOrientation = 0;
logfont.lfWeight = ( ISNIL( 4 ) ? 0 : hb_parni( 4 ) );
logfont.lfItalic = ( ISNIL( 5 ) ? 0 : hb_parl( 5 ) );
logfont.lfUnderline = ( ISNIL( 6 ) ? 0 : hb_parl( 6 ) );
logfont.lfStrikeOut = ( ISNIL( 7 ) ? 0 : hb_parl( 7 ) );
logfont.lfCharSet = ( ISNIL( 8 ) ? _s->CodePage : hb_parni( 8 ) );
logfont.lfOutPrecision = 0;
logfont.lfClipPrecision = 0;
logfont.lfQuality = ( ISNIL( 9 ) ? DEFAULT_QUALITY : hb_parni( 9 ) );
logfont.lfPitchAndFamily = FF_DONTCARE;
logfont.lfHeight = ( ISNIL( 2 ) ? _s->fontHeight : hb_parni( 2 ) );
logfont.lfWidth = ( ISNIL( 3 ) ? ( _s->fontWidth < 0 ? -_s->fontWidth : _s->fontWidth ) : hb_parni( 3 ) );
//strcpy( logfont.lfFaceName, ( ISNIL( 1 ) ? _s->fontFace : hb_parcx( 1 ) ) );
HB_TCHAR_CPTO( logfont.lfFaceName, ( ISNIL( 1 ) ? _s->fontFace : hb_parcx( 1 ) ), sizeof( logfont.lfFaceName )-1 );
hFont = CreateFontIndirect( &logfont );
if ( hFont )
{
hb_retnl( ( ULONG ) hFont );
}
else
{
hb_retnl( 0 );
}
}
//-------------------------------------------------------------------//
//
// Wvt_LoadPicture( nSlot, cFilePic )
//
HB_FUNC( WVT_LOADPICTURE )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
IPicture * iPicture = hb_wvt_gtLoadPicture( hb_parcx( 2 ) );
BOOL bResult = FALSE;
int iSlot = hb_parni( 1 ) - 1 ;
if ( iPicture )
{
if ( _s->iPicture[ iSlot ] )
{
hb_wvt_gtDestroyPicture( _s->iPicture[ iSlot ] );
}
_s->iPicture[ iSlot ] = iPicture;
bResult = TRUE;
}
hb_retl( bResult );
}
//-------------------------------------------------------------------//
HB_FUNC( WVT_LOADPICTUREFROMRESOURCE )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
IPicture * iPicture = hb_wvt_gtLoadPictureFromResource( hb_parcx( 2 ),hb_parcx( 3 ) );
BOOL bResult = FALSE;
int iSlot = hb_parni( 1 ) - 1 ;
if ( iPicture )
{
if ( _s->iPicture[ iSlot ] )
{
hb_wvt_gtDestroyPicture( _s->iPicture[ iSlot ] );
}
_s->iPicture[ iSlot ] = iPicture;
bResult = TRUE;
}
hb_retl( bResult );
}
//-------------------------------------------------------------------//
//
// Wvt_LoadFont( nSlotFont, cFontFace, nHeight, nWidth, nWeight, lItalic, lUnderline, lStrikeout,
// nCharSet, nQuality, nEscapement )
//
HB_FUNC( WVT_LOADFONT )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
LOGFONT logfont;// = { 0 };
int iSlot = hb_parni( 1 ) - 1;
HFONT hFont;
logfont.lfEscapement = ( ISNIL( 11 ) ? 0 : ( hb_parni( 11 ) * 10 ) );
logfont.lfOrientation = 0;
logfont.lfWeight = ( ISNIL( 5 ) ? 0 : hb_parni( 5 ) );
logfont.lfItalic = ( ISNIL( 6 ) ? 0 : hb_parl( 6 ) );
logfont.lfUnderline = ( ISNIL( 7 ) ? 0 : hb_parl( 7 ) );
logfont.lfStrikeOut = ( ISNIL( 8 ) ? 0 : hb_parl( 8 ) );
logfont.lfCharSet = ( ISNIL( 9 ) ? _s->CodePage : hb_parni( 9 ) );
logfont.lfOutPrecision = 0;
logfont.lfClipPrecision = 0;
logfont.lfQuality = ( ISNIL( 10 ) ? DEFAULT_QUALITY : hb_parni( 10 ) );
logfont.lfPitchAndFamily = FF_DONTCARE;
logfont.lfHeight = ( ISNIL( 3 ) ? _s->fontHeight : hb_parni( 3 ) );
logfont.lfWidth = ( ISNIL( 4 ) ? ( _s->fontWidth < 0 ? -_s->fontWidth : _s->fontWidth ) : hb_parni( 4 ) );
//strcpy( logfont.lfFaceName, ( ISNIL( 2 ) ? _s->fontFace : hb_parcx( 2 ) ) );
HB_TCHAR_CPTO( logfont.lfFaceName, ( ISNIL( 2 ) ? _s->fontFace : hb_parcx( 2 ) ), sizeof( logfont.lfFaceName )-1 );
hFont = CreateFontIndirect( &logfont );
if ( hFont )
{
if ( _s->hUserFonts[ iSlot ] )
{
DeleteObject( _s->hUserFonts[ iSlot ] );
}
_s->hUserFonts[ iSlot ] = hFont;
}
}
//-------------------------------------------------------------------//
//
// Wvt_LoadPen( nSlot, nStyle, nWidth, nRGBColor )
//
HB_FUNC( WVT_LOADPEN )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
int iPenWidth, iPenStyle;
COLORREF crColor;
HPEN hPen;
int iSlot = hb_parni( 1 ) - 1;
iPenStyle = ISNIL( 2 ) ? 0 : hb_parni( 2 ) ;
iPenWidth = ISNIL( 3 ) ? 0 : hb_parni( 3 );
crColor = ISNIL( 4 ) ? RGB( 0,0,0 ) : ( COLORREF ) hb_parnl( 4 );
hPen = CreatePen( iPenStyle, iPenWidth, crColor );
if ( hPen )
{
if ( _s->hUserPens[ iSlot ] )
{
DeleteObject( _s->hUserPens[ iSlot ] );
}
_s->hUserPens[ iSlot ] = hPen;
hb_retl( TRUE );
}
else
{
hb_retl( FALSE );
}
}
//-------------------------------------------------------------------//
//
// aScr := Wvt_SaveScreen( nTop, nLeft, nBottom, nRight )
//
HB_FUNC( WVT_SAVESCREEN )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
HBITMAP hBmp, oldBmp;
POINT xy = { 0,0 };
int iTop, iLeft, iBottom, iRight, iWidth, iHeight;
PHB_ITEM info = hb_itemArrayNew( 3 );
PHB_ITEM temp = hb_itemNew( NULL );
xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) );
iTop = xy.y;
iLeft = xy.x;
xy = hb_wvt_gtGetXYFromColRow( hb_parni( 4 ) + 1, hb_parni( 3 ) + 1 );
iBottom = xy.y-1;
iRight = xy.x-1;
iWidth = iRight - iLeft + 1;
iHeight = iBottom - iTop + 1;
hBmp = CreateCompatibleBitmap( _s->hdc, iWidth, iHeight ) ;
oldBmp = (HBITMAP) SelectObject( _s->hCompDC, hBmp );
BitBlt( _s->hCompDC, 0, 0, iWidth, iHeight, _s->hdc, iLeft, iTop, SRCCOPY );
SelectObject( _s->hCompDC, oldBmp );
hb_arraySet( info, 1, hb_itemPutNI( temp, iWidth ) );
hb_arraySet( info, 2, hb_itemPutNI( temp, iHeight ) );
hb_arraySet( info, 3, hb_itemPutNL( temp, ( ULONG ) hBmp ) );
hb_itemRelease( temp );
hb_itemReturnRelease( info );
}
//-------------------------------------------------------------------//
//
// Wvt_RestScreen( nTop, nLeft, nBottom, nRight, aScr, lDoNotDestroyBMP )
//
HB_FUNC( WVT_RESTSCREEN )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
POINT xy = { 0,0 };
int iTop, iLeft, iBottom, iRight, iWidth, iHeight;
HBITMAP hBmp;
BOOL bResult = FALSE;
BOOL bDoNotDestroyBMP = ISNIL( 6 ) ? FALSE : hb_parl( 6 );
xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) );
iTop = xy.y;
iLeft = xy.x;
xy = hb_wvt_gtGetXYFromColRow( hb_parni( 4 ) + 1, hb_parni( 3 ) + 1 );
iBottom = xy.y-1;
iRight = xy.x-1;
iWidth = iRight - iLeft + 1 ;
iHeight = iBottom - iTop + 1 ;
hBmp = (HBITMAP) SelectObject( _s->hCompDC, ( HBITMAP ) hb_parnl( 5,3 ) );
if ( hBmp )
{
if ( ( iWidth == hb_parni( 5,1 ) ) && ( iHeight == hb_parni( 5,2 ) ) )
{
if ( BitBlt( _s->hdc,
iLeft,
iTop,
iWidth,
iHeight,
_s->hCompDC,
0,
0,
SRCCOPY ) )
{
bResult = TRUE;
}
}
else
{
if ( StretchBlt( _s->hdc,
iLeft,
iTop,
iWidth,
iHeight,
_s->hCompDC,
0,
0,
hb_parni( 5,1 ),
hb_parni( 5,2 ),
SRCCOPY ) )
{
bResult = TRUE;
}
}
}
SelectObject( _s->hCompDC, hBmp );
if ( ! bDoNotDestroyBMP )
{
DeleteObject( ( HBITMAP ) hb_parnl( 5,3 ) );
}
hb_retl( bResult );
}
//-------------------------------------------------------------------//

View File

@@ -61,7 +61,6 @@
#include 'wvtwin.ch'
#include 'common.ch'
//#include 'xhb.ch'
//-------------------------------------------------------------------//
@@ -567,17 +566,7 @@ FUNCTION WVT_GetSaveFileName( hWnd, cFile, cTitle, aFilter, nFlags, cIniDir, cDe
//----------------------------------------------------------------------//
#include 'hbgtinfo.ch'
// Eventually the defines below should go into hbgtinfo.ch
//
#define HB_GTI_SETFONT 71
#define HB_GTI_USER 1000
#define HB_GTU_WINDOWHANDLE 1
#define HB_GTU_CENTERWINDOW 2
#define HB_GTU_PROCESSMESSAGES 3
#define HB_GTU_KEYBOARD 4
#define HB_GTU_RESETWINDOW 5
#include 'hbgtwvg.ch'
//----------------------------------------------------------------------//
@@ -664,59 +653,59 @@ FUNCTION Wvt_GetScreenHeight()
//-------------------------------------------------------------------//
FUNCTION WVT_GETWINDOWHANDLE()
FUNCTION Wvt_GetWindowHandle()
RETURN Hb_GtInfo( HB_GTI_USER, HB_GTU_WINDOWHANDLE )
RETURN Hb_GtInfo( HB_GTI_SPEC, HB_GTS_WINDOWHANDLE )
//-------------------------------------------------------------------//
FUNCTION WVT_CENTERWINDOW( lCenter, lRePaint )
FUNCTION Wvt_CenterWindow( lCenter, lRePaint )
DEFAULT lCenter TO .t.
DEFAULT lRePaint TO .f.
RETURN Hb_GtInfo( HB_GTI_USER, HB_GTU_CENTERWINDOW, { lCenter, lRePaint } )
RETURN Hb_GtInfo( HB_GTI_SPEC, HB_GTS_CENTERWINDOW, { lCenter, lRePaint } )
//-------------------------------------------------------------------//
FUNCTION WVT_SETWINDOWCENTRE( lCenter, lRePaint )
FUNCTION Wvt_WindowCentre( lCenter, lRePaint )
DEFAULT lCenter TO .t.
DEFAULT lRePaint TO .f.
RETURN Hb_GtInfo( HB_GTI_USER, HB_GTU_CENTERWINDOW, { lCenter, lRePaint } )
RETURN Hb_GtInfo( HB_GTI_SPEC, HB_GTS_CENTERWINDOW, { lCenter, lRePaint } )
//-------------------------------------------------------------------//
FUNCTION WVT_PROCESSMESSAGES()
FUNCTION Wvt_ProcessMessages()
Hb_GtInfo( HB_GTI_USER, HB_GTU_PROCESSMESSAGES )
Hb_GtInfo( HB_GTI_SPEC, HB_GTS_PROCESSMESSAGES )
RETURN .t.
//----------------------------------------------------------------------//
//-------------------------------------------------------------------//
FUNCTION WVT_KEYBOARD( nKey )
FUNCTION Wvt_KeyBoard( nKey )
Hb_GtInfo( HB_GTI_USER, HB_GTU_KEYBOARD, nKey )
Hb_GtInfo( HB_GTI_SPEC, HB_GTS_KEYBOARD, nKey )
RETURN NIL
//-------------------------------------------------------------------//
FUNCTION WVT_GETCLIPBOARD()
FUNCTION Wvt_GetClipboard()
RETURN Hb_GtInfo( HB_GTI_CLIPBOARDDATA )
//-------------------------------------------------------------------//
FUNCTION WVT_SETCLIPBOARD( cText )
FUNCTION Wvt_SetClipboard( cText )
RETURN Hb_GtInfo( HB_GTI_CLIPBOARDDATA, cText )
//-------------------------------------------------------------------//
FUNCTION WVT_PASTEFROMCLIPBOARD()
FUNCTION Wvt_PasteFromClipboard()
Local cText, nLen, i
cText := Hb_GtInfo( HB_GTI_CLIPBOARDDATA )
@@ -732,6 +721,72 @@ FUNCTION WVT_PASTEFROMCLIPBOARD()
FUNCTION Wvt_ResetWindow()
RETURN Hb_GtInfo( HB_GTI_USER, HB_GTU_RESETWINDOW )
RETURN Hb_GtInfo( HB_GTI_SPEC, HB_GTS_RESETWINDOW )
//----------------------------------------------------------------------//
//-------------------------------------------------------------------//
FUNCTION Wvt_SetTimer( nTimerID, nMiliSeconds )
RETURN Hb_GtInfo( HB_GTI_SPEC, HB_GTS_SETTIMER, { nTimerID, nMiliSeconds } )
//-------------------------------------------------------------------//
FUNCTION Wvt_KillTimer( nTimerID )
RETURN Hb_GtInfo( HB_GTI_SPEC, HB_GTS_KILLTIMER, nTimerID )
//-------------------------------------------------------------------//
FUNCTION Wvt_SetOnTop()
RETURN Hb_GtInfo( HB_GTI_SPEC, HB_GTS_WNDSTATE, WNDS_SETONTOP )
//-------------------------------------------------------------------//
FUNCTION Wvt_SetAsNormal()
RETURN Hb_GtInfo( HB_GTI_SPEC, HB_GTS_WNDSTATE, WNDS_SETASNORMAL )
//-------------------------------------------------------------------//
FUNCTION Wvt_Minimize()
RETURN Hb_GtInfo( HB_GTI_SPEC, HB_GTS_WNDSTATE, WNDS_MINIMIZED )
//-------------------------------------------------------------------//
FUNCTION Wvt_Maximize()
RETURN Hb_GtInfo( HB_GTI_SPEC, HB_GTS_WNDSTATE, WNDS_MAXIMIZED )
//-------------------------------------------------------------------//
FUNCTION Wvt_Hide()
RETURN Hb_GtInfo( HB_GTI_SPEC, HB_GTS_WNDSTATE, WNDS_HIDDEN )
//-------------------------------------------------------------------//
FUNCTION Wvt_Show()
RETURN Hb_GtInfo( HB_GTI_SPEC, HB_GTS_WNDSTATE, WNDS_NORMAL )
//-------------------------------------------------------------------//
FUNCTION Wvt_SetWindowPos( nX, nY )
RETURN Hb_GtInfo( HB_GTI_SPEC, HB_GTS_SETPOSITION, { nX, nY } )
//-------------------------------------------------------------------//
FUNCTION Wvt_ShowWindow( nState )
RETURN Hb_GtInfo( HB_GTI_SPEC, HB_GTS_SHOWWINDOW, nState )
//-------------------------------------------------------------------//
FUNCTION Wvt_Update()
RETURN Hb_GtInfo( HB_GTI_SPEC, HB_GTS_UPDATEWINDOW )
//-------------------------------------------------------------------//

View File

@@ -87,10 +87,6 @@ BOOL WINAPI ChooseColor( LPCHOOSECOLORW );
//-------------------------------------------------------------------//
static GLOBAL_DATA *_s = NULL;
//-------------------------------------------------------------------//
HB_EXTERN_BEGIN
extern HANDLE hb_hInstance;
@@ -117,16 +113,9 @@ HB_EXTERN_END
//-------------------------------------------------------------------//
//-------------------------------------------------------------------//
void HB_EXPORT hb_wvt_wvtUtils( void )
{
_s = hb_wvt_gtGetGlobalData();
}
//-------------------------------------------------------------------//
HB_FUNC( WVT_UTILS )
{
hb_wvt_wvtUtils();
// Retained for legacy code.
}
//-------------------------------------------------------------------//
@@ -136,6 +125,8 @@ HB_FUNC( WVT_UTILS )
//
HB_FUNC( WVT_CHOOSEFONT )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
CHOOSEFONT cf;// = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };
LOGFONT lf;// = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0 };
LONG PointSize = 0;
@@ -216,6 +207,8 @@ HB_FUNC( WVT_CHOOSEFONT )
//
HB_FUNC( WVT_CHOOSECOLOR )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
CHOOSECOLOR cc ;
COLORREF crCustClr[ 16 ] ;
int i ;
@@ -247,6 +240,8 @@ HB_FUNC( WVT_CHOOSECOLOR )
//
HB_FUNC( WVT_MESSAGEBOX )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
LPTSTR title = HB_TCHAR_CONVTO( hb_parc( 1 ) );
LPTSTR msg = HB_TCHAR_CONVTO( hb_parc( 2 ) );
hb_retni( MessageBox( _s->hWnd, title, msg, ISNIL( 3 ) ? MB_OK : hb_parni( 3 ) ) ) ;
@@ -264,6 +259,8 @@ HB_FUNC( WVT_MESSAGEBOX )
HB_FUNC( WVT_SETTOOLTIPACTIVE )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
BOOL bActive = _s->bToolTipActive;
if ( ! ISNIL( 1 ) )
@@ -280,6 +277,8 @@ HB_FUNC( WVT_SETTOOLTIPACTIVE )
//
HB_FUNC( WVT_SETTOOLTIP )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
TOOLINFO ti;
POINT xy = { 0,0 };
int iTop, iLeft, iBottom, iRight;
@@ -323,6 +322,8 @@ HB_FUNC( WVT_SETTOOLTIP )
HB_FUNC( WVT_SETTOOLTIPTEXT )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
TOOLINFO ti;
ti.cbSize = sizeof( TOOLINFO );
@@ -343,6 +344,8 @@ HB_FUNC( WVT_SETTOOLTIPTEXT )
HB_FUNC( WVT_SETTOOLTIPMARGIN )
{
#if !defined( __WINCE__ )
PHB_GTWVT _s = hb_wvt_gtGetWVT();
RECT rc = { 0,0,0,0 };
rc.left = hb_parni( 2 );
@@ -359,6 +362,8 @@ HB_FUNC( WVT_SETTOOLTIPMARGIN )
HB_FUNC( WVT_SETTOOLTIPWIDTH )
{
#if !defined( __WINCE__ )
PHB_GTWVT _s = hb_wvt_gtGetWVT();
int iTipWidth = SendMessage( _s->hWndTT, TTM_GETMAXTIPWIDTH, 0, 0 );
if ( ISNUM( 1 ) )
@@ -375,6 +380,8 @@ HB_FUNC( WVT_SETTOOLTIPWIDTH )
HB_FUNC( WVT_SETTOOLTIPBKCOLOR )
{
#if !defined( __WINCE__ )
PHB_GTWVT _s = hb_wvt_gtGetWVT();
COLORREF cr = SendMessage( _s->hWndTT, TTM_GETTIPBKCOLOR, 0, 0 );
if ( ISNUM( 1 ) )
@@ -390,6 +397,8 @@ HB_FUNC( WVT_SETTOOLTIPBKCOLOR )
HB_FUNC( WVT_SETTOOLTIPTEXTCOLOR )
{
#if !defined( __WINCE__ )
PHB_GTWVT _s = hb_wvt_gtGetWVT();
COLORREF cr = SendMessage( _s->hWndTT, TTM_GETTIPTEXTCOLOR, 0, 0 );
if ( ISNUM( 1 ) )
@@ -407,6 +416,8 @@ HB_FUNC( WVT_SETTOOLTIPTEXTCOLOR )
HB_FUNC( WVT_SETTOOLTIPTITLE )
{
#if !defined( __WINCE__ )
PHB_GTWVT _s = hb_wvt_gtGetWVT();
int iIcon;
if ( ! ISNIL( 2 ) )
@@ -427,6 +438,8 @@ HB_FUNC( WVT_SETTOOLTIPTITLE )
HB_FUNC( WVT_GETTOOLTIPWIDTH )
{
#if !defined( __WINCE__ )
PHB_GTWVT _s = hb_wvt_gtGetWVT();
hb_retni( SendMessage( _s->hWndTT, TTM_GETMAXTIPWIDTH, 0, 0 ) );
#endif
}
@@ -436,6 +449,8 @@ HB_FUNC( WVT_GETTOOLTIPWIDTH )
HB_FUNC( WVT_GETTOOLTIPBKCOLOR )
{
#if !defined( __WINCE__ )
PHB_GTWVT _s = hb_wvt_gtGetWVT();
hb_retnl( ( COLORREF ) SendMessage( _s->hWndTT, TTM_GETTIPBKCOLOR, 0, 0 ) );
#endif
}
@@ -445,6 +460,8 @@ HB_FUNC( WVT_GETTOOLTIPBKCOLOR )
HB_FUNC( WVT_GETTOOLTIPTEXTCOLOR )
{
#if !defined( __WINCE__ )
PHB_GTWVT _s = hb_wvt_gtGetWVT();
hb_retnl( ( COLORREF ) SendMessage( _s->hWndTT, TTM_GETTIPTEXTCOLOR, 0, 0 ) );
#endif
}
@@ -455,9 +472,11 @@ HB_FUNC( WVT_GETTOOLTIPTEXTCOLOR )
HB_FUNC( WVT_SETGUI )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
BOOL bGui = _s->bGui;
if ( ! ISNIL( 1 ) )
if ( ISLOG( 1 ) )
{
_s->bGui = hb_parl( 1 );
}
@@ -467,82 +486,10 @@ HB_FUNC( WVT_SETGUI )
//-------------------------------------------------------------------//
HB_FUNC( WVT_SETTIMER )
{
hb_retl( SetTimer( _s->hWnd, hb_parni( 1 ), hb_parni( 2 ), NULL ) );
}
//-------------------------------------------------------------------//
HB_FUNC( WVT_KILLTIMER )
{
hb_retl( KillTimer( _s->hWnd, hb_parni( 1 ) ) );
}
//-------------------------------------------------------------------//
HB_FUNC( WVT_SETONTOP )
{
RECT rect = { 0,0,0,0 };
GetWindowRect( _s->hWnd, &rect );
hb_retl( SetWindowPos( _s->hWnd, HWND_TOPMOST,
rect.left,
rect.top,
0,
0,
SWP_NOSIZE + SWP_NOMOVE + SWP_NOACTIVATE ) );
}
//-------------------------------------------------------------------//
HB_FUNC( WVT_SETASNORMAL )
{
RECT rect = { 0,0,0,0 };
GetWindowRect( _s->hWnd, &rect );
hb_retl( SetWindowPos( _s->hWnd, HWND_NOTOPMOST,
rect.left,
rect.top,
0,
0,
SWP_NOSIZE + SWP_NOMOVE + SWP_NOACTIVATE ) );
}
//-------------------------------------------------------------------//
HB_FUNC( WVT_MINIMIZE )
{
ShowWindow( _s->hWnd, SW_MINIMIZE );
}
//-------------------------------------------------------------------//
HB_FUNC( WVT_MAXIMIZE )
{
ShowWindow( _s->hWnd, SW_RESTORE );
}
//-------------------------------------------------------------------//
HB_FUNC( WVT_HIDE )
{
ShowWindow( _s->hWnd, SW_HIDE );
}
//-------------------------------------------------------------------//
HB_FUNC( WVT_SHOW )
{
ShowWindow( _s->hWnd, SW_SHOWNORMAL );
}
//-------------------------------------------------------------------//
HB_FUNC( WVT_SETMOUSEPOS )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
POINT xy = { 0,0 };
xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) );
@@ -561,6 +508,8 @@ HB_FUNC( WVT_SETMOUSEPOS )
HB_FUNC( WVT_GETPAINTRECT )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
PHB_ITEM info = hb_itemArrayNew( 4 );
hb_arraySetNI( info, 1, _s->rowStart );
@@ -575,6 +524,8 @@ HB_FUNC( WVT_GETPAINTRECT )
HB_FUNC( WVT_SETPOINTER )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
int iCursor = hb_parni( 1 );
HCURSOR hCursor;
@@ -654,24 +605,10 @@ HB_FUNC( WVT_SETPOINTER )
//-------------------------------------------------------------------//
HB_FUNC( WVT_SETWINDOWPOS )
{
RECT rect = { 0,0,0,0 };
GetWindowRect( _s->hWnd, &rect );
hb_retl( SetWindowPos( _s->hWnd, NULL,
hb_parni( 1 ),
hb_parni( 2 ),
rect.right - rect.left + 1,
rect.bottom - rect.top + 1,
SWP_NOZORDER ) );
}
//-------------------------------------------------------------------//
HB_FUNC( WVT_SETMOUSEMOVE )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
BOOL bMouseMove = _s->MouseMove;
if( ISLOG( 1 ) )
@@ -699,6 +636,8 @@ HB_FUNC( WVT_GETXYFROMROWCOL )
HB_FUNC( WVT_GETFONTINFO )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
PHB_ITEM info = hb_itemArrayNew( 7 );
hb_arraySetC( info, 1, _s->fontFace );
@@ -724,6 +663,8 @@ HB_FUNC( WVT_GETFONTINFO )
HB_FUNC( WVT_SETMENU )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
RECT wi = { 0, 0, 0, 0 };
RECT ci = { 0, 0, 0, 0 };
RECT rc = { 0, 0, 0, 0 };
@@ -752,6 +693,8 @@ HB_FUNC( WVT_SETMENU )
HB_FUNC( WVT_SETPOPUPMENU )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
HMENU hPopup = _s->hPopup ;
_s->hPopup = ( HMENU ) hb_parnl( 1 );
@@ -831,50 +774,60 @@ HB_FUNC( WVT_DESTROYMENU )
HB_FUNC( WVT_ENABLEMENUITEM )
{
hb_retni( EnableMenuItem( ( HMENU ) hb_parnl( 1 ), ( UINT ) hb_parni( 2 ), ( UINT ) hb_parni( 3 ) ) );
hb_retni( EnableMenuItem( ( HMENU ) hb_parnl( 1 ), ( UINT ) hb_parni( 2 ), ( UINT ) hb_parni( 3 ) ) );
}
//-------------------------------------------------------------------//
HB_FUNC( WVT_GETLASTMENUEVENT )
{
hb_retni( _s->LastMenuEvent );
PHB_GTWVT _s = hb_wvt_gtGetWVT();
hb_retni( _s->LastMenuEvent );
}
//-------------------------------------------------------------------//
HB_FUNC( WVT_SETLASTMENUEVENT )
{
int iEvent = _s->LastMenuEvent;
if ( ISNUM( 1 ) )
PHB_GTWVT _s = hb_wvt_gtGetWVT();
int iEvent = _s->LastMenuEvent;
if ( ISNUM( 1 ) )
_s->LastMenuEvent = hb_parni( 1 );
hb_retni( iEvent );
hb_retni( iEvent );
}
//-------------------------------------------------------------------//
HB_FUNC( WVT_SETMENUKEYEVENT )
{
int iOldEvent = _s->MenuKeyEvent;
PHB_GTWVT _s = hb_wvt_gtGetWVT();
if( ISNUM( 1 ) )
int iOldEvent = _s->MenuKeyEvent;
if( ISNUM( 1 ) )
_s->MenuKeyEvent = hb_parni( 1 );
hb_retni( iOldEvent ) ;
hb_retni( iOldEvent ) ;
}
//-------------------------------------------------------------------//
HB_FUNC( WVT_DRAWMENUBAR )
{
DrawMenuBar( _s->hWnd ) ;
PHB_GTWVT _s = hb_wvt_gtGetWVT();
DrawMenuBar( _s->hWnd ) ;
}
//-------------------------------------------------------------------//
HB_FUNC( WVT_ENABLESHORTCUTS )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
BOOL bWas = _s->EnableShortCuts;
if( ISLOG( 1 ) )
@@ -887,6 +840,8 @@ HB_FUNC( WVT_ENABLESHORTCUTS )
HB_FUNC( WVT_INVALIDATERECT )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
RECT rc = { 0,0,0,0 };
POINT xy = { 0,0 };
@@ -911,6 +866,8 @@ HB_FUNC( WVT_ISLBUTTONPRESSED )
HB_FUNC( WVT_CLIENTTOSCREEN )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
PHB_ITEM info = hb_itemArrayNew( 2 );
POINT xy = { 0,0 };
@@ -943,6 +900,8 @@ HB_FUNC( WVT_GETCURSORPOS )
HB_FUNC( WVT_TRACKPOPUPMENU )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
POINT xy = { 0,0 };
GetCursorPos( &xy );
@@ -960,23 +919,11 @@ HB_FUNC( WVT_TRACKPOPUPMENU )
HB_FUNC( WVT_GETMENU )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
hb_retnl( ( ULONG ) GetMenu( _s->hWnd ) );
}
//-------------------------------------------------------------------//
HB_FUNC( WVT_SHOWWINDOW )
{
ShowWindow( _s->hWnd, hb_parni( 1 ) );
}
//-------------------------------------------------------------------//
HB_FUNC( WVT_UPDATEWINDOW )
{
UpdateWindow( _s->hWnd );
}
//-------------------------------------------------------------------//
//-------------------------------------------------------------------//
//-------------------------------------------------------------------//
@@ -989,6 +936,8 @@ HB_FUNC( WVT_UPDATEWINDOW )
HB_FUNC( WVT_CREATEDIALOGDYNAMIC )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
PHB_ITEM pFirst = hb_param( 3,HB_IT_ANY );
PHB_ITEM pFunc = NULL ;
PHB_DYNS pExecSym;
@@ -1121,6 +1070,8 @@ HB_FUNC( WVT_CREATEDIALOGDYNAMIC )
HB_FUNC( WVT_CREATEDIALOGMODAL )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
PHB_ITEM pFirst = hb_param( 3,HB_IT_ANY );
PHB_ITEM pFunc = NULL ;
PHB_DYNS pExecSym;
@@ -1861,10 +1812,12 @@ HB_FUNC( WIN_ISWINDOW )
hb_retl( IsWindow( (HWND) hb_parnl( 1 ) ) );
}
//----------------------------------------------------------------------//
//-------------------------------------------------------------------//
HB_FUNC( WVT_GETFONTHANDLE )
{
PHB_GTWVT _s = hb_wvt_gtGetWVT();
HFONT hFont = 0;
int iSlot = hb_parni( 1 ) - 1;
@@ -1874,7 +1827,7 @@ HB_FUNC( WVT_GETFONTHANDLE )
hb_retnl( ( ULONG ) hFont );
}
//----------------------------------------------------------------------//
//-------------------------------------------------------------------//
HB_FUNC( WIN_CLIENTTOSCREEN )
{