HwGUI reference manual for version 2.14

Alexander S.Kresin
November 2004


1. Introduction

1.1. What is HwGUI

HwGUI is an add-on library for Harbour and xHarbour, intended for creating GUI applications on Win32 platform. HwGUI is based on direct calls of Win32 API, so it cannot be used with other operating systems. While developing HwGUI I tried to hide from the end user - Harbour programmer technical details of API calls and to build a set of commands and functions, which could allow easily create and manage GUI objects.


1.2. History of HwGUI

I began to work on HwGUI in August 2001 and the first version was released on August 21. My initial intention was to create a small and fast GUI lib mainly for my own needs. And already in October I had wrote the first small application with HwGUI for my firm, it reads the databases, created and managed with the accounting system, generates some documents and sends them by fax.

Firstly, from the initial release and til the 1.3 HwGUI didn't use the OOP paradigm - and I even had declared this as one of HwGUI features. My main motivations was speed and stability. Harbour's implementation of classes at that time had some bugs and I didn't want to add problems to myself. And, of course, access to object's variables is more slow than access to the array items. OOP is an additional level and using of it reduces application's performance.

But later I have arrived at a decision to make HwGUI OOP based - to simplify user interface and make it better structured and more convenient. So since release 2.0 HwGUI uses classes.


2. Installation of HwGUI

2.1. HwGUI package

HwGUI is distributed as a zip package. Currently it doesn't use any setup utility, you need simply unzip it to any place you want. The zip package includes following files and directories:

make_b32.bat- Command file to build HwGUI.lib with Borland C
makefile.bc
make_vc.bat- Command file to build HwGUI.lib with MSVC
makefile.vc
make_pc.bat- Command file to build HwGUI.lib with Pelles C
makefile.pc
make_w32.bat- Command file to build HwGUI.lib with Open Watcom C
makefile.wc
makemngw.bat- Command file to build HwGUI.lib with Mingw
makefile.gcc
makedll.bat
makedll.bc
license.txt
install.txt
whatsnew.txt
DOC- Folder with documentation
IMAGE- Folder with sample image files
INCLUDE- Folder with HwGUI header files
LIB- Folder for HwGUI lib
OBJ
SAMPLES- Folder with HwGUI samples
SOURCE- Folder with Hwgui sources
UTILS- Folder with Hwgui utilities

2.2. How to build HwGUI library

Before building the library you need to set the HB_PATH environment variable, it should point to the directory where your copy of Harbour is. Then run one of command files depending of the C compiler you use ( make_b32.bat for Borland C, make_pc.bat for Pelles C, make_vc.bat for MSVC, make_w32.bat for Open Watcom C, makemngw.bat for Mingw ) - this will build four libraries - hwgui.lib, procmisc.lib, hwg_qhtm.lib and hbxml.lib. That's all !


2.3. How to build HwGUI samples

3. How to use HwGUI

3.1. First HwGUI application
   Function Main
   Local oMainWnd, oFont
   Local aCombo := {"First","Second" }
   PREPARE FONT oFont NAME "MS Sans Serif" WIDTH 0 HEIGHT -13
   INIT WINDOW oMainWnd TITLE "Example" ;
           FONT oFont ;
           ON EXIT {||MsgYesNo("Really want to quit ?")}

   @ 20,10 EDITBOX "Hello, World!" ;
           SIZE 200,30 ;

   @ 270,10 COMBOBOX aCombo ;
           SIZE 100, 150 TOOLTIP "Combobox"

   @ 120,60 BUTTON "Close" ;
           SIZE 150,30 ;
           ON CLICK {||EndWindow()}

   MENU OF oMainWnd
           MENUITEM "About" ACTION MsgInfo("First HwGUI Application")
   ENDMENU

   ACTIVATE WINDOW oMainWnd
   Return

First thing you will want to do, I think, is to create the main window. The best way to do this is the command INIT WINDOW. In this command you can define initial position and the size of the window, it's style, icon, background color. You can set also event handlers - codeblocks, which are evaluated for different events ( INIT, EXIT, PAINT, SIZE changing, GETFOCUS, LOSTFOCUS and others ).

Then you need to define controls for that window and the main menu ( MENU ... ENDMENU commands), and, at least, activate the window, ( ACTIVATE WINDOW ) show it on the screen. Let analyse the above sample.

   PREPARE FONT oFont NAME "MS Sans Serif" WIDTH 0 HEIGHT -13
At first, we create the font object for the main window. HwGUI works in such a way, that if a font isn't defined for a control, this control uses the font, defined for his parent window.
   INIT WINDOW oMainWnd MAIN TITLE "Example" ;
           FONT oFont ;
           ON EXIT {||MsgYesNo("Really want to quit ?")}
This command creates main window with the title "Example" and with previously created font. ON EXIT clause will cause appearance of a message box, user will need to choose "Yes" to quit the application.
   @ 20,10 EDITBOX "Hello, World!" ;
           SIZE 200,30 ;
   @ 270,10 COMBOBOX aCombo ;
           SIZE 100, 150 TOOLTIP "Combobox"
   @ 120,60 BUTTON "Close" ;
           SIZE 150,30 ;
           ON CLICK {||EndWindow()}
The above commands creates appropriate controls - Edit, Combobox and Push Button. ComboBox is initialized with aCombo array, which was declared before. Button has an event handler defined - closing the application.
   MENU OF oMainWnd
           MENUITEM "About" ACTION MsgInfo("First HwGUI Application")
   ENDMENU

These commands creates the main menu, which includes the only item "About".
   ACTIVATE WINDOW oMainWnd
And, at least, this last command activates the main window. It appears on the screen with menu and all controls defined.

4. Commands

4.1. Commands for windows and dialogs handling
4.1.1. INIT WINDOW

This command creates the window - main, MDI or MDI CHILD. To force this window show up on the screen you need to activate it later. You can do this with ACTIVATE WINDOW command or with Activate() method of that window object.

INIT WINDOW <oWnd>
[ MAIN ]
[ MDI ]
[ MDICHILD ]
[ APPNAME <appname> ]
[ TITLE <cTitle> ]
[ AT <x>, <y> ]
[ SIZE <width>, <height> ]
[ ICON <ico> ]
[ COLOR <clr> ]
[ BACKGROUND BITMAP <oBmp>> ]
[ STYLE <nStyle> ]
[ FONT <oFont> ]
[ MENU <cMenu> ]
[ MENUPOS <nPos> ]
[ ON INIT <bInit> ]
[ ON SIZE <bSize> ]
[ ON PAINT <bPaint> ]
[ ON GETFOCUS <bGfocus> ]
[ ON LOSTFOCUS <bLfocus> ]
[ ON OTHER MESSAGES <bOther> ]
[ ON EXIT <bExit>]
[ MAXIMIZE]
[ HELP <cHelp> ]
[ HELPID <nHelpId> ]

MAIN,MDI,MDICHILD clauses specifies the type of the window, only one of this clauses may be used in the command.
cTitle - title of the window;
x,y,width,height - left and top coordinates of the window, it's width and height;
ico - the name of the Icon in the resource file;
clr - the background color of the window;
nStyle - style of the window;
oFont - previously created HFont object;
cMenu - the name of menu declaration in the resource file ( if you specify menu in resources );
nPos - identifies the window menu used for controlling MDI child windows. As child windows are created, the application adds their titles to the Window menu as menu items. The user can then activate a child window by choosing its title from the window menu.
bSize - codeblock, which is evaluated while resizing window;
bPaint - codeblock, which is evaluated while window drawing;
bGFocus - codeblock, which is evaluated when window gets focus;
bLFocus - codeblock, which is evaluated when window losts focus;
bExit - codeblock, which is evaluated when window is closed;
bOther - codeblock, which is evaluated for all other messages - you can write your own procedure for messages handling;
MAXIMIZE clause forces the window to be maximized at start.

4.1.2. INIT DIALOG

This command creates the dialog box. To force the dialog show up on the screen you need to activate it later. You can do this with ACTIVATE DIALOG command or with Activate() method of that window object.

INIT DIALOG <oWnd>
[ FROM RESOURCE ]
[ TITLE <cTitle> ]
[ AT <x>, <y> ]
[ SIZE <width>, <height> ]
[ ICON <ico> ]
[ BACKGROUND BITMAP <oBmp> ]
[ STYLE <nStyle> ]
[ FONT <oFont> ]
[ CLIPPER ]
[ NOEXIT ]
[ ON INIT <bInit> ]
[ ON SIZE <bSize> ]
[ ON PAINT <bPaint> ]
[ ON GETFOCUS <bGfocus> ]
[ ON LOSTFOCUS <bLfocus> ]
[ ON OTHER MESSAGES <bOther> ]
[ ON EXIT <bExit> ]
[ HELPID <nHelpId>> ]

All clauses has the same meaning as in INIT WINDOW command, there is only three specific clause:
FROM RESOURCE - it is used if you create the dialog box from resource file;
CLIPPER - to force the Clipper like behavior - the Enter key is used for moving between GET's;
NOEXIT - the Enter key doesn't cause closing of a dialog box.

4.1.3. ACTIVATE WINDOW
ACTIVATE WINDOW <oWnd>

This command is equal to 'oWnd:Activate()' call. It shows the previously created window and starts messages processing for it.

4.1.4. ACTIVATE DIALOG
ACTIVATE DIALOG <oDlg> [ NOMODAL ]

This command is equal to 'oDlg:Activate()' call. It shows the previously defined dialog and starts messages processing for it. By default, it creates modal dialog. You can create modeless dialog, specifying NOMODAL clause in this command.

4.1.5. DIALOG ACTIONS OF

DIALOG ACTIONS OF <oWnd>
ON <id1>,<id2> ACTION <b1>
[ ON <idn1>,<idn2> ACTION <bn> ]

This is a compatibility command and therefore not recommended. The window gets WM_COMMAND message when the user selects a command item from a menu, when a control sends a notification message to its parent window, or when an accelerator keystroke is translated.
You can specify in this command the event, the source of the event and the appropriate action. id1 ...idn1 is the event code, id1 ... idn2 - is the identificator of the control, b1 ... bn - the codeblock.
Take a look at the samples to see how this command may be used.


4.2. Menu commands

4.2.1. MENU

MENU [ OF <oWnd> ] [ ID <nId> ] [ TITLE <cTitle> ]
4.2.2. ENDMENU

ENDMENU
4.2.3. MENUITEM

MENUITEM <item> [ ID <nId> ]
ACTION <act>
[ BITMAP <bmp> ]
[ ACCELERATOR <flag>, <key> ]
[ <lDisabled: DISABLED> ]
4.2.4. SEPARATOR

SEPARATOR
4.2.5. MENU FROM RESOURCE OF

MENU FROM RESOURCE OF <oWnd>
ON <id1> ACTION <b1>
[ ON <idn> ACTION <bn> ]

This command is used if you specify menu in resource file, it defines actions for each menu item.

4.2.6. CONTEXT MENU

CONTEXT MENU <oMenu>
4.2.7. ACCELERATOR

ACCELERATOR <flag>, <key>
[ ID <nId> ]
ACTION <act>

4.3. Commands for controls handling

All the following commands creates the instances of classes, they are preprocessed into the New() or Redefine() method of appropriate class.

4.3.1. ADD STATUS TO

ADD STATUS [ TO <oWnd> ]
[ ID <nId> ]
[ ON INIT <bInit> ]
[ ON SIZE <bSize> ]
[ ON PAINT <bDraw> ]
[ STYLE <nStyle> ]
[ FONT <oFont> ]
[ PARTS <aparts,...> ]
4.3.2. @ <x>,<y> SAY

@ <x>,<y> SAY [ <oSay> CAPTION ] <caption>
[ OF <oWnd> ];
[ ID <nId> ]
[ SIZE <width>, <height> ]
[ COLOR <tcolor> ]
[ BACKCOLOR <bcolor> ]
[ TRANSPARENT ]
[ ON INIT <bInit> ]
[ ON SIZE <bSize> ]
[ ON PAINT <bDraw> ]
[ STYLE <nStyle> ]
[ FONT <oFont> ]
[ TOOLTIP <ctoolt> ]
4.3.3. @ <x>,<y> EDITBOX

@ <x>,<y> EDITBOX [ <oEdit> CAPTION ] <caption>
[ OF <oWnd> ];
[ ID <nId> ]
[ SIZE <width>, <height> ]
[ COLOR <tcolor> ]
[ BACKCOLOR <bcolor> ]
[ ON INIT <bInit> ]
[ ON SIZE <bSize> ]
[ ON PAINT <bDraw> ]
[ ON GETFOCUS <bGfocus> ]
[ ON LOSTFOCUS <bLfocus> ]
[ STYLE <nStyle> ]
[ NOBORDER ]
[ PASSWORD ]
[ FONT <oFont> ]
[ TOOLTIP <ctoolt> ]
4.3.4. REDEFINE EDITBOX

REDEFINE EDITBOX <oEdit>
[ OF <oWnd> ]
ID <nId>
[ COLOR <tcolor> ]
[ BACKCOLOR <bcolor> ]
[ ON INIT <bInit> ]
[ ON SIZE <bSize> ]
[ ON PAINT <bDraw> ]
[ ON GETFOCUS <bGfocus> ]
[ ON LOSTFOCUS <bLfocus> ]
[ FONT <oFont> ]
[ TOOLTIP <ctoolt> ]
4.3.5. @ <x>,<y> BUTTON

@ <x>,<y> BUTTON [ <oButton> CAPTION ] <caption>
[ OF <oWnd> ];
[ ID <nId> ]
[ SIZE <width>, <height> ]
[ COLOR <tcolor> ]
[ BACKCOLOR <bcolor> ]
[ ON INIT <bInit> ]
[ ON SIZE <bSize> ]
[ ON PAINT <bDraw> ]
[ ON CLICK <bClick> ]
[ STYLE <nStyle> ]
[ FONT <oFont> ]
[ TOOLTIP <ctoolt> ]
4.3.6. REDEFINE BUTTON

REDEFINE BUTTON <oButton>
[ OF <oWnd> ]
ID <nId>
[ COLOR <tcolor> ]
[ BACKCOLOR <bcolor> ]
[ ON INIT <bInit> ]
[ ON SIZE <bSize> ]
[ ON PAINT <bDraw> ]
[ ON CLICK <bClick> ]
[ FONT <oFont> ]
[ TOOLTIP <ctoolt> ]
4.3.7. @ <x>,<y> CHECKBOX

@ <x>,<y> CHECKBOX [ <oCheck> CAPTION ] <caption>
[ OF <oWnd> ];
[ ID <nId> ]
[ SIZE <width>, <height> ]
[ COLOR <tcolor> ]
[ BACKCOLOR <bcolor> ]
[ INIT <lInit> ]
[ ON INIT <bInit> ]
[ ON SIZE <bSize> ]
[ ON PAINT <bDraw> ]
[ ON CLICK <bClick> ]
[ STYLE <nStyle> ]
[ FONT <oFont> ]
[ TOOLTIP <ctoolt> ]
4.3.8. REDEFINE CHECKBOX

REDEFINE CHECKBOX <oCheck>
[ OF <oWnd> ]
ID <nId>
[ COLOR <tcolor> ]
[ BACKCOLOR <bcolor> ]
[ INIT <lInit> ]
[ ON INIT <bInit> ]
[ ON SIZE <bSize> ]
[ ON PAINT <bDraw> ]
[ ON CLICK <bClick> ]
[ FONT <oFont> ]
[ TOOLTIP <ctoolt> ]
4.3.9. @ <x>,<y> COMBOBOX

@ <x>,<y> COMBOBOX [ <oCombo> ITEMS ] <aItems>
[ OF <oWnd> ];
[ ID <nId> ]
[ SIZE <width>, <height> ]
[ INIT <nInit> ]
[ COLOR <tcolor> ]
[ BACKCOLOR <bcolor> ]
[ ON INIT <bInit> ]
[ ON SIZE <bSize> ]
[ ON PAINT <bDraw> ]
[ ON CHANGE <bChange> ]
[ STYLE <nStyle> ]
[ FONT <oFont> ]
[ TOOLTIP <ctoolt> ]
[ EDIT ]
[ TEXT ]
4.3.10. REDEFINE COMBOBOX

REDEFINE COMBOBOX [ <oCombo> ITEMS ] <aItems>
[ OF <oWnd> ]
ID <nId>
[ INIT <nInit> ]
[ ON INIT <bInit> ]
[ ON SIZE <bSize> ]
[ ON PAINT <bDraw> ]
[ ON CHANGE <bChange> ]
[ FONT <oFont> ]
[ TOOLTIP <ctoolt> ]
4.3.11. @ <x>,<y> RADIOBUTTON

@ <x>,<y> RADIOBUTTON [ <oRadio> CAPTION ] <caption>
[ OF <oWnd> ];
[ ID <nId> ]
[ SIZE <width>, <height> ]
[ COLOR <tcolor> ]
[ BACKCOLOR <bcolor> ]
[ ON INIT <bInit> ]
[ ON SIZE <bSize> ]
[ ON PAINT <bDraw> ]
[ ON CLICK <bClick> ]
[ STYLE <nStyle> ]
[ FONT <oFont> ]
[ TOOLTIP <ctoolt> ]
4.3.12. REDEFINE RADIOBUTTON

REDEFINE RADIOBUTTON <oRadio>
[ OF <oWnd> ]
ID <nId>
[ COLOR <tcolor> ]
[ BACKCOLOR <bcolor> ]
[ ON INIT <bInit> ]
[ ON SIZE <bSize> ]
[ ON PAINT <bDraw> ]
[ ON CLICK <bClick> ]
[ FONT <oFont> ]
[ TOOLTIP <ctoolt> ]
4.3.13. RADIOGROUP
   RADIOGROUP
4.3.14. END RADIOGROUP
   END RADIOGROUP [ SELECTED <nSel> ]
4.3.15. @ <x>,<y> PANEL

@ <x>,<y> PANEL <oPanel>
[ OF <oWnd> ];
[ ID <nId> ]
[ SIZE <width>, <height> ]
[ ON INIT <bInit> ]
[ ON SIZE <bSize> ]
[ ON PAINT <bDraw> ]
[ STYLE <nStyle> ]
4.3.16. REDEFINE PANEL

REDEFINE PANEL <oCheck>
[ OF <oWnd> ]
ID <nId>
[ ON INIT <bInit> ]
[ ON SIZE <bSize> ]
[ ON PAINT <bDraw> ]
4.3.17. @ <x>,<y> BROWSE

@ <x>,<y> BROWSE <oBrowse>
[ ARRAY ]
[ DATABASE ]
[ OF <oWnd> ];
[ ID <nId> ]
[ SIZE <width>, <height> ]
[ ON INIT <bInit> ]
[ ON SIZE <bSize> ]
[ ON PAINT <bDraw> ]
[ ON CLICK <bClick> ]
[ ON GETFOCUS <bGetFocus> ]
[ ON LOSTFOCUS <bLostFocus> ]
[ STYLE <nStyle> ]
[ <lNoVScr: NO VSCROLL> ]
[ <lNoBord: NO BORDER> ]
[ FONT <oFont> ]
[ APPEND ]
[ AUTOEDIT ]
[ ON UPDATE <bUpdate> ]
[ ON KEYDOWN <bKeyDown> ]
[ ON POSCHANGE <bPosChg> ]
4.3.18. REDEFINE BROWSE

REDEFINE BROWSE <oBrowse>
[ ARRAY ]
[ DATABASE ]
[ OF <oWnd> ]
ID <nId>
[ ON INIT <bInit> ]
[ ON SIZE <bSize> ]
[ ON PAINT <bDraw> ]
[ ON CLICK <bClick> ]
[ ON GETFOCUS <bGetFocus> ]
[ ON LOSTFOCUS <bLostFocus> ]
[ FONT <oFont> ]
4.3.19. ADD COLUMN

ADD COLUMN <block> <
TO <oBrowse>
[ HEADER <cTitle> ]
[ TYPE <type> ]
[ LENGTH <length> ]
[ DEC <dec> ]
[ <lEdit: EDITABLE> ]
[ JUSTIFY HEAD <nJusHead> ]
[ JUSTIFY LINE <nJusLine> ]
[ PICTURE <cPict> ]
[ VALID <bValid> ]
[ WHEN <bWhen> ]
[ ITEMS <aItem> ]
[ BITMAP >oBmp> ]
4.3.20. @ <x>,<y> OWNERBUTTON

@ <x>,<y> OWNERBUTTON <oOwnBtn>
[ OF <oWnd> ];
[ ID <nId> ]
[ SIZE <width>, <height> ]
[ ON INIT <bInit> ]
[ ON SIZE <bSize> ]
[ ON PAINT <bDraw> ]
[ ON CLICK <bClick> ]
[ STYLE <nStyle> ]
[ FLAT ]
[ TEXT <cText>
           [ COLOR <color> ] [ FONT <font> ]
           [ COORDINATES <xt>, <yt>, <widthtt>, <heightt> ]
]
[ BITMAP <bmp> [ FROM RESOURCE ] [ TRANSPARENT ]
           [ COORDINATES <xb>, <yb>, <widthtb>, <heightb> ]
]
4.3.21. REDEFINE OWNERBUTTON

REDEFINE OWNERBUTTON <oOwnBtn>
[ OF <oWnd> ]
ID <nId>
[ ON INIT <bInit> ]
[ ON SIZE <bSize> ]
[ ON PAINT <bDraw> ]
[ ON CLICK <bClick> ]
[ STYLE <nStyle> ]
[ FLAT ]
[ TEXT <cText>
           [ COLOR <color> ] [ FONT <font> ]
           [ COORDINATES <xt>, <yt>, <widthtt>, <heightt> ]
]
[ BITMAP <bmp> [ FROM RESOURCE ] [ TRANSPARENT ]
           [ COORDINATES <xb>, <yb>, <widthtb>, <heightb> ]
]
4.3.22. @ <x>,<y> GROUPBOX
@ <x>,<y> GROUPBOX [ <oGroup> CAPTION ] <caption>
[ OF <oWnd> ];
[ ID <nId> ]
[ SIZE <width>, <height> ]
[ COLOR <tcolor> ]
[ BACKCOLOR <bcolor> ]
[ ON INIT <bInit> ]
[ ON SIZE <bSize> ]
[ ON PAINT <bDraw> ]
[ STYLE <nStyle> ]
[ FONT <oFont> ]
4.3.23. @ <x>,<y> DATEPICKER
@ <x>,<y> DATEPICKER [ <oPicker> CAPTION ] <caption>
[ OF <oWnd> ]
ID <nId>
[ SIZE <width>, <height> ]
[ COLOR <tcolor> ]
[ BACKCOLOR <bcolor> ]
[ INIT <value> ]
[ ON INIT <bInit> ]
[ ON GETFOCUS <bGetFocus> ]
[ ON LOSTFOCUS <bLostFocus> ]
[ STYLE <nStyle> ]
[ FONT <oFont> ]
[ TOOLTIP <ctoolt> ]
4.3.24. @ <x>,<y> UPDOWN

@ <x>,<y> UPDOWN [ <oUpDown> INIT ] <nInit>
RANGE <nLower>, <nUpper>
[ OF <oWnd> ]
[ ID <nId> ]
[ SIZE <width>, <height> ]
[ WIDTH <nUpdWidth> ]
[ COLOR <tcolor> ]
[ BACKCOLOR <bcolor> ]
[ ON INIT <bInit> ]
[ ON SIZE <bSize> ]
[ ON PAINT <bDraw> ]
[ ON GETFOCUS <bGfocus> ]
[ ON LOSTFOCUS <bLfocus> ]
[ STYLE <nStyle> ]
[ FONT <oFont> ]
[ TOOLTIP <ctoolt> ]
4.3.25. @ <x>,<y> TAB

@ <x>,<y> TAB [ <oTab> ITEMS ] <aTabs>
[ OF <oWnd> ]
[ ID <nId> ]
[ SIZE <width>, <height> ]
[ STYLE <nStyle> ]
[ FONT <oFont> ]
[ ON INIT <bInit> ]
[ ON SIZE <bSize> ]
[ ON PAINT <bDraw> ]
[ ON CHANGE <bChange> ]
[ BITMAP <aBmp> [ FROM RESOURCE] [ BITCOUNT <nBC> ] ]
4.3.26. BEGIN PAGE BEGIN PAGE <cname> OF <oTab>

4.3.27. END PAGE

END PAGE OF <oTab>

4.3.28. @ <x>,<y> TREE

@ <x>,<y> TREE [ <oTree> ]
[ OF <oWnd> ]
[ ID <nId> ]
[ SIZE <width>, <height> ]
[ FONT <oFont> ]
[ COLOR <tcolor> ]
[ BACKCOLOR <bcolor> ]
[ ON INIT <bInit> ]
[ ON SIZE <bSize> ]
[ STYLE <nStyle> ]
[ EDITABLE ]
[ BITMAP <aBmp> [ FROM RESOURCE ] ]
4.3.29. INSERT NODE

INSERT NODE [ <oNode> TITLE ] <cTitle>
TO <oTree>
[ AFTER <oPrev> ]
[ BEFORE <oNext> ]
[ BITMAP <aBmp> ]
[ ON CLICK <bClick> ]
4.3.30. SET TIMER

SET TIMER [ <oTimer> ]
[ OF <oWnd> ]
[ ID <id> ]
VALUE <value>
ACTION <bAction>
4.3.31. @ <x>,<y> BITMAP

@ <x>,<y> BITMAP [ <oBmp> SHOW ] <bitmap>
[<res: FROM RESOURCE> ]
[ OF <oWnd> ]
[ ID <nId> ]
[ SIZE <width>, <height> ]
[ ON INIT <bInit> ]
[ ON SIZE <bSize> ]
[ TOOLTIP <ctoolt> ]
4.3.32. @ <x>,<y> REDEFINE BITMAP REDEFINE BITMAP [ <oBmp> SHOW ] <bitmap>
[ OF <oWnd> ]
[ ID <nId> ]
[ ON INIT <bInit> ]
[ ON SIZE <bSize> ]
[ TOOLTIP <ctoolt> ]
4.3.33. @ <x>,<y> ICON

@ <x>,<y> ICON [ <oBmp> SHOW ] <icon>
[<res: FROM RESOURCE> ]
[ OF <oWnd> ]
[ ID <nId> ]
[ SIZE <width>, <height> ]
[ ON INIT <bInit> ]
[ ON SIZE <bSize> ]
[ TOOLTIP <ctoolt> ]
4.3.34. @ <x>,<y> REDEFINE ICON REDEFINE ICON [ <oBmp> SHOW ] <icon>
[ OF <oWnd> ]
ID <nId>
[ ON INIT <bInit> ]
[ ON SIZE <bSize> ]
[ TOOLTIP <ctoolt> ]
4.3.35. @ <x>,<y> IMAGE

@ <x>,<y> IMAGE [ <oBmp> SHOW ] <image>
[ OF <oWnd> ]
[ ID <nId> ]
[ SIZE <width>, <height> ]
[ ON INIT <bInit> ]
[ ON SIZE <bSize> ]
[ TOOLTIP <ctoolt> ]
4.3.36. @ <x>,<y> REDEFINE IMAGE REDEFINE IMAGE [ <oBmp> SHOW ] <image>
[ OF <oWnd> ]
ID <nId>
[ ON INIT <bInit> ]
[ ON SIZE <bSize> ]
[ TOOLTIP <ctoolt> ]
4.3.37. @ <x>,<y> LINE

@ <x>,<y> LINE [ <oLine> ]
[ LENGTH <length> ]
[ OF <oWnd> ]
[ ID <nId> ]
[ VERTICAL]
[ ON SIZE <bSize> ]
4.3.38. @ <x>,<y> RICHEDIT

@ <x>,<y> RICHEDIT [ <oEdit> TEXT ] <vari>
[ OF <oWnd> ]
[ ID <nId> ]
[ SIZE <width>, <height> ]
[ COLOR <tcolor> ]
[ BACKCOLOR <bcolor> ]
[ ON INIT <bInit> ]
[ ON SIZE <bSize> ]
[ ON PAINT <bPaint> ]
[ ON GETFOCUS <bGfocus> ]
[ ON LOSTFOCUS <bLfocus> ]
[ STYLE <nStyle> ]
[ FONT <oFont> ]
[ TOOLTIP <ctoolt> ]
4.3.39. @ <x>,<y> SPLITTER

@ <x>,<y> SPLITTER [ <oSplit> ]
[ OF <oWnd> ]
[ ID <nId> ]
[ SIZE <width>, <height> ]
[ COLOR <tcolor> ]
[ BACKCOLOR <bcolor> ]
[ ON SIZE <bSize> ]
[ ON PAINT <bPaint> ]
[ DIVIDE <aLeft> FROM <aRight> ]
4.3.40. @ <x>,<y> GRAPH

@ <x>,<y> GRAPH [ <oGraph> DATA ] <aData>
[ OF <oWnd> ]
[ ID <nId> ]
[ SIZE <width>, <height> ]
[ COLOR <tcolor> ]
[ BACKCOLOR <bcolor> ]
[ ON SIZE <bSize> ]
[ FONT <oFont> ]
[ TOOLTIP <ctoolt> ]
4.3.41. @ <x>,<y> PROGRESSBAR

@ <x>,<y> PROGRESSBAR <oPBar>
[ OF <oWnd> ]
[ ID <nId> ]
[ SIZE <width>, <height> ]
[ BARWIDTH <maxpos> ]
[ QUANTITY <nRange> ]
4.3.42. @ <x>,<y> MONTHCALENDAR

@ <x>,<y> MONTHCALENDAR [ <oCalendar> ]
[ OF <oWnd> ]
[ ID <nId> ]
[ INIT <dInit> ]
[ SIZE <width>, <height> ]
[ ON INIT <bInit> ]
[ ON CHANGE <bChange> ]
[ STYLE <nStyle> ]
[ FONT <oFont> ]
[ TOOLTIP <ctoolt> ]
[ NOTODAY ]
[ NOTODAYCIRCLE ]
[ WEEKNUMBERS ]
4.3.43. @ <x>,<y> LISTBOX

@ <x>,<y> LISTBOX [ <oList> ITEMS ] <aItems>
[ OF <oWnd> ]
[ ID <nId> ]
[ INIT <dInit> ]
[ SIZE <width>, <height> ]
[ ON INIT <bInit> ]
[ ON SIZE <bSize> ]
[ ON PAINT <bPaint> ]
[ ON CHANGE <bChange> ]
[ STYLE <nStyle> ]
[ FONT <oFont> ]
[ TOOLTIP <ctoolt> ]
4.3.44. @ <x>,<y> REDEFINE LISTBOX REDEFINE LISTBOX [ <oList> ITEMS ] <aItems>
[ OF <oWnd> ]
ID <nId>
[ INIT <dInit> ]
[ ON INIT <bInit> ]
[ ON SIZE <bSize> ]
[ ON PAINT <bPaint> ]
[ ON CHANGE <bChange> ]
[ FONT <oFont> ]
[ TOOLTIP <ctoolt> ]
4.3.45. SPLASH

SPLASH [ <oPBar> TO ] <oBitmap>
[ FROM RESOURCE ]
[ TIME <otime> ]
4.3.46. @ <x>,<y> TRACKBAR

@ <x>,<y> TRACKBAR [ <oTrack> ]
[ OF <oWnd> ]
[ ID <nId> ]
[ SIZE <width>, <height> ]
[ RANGE <nLow>, <nHigh> ]
[ INIT <dInit> ]
[ ON INIT <bInit> ]
[ ON SIZE <bSize> ]
[ ON PAINT <bPaint> ]
[ ON CHANGE <bChange> ]
[ ON DRAG <bDrag> ]
[ STYLE <nStyle> ]
[ TOOLTIP <ctoolt> ]
[ VERTICAL ]
[ AUTOTICKS ]
[ NOTICKS ]
[ BOTH ]
[ TOP ]
[ LEFT ]
4.3.47. @ <x>,<y> ANIMATION

@ <x>,<y> ANIMATION [ <oAnimation> ]
[ OF <oWnd> ]
[ ID <nId> ]
[ STYLE <nStyle> ]
[ SIZE <width>, <height> ]
[ FILE <cFile> ]
[ AUTOPLAY ]
[ CENTER ]
[ TRANSPARENT ]

4.4. Get system commands

Get system doesn't use a special class, something like HGet. It uses the same control classes ( HEdit, HCheckButton, etc. ), as usual control creating commands, only add there some new behavour.

4.4.1. @ <x>,<y> GET

@ <x>,<y> GET [ <oEdit> VAR ] <vari>
[ OF <oWnd> ]
[ ID <nId> ]
[ SIZE <width>, <height> ]
[ COLOR <tcolor> ]
[ BACKCOLOR <bcolor> ]
[ PICTURE <cPicture> ]
[ WHEN <bWhen> ]
[ VALID <bValid> ]
[ NOBORDER ]
[ PASSWORD ]
[ MAXLENGTH <lMaxLength> ]
[ STYLE <nStyle> ]
[ FONT <oFont> ]
[ TOOLTIP <ctoolt> ]
4.4.2. REDEFINE GET

REDEFINE GET [ <oEdit> VAR ] <vari>
[ OF <oWnd> ]
ID <nId>
[ COLOR <tcolor> ]
[ BACKCOLOR <bcolor> ]
[ WHEN <bWhen> ]
[ VALID <bValid> ]
[ FONT <oFont> ]
[ TOOLTIP <ctoolt> ]
4.4.3. @ <x>,<y> GET CHECKBOX

@ <x>,<y> GET CHECKBOX [ <oEdit> VAR ] <vari>
[ OF <oWnd> ]
[ ID <nId> ]
[ SIZE <width>, <height> ]
[ COLOR <tcolor> ]
[ BACKCOLOR <bcolor> ]
[ VALID,ON CLICK <bValid> ]
[ STYLE <nStyle> ]
[ FONT <oFont> ]
[ TOOLTIP <ctoolt> ]
4.4.4. REDEFINE GET CHECKBOX

REDEFINE GET CHECKBOX [ <oEdit> VAR ] <vari>
[ OF <oWnd>]
ID <nId>
[ COLOR <tcolor> ]
[ BACKCOLOR <bcolor> ]
[ VALID,ON CLICK <bValid> ]
[ FONT <oFont> ]
[ TOOLTIP <ctoolt> ]
4.4.5. @ <x>,<y> GET COMBOBOX

@ <x>,<y> GET COMBOBOX [ <oCombo> VAR ] <vari>
ITEMS ] <aItems>
[ OF <oWnd> ]
[ ID <nId> ]
[ SIZE <width>, <height> ]
[ ON CHANGE <bChange> ]
[ WHEN <bWhen> ]
[ STYLE <nStyle> ]
[ FONT <oFont> ]
[ EDIT ]
[ TEXT ]
[ TOOLTIP <ctoolt> ]
4.4.6. REDEFINE GET COMBOBOX

REDEFINE GET COMBOBOX [ <oCombo> VAR ] <vari>
ITEMS ] <aItems>
[ OF <oWnd> ]
ID <nId>
[ ON CHANGE <bChange> ]
[ FONT <oFont> ]
[ TOOLTIP <ctoolt> ]
4.4.7. GET RADIOGROUP

   GET RADIOGROUP [ <ogr> VAR ] <vari>
4.4.8. @ <x>,<y> GET DATEPICKER

@ <x>,<y> GET DATEPICKER [ <oPick> VAR ] <vari>
[ OF <oWnd>]
[ ID <nId> ]
[ SIZE <width>, <height> ]
[ COLOR <tcolor> ]
[ BACKCOLOR <bcolor> ]
[ WHEN <bWhen> ]
[ VALID <bValid> ]
[ STYLE <nStyle> ]
[ FONT <oFont> ]
[ TOOLTIP <ctoolt> ]
4.4.9. @ <x>,<y> GET UPDOWN

@ <x>,<y> GET UPDOWN[ <oUpDown> VAR ] <vari>
RANGE <nLower>, <nUpper>
[ OF <oWnd> ]
[ ID <nId> ]
[ SIZE <width>, <height> ]
[ WIDTH <nUpdWidth> ]
[ COLOR <tcolor> ]
[ BACKCOLOR <bcolor> ]
[ PICTURE <cPicture> ]
[ WHEN <bWhen> ]
[ VALID <bValid> ]
[ STYLE <nStyle> ]
[ FONT <oFont> ]
[ TOOLTIP <ctoolt> ]
4.4.10. SET KEY

SET KEY <nctrl>, <nkey> [ OF <oDlg> ] [ TO <func> ]

4.5. Print commands
4.5.1. INIT PRINTER

INIT PRINTER <oPrinter>
[ NAME <cPrinter> ]
[ PIXEL ]
4.5.2. INIT DEFAULT PRINTER

INIT DEFAULT PRINTER <oPrinter>
[ PIXEL ]

5. Functions

5.1. Common dialogs
5.1.1. SelectFont( [ oFont ] )
This function calls the standard dialog for font selecting. Usually it isn't needed to call this function directly, use HFont():Select( oFont ) instead.
5.1.2. SelectFile( cDescript,cMask,[ cInitDir ], [ cTitle ] )
This function calls the standard dialog for file selecting.
5.1.3. SaveFile( cPrompt,cDescript,cMask,cInitDir,cTitle )
This function calls the standard dialog for file saving.
5.1.4. PrintSetup( @cPrinterName )
This function calls the standard dialog for printer selecting.
5.1.5. hwg_ChooseColor( nColorCurrent )
This function calls the standard dialog for color selecting.
5.2. MessageBoxes and HwGUI dialogs

5.2.1. MsgInfo( cMessage,cTitle )

5.2.2. MsgStop( cMessage,cTitle )

5.2.3. MsgOkCancel( cMessage,cTitle )

5.2.4. MsgYesNo( cMessage,cTitle )

5.2.5. MsgBeep( nSound )

5.2.6. MsgGet( cTitle, cText, nStyle, x, y, nDlgStyle )

5.2.7. WChoice( arr, cTitle, nLeft, nTop, oFont, clrT, clrB, clrTSel, clrBSel )

5.3. Drawing functions.

6. Classes

6.1. Class hierarchy

The following schema illustrates the hierarchy of classes, currently implemented in HwGUI.


HObject

It is a base class for all HwGUI classes.


HCustomWindow

Do not create instances of HCustomWindow. It serves as a base class for windows, dialogs and controls classes. Variables and methods of HCustomWindow provide basic behavior that descendant classes inherit as well as behavior that components can override to customize their behavior.

DATA
CLASS VAR oDefaultParent SHARED
handle
oParent
title
type
nTop, nLeft, nWidth, nHeight
tcolor, bcolor, brush
style
extstyle
lHide
oFont
aEvents, aNotify
aControls
bInit
bDestroy
bSize
bPaint
bGetFocus
bLostFocus
bOther
cargo
HelpId
nHolder
METHODS
AddControl( oCtrl )
DelControl( oCtrl )
AddEvent( nEvent,nId,bAction )
FindControl( nId )
Hide()
Show()
Move( x1,y1,width,height )
onEvent( msg, wParam, lParam )
End()

HWindow
Do not create instances of HWindow. It serves as a base class for other windows - main, child and MDI child. Variables and methods of HWindow provide basic behavior that descendant classes inherit as well as behavior that components can override to customize their behavior.

DATA
CLASS VAR aWindows
CLASS VAR szAppName
menu, oPopup, hAccel
oIcon, oBmp
lUpdated
lClipper
GetList
KeyList
nLastKey
aOffset
lMaximize
METHODS
New( oIcon,clr,nStyle,x,y,width,height,cTitle,cMenu,nPos,oFont,
           bInit,bExit,bSize,bPaint,bGfocus,bLfocus,bOther,cAppName,oBmp,lMaximize,cHelp,nHelpId )
AddItem( oWnd )
DelItem( oWnd )
FindWindow( hWnd )
GetMain()
Center()
Restore()
Maximize()
Minimize()
Close()

HMainWindow
DATA
CLASS VAR aMessages
nMenuPos
oNotifyIcon, bNotify, oNotifyMenu
lTray
METHODS
New( lType,oIcon,clr,nStyle,x,y,width,height,cTitle,cMenu,nPos,
           oFont,bInit,bExit,bSize,bPaint,bGfocus,bLfocus,bOther,
           cAppName,oBmp,lMaximize,cHelp,nHelpId )
Activate( lShow )
onEvent( msg, wParam, lParam )
InitTray( oNotifyIcon, bNotify, oNotifyMenu )
GetMdiActive()

HMDIChildWindow
DATA
CLASS VAR aMessages
METHODS
Activate( lShow )
onEvent( msg, wParam, lParam )

HChildWindow
METHODS
New( oIcon,clr,nStyle,x,y,width,height,cTitle,cMenu,oFont,
           bInit,bExit,bSize,bPaint,bGfocus,bLfocus,bOther,
           cAppName,oBmp,lMaximize,cHelp,nHelpId )
Activate( lShow )
onEvent( msg, wParam, lParam )

HDialog
DATA
CLASS VAR aDialogs
CLASS VAR aModalDialogs
menu
oPopup
lResult
lUpdated // TRUE, if any GET is changed
lClipper // Set it to TRUE for moving between GETs with ENTER key
GetList
KeyList
nLastKey
oIcon, oBmp
lExitOnEnter
bActivate
lActivated
xResourceID
METHODS
New( lType,nStyle,x,y,width,height,cTitle,bInit,bExit,bSize,
           bPaint,bGfocus,bLfocus,bOther,lClipper,oBmp,oIcon,lExitOnEnter,nHelpId,xResourceID )
Activate(lNoModal)
onEvent( msg, wParam, lParam )
AddItem( oWnd,lModal )
DelItem( oWnd,lModal )
FindDialog( hWnd )
GetActive()
Center()
Restore()
Maximize()
Minimize()
Close()

HControl
DATA
id
tooltip
lInit
METHODS
New( oWndParent,nId,nStyle,nLeft,nTop,nWidth,nHeight,oFont,bInit,
           bSize,bPaint,ctoolt,tcolor,bcolor )
Init()
SetColor( tcolor,bcolor,lRepaint )
NewId()
Disable()
Enable()
IsEnabled()
SetFocus()
GetText()
SetText( c )
End()

HBrowse
DATA
winclass
active
lChanged
lDispHead Should I display headers ?
lDispSep Should I display separators ?
aColumns HColumn's array
rowCount Number of visible data rows
rowPos Current row position
rowCurrCountCurrent number of rows
colPos Current column position
nColumns Number of visible data columns
nLeftCol Leftmost column
xpos
freeze Number of columns to freeze
kolz Number of records in browse
tekzp,msrec
recCurr
headColor Header text color
sepColor Separators color
lSep3d
varbuf
tcolorSel,bcolorSel,brushSel
bSkip,bGoTo,bGoTop,bGoBot,bEof,bBof
bRcou,bRecno
bPosChanged, bLineOut, bScrollPos
bEnter, bKeyDown, bUpdate
internal
alias Alias name of browsed database
x1,y1,x2,y2,width,height
minHeight
lEditable
lAppable
lAppMode
lAutoEdit
lUpdated
lAppended
lAdjRight Adjust last column to right
nHeadRows Rows in header
nFootRows Rows in footer
METHODS
New( lType,oWndParent,nId,nStyle,nLeft,nTop,nWidth,nHeight,oFont ;
           bInit,bSize,bPaint,bEnter,bGfocus,bLfocus,lNoVScroll,lNoBorder,
           lAppend,lAutoedit,bUpdate,bKeyDown,bPosChg ) InitBrw( nType )
Rebuild()
Activate()
onEvent( msg, wParam, lParam )
Redefine( lType,oWnd,nId,bInit,bSize,bDraw,bEnter,bGfocus,bLfocus )
FindBrowse( nId )
AddColumn( oColumn )
InsColumn( oColumn,nPos )
DelColumn( nPos )
Paint()
LineOut()
HeaderOut( hDC )
FooterOut( hDC )
SetColumn( nCol )
DoHScroll( wParam )
DoVScroll( wParam )
LineDown()
LineUp()
PageUp()
PageDown()
Bottom()
Top()
ButtonDown( lParam )
ButtonUp( lParam )
ButtonDbl( lParam )
MouseMove( wParam, lParam )
MouseWheel( nKeys, nDelta, nXPos, nYPos )
Edit( wParam,lParam )
Append()
RefreshLine()
Refresh()
ShowSizes()
End()

HPanel
DATA
winclass
METHODS
New( oWndParent,nId,nStyle,nLeft,nTop,nWidth,nHeight,
           bInit,bSize,bPaint,lDocked )
Activate()
onEvent( msg, wParam, lParam )
Redefine( oWnd,nId,nHeight,bInit,bSize,bPaint )
Paint()
End()

HOwnerButton
DATA
winclass
lFlat
state
bClick
lPress
text,tfont,xt,yt,widtht,heightt
bitmap,xb,yb,widthb,heightb,lTransp,oBitmap
lEnabled
METHODS
New( oWndParent,nId,nStyle,nLeft,nTop,nWidth,nHeight,
           bInit,bSize,bPaint,bClick,lflat,
           cText,color,font,xt,yt,widtht,heightt,
           bmp,lResour,xb,yb,widthb,heightb,lTr,
           cTooltip,lEnabled )
Activate()
onEvent( msg, wParam, lParam )
Init()
Redefine( oWndParent,nId,bInit,bSize,bPaint,bClick,lflat,
           cText,color,font,xt,yt,widtht,heightt,
           bmp,lResour,xb,yb,widthb,heightb,lTr,
           cTooltip,lEnabled ) Paint()
MouseMove( wParam, lParam )
MDown()
MUp()
Press()
Release()
End()

HSplitter
DATA
winclass
aLeft
aRight
lVertical
hCursor
lCaptured, lMoved
bEndDrag
METHODS
New( oWndParent,nId,nLeft,nTop,nWidth,nHeight,
           bSize,bPaint,color,bcolor,aLeft,aRight )
Activate()
onEvent( msg, wParam, lParam )
Init()
Paint( lpdis )
Drag( lParam )
DragAll()

HStatus
DATA
CLASS VAR winclass
aParts
METHODS
New( oWndParent,nId,nStyle,aParts,bInit,bSize,bPaint )
Activate()
Init()

HStatic
DATA
CLASS VAR winclass
METHODS
New( oWndParent,nId,nStyle,nLeft,nTop,nWidth,nHeight,cCaption,oFont,bInit,bSize,bPaint,ctoolt,tcolor,bcolor,lTransp )
Activate()
Redefine( oWndParent,nId,oFont,bInit, ;
           bSize,bPaint,ctoolt,tcolor,bcolor,lTransp )
SetValue(value)
Init()

HButton
DATA
CLASS VAR winclass
METHODS
New( oWndParent,nId,nStyle,nLeft,nTop,nWidth,nHeight,cCaption,oFont,
           bInit,bSize,bPaint,bClick,ctoolt,tcolor,bcolor )
Activate()
Redefine( oWnd,nId,oFont,bInit,bSize,bDraw,bClick,ctoolt,tcolor,bcolor )
Init()

HEdit
DATA
CLASS VAR winclass
lMultiLine
cType
bSetGet
bValid
cPicFunc, cPicMask
lPicComplex
lFirst
lChanged
lMaxLength
METHODS
New( oWndParent,nId,vari,bSetGet,nStyle,nLeft,nTop,nWidth,nHeight,oFont,
           bInit,bSize,bPaint,bGfocus,bLfocus,ctoolt,tcolor,bcolor,cPicture,lNoBorder,lMaxLength )
Activate()
onEvent( msg, wParam, lParam )
Redefine( oWnd,nId,vari,bSetGet,oFont,bInit,bSize,bDraw,bGfocus,bLfocus,ctoolt,tcolor,bcolor,cPicture )
Init()
SetGet(value) INLINE Eval( ::bSetGet,value )
Refresh()
SetText(c)

HChecButton
DATA
CLASS VAR winclass
bSetGet
value
METHODS
New( oWndParent,nId,vari,bSetGet,nStyle,nLeft,nTop,nWidth,nHeight,cCaption,oFont,
           bInit,bSize,bPaint,bClick,ctoolt,tcolor,bcolor,bGFocus )
Activate()
Redefine( oWnd,nId,vari,bSetGet,oFont,bInit,bSize,bDraw,bClick,ctoolt,tcolor,bcolor,bGFocus )
Init()
Refresh()
Disable()
Enable()

HRadioButton
DATA
CLASS VAR winclass
CLASS VAR oGroup
METHODS
New( oWndParent,nId,nStyle,nLeft,nTop,nWidth,nHeight,cCaption,oFont,
           bInit,bSize,bPaint,bClick,ctoolt,tcolor,bcolor )
Activate()
Redefine( oWnd,nId,oFont,bInit,bSize,bDraw,bClick,ctoolt,tcolor,bcolor )

HCombobox
DATA
CLASS VAR winclass
aItems
bSetGet
value
bChangeSel
lText
lEdit
METHODS
New( oWndParent,nId,vari,bSetGet,nStyle,nLeft,nTop,nWidth,nHeight,aItems,
           bInit,bSize,bPaint,bChange,cTooltip,lEdit,lText,bGFocus,tcolor,bcolor )
Activate()
Redefine( oWnd,nId,vari,bSetGet,aItems,bInit,bSize,bPaint,bChange,cTooltip,bGFocus )
Init( aCombo, nCurrent )
Refresh()
Setitem( nPos )

HGroup
DATA
CLASS VAR winclass
METHODS
New( oWndParent,nId,nStyle,nLeft,nTop,nWidth,nHeight,cCaption,oFont,
           bInit,bSize,bPaint,tcolor,bcolor )
Activate()

HLine
DATA
CLASS VAR winclass
lVert
oPenLight, oPenGray
METHODS
New( oWndParent,nId,lVert,nLeft,nTop,nLength,bSize )
Activate()
Paint()

HSayImage
DATA
CLASS VAR winclass
oImage
METHODS
New( oWndParent,nId,nLeft,nTop,nWidth,nHeight,bInit,
           bSize,ctoolt )
Activate() Redefine( oWndParent,nId,bInit,bSize,ctoolt )
End()

HSayBmp
METHODS
New( oWndParent,nId,nLeft,nTop,nWidth,nHeight,Image,lRes,bInit,
           bSize,ctoolt )
Redefine( oWndParent,nId,Image,lRes,bInit,bSize,ctoolt )
Init()
ReplaceBitmap( Image, lRes )

HSayIcon
METHODS
New( oWndParent,nId,nLeft,nTop,nWidth,nHeight,Image,lRes,bInit,
           bSize,ctoolt )
Redefine( oWndParent,nId,Image,lRes,bInit,bSize,ctoolt )
Init()

HSayFImage
METHODS
New( oWndParent,nId,nLeft,nTop,nWidth,nHeight,Image,lRes,bInit,
           bSize,ctoolt )
Redefine( oWndParent,nId,Image,lRes,bInit,bSize,ctoolt )
Paint()

HDatePicker
DATA
CLASS VAR winclass
bSetGet
value
bChange
METHODS
New( oWndParent,nId,vari,bSetGet,nStyle,nLeft,nTop,nWidth,nHeight, ;
           oFont,bInit,bGfocus,bLfocus,ctoolt,tcolor,bcolor )
Activate()
Init()
Refresh()

HUpDown
DATA
CLASS VAR winclass
bSetGet
value
hUpDown, idUpDown, styleUpDown
nLower
nUpper
nUpDownWidth
lChanged
METHODS
New( oWndParent,nId,vari,bSetGet,nStyle,nLeft,nTop,nWidth,nHeight, ;
           oFont,bInit,bSize,bPaint,bGfocus,bLfocus,ctoolt,tcolor,bcolor,nUpDWidth,nLower,nUpper )
Activate()
Init()
Refresh()

HTab
DATA
CLASS VAR winclass
aTabs
aPages
bChange,bChange2
hIml, aImages, Image1, Image2
oTemp
bAction
METHODS
New( oWndParent,nId,nStyle,nLeft,nTop,nWidth,nHeight, ;
           oFont,bInit,bSize,bPaint,aTabs,bChange,,aImages,lResour,nBC,bClick, bGetFocus, bLostFocus )
Activate()
Init()
SetTab( n )
StartPage( cname )
EndPage()
ChangePage( nPage )
HidePage( nPage )
ShowPage( nPage )
GetActivePage( nFirst,nEnd )

HTree
DATA
CLASS VAR winclass
aItems
oSelected
himl,aImages,Image1,Image2
bItemChange, bExpand, bRClick, bAction
lEmpty
METHODS
New( oWndParent,nId,nStyle,nLeft,nTop,nWidth,nHeight,oFont,
           bInit,bSize,color,bcolor,aImages,lResour,lEditLabels,bAction,nBC )
Activate()
Init()
AddNode( cTitle, oPrev, oNext, bAction, aImages )
FindChild( handle )
GetSelected()
EditLabel( oNode )
Expand( oNode )
Select( oNode )
Clean()
End()

HMonthCalendar
DATA
CLASS VAR winclass
value
bChange
METHODS
New( oWndParent, nId, vari, nStyle, nLeft, nTop, nWidth, nHeight,
           oFont, bInit, bChange, cTooltip, lNoToday, lNoTodayCircle, lWeekNumbers )
Activate()
Init()
SetValue( dValue )
GetValue()

HListbox
DATA
CLASS VAR winclass
aItems
bSetGet
value
bChangeSel
METHODS
New( oWndParent,nId,vari,bSetGet,nStyle,nLeft,nTop,nWidth,nHeight,aItems,oFont,
           bInit,bSize,bPaint,bChange,cTooltip )
Activate()
Redefine( oWnd,nId,vari,bSetGet,aItems,oFont,bInit,bSize,bDraw,bChange,cTooltip )
Init( aListbox, nCurrent )
Refresh()
Setitem( nPos )

HTrackBar
DATA
CLASS VAR winclass
value
bChange
bThumbDrag
nLow
nHigh
hCursor
METHODS
New( oWndParent,nId,vari,nStyle,nLeft,nTop,nWidth,nHeight,
           bInit,bSize,bPaint,cTooltip,bChange,bDrag,nLow,nHigh,lVertical,TickStyle,TickMarks )
Activate()
onEvent( msg, wParam, lParam )
Init()
SetValue( nValue )
GetValue()

HAnimation
DATA
CLASS VAR winclass
cFileName
METHODS
New( oWndParent, nId, nStyle, nLeft, nTop, nWidth, nHeight,
           cFilename, lAutoPlay, lCenter, lTransparent )
Activate()
Init()
Open( cFileName )
Play( nFrom, nTo, nRep )
Seek( nFrame )
Stop()
Close()
Destroy()

HColumn
DATA
block,heading,width,type,length,dec,cargo
nJusHead, nJusLin
tcolor,bcolor,brush
lEditable
aList
aBitmaps
bValid,bWhen
bEdit
cGrid
lSpandHead
lSpandFoot
Picture
METHODS
New( cHeading,block,type,length,dec,lEditable,nJusHead,nJusLin,,cPict,bValid,bWhen,aItem,oBmp )

HRadioGroup
DATA
CLASS VAR oGroupCurrent
aButtons
value
bSetGet
METHODS
New( vari,bSetGet )
EndGroup( nSelected )
SetValue( nValue )
Refresh()

HFont
DATA
CLASS VAR aFonts
handle
name, width, height ,weight
charset, italic, Underline, StrikeOut
nCounter
METHODS
Add( fontName, nWidth, nHeight ,fnWeight, fdwCharSet, ;
           fdwItalic, fdwUnderline, fdwStrikeOut, nHandle )
Select()
Release()

HPen
DATA
CLASS VAR aPens
handle
style, width, color
nCounter
METHODS
Add( style, width, color )
Release()

HBrush
DATA
CLASS VAR aBrushes
handle
color
nHatch
nCounter
METHODS
Add( color,nHatch )
Release()

HBitmap
DATA
CLASS VAR aBitmaps
handle
name
nWidth, nHeight
nCounter
METHODS
AddResource( name )
AddFile( name,hDC )
AddWindow( oWnd,lFull )
Release()

HIcon
DATA
CLASS VAR aIcons
handle
name
nCounter
METHODS
AddResource( name )
AddFile( name,hDC )
Release()

HPrinter
DATA
hDCPrn
hDC
cPrinterName
hPrinter
aMeta
lPreview
cMetaName
nWidth, nHeight
nPWidth, nPHeight
nHRes, nVRes
lmm
nCurrPage, oTrackV, oTrackH
nZoom, xOffset, yOffset, x1, y1, x2, y2
METHODS
New( cPrinter,lmm )Opening a printer. If 'cPrinter' is omitted, Printer Setup dialog appears; if 'cPrinter' is an empty string, default printer is used.
SetMode( nOrientation )
AddFont( fontName, nHeight ,lBold, lItalic, lUnderline )
SetFont( oFont )
StartDoc( lPreview,cMetaName )Starts printing of a document. lPreview should be TRUE, if you want to preview the printing result.
EndDoc()End of a document printing.
StartPage()
EndPage()
ReleaseMeta()
PlayMeta( nPage, oWnd, x1, y1, x2, y2 )
PrintMeta( nPage )
Preview( cTitle,aBitmaps,aTooltips,aBtnUser )Opening of a preview window, this should be used after EndDoc() call.
End()Releasing the printer.
Box( x1,y1,x2,y2,oPen )
Line( x1,y1,x2,y2,oPen )
Say( cString,x1,y1,x2,y2,nOpt,oFont )
Bitmap( x1,y1,x2,y2,nOpt,hBitmap )

HTreeNode
DATA
CLASS VAR winclass
aItems
handle
oTree, oParent
bAction
cargo
METHODS
New( oTree, oParent, oPrev, oNext, cTitle, bAction,aImages )
AddNode( cTitle, oPrev, oNext, bAction, aImages )
Delete()
FindChild( handle )
GetText()
SetText(cText)

HTimer
DATA
CLASS VAR aTimers
id
value
oParent
bAction
METHODS
New( oParent,id,value,bAction )
End()

HFreeImage

This class is similar to HBitmap, HIcon classes, it allows to load, save and draw an image in BMP, JPEG, PNG and some other formats. It uses FreeImage library (http://freeimage.sourceforge.net>) - so, if you include it in your application, you need to have FreeImage.dll.

DATA
CLASS VAR aImages
handle
hBitmap
name
nWidth, nHeight
nCounter
METHODS
AddFile( name )Load the image from a file
FromBitmap( oBitmap )Create an image from a bitmap
Draw( hDC,nLeft,nTop,nWidth,nHeight )Draw the image on specified device contect
Release()Unload the image
The example of using this class you may find in samples/viewer/viewer.prg.

HSplash
METHODS
Create( cFile,oTime,oResource )

7. Qhtm integration

7.1. Overview

QHTM is a C++ library, which allows to display and print HTML content in your application - on any window, device context, on a report, on a button or in a tooltip. For more details look at http://www.gipsysoft.com.
HwGUI provides an interface for this library. To use it, you need to download QHTM from the http://www.gipsysoft.com/qhtm/freedownload.shtml and copy qhtm.dll to the same directory, where your application is.
Attention !!! QHTM is released under other license than Harbour and HwGUI, so don't forget to read it before using !


7.2. Commands
@ <x>,<y> QHTM [ <oQhtm> ]
[ CAPTION <caption> ]
[ FILE <fname> ]
[ RESOURCE <resname> ]
[ OF <oWnd> ];
[ ID <nId> ]
[ SIZE <width>, <height> ]
[ ON INIT <bInit> ]
[ ON SIZE <bSize> ]
[ ON CLICK <bLink> ]
[ ON SUBMIT <bSubmit> ]
[ STYLE <nStyle> ]

This command creates QHTM control. Html content may be assigned in three ways:

ON CLICK clause determines the codeblock, which will be executed when user clicks on an external link.
ON SUBMIT clause determines the codeblock, which will be executed when user submits form.

REDEFINE QHTM [ <oQhtm> ]
[ CAPTION <caption> ]
[ FILE <fname> ]
[ RESOURCE <resname> ]
[ OF <oWnd> ];
ID <nId>
[ ON INIT <bInit> ]
[ ON SIZE <bSize> ]
[ ON CLICK <bLink> ]
[ ON SUBMIT <bSubmit> ]

This command redefines QHTM control from resources. Html content may be assigned in three ways the same three ways as in @ ... QHTM command.

@ <x>,<y> QHTMBUTTON [ <oButton> CAPTION ] <caption>
[ OF <oWnd> ];
[ ID <nId> ]
[ SIZE <width>, <height> ]
[ ON INIT <bInit> ]
[ ON SIZE <bSize> ]
[ ON CLICK <bClick> ]
[ STYLE <nStyle> ]
[ FONT <oFont> ]
[ TOOLTIP <ctoolt> ]

This command works exactly as @ ... BUTTON, but <caption> may include html content.

REDEFINE QHTMBUTTON <oButton>
[ OF <oWnd> ]
ID <nId>
[ ON INIT <bInit> ]
[ ON SIZE <bSize> ]
[ ON CLICK <bClick> ]
[ FONT <oFont> ]
[ TOOLTIP <ctoolt> ]

This command works exactly as REDEFINE BUTTON, but <caption> may include html content.


7.3. Functions

QHTM_Init( [ cDllName ] )

QHTM_Message( cMessage [,cTitle ] [,nFlags ] )

QHTM_LoadFile( handle, cFileName )

QHTM_LoadRes( handle, cResourceName )

QHTM_AddHtml( handle, cText )

QHTM_GetTitle( handle )

QHTM_GetSize( handle )

QHTM_EnableCooltips()

QHTM_PrintCreateContext() --> hContext

QHTM_PrintSetText( hContext,cHtmlText )

QHTM_PrintSetTextFile( hContext,cFileName )

QHTM_PrintSetTextResource( hContext,cResourceName )

QHTM_PrintLayOut( hDC,hContext ) --> nNumberOfPages

QHTM_PrintPage( hDC,hContext,nPage )

QHTM_PrintDestroyContext( hContext )


8. Utilities

8.1. Designer

The Designer is intended to create/modify input screen forms and reports. It's main features are:

Few notes for HwGUI applications about using of some properties and methods:

Few notes about the reports builder.
For a few years there was another report designer in HwGUI - HwReport. Now the Designer becomes the main report builder utility. It has more modern and advanced engine than Hwreport and, what is important, it is more easy to support one engine than two different :). The important point is that now the report builder may be integrated into the application and it is convenient, IMO, that the same code, the same module, linked into the application, implements two tasks - works with input forms and with reports.
The compatibility with the *.rpt files, created with Hwreport, is implemented via the plugin ( resource/r_text.prg ) - you may open rpt files, choosing the 'plain text format' and then save them in a new format, which is exactly the same as for input forms.
The new report engine uses a bit different approach than the old one. There are no 'markers' - the widget 'area' is used instead. You can convert any rpt file into the new format and you will see how these 'areas' are used. The 'area' has two main properties:

The areas may be nested - to implement subtables, for example.
The report itself has two methods: Every print item ( Label, Box, Vline, HLine, Bitmap ) has three methods: The 'Label' item has additionally a method 'Expression', which calculates a string, which should be printed.
The 'area' has additionally a method 'onNextLine', which is executed for the each line in a 'Table' area - it is the same as script for the 'End Line' marker in an old report engine.



9. License

HwGUI is released under the same license, as Harbour itself.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this software; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).

As a special exception, you have permission for additional uses of the text contained in its release of HWGUI.

The exception is that, if you link the HWGUI library with other files to produce an executable, this does not by itself cause the resulting executable to be covered by the GNU General Public License. Your use of that executable is in no way restricted on account of linking the HWGUI library code into it.



10. About the author