Documente Academic
Documente Profesional
Documente Cultură
software
HwGUI 2.21 reference manual
prev Alexander S.Kresin, October 2018 next
5. Functions
hwg_SelectFont( [ oFont ] )
This function calls the standard dialog for font selecting.
An example:
cFileName := hwg_Selectfile( {"dbf files( *.dbf )","All
files(*.*)"}, ;
{"*.dbf","*.*"}, cPath )
An example:
cFileName := hwg_SelectFileEx( ,, { { "Dbf files", "*.dbf"
}, { "All files", "*" } } )
hwg_SelectFolder( cTitle )
The standard dialog for folder selection.
hwg_SaveFile( cPrompt,cDescript,cMask,cInitDir,cTitle )
(Windows only)
This function calls the standard dialog for file saving.
An example:
fname := hwg_Savefile( "*.htm","( *.htm )","*.htm", cPath )
hwg_ChooseColor( nColorCurrent )
This function calls the standard dialog for color selecting.
hwg_GetClientRect( handle )
For example:
// Create HPen object: a line thickness - 2px, a color -
red
oPen := HPen():Add( BS_SOLID, 2, 255 )
// Select this object as current for hDC
hwg_Selectobject( hDC, oPen:handle )
// Draw a 2px red line
hwg_Drawline( hDC, 5, 1, 100, 1 )
hwg_DeleteObject( handle )
Deletes a font, a pen, a brush, a bitmap or an icon. Pay attention
that this function works on WinAPI/GTK level, it deletes not a HwGUI
object, but WinaPI/GTK's. Ususlly it isn't needed to call it directly
from your application, the Release() method of an appropriate HwGUI
class does all necessary operations.
hwg_Pie( hDC, x1, y1, x2, y2, xr1, yr1, xr2, yr2 ) (Windows
only)
Draws a pie-shaped wedge bounded by the intersection of an ellipse and
two radials and fills area inside. Uses a pen and a brush, selected
with the help of hwg_SelectObject().
• cName - name of a stock object. The set of names you may see,
for example, with the help of Tutorial utility, chapter
"Advanced using of controls", module "Browse of bitmaps" ;
• nSizeType - (optional) type of a size, may be one of following:
GTK_ICON_SIZE_MENU,
GTK_ICON_SIZE_SMALL_TOOLBAR,
GTK_ICON_SIZE_LARGE_TOOLBAR,
GTK_ICON_SIZE_BUTTON (default),
GTK_ICON_SIZE_DND,
GTK_ICON_SIZE_DIALOG;
• Return value - handle of a bitmap;
hwg_GetBitmapSize( hBitmap )
Returns an array with the size (width and height) of a bitmap.
hwg_Getsyscolor( nCode )
Retrieves the current color of the specified display element. Display
elements are the parts of a window and the display that appear on the
system display screen. In GTK version always return a background color
of a main window.
hwg_Createsolidbrush( nColor )
Creates a brush that has the specified color. Usually it isn't needed
to call this function directly, use HBrush():Add() instead.
hwg_GetDC( hWnd )
Returns handle of device context of GUI element. After using this
handle must be released with a help of hwg_ReleaseDC( hWnd, hDC ).
hwg_CreateCompatibleDC( hDC )
hwg_GetClientRect( handle )
hwg_GetWindowRect( handle )
hwg_GetTextColor( hDC )
Returns current text color setting for a drawing area.
hwg_GetBkColor( hDC )
Returns current background color setting for a drawing area.
• hDC - handle of the device context;
• Return value - previous color value.
hwg_EndWindow()
Closes the main window.
hwg_GetActiveWindow()
hwg_CenterWindow( handle )
Centers a window on a screen.
hwg_RestoreWindow( handle )
Restores the default window size.
hwg_isWindowEnabled( handle )
Checks, if the GUI element (window or control) is enabled.
hwg_HideWindow( handle )
Hide GUI element (window or control).
hwg_GetWindowObject( handle )
hwg_GetWindowText( handle )
Returns the text of the specified window's title bar or the text of a
control.
hwg_SetTopmost( hWnd )
Sets a window as Topmost, i.e. makes it visible independently of it
state (is it active or no).
hwg_RemoveTopmost( hWnd )
Resets the Topmost mode (look at hwg_SetTopmost()).
hwg_GetFocus()
Retrieves the handle to the GUI element (window or control) that has
the keyboard focus.
• Return value - handle to the GUI element that has the keyboard
focus.
hwg_FindParent( hCtrl )
Returns an object of a parent GUI element for a widget by it handle.
hwg_FindSelf( hCtrl )
Returns an object of a widget by it handle.
hwg_getParentForm( oCtrl )
Returns an object of a window, which includes a given widget. The
distinction from hwg_FindParent() is the following: hwg_FindParent()
looks for a direct parent, it may be another widget, such as Tab,
Panel or Toolbar. hwg_getParentForm() always returns a window, which
includes the given widget.
hwg_DestroyWindow( handle )
hwg_ColumnArBlock()
hwg_ShowProgress( nStep, maxPos, nRange, cTitle, oWnd, x1,
y1, width, height ) (Windows only)
hwg_UpdateProgressBar( handle )
hwg_GetMonthCalendarDate( handle )
hwg_DelTooltip( handle )
Delete a tooltip of the control.
hwg_getParent( handle )
Returns handle of a parent GUI element, using a system call WinAPI/GTK
- so, it is faster, than with the help of oParent variable of
appropriate object.
hwg_LoadCursor( cursor )
hwg_DrawMenuBar( hWnd )
hwg_Version( n )
Returns an information about current HwGUI version. The optional
parameter defines the kind of information:
hwg_ColorC2N( cColor )
Converts color representation from string to numeric format.
hwg_ColorN2C( nColor )
Converts color representation from numeric to string format.
hwg_BmpFromRes( cBmp )
Creates a bitmap from the data stored in the resources or in the
binary container (if it is previouslu opened with
hwg_SetResContainer() function). In most cases you don't need to call
this function directly, use HBitmap():AddResource(cBmp) instead.
hwg_SetResContainer( cName )
Opens a file of a binary container and sets is as a current fot
resources retrieving. Corresponding command: SET RESOURCES CONTAINER
TO.
hwg_SetGetUpdated( oEdit )
Sets the state of a GET item as updated.
hwg_Chr( nCode )
hwg_Substr( cString, nPos, nLen )
hwg_Left( cString, nLen )
hwg_Len( cString )
hwg__isUnicode()
Lets to determine, is this HwGUI binary compiled in Unicode mode.
hwg_GetPrinters()
Returns a list of printers, registered in OS.
hwg_GetFontsList()
Returns a list of fonts, registered in OS.
hwg_ErrMsg( oError )
hwg_CopyStringToClipboard( cString )
hwg_GetClipboardText( hWnd )
hwg_LoWord( n )
Retrieves the low-order word from the specified 32-bit value.
hwg_HiWord( n )
Retrieves the high-order word from the specified 32-bit value.
hwg_BitOr( n1, n2 )
hwg_BitAnd( n1, n2 )
hwg_BitAndInverse( n1, n2 )
hwg_SetBit( n, nBit )
hwg_CheckBit( n, nBit )
Bit functions as in Harbour ( hb_bitand(),... ).
hwg_Sin( n )
hwg_Cos( n )
Two mathematical functions.
hwg_GetKeyboardState( nState )
This function returns a keyboard state string, which allows to
determine, is Ctrl, Shift or Alt key is pressed. It should be called
inside events handler, in GTK version lParam must be passed as nState
parameter.
hwg_GetDesktopWidth()
Returns a width of a desktop in pixels.
hwg_GetDesktopHeight()
Returns a height of a desktop in pixels.
hwg_PtrToUlong( ptr )
Converts a variable of Pointer type to a long integer. This is
necessary in some cases for handling parameters of system messages.
Site map
© Copyright 2016. All Rights Reserved.
<div><img src="https://mc.yandex.ru/watch/37824975"
style="position:absolute; left:-9999px;" alt="" /></div>