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,lNotify )
FindControl( nId,nHandle )
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
METHODS
New( oIcon,clr,nStyle,x,y,width,height,cTitle,cMenu,nPos,oFont,
bInit,bExit,bSize,bPaint,bGfocus,bLfocus,bOther,cAppName,oBmp,cHelp,nHelpId,bCloseQuery )
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,cHelp,nHelpId,bCloseQuery )
Activate( lShow )
onEvent( msg, wParam, lParam )
InitTray( oNotifyIcon, bNotify, oNotifyMenu )
GetMdiActive()
HMDIChildWindow
DATA
CLASS VAR aMessages
METHODS
Activate( lShow )
onEvent( msg, wParam, lParam )
HChildWindow
DATA
oNotifyMenu
METHODS
New( oIcon,clr,nStyle,x,y,width,height,cTitle,cMenu,oFont,
bInit,bExit,bSize,bPaint,bGfocus,bLfocus,bOther,
cAppName,oBmp,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
lExitOnEsc
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,lExitOnEsc )
Activate(lNoModal)
onEvent( msg, wParam, lParam )
Add()
Del()
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 )
Refresh()
End()
HBrowse
DATA
| winclass |
|
| active |
|
| lChanged |
|
| lDispHead | Should I display headers ?
|
| lDispSep | Should I display separators ?
|
| aColumns | HColumn's array
|
| aColAlias |
|
| aRelation |
|
| rowCount | Number of visible data rows
|
| rowPos | Current row position
|
| rowCurrCount | Current number of rows
|
| colPos | Current column position
|
| nColumns | Number of visible data columns
|
| nLeftCol | Leftmost column
|
| xpos |
|
| freeze | Number of columns to freeze
|
| nRecords | Number of records in browse
|
| nCurrent |
|
| aArray |
|
| recCurr |
|
| headColor | Header text color
|
| sepColor | Separators color
|
| lSep3d |
|
| varbuf |
|
| tcolorSel,bcolorSel,brushSel |
|
| bSkip,bGoTo,bGoTop,bGoBot,bEof,bBof |
|
| bRcou,bRecno,bRecnoLog |
|
| bPosChanged, bLineOut, bScrollPos, bHScrollPos |
|
| 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
|
| lResizing |
|
| lCtrlPress |
|
| aSelected |
|
METHODS
New( lType,oWndParent,nId,nStyle,nLeft,nTop,nWidth,nHeight,oFont ;
bInit,bSize,bPaint,bEnter,bGfocus,bLfocus,lNoVScroll,lNoBorder,
lAppend,lAutoedit,bUpdate,bKeyDown,bPosChg,,lMultiSelect )
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()
Home()
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()
HOwnerButton
DATA
CLASS VAR cPath SHARED
winclass
lFlat
state
bClick
lPress
text,tfont,xt,yt,widtht,heightt
bitmap,xb,yb,widthb,heightb,lTransp,trColor,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,trColor,
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()
Enable()
Disable()
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()
HStaticLink
HButton
DATA
CLASS VAR winclass
bClick
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
nColorinFocus
METHODS
New( oWndParent,nId,vari,bSetGet,nStyle,nLeft,nTop,nWidth,nHeight,oFont,
bInit,bSize,bPaint,bGfocus,bLfocus,ctoolt,tcolor,bcolor,cPicture,lNoBorder,lMaxLength,lPassword )
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()
SetValue( lValue )
GetValue()
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
bValid
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,bValid )
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
DATA
nOffsetV
nOffsetH
nZoom
METHODS
New( oWndParent,nId,nLeft,nTop,nWidth,nHeight,Image,lRes,bInit,
bSize,ctoolt )
Redefine( oWndParent,nId,Image,lRes,bInit,bSize,ctoolt )
Paint( lpdis )
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
DATA
nOffsetV
nOffsetH
nZoom
METHODS
New( oWndParent,nId,nLeft,nTop,nWidth,nHeight,Image,lRes,bInit,
bSize,ctoolt )
Redefine( oWndParent,nId,Image,lRes,bInit,bSize,ctoolt )
Paint( lpdis )
ReplaceImage( Image )
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 )
DeletePage( nPage )
HidePage( nPage )
ShowPage( nPage )
GetActivePage( nFirst,nEnd )
Notify( lParam )
HTree
DATA
CLASS VAR winclass
aItems
oSelected
himl,aImages,Image1,Image2
bItemChange, bExpand, bRClick, bDblClick, 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()
Notify( lParam )
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()
GetNumTics()
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()
HGrid
HGridEx
HToolBar
HColumn
DATA
block,heading,width,type,length,dec,cargo
nJusHead, nJusLin, nJusFoot
tcolor,bcolor,brush
lEditable
aList
aBitmaps
bValid,bWhen
bEdit
cGrid
lSpandHead
lSpandFoot
Picture
bHeadClick
bColorFoot
bColorBlock
METHODS
New( cHeading,block,type,length,dec,lEditable,nJusHead,nJusLin,cPict,bValid,bWhen,aItem,bColorBlock )
HRadioGroup
DATA
CLASS VAR oGroupCurrent
aButtons
value
bSetGet
METHODS
New( vari,bSetGet )
EndGroup( nSelected )
SetValue( nValue )
GetValue()
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( oFont )
Release()
HPen
DATA
CLASS VAR aPens
handle
style, width, color
nCounter
METHODS
Add( style, width, color )
Get( nStyle,nWidth,nColor )
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 )
AddStandard( nId )
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
nPage
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 ) |
|
| SetTextColor( nColor ) | Set text color.
|
| SetTBkColor( nColor ) | Set background color of a text.
|
| SetBkmode( lmode ) | Set transparent mode for printing text.
|
| 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,oBrush ) |
|
| Line( x1,y1,x2,y2,oPen ) |
|
| Say(cString,x1,y1,x2,y2,nOpt,oFont,nTextColor,nBkColor) |
|
| Bitmap( x1,y1,x2,y2,nOpt,hBitmap ) |
|
| GetTextWidth( cString, oFont ) |
|
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
|
| AddFromVar( cImage,cType )
|
| 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 )
HPrintDos
DATA
METHODS
HWinPrn
DATA
CLASS VAR nStdHeight SHARED
CLASS VAR cPrinterName SHARED
oPrinter
oFont
nLineHeight, nLined
nCharW
x, y
lElite
lCond
nLineInch
lBold
lItalic
lUnder
lChanged
cpFrom, cpTo
nTop
nBottom
nLeft
nRight
METHODS
New( cPrinter, cpFrom, cpTo )
InitValues( lElite, lCond, nLineInch, lBold, lItalic, lUnder )
SetMode( lElite, lCond, nLineInch, lBold, lItalic, lUnder )
StartDoc( lPreview,cMetaName )
NextPage()
PrintLine( cLine,lNewLine )
PrintText( cText )
PutCode( cText )
EndDoc()
End()
HFormTmpl
HRepTmpl