This GDI class library was written and placed in the Public Domain in 2005 by Dirk Busch
:class gdiPOINT <super object
Wrapper class for a POINT struct.
:M GetX: ( -- x )
Get the x value of the point.
:M GetY: ( -- y )
Get the y value of the point.
:M SetX: ( x -- )
Set the x value of the point.
:M SetY: ( y -- )
Get the y value of the point.
:M Addr: ( -- addr )
Get the address of the point struct.
:M Size: ( -- size )
Get the site of the point struct
;class
End of gdiPOINT class
:class gdiCOLORREF <super object
Wrapper class for a COLORREF struct.
A COLORREF value is used to specify an RGB color.
When specifying an explicit RGB color, the COLORREF value has the following
hexadecimal form: 0x00bbggrr
The low-order byte contains a value for the relative intensity of red;
the second byte contains a value for green; and the third byte contains a
value for blue. The high-order byte must be zero. The maximum value for a
single byte is 0xFF.
:M SetRValue: ( r -- )
Set the red value of the color
:M SetGValue: ( g -- )
Set the green value of the color
:M SetBValue: ( b -- )
Set the blue value of the color
:M GetRValue: ( -- r )
Get the red value of the color
:M GetGValue: ( -- g )
Get the green value of the color
:M GetBValue: ( -- b )
Get the blue value of the color
:M SetColor: ( colorref -- )
Set the color
:M SetSysColor: ( n -- )
Set a system color. Possible values are:
COLOR_3DDKSHADOW | Dark shadow for three-dimensional display elements. |
COLOR_3DFACE, COLOR_BTNFACE | Face color for three-dimensional display elements and for dialog box backgrounds. |
COLOR_3DHILIGHT | Highlight color for three-dimensional display elements (for edges facing the light source.) |
COLOR_3DHIGHLIGHT | Highlight color for three-dimensional display elements (for edges facing the light source.) |
COLOR_BTNHILIGHT | Highlight color for three-dimensional display elements (for edges facing the light source.) |
COLOR_BTNHIGHLIGHT | Highlight color for three-dimensional display elements (for edges facing the light source.) |
COLOR_3DLIGHT | Light color for three-dimensional display elements (for edges facing the light source.) |
COLOR_3DSHADOW, COLOR_BTNSHADOW | Shadow color for three-dimensional display elements (for edges facing away from the light source). |
COLOR_ACTIVEBORDER | Active window border. |
COLOR_ACTIVECAPTION | Active window title bar. Windows 98, Windows 2000: Specifies the left side color in the color gradient of an active window's title bar if the gradient effect is enabled. |
COLOR_APPWORKSPACE | Background color of multiple document interface (MDI) applications. |
COLOR_BACKGROUND, COLOR_DESKTOP | Desktop. |
COLOR_BTNTEXT | Text on push buttons. |
COLOR_CAPTIONTEXT | Text in caption, size box, and scroll bar arrow box. |
COLOR_GRADIENTACTIVECAPTION | Windows 98, Windows 2000: Right side color in the color gradient of an active window's title bar |
COLOR_ACTIVECAPTION | Windows 98, Windows 2000: specifies the left side color |
COLOR_GRADIENTINACTIVECAPTION | Windows 98, Windows 2000: Right side color in the color gradient of an inactive window's title bar |
COLOR_INACTIVECAPTION | Windows 98, Windows 2000: specifies the left side color. |
COLOR_GRAYTEXT | Grayed (disabled) text. This color is set to 0 if the current display driver does not support a solid gray color. |
COLOR_HIGHLIGHT | Item(s) selected in a control. |
COLOR_HIGHLIGHTTEXT | Text of item(s) selected in a control. |
COLOR_HOTLIGHT | Windows 98, Windows 2000: Color for a hot-tracked item. Single clicking a hot-tracked item executes the item. |
COLOR_INACTIVEBORDER | Inactive window border. |
COLOR_INACTIVECAPTION | Inactive window caption. Windows 98, Windows 2000: Specifies the left side color in the color gradient of an inactive window's title bar if the gradient effect is enabled. |
COLOR_INACTIVECAPTIONTEXT | Color of text in an inactive caption. |
COLOR_INFOBK | Background color for tooltip controls. |
COLOR_INFOTEXT | Text color for tooltip controls. |
COLOR_MENU | Menu background. |
COLOR_MENUTEXT | Text in menus. |
COLOR_SCROLLBAR | Scroll bar gray area. |
COLOR_WINDOW | Window background. |
COLOR_WINDOWFRAME | Window frame. |
COLOR_WINDOWTEXT | Text in windows. |
:M GetColor: ( -- colorref )
Get the color
:M SetRGB: ( r g b -- )
Set the red, green and blue values of the color
:M Addr: ( -- addr )
Get the address of the COLORREF struct
:M Size: ( -- size )
Get the size of the COLORREF struct
:M Choose: ( hWnd -- f )
Open the windows dialog for choosing a color.
:M CustomColors: ( -- addr len )
Get the address and length (in cells) of the CustomColors array used by Choose:
;class
End of gdiCOLORREF class
:class gdiRGBQUAD <super gdiCOLORREF
Wrapper class for a RGBQUAD struct
The RGBQUAD structure describes a color consisting of relative intensities of red, green, and blue.
The bmiColors member of the BITMAPINFO structure consists of an array of RGBQUAD structures.
Note: This class doesn't have any private methods. For a description of the methods see the gdiCOLORREF class.
;class
End of gdiRGBQUAD class
:class gdiSIZE <super object
Wrapper class for a SIZE struct
:M GetX: ( -- x )
Get the x value
:M GetY: ( -- y )
Get the y value
:M SetX: ( x -- )
Set the x value
:M SetY: ( y -- )
Set the y value
:M Addr: ( -- addr )
Get the address of the SIZE struct
:M Size: ( -- size )
Get the size of the SIZE struct
;class
End of gdiSIZE class
:class gdiTEXTMETRIC <super object
Wrapper class for a TEXTMETRIC struct
:M SetHeight: ( n -- )
:M SetAscent: ( n -- )
:M SetDescent: ( n -- )
:M SetInternalLeading: ( n -- )
:M SetExternalLeading: ( n -- )
:M SetAveCharWidth: ( n -- )
:M SetMaxCharWidth: ( n -- )
:M SetWeight: ( n -- )
:M SetOverhang: ( n -- )
:M SetDigitizedAspectX: ( n -- )
:M SetDigitizedAspectY: ( n -- )
:M SetFirstChar: ( n -- )
:M SetLastChar: ( n -- )
:M SetDefaultChar: ( n -- )
:M SetBreakChar: ( n -- )
:M SetItalic: ( n -- )
:M SetUnderlined: ( n -- )
:M SetStruckOut: ( n -- )
:M SetPitchAndFamily: ( n -- )
:M SetCharSet: ( n -- )
:M GetHeight: ( -- n )
:M GetAscent: ( -- n )
:M GetDescent: ( -- n )
:M GetInternalLeading: ( -- n )
:M GetExternalLeading: ( -- n )
:M GetAveCharWidth: ( -- n )
:M GetMaxCharWidth: ( -- n )
:M GetWeight: ( -- n )
:M GetOverhang: ( -- n )
:M GetDigitizedAspectX: ( -- n )
:M GetDigitizedAspectY: ( -- n )
:M GetFirstChar: ( -- n )
:M GetLastChar: ( -- n )
:M GetDefaultChar: ( -- n )
:M GetBreakChar: ( -- n )
:M GetItalic: ( -- n )
:M GetUnderlined: ( -- n )
:M GetStruckOut: ( -- n )
:M GetPitchAndFamily: ( -- n )
:M GetCharSet: ( -- n )
:M Addr: ( -- addr ) &TEXTMETRIC ;M
Get the address of the TEXTMETRIC struct.
:M Size: ( -- size ) sizeof(TEXTMETRIC) ;M
Get the size of the TEXTMETRIC struct.
;class
End of gdiTEXTMETRIC class
Document $Id: gdiStruct.htm,v 1.13 2007/05/26 10:24:13 dbu_de Exp $