Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | Related Pages | Examples

fgl::FGWindow Class Reference

#include <fastgl.h>

Inheritance diagram for fgl::FGWindow:

Inheritance graph
[legend]
Collaboration diagram for fgl::FGWindow:

Collaboration graph
[legend]
List of all members.

Detailed Description

It is a rectangle space at the screen that is intended to the communication with the user. Its look & feel is derived from the flags assigned on the create time. The maximal size of the window is limited by current video mode resolutions only. It's have own fore and back color, title (or no). You can use many windows at once (it is limited with free memory only), but only and just only one may be in the active state. You can draw your windows everywhere, but if you go out of bounds of the screen, then graphics system adjust the size and position at the right values. You can set that windows to remember its position and size. The each window is active immediate after it is created. To the active window goes user's input, key pressing, mouse events and other system events. You can serve these events by defining your own FGWindow Handler. It is a single procedure with type GuiHwnd and it is described below. Because using FGWindow methods to a not existing object, library has implemented safe mechanism (it is not mandatory but it is a good practise).

wnd.png
Examples:

bgroup.cpp, bitmap.cpp, buttons.cpp, calc.cpp, connect.cpp, events.cpp, fgcolor.cpp, fgv.cpp, font.cpp, gears16.cpp, geartrain.cpp, gradient.cpp, hello.cpp, listbox.cpp, mandel.cpp, pane.cpp, radio.cpp, regress.cpp, tabpage.cpp, timer.cpp, ttf.cpp, updown.cpp, and widget.cpp.


Public Member Functions

virtual void draw (void)
void __fastcall SetDefaultControl (FGControl *ctrl)
void SetNextControl (void)
void SetPreviousControl (void)
FGControlGetDefaultControl (void)
void InstallWindowHook (void(*hook)(int, int, int &, int &, int))
void SetActive (FGControl *c)
void RunHandler (void)
void StateLock (void)
void StateUnlock (void)
void __fastcall SetChange (void)
void __fastcall ResetChange (void)
bool __fastcall ShowNotify (void)
void AbsToWindowPosition (int &_x, int &_y)
void __fastcall SetIconPosition (int x, int y)
int __fastcall IsIconized (void) const
int __fastcall WindowIconize (void)
int __fastcall WindowIconize (int, int)
void __fastcall WindowAttachIcon (FGDrawBuffer *ico)
FGControlBoxIterator GetCurrentControls (void)
void __fastcall WindowRepaint (int xr, int yr, int w, int h)
void __fastcall WindowRepaintUser (int xr, int yr, int w, int h)
 FGWindow (FGWindow **, int xs, int ys, int ws, int hs, const char *nm, GuiHwnd=0, int i=IM, int p=PM, int flag=WTITLED|WFRAMED, void *user_data=UNDEFINED_USER_DATA)
bool WindowClose (void)
bool __fastcall WindowFlushInput (void)
FGPushButtonAddPushButton (int xs, int ys, int ws, int hs, const char *nm, int key=0, ControlCall f=0, void *user_data=UNDEFINED_USER_DATA)
FGPushButtonAddPushButton (int xs, int ys, int ws, int hs, const char *nm, int key, FGDrawBuffer *bm, ControlCall f, void *user_data=UNDEFINED_USER_DATA)
FGPushButtonAddPushButton (int xs, int ys, int key, FGDrawBuffer *bm, ControlCall f, void *user_data=UNDEFINED_USER_DATA)
FGSlideBarHAddSlideBarH (int xs, int ys, int min, int max, int step, int *val, ControlCall f=0, void *user_data=UNDEFINED_USER_DATA)
FGSlideBarVAddSlideBarV (int xs, int ys, int min, int max, int step, int *val, ControlCall f=0, void *user_data=UNDEFINED_USER_DATA)
FGCheckBoxAddCheckBox (int xs, int ys, const char *nm, int key=0, int *variable=0, ControlCall=0, void *user_data=UNDEFINED_USER_DATA)
FGCheckBoxAddCheckBox (int xs, int ys, const char *nm, int key, bool *variable, ControlCall=0, void *user_data=UNDEFINED_USER_DATA)
FGRadioButtonAddRadioButton (int xs, int ys, const char *nm, int key=0, int *variable=0, ControlCall=0, void *user_data=UNDEFINED_USER_DATA)
FGCheckBoxAddCheckBoxMask (int mask, int xs, int ys, const char *nm, int key=0, int *variable=0, ControlCall=0, void *user_data=UNDEFINED_USER_DATA)
FGRadioButtonAddRadioButtonMask (int mask, int xs, int ys, const char *nm, int key=0, int *variable=0, ControlCall=0, void *user_data=UNDEFINED_USER_DATA)
FGTwoStateButtonAddTwoStateButton (int xs, int ys, int w, int h, const char *nm, int key=0, int *variable=0, ControlCall=0, void *user_data=UNDEFINED_USER_DATA)
FGEditBoxAddEditBox (int xs, int ys, int ws1, int ws2, const char *nm, int key, int *p, ControlCall f, int min, int max, void *user_data=UNDEFINED_USER_DATA)
FGEditBoxAddEditBox (int xs, int ys, int ws1, int ws2, const char *nm, int key, int *p, ControlCall f=0, void *user_data=UNDEFINED_USER_DATA)
FGEditBoxAddEditBox (int xs, int ys, int ws1, int ws2, const char *nm, int key, char *p, ControlCall f=0, void *user_data=UNDEFINED_USER_DATA)
FGEditBoxAddEditBox (int sz, int xs, int ys, int ws1, int ws2, const char *nm, int key, char *p, ControlCall f=0, void *user_data=UNDEFINED_USER_DATA)
FGEditBoxAddEditBox (int xs, int ys, int ws1, int ws2, const char *nm, int key, double *p, ControlCall f, double min, double max, void *user_data=UNDEFINED_USER_DATA)
FGEditBoxAddEditBox (int xs, int ys, int ws1, int ws2, const char *nm, int key, double *p, ControlCall f=0, void *user_data=UNDEFINED_USER_DATA)
FGBaseMenuAddBaseMenu (const char *nm, int key=0, ControlCall f=0, void *user_data=UNDEFINED_USER_DATA)
FGProgressBarAddProgressBar (int xs, int ys, int ws, int hs, int size)
FGListBoxAddListBox (int xs, int ys, int w, int h, int dropdown, FGListBoxCallBack drawone=0, void *userdata=0)
FGLabelAddLabel (int x, int y, const char *s, int key=0, ControlCall f=0, unsigned i=UNDEFINED_COLOR, unsigned p=UNDEFINED_COLOR, void *user_data=UNDEFINED_USER_DATA)
FGPanelAddPanel (int, int, int, int, const char *s=0, unsigned paper=UNDEFINED_COLOR, unsigned ink=CWHITED, unsigned ink2=CDARK)
FGTextAddText (int x, int y, const char *s, unsigned ink=UNDEFINED_COLOR, unsigned paper=UNDEFINED_COLOR)
FGImageAddImage (int x, int y, FGDrawBuffer *img)
void __fastcall WindowText (int x, int y, const char *s, unsigned Ink=UNDEFINED_COLOR, unsigned Paper=UNDEFINED_COLOR)
void __fastcall WindowText (int x, int y, const char *s, FGFontProperty *f, unsigned color, unsigned bk)
void __fastcall WindowTextUTF8 (int x, int y, const char *s, FGFontProperty *f, unsigned color, unsigned bk)
void __fastcall WindowTextUnicode (int x, int y, const unsigned short *s, FGFontProperty *f, unsigned color, unsigned bk)
void __fastcall WindowPanel (int, int, int, int, const char *s=0, int unsigned=CWHITED, unsigned ink2=CDARK)
void __fastcall WindowBox (int x, int y, int a, int b, unsigned color=UNDEFINED_COLOR)
void __fastcall WindowPixel (int x, int y, unsigned color=UNDEFINED_COLOR)
void __fastcall WindowRect (int x, int y, int a, int b, unsigned color=UNDEFINED_COLOR)
void __fastcall WindowPatternRect (int x, int y, int a, int b, FGPattern *)
void __fastcall WindowLine (int x, int y, int a, int b, unsigned color=UNDEFINED_COLOR)
void __fastcall WindowPatternLine (int x, int y, int a, int b, FGPattern *p=&PatternDot)
void __fastcall WindowDrawCircle (int x, int y, int r, unsigned color=UNDEFINED_COLOR)
void __fastcall WindowFillCircle (int x, int y, int r, unsigned color=UNDEFINED_COLOR)
void __fastcall WindowDrawEllipse (int x, int y, int rx, int ry, unsigned color=UNDEFINED_COLOR)
void __fastcall WindowFillEllipse (int x, int y, int rx, int ry, unsigned color=UNDEFINED_COLOR)
void __fastcall WindowDrawArc (int x, int y, double ang1, double ang2, int r, unsigned color=UNDEFINED_COLOR)
FGRect __fastcall WindowFillPolygon (const FGPointArray &, unsigned col=UNDEFINED_COLOR)
void __fastcall WindowDrawPolygon (const FGPointArray &, unsigned col=UNDEFINED_COLOR)
FGRect __fastcall WindowFillTriangle (int x1, int y1, int x2, int y2, int x3, int y3, unsigned col=UNDEFINED_COLOR)
void __fastcall WindowSpline (FGPoint points[4], unsigned color=UNDEFINED_COLOR)
void __fastcall WindowScrollDown (int xx, int yy, int ww, int hh, int about)
void __fastcall WindowScrollUp (int xx, int yy, int ww, int hh, int about)
void __fastcall WindowScrollLeft (int xx, int yy, int ww, int hh, int about)
void __fastcall WindowScrollRight (int xx, int yy, int ww, int hh, int about)
void __fastcall WindowStatusBar (int, const char *s, int c=CBLACK)
int printf (const char *,...)
int printf (int, int, const char *,...)
void __fastcall SendEvent (int event, int key=0, int x=0, int y=0)
void __fastcall SendEvent (int event, int x, int y, int ww, int hh)
void __fastcall SendToWindow (FGEvent *p)
void __fastcall WindowLock (void)
void __fastcall WindowUnLock (void)
void __fastcall WindowResize (int, int)
void __fastcall WindowMove (int, int)
void __fastcall WindowFocus (void)
void __fastcall WindowShape (int, int, int, int)
void __fastcall WindowPutBitmap (int x, int y, int xs, int ys, int w, int h, FGDrawBuffer *p)
void __fastcall WindowGetBitmap (int x, int y, int xs, int ys, int w, int h, FGDrawBuffer *p)
MODAL_RETURN __fastcall ShowModal (void)
bool __fastcall WindowSetWorkRect (int, int, int, int)
void __fastcall RedrawControls (void)
void __fastcall RemoveControls (void)
void __fastcall RemoveControls (FGControlBoxIterator iter)
bool __fastcall RemoveControl (FGControlBoxIterator iter, FGControl *ctrl)
void __fastcall RemoveControl (FGControl *ctrl)
void __fastcall DisableControls (void)
void __fastcall DisableControls (FGControlBoxIterator iter)
void __fastcall EnableControls (void)
void __fastcall EnableControls (FGControlBoxIterator iter)
void __fastcall SetInk (FGPixel i)
void __fastcall SetPaper (FGPixel p)
void __fastcall SetName (const char *s)
bool __fastcall AddTabPage (const char *name)
const char *__fastcall GetCurrentTabPage (void)
void __fastcall SetTabPage (const char *name)
void __fastcall DeleteTabPages (void)
void __fastcall DeleteTabPage (const char *name)
int GetNumberOfTabPages (void)
virtual void OnKeyPress (int akey)
virtual void OnMouseMove (int x, int y)
virtual void OnClick (int x, int y)
virtual void OnDoubleClick (int x, int y)
virtual void OnMiddleButton (int, int)
virtual void OnContextPopup (int x, int y)
virtual void OnWheel (int x, int y, int delta)
virtual void OnPaint (void)
virtual void OnStartDrag (int, int, int)
virtual void OnEndDrag (int, int, int, int, int)
virtual void OnMove (int dx, int dy)
virtual void OnResize (int dx, int dy)
virtual void OnIconize (void)
virtual void OnAccelerator (FGControl *which)
virtual void OnTabSwitch (const char *)

Static Public Member Functions

static void ShowAll (void)
static void __fastcall WindowVirtualRoot (int, int, int, int)

Protected Member Functions

virtual void __fastcall RepaintBlock (int x, int y, int w, int h)
void __fastcall init (void)
void __fastcall default_clipping (void)
long __fastcall WindowStatus (long status)
virtual void WindowPiktograms (int x, int y)
virtual void WindowDrawTitle (int color)

Protected Attributes

FGDrawBuffericon


Constructor & Destructor Documentation

fgl::FGWindow::FGWindow FGWindow **  wp,
int  xs,
int  ys,
int  ws,
int  hs,
const char *  nm,
GuiHwnd  hnd = 0,
int  i = IM,
int  p = PM,
int  flag = WTITLED|WFRAMED,
void *  user_data = UNDEFINED_USER_DATA
 

Parameters:
wp pointer at the pointer at the window itself. It is an address of store of pointer to this window. When window is destroyed, to this pointer is assigned NULL. You can basically test this pointer to NULL to prevent manipulating with destroyed object.
xs X position
ys Y position
ws width of complete window (client space is this size minus the window frame.)
hs height of complete window (client space is this size minus the window frame.)
nm standard C string, which can be with any length. This name will be displayed it the title of the window (if title is present).
hnd pointer to the window callback procedure. It is a big switch command with many cases. You can set this to 0 by default.
i ink color
p paper color
flag for the window properties (e.g. has frame, has title etc.)
user_data sets user data pointer to this parameter ( see GetUserData() )


Member Function Documentation

FGBaseMenu * fgl::FGWindow::AddBaseMenu const char *  nm,
int  key = 0,
ControlCall  f = 0,
void *  user_data = UNDEFINED_USER_DATA
 

Adds an line menu item to the FGWindow. This used for pop-up menus. The position and size is calculated automatically.

Parameters:
nm name of the button
key a keycode used as a hot-key for the button (it isn't case sensitive). By example: 'a', 0x20 or ALT_G
f a callback function of type ControllCall
user_data an optional user data pointer (for better binding between GUI and user's objects).
Returns:
a pointer to created object, you can save this one if you can call any methods.
Note:
You don't need save the pointer if you don't want call other methods ( e.g. Enable() ) or groups with other buttons. The object will be release automatically when the FGWindow will be destroyed. Don't destruct the object explicitly!
See also:
FGBaseGui FGControl FGBaseMenu
Examples:
buttons.cpp.

FGCheckBox * fgl::FGWindow::AddCheckBox int  xs,
int  ys,
const char *  nm,
int  key,
bool *  variable,
ControlCall  f = 0,
void *  user_data = UNDEFINED_USER_DATA
 

Adds a FGCheckBox to the FGWindow.

Parameters:
xs x position in a window
ys y position in a window
nm name of the button
key a keycode used as a hot-key for the button (it isn't case sensitive). By example: 'a', 0x20 or ALT_G
variable a pointer to bool variable. The value of this variable controls the state of button (true/false)
f a callback function of type ControllCall
user_data an optional user data pointer (for better binding between GUI and user's objects).
Returns:
a pointer to created object, you can save this one if you can call any methods.
Note:
You don't need save the pointer if you don't want call other methods ( e.g. Enable() ) or groups with other buttons. The object will be release automatically when the FGWindow will be destroyed. Don't destruct the object explicitly!
See also:
FGBaseGui FGControl FGCheckBox FGButtonGroup

FGCheckBox * fgl::FGWindow::AddCheckBox int  xs,
int  ys,
const char *  nm,
int  key = 0,
int *  variable = 0,
ControlCall  f = 0,
void *  user_data = UNDEFINED_USER_DATA
 

Adds a FGCheckBox to the FGWindow.

Parameters:
xs x position in a window
ys y position in a window
nm name of the button
key a keycode used as a hot-key for the button (it isn't case sensitive). By example: 'a', 0x20 or ALT_G
variable a pointer to int variable. The value of this variable controls the state of button (true/false)
f a callback function of type ControllCall
user_data an optional user data pointer (for better binding between GUI and user's objects).
Returns:
a pointer to created object, you can save this one if you can call any methods.
Note:
You don't need save the pointer if you don't want call other methods ( e.g. Enable() ) or groups with other buttons. The object will be release automatically when the FGWindow will be destroyed. Don't destruct the object explicitly!
See also:
FGBaseGui FGControl FGCheckBox FGButtonGroup

FGCheckBox * fgl::FGWindow::AddCheckBoxMask int  mask,
int  xs,
int  ys,
const char *  nm,
int  key = 0,
int *  variable = 0,
ControlCall  f = 0,
void *  user_data = UNDEFINED_USER_DATA
 

Adds a masked version FGCheckBox to the FGWindow. This is like a normal check box but it is controlled by one of a 32 bit in a triggered variable (of type uint32). This is useful when you want change only one bit of variable.

Parameters:
mask bit mask value, by example 1 for a bit 0 or (1<<20) for twenth bit.
xs x position in a window
ys y position in a window
nm name of the button
key a keycode used as a hot-key for the button (it isn't case sensitive). By example: 'a', 0x20 or ALT_G
variable a pointer to int variable. The value of this variable controls the state of button (true/false)
f a callback function of type ControllCall
user_data an optional user data pointer (for better binding between GUI and user's objects).
Returns:
a pointer to created object, you can save this one if you can call any methods.
Note:
You don't need save the pointer if you don't want call other methods ( e.g. Enable() ) or groups with other buttons. The object will be release automatically when the FGWindow will be destroyed. Don't destruct the object explicitly!
See also:
FGBaseGui FGControl FGCheckBox FGButtonGroup

FGEditBox * fgl::FGWindow::AddEditBox int  xs,
int  ys,
int  ws1,
int  ws2,
const char *  nm,
int  key,
double *  p,
ControlCall  f = 0,
void *  user_data = UNDEFINED_USER_DATA
 

Adds an FGEditBox for an one-line-edit box for an double number without the test to in-a-range-number.

Parameters:
xs x position in a window
ys y position in a window
ws1 width of the button caption, the text is right alligned
ws2 width of the button input part
nm name of the button
key a keycode used as a hot-key for the button (it isn't case sensitive). By example: 'a', 0x20 or ALT_G
p a pointer to the edited double variable
f a callback function of type ControllCall
user_data an optional user data pointer (for better binding between GUI and user's objects).
Returns:
a pointer to created object, you can save this one if you can call any methods.
Note:
You don't need save the pointer if you don't want call other methods ( e.g. Enable() ) or groups with other buttons. The object will be release automatically when the FGWindow will be destroyed. Don't destruct the object explicitly!
See also:
FGBaseGui FGControl FGEditBox

FGEditBox * fgl::FGWindow::AddEditBox int  xs,
int  ys,
int  ws1,
int  ws2,
const char *  nm,
int  key,
double *  p,
ControlCall  f,
double  min,
double  max,
void *  user_data = UNDEFINED_USER_DATA
 

Adds an FGEditBox for an one-line-edit box for an double number with the test to in-a-range-number.

Parameters:
xs x position in a window
ys y position in a window
ws1 width of the button caption, the text is right alligned
ws2 width of the button input part
nm name of the button
key a keycode used as a hot-key for the button (it isn't case sensitive). By example: 'a', 0x20 or ALT_G
p a pointer to the edited double variable
f a callback function of type ControllCall
min minimal correct value for a range testing
max maximal correct value for a range testing
user_data an optional user data pointer (for better binding between GUI and user's objects).
Returns:
a pointer to created object, you can save this one if you can call any methods.
Note:
You don't need save the pointer if you don't want call other methods ( e.g. Enable() ) or groups with other buttons. The object will be release automatically when the FGWindow will be destroyed. Don't destruct the object explicitly!
See also:
FGBaseGui FGControl FGEditBox

FGEditBox * fgl::FGWindow::AddEditBox int  sz,
int  xs,
int  ys,
int  ws1,
int  ws2,
const char *  nm,
int  key,
char *  p,
ControlCall  f = 0,
void *  user_data = UNDEFINED_USER_DATA
 

Adds an FGEditBox for an one-line-edit box for an string. The max length of string is get from the ws2 parameter/8, i.e. you don't type bigger string string that that value.

Parameters:
sz is the maximal size of input string in range from 1 to 127 characters.
xs x position in a window
ys y position in a window
ws1 width of the button caption, the text is right alligned
ws2 width of the button input part
nm name of the button
key a keycode used as a hot-key for the button (it isn't case sensitive). By example: 'a', 0x20 or ALT_G
p a pointer to the edited int variable
f a callback function of type ControllCall
user_data an optional user data pointer (for better binding between GUI and user's objects).
Returns:
a pointer to created object, you can save this one if you can call any methods.
Note:
You don't need save the pointer if you don't want call other methods ( e.g. Enable() ) or groups with other buttons. The object will be release automatically when the FGWindow will be destroyed. Don't destruct the object explicitly!
See also:
FGBaseGui FGControl FGEditBox

FGEditBox * fgl::FGWindow::AddEditBox int  xs,
int  ys,
int  ws1,
int  ws2,
const char *  nm,
int  key,
char *  p,
ControlCall  f = 0,
void *  user_data = UNDEFINED_USER_DATA
 

Adds an FGEditBox for an one-line-edit box for an string. The max length of string is get from the ws2 parameter/8, i.e. you don't type bigger string string that that value.

Parameters:
xs x position in a window
ys y position in a window
ws1 width of the button caption, the text is right alligned
ws2 width of the button input part
nm name of the button
key a keycode used as a hot-key for the button (it isn't case sensitive). By example: 'a', 0x20 or ALT_G
p a pointer to the edited int variable
f a callback function of type ControllCall
user_data an optional user data pointer (for better binding between GUI and user's objects).
Returns:
a pointer to created object, you can save this one if you can call any methods.
Note:
You don't need save the pointer if you don't want call other methods ( e.g. Enable() ) or groups with other buttons. The object will be release automatically when the FGWindow will be destroyed. Don't destruct the object explicitly!
See also:
FGBaseGui FGControl FGEditBox

FGEditBox * fgl::FGWindow::AddEditBox int  xs,
int  ys,
int  ws1,
int  ws2,
const char *  nm,
int  key,
int *  p,
ControlCall  f = 0,
void *  user_data = UNDEFINED_USER_DATA
 

Adds an FGEditBox for an one-line-edit box for an integer number without the test to in-a-range-number.

Parameters:
xs x position in a window
ys y position in a window
ws1 width of the button caption, the text is right alligned
ws2 width of the button input part
nm name of the button
key a keycode used as a hot-key for the button (it isn't case sensitive). By example: 'a', 0x20 or ALT_G
p a pointer to the edited int variable
f a callback function of type ControllCall
user_data an optional user data pointer (for better binding between GUI and user's objects).
Returns:
a pointer to created object, you can save this one if you can call any methods.
Note:
You don't need save the pointer if you don't want call other methods ( e.g. Enable() ) or groups with other buttons. The object will be release automatically when the FGWindow will be destroyed. Don't destruct the object explicitly!
See also:
FGBaseGui FGControl FGEditBox

FGEditBox * fgl::FGWindow::AddEditBox int  xs,
int  ys,
int  ws1,
int  ws2,
const char *  nm,
int  key,
int *  p,
ControlCall  f,
int  min,
int  max,
void *  user_data = UNDEFINED_USER_DATA
 

Adds an FGEditBox for an one-line-edit box for an integer number with the test to in-a-range-number.

Parameters:
xs x position in a window
ys y position in a window
ws1 width of the button caption, the text is right alligned
ws2 width of the button input part
nm name of the button
key a keycode used as a hot-key for the button (it isn't case sensitive). By example: 'a', 0x20 or ALT_G
p a pointer to the edited int variable
f a callback function of type ControllCall
min minimal correct value from -2147483648 to 2147483647 for a range testing
max maximal correct value from -2147483648 to 2147483647 for a range testing
user_data an optional user data pointer (for better binding between GUI and user's objects).
Returns:
a pointer to created object, you can save this one if you can call any methods.
Note:
You don't need save the pointer if you don't want call other methods ( e.g. Enable() ) or groups with other buttons. The object will be release automatically when the FGWindow will be destroyed. Don't destruct the object explicitly!
See also:
FGBaseGui FGControl FGEditBox
Examples:
buttons.cpp.

FGImage * fgl::FGWindow::AddImage int  x,
int  y,
FGDrawBuffer img
 

Adds dynamic image to the FGWindow. The attached image is nor released at the end of live.

Parameters:
x x position in a window
y y position in a window
img Image

FGLabel * fgl::FGWindow::AddLabel int  x,
int  y,
const char *  s,
int  key = 0,
ControlCall  f = 0,
unsigned  i = UNDEFINED_COLOR,
unsigned  p = UNDEFINED_COLOR,
void *  user_data = UNDEFINED_USER_DATA
 

Adds a text Label.

Parameters:
x x position in a window
y y position in a window
s name of the button
key a keycode used as a hot-key for the button (it isn't case sensitive). By example: 'a', 0x20 or ALT_G
f a callback function of type ControllCall
i explicit foreground color, default is color of parents
p explicit background color, default is color of parents
user_data an optional user data pointer (for better binding between GUI and user's objects).
Returns:
a pointer to created object, you can save this one if you can call any methods.
Note:
You don't need save the pointer if you don't want call other methods ( e.g. Enable() ) or groups with other buttons. The object will be release automatically when the FGWindow will be destroyed. Don't destruct the object explicitly!
See also:
FGBaseGui FGControl Label

FGListBox * fgl::FGWindow::AddListBox int  xs,
int  ys,
int  w,
int  h,
int  dropdown,
FGListBoxCallBack  drawone = 0,
void *  user_data = 0
 

Adds a LISTBOX container to the FGWindow.

Parameters:
xs x position in a window
ys y position in a window
w width of the one item
h height of the one item
dropdown number of lines that list box occupies. This is not a real number items, it is only visual size.
drawone a callback function of type FGListBoxCallBack
user_data an optional user data pointer (for better binding between GUI and user's objects).
Returns:
a pointer to created object, you can save this one if you can call any methods.
Note:
You don't need save the pointer if you don't want call other methods ( e.g. Enable() ) or groups with other buttons. The object will be release automatically when the FGWindow will be destroyed. Don't destruct the object explicitly!
See also:
FGListBox listbox0

FGPanel * fgl::FGWindow::AddPanel int  x,
int  y,
int  w,
int  h,
const char *  s = 0,
unsigned  paper = UNDEFINED_COLOR,
unsigned  ink = CWHITED,
unsigned  ink2 = CDARK
 

Adds panel to the FGWindow.

Parameters:
x x position in a window
y y position in a window
w width of the button caption, the text is right alligned
h width of the button input part
s name of the panel
paper explicit background color, default is color of parents
ink explicit foreground color1, default is CWHITED
ink2 explicit foreground color1, default is CDARK
Note:
This object is replacement for an older WindowPanel() methods that is absolete and will be removed in OpenGUI 4.4.0 The main reason is compatibility with TabPages - WindowPanel() doesn't work properly with one.

FGProgressBar * fgl::FGWindow::AddProgressBar int  xs,
int  ys,
int  ws,
int  hs,
int  size
 

Adds a FGProgressBar into the FGWindow.

Parameters:
xs x position in a window
ys y position in a window
ws width of widget
hs height of widget
size the progressed value
Returns:
a pointer to created object, you can save this one if you can call any methods.
Note:
You don't need save the pointer if you don't want call other methods ( e.g. Enable() ) or groups with other buttons. The object will be release automatically when the FGWindow will be destroyed. Don't destruct the object explicitly!
See also:
FGBaseGui FGControl FGProgressBar

FGPushButton * fgl::FGWindow::AddPushButton int  xs,
int  ys,
int  key,
FGDrawBuffer bm,
ControlCall  f,
void *  user_data = UNDEFINED_USER_DATA
 

Adds an icon form of FGPushButton to the FGWindow.

Parameters:
xs x position in a window
ys y position in a window
key a keycode used as a hot-key for the button (it isn't case sensitive). By example: 'a', 0x20 or ALT_G
bm pointer to image object - ICON as a FGDrawBuffer object
f a callback function of type ControllCall
user_data an optional user data pointer (for better binding between GUI and user's objects).
Returns:
a pointer to created object, you can save this one if you can call any methods.
Note:
You don't need save the pointer if you don't want call other methods ( e.g. Enable() ) or groups with other buttons. The object will be release automatically when the FGWindow will be destroyed. Don't destruct the object explicitly!
See also:
FGBaseGui FGControl FGPushButton FGButtonGroup

FGPushButton * fgl::FGWindow::AddPushButton int  xs,
int  ys,
int  ws,
int  hs,
const char *  nm,
int  key,
FGDrawBuffer bm,
ControlCall  f,
void *  user_data = UNDEFINED_USER_DATA
 

Adds an icon form of FGPushButton to the FGWindow. This method can set size & name of button directly.

Parameters:
xs x position in a window
ys y position in a window
ws width of the button
hs height of the button, there is recomended values from 21 and above
nm name of the button
key a keycode used as a hot-key for the button (it isn't case sensitive). By example: 'a', 0x20 or ALT_G
bm pointer to image object - ICON as a FGDrawBuffer object
f a callback function of type ControllCall
user_data an optional user data pointer (for better binding between GUI and user's objects).
Returns:
a pointer to created object, you can save this one if you can call any methods.
Note:
You don't need save the pointer if you don't want call other methods ( e.g. Enable() ) or groups with other buttons. The object will be release automatically when the FGWindow will be destroyed. Don't destruct the object explicitly!
See also:
FGBaseGui FGControl FGPushButton FGButtonGroup

FGPushButton * fgl::FGWindow::AddPushButton int  xs,
int  ys,
int  ws,
int  hs,
const char *  nm,
int  key = 0,
ControlCall  f = 0,
void *  user_data = UNDEFINED_USER_DATA
 

Adds a text form of FGPushButton to the FGWindow.

Parameters:
xs x position in a window
ys y position in a window
ws width of the button
hs height of the button, there is recomended values from 21 and above
nm name of the button
key a keycode used as a hot-key for the button (it isn't case sensitive). By example: 'a', 0x20 or ALT_G
f a callback function of type ControllCall
user_data an optional user data pointer (for better binding between GUI and user's objects).
Returns:
a pointer to created object, you can save this one if you can call any methods.
Note:
You don't need save the pointer if you don't want call other methods ( e.g. Enable() ) or groups with other buttons. The object will be release automatically when the FGWindow will be destroyed. Don't destruct the object explicitly!
See also:
FGBaseGui FGControl FGPushButton FGButtonGroup
Examples:
bitmap.cpp, buttons.cpp, connect.cpp, and hello.cpp.

FGRadioButton * fgl::FGWindow::AddRadioButton int  xs,
int  ys,
const char *  nm,
int  key = 0,
int *  variable = 0,
ControlCall  f = 0,
void *  user_data = UNDEFINED_USER_DATA
 

Adds a FGRadioButton to the FGWindow.

Parameters:
xs x position in a window
ys y position in a window
nm name of the button
key a keycode used as a hot-key for the button (it isn't case sensitive). By example: 'a', 0x20 or ALT_G
variable a pointer to int variable. The value of this variable controls the state of button (true/false)
f a callback function of type ControllCall
user_data an optional user data pointer (for better binding between GUI and user's objects).
Returns:
a pointer to created object, you can save this one if you can call any methods.
Note:
You don't need save the pointer if you don't want call other methods ( e.g. Enable() ) or groups with other buttons. The object will be release automatically when the FGWindow will be destroyed. Don't destruct the object explicitly!
See also:
FGBaseGui FGControl FGRadioButton FGButtonGroup

FGRadioButton * fgl::FGWindow::AddRadioButtonMask int  mask,
int  xs,
int  ys,
const char *  nm,
int  key = 0,
int *  variable = 0,
ControlCall  f = 0,
void *  user_data = UNDEFINED_USER_DATA
 

Adds a masked version FGRadioButton to the FGWindow. This is like a normal check box but it is controlled by one of a 32 bit in a triggered variable (of type uint32). This is useful when you want change only one bit of variable.

Parameters:
mask bit mask value, by example 1 for a bit 0 or (1<<20) for twenth bit.
xs x position in a window
ys y position in a window
nm name of the button
key a keycode used as a hot-key for the button (it isn't case sensitive). By example: 'a', 0x20 or ALT_G
variable a pointer to int variable. The value of this variable controls the state of button (true/false)
f a callback function of type ControllCall
user_data an optional user data pointer (for better binding between GUI and user's objects).
Returns:
a pointer to created object, you can save this one if you can call any methods.
Note:
You don't need save the pointer if you don't want call other methods ( e.g. Enable() ) or groups with other buttons. The object will be release automatically when the FGWindow will be destroyed. Don't destruct the object explicitly!
See also:
FGBaseGui FGControl FGRadioButton FGButtonGroup

FGSlideBarH * fgl::FGWindow::AddSlideBarH int  xs,
int  ys,
int  min,
int  max,
int  step,
int *  val,
ControlCall  f = 0,
void *  user_data = UNDEFINED_USER_DATA
 

Adds a horizontal slider to the FGWindow.

Parameters:
xs x position in a window
ys y position in a window
min the start value of slider
max the last value of slider
step thes stepping (1 and above)
val a pointer to the controled int variable
f a callback function of type ControllCall
user_data an optional user data pointer (for better binding between GUI and user's objects).
Returns:
a pointer to created object, you can save this one if you can call any methods.
Note:
You don't need save the pointer if you don't want call other methods ( e.g. Enable() ) or groups with other buttons. The object will be release automatically when the FGWindow will be destroyed. Don't destruct the object explicitly!
See also:
FGBaseGui FGControl FGSlider FGSlideBarH
Examples:
buttons.cpp.

FGSlideBarV * fgl::FGWindow::AddSlideBarV int  xs,
int  ys,
int  min,
int  max,
int  step,
int *  val,
ControlCall  f = 0,
void *  user_data = UNDEFINED_USER_DATA
 

Adds a vertical slider to the FGWindow.

Parameters:
xs x position in a window
ys y position in a window
min the start value of slider
max the last value of slider
step thes stepping (1 and above)
val a pointer to the controled int variable
f a callback function of type ControllCall
user_data an optional user data pointer (for better binding between GUI and user's objects).
Returns:
a pointer to created object, you can save this one if you can call any methods.
Note:
You don't need save the pointer if you don't want call other methods ( e.g. Enable() ) or groups with other buttons. The object will be release automatically when the FGWindow will be destroyed. Don't destruct the object explicitly!
See also:
FGBaseGui FGControl FGSlider FGSlideBarV

bool __fastcall fgl::FGWindow::AddTabPage const char *  name  ) 
 

Add current controls to the named tabpage and make one current.

Adds a TabPage to the FGWindow. This Tab will contens all controls added to the FGWindow before this. From now, you can add controls to the next Tab.

Parameters:
name caption / id string
Returns:
returns false if the name is already used (and all current controls are dropped!)
Note:
that the call to this function creates a tab with controls that are ALREADY in the window but not with controls that you will add after this!
See also:
SetTabPage() GetCurrentPage()

FGText * fgl::FGWindow::AddText int  x,
int  y,
const char *  s,
unsigned  ink = UNDEFINED_COLOR,
unsigned  paper = UNDEFINED_COLOR
 

Adds dynamic text string to the FGWindow.

Parameters:
x x position in a window
y y position in a window
s name of the panel
ink explicit foreground color1, default is CWHITED
paper explicit background color, default is color of parents

FGTwoStateButton * fgl::FGWindow::AddTwoStateButton int  xs,
int  ys,
int  w,
int  h,
const char *  nm,
int  key = 0,
int *  variable = 0,
ControlCall  f = 0,
void *  user_data = UNDEFINED_USER_DATA
 

Adds FGTwoStateButton to the FGWindow.

Parameters:
xs x position in a window
ys y position in a window
w width of the button
h height of the button, there is recomended values from 21 and above
nm name of the button
key a keycode used as a hot-key for the button (it isn't case sensitive). By example: 'a', 0x20 or ALT_G
variable a pointer to int variable. The value of this variable controls the state of button (true/false)
f a callback function of type ControllCall
user_data an optional user data pointer (for better binding between GUI and user's objects).
Returns:
a pointer to created object, you can save this one if you can call any methods.
Note:
You don't need save the pointer if you don't want call other methods ( e.g. Enable() ) or groups with other buttons. The object will be release automatically when the FGWindow will be destroyed. Don't destruct the object explicitly!
See also:
FGBaseGui FGControl FGTwoStateButton FGButtonGroup

void __fastcall fgl::FGWindow::DeleteTabPage const char *  name  ) 
 

Removes tab page from the window.

void __fastcall fgl::FGWindow::DeleteTabPages void   ) 
 

Removes all tab pages from the window.

void __fastcall fgl::FGWindow::DisableControls FGControlBoxIterator  iter  ) 
 

Disables all the controls in the FGWindow at once.

void __fastcall fgl::FGWindow::DisableControls void   ) 
 

Disables all the controls in the FGWindow at once.

void __fastcall fgl::FGWindow::EnableControls FGControlBoxIterator  iter  ) 
 

Enables all the controls in the FGWindow at once.

void __fastcall fgl::FGWindow::EnableControls void   ) 
 

Enables all the controls in the FGWindow at once.

FGControlBoxIterator fgl::FGWindow::GetCurrentControls void   )  [inline]
 

Returns the pointer to the first FGControl in the FGWindow.

const char* __fastcall fgl::FGWindow::GetCurrentTabPage void   )  [inline]
 

Returns current tab page name or null.

See also:
SetTabPage()

int fgl::FGWindow::GetNumberOfTabPages void   ) 
 

Returns the number of attached TabPages.

void fgl::FGWindow::InstallWindowHook void(*)(int, int, int &, int &, int)  hook  )  [inline]
 

internal

int __fastcall fgl::FGWindow::IsIconized void   )  const [inline]
 

Returns true/false if the FGWindow is iconized.

virtual void fgl::FGWindow::OnAccelerator FGControl which  )  [inline, virtual]
 

override this member when you want your own processing of ACCELERATORS

virtual void fgl::FGWindow::OnClick int  x,
int  y
[inline, virtual]
 

override this member when you want your own processing of MOUSE LEFT CLICK

virtual void fgl::FGWindow::OnContextPopup int  x,
int  y
[inline, virtual]
 

override this member when you want your own processing of MOUSE RIGHT CLICK

virtual void fgl::FGWindow::OnDoubleClick int  x,
int  y
[inline, virtual]
 

override this member when you want your own processing of DOUBLE MOUSE LEFT CLICK

virtual void fgl::FGWindow::OnEndDrag int  ,
int  ,
int  ,
int  ,
int 
[inline, virtual]
 

override this member when you want your own processing of DRAG&DROP

virtual void fgl::FGWindow::OnIconize void   )  [inline, virtual]
 

override this member when you want your own processing of WINDOW ICONIZE

virtual void fgl::FGWindow::OnKeyPress int  akey  )  [inline, virtual]
 

override this member when you want your own processing of KEYPRESS

virtual void fgl::FGWindow::OnMiddleButton int  ,
int 
[inline, virtual]
 

overload this member when you want catch the click on MIDDLE mouse's button event.

virtual void fgl::FGWindow::OnMouseMove int  x,
int  y
[inline, virtual]
 

override this member when you want your own processing of MOUSE MOVING

virtual void fgl::FGWindow::OnMove int  dx,
int  dy
[inline, virtual]
 

override this member when you want your own processing of WINDOW MOVE

virtual void fgl::FGWindow::OnPaint void   )  [inline, virtual]
 

override this member when you want your own processing of REPAINT event.

virtual void fgl::FGWindow::OnResize int  dx,
int  dy
[inline, virtual]
 

override this member when you want your own processing of WINDOW RESIZE

virtual void fgl::FGWindow::OnStartDrag int  ,
int  ,
int 
[inline, virtual]
 

override this member when you want your own processing of DRAG&DROP

virtual void fgl::FGWindow::OnTabSwitch const char *   )  [inline, virtual]
 

override this member when you want to handle the TabPage switch

virtual void fgl::FGWindow::OnWheel int  x,
int  y,
int  delta
[inline, virtual]
 

overload this member when you want catch the mouse's wheel spin.

int fgl::FGWindow::printf int  xx,
int  yy,
const char *  format,
  ...
 

A traditional printf in window form + position As printf() but at the exact position.

Reimplemented from fgl::FGDrawBuffer.

int fgl::FGWindow::printf const char *  format,
  ...
 

A traditional printf in window form.

Writes formatted output to the window at current position. When the whole FGWindow is printed out, image automatically scroll-up.

The printf function:

  • Accepts a series of arguments
  • Applies to each argument a format specifier contained in the format string *format
  • Outputs the formatted data (to the screen, a stream, stdout, or a string)

There must be enough arguments for the format. If there are not, the results will be unpredictable and likely disastrous. Excess arguments (more than required by the format) are merely ignored.

The format string, present in each of the printf function calls, controls how each function will convert, format, and print its arguments.

Note:
There must be enough arguments for the format; if not, the results will be unpredictable and possibly disastrous. Excess arguments (more than required by the format) are ignored.
The format string is a character string that contains two types of objects:
  • Plain characters are copied verbatim to the output stream.
  • Conversion specifications fetch arguments from the argument list and apply formatting to them.

Plain characters are simply copied verbatim to the output stream. Conversion specifications fetch arguments from the argument list and apply formatting to them.

see 'man printf' for more details

Returns:
On success, printf returns the number of bytes output. On error, printf returns EOF.
Parameters:
format formatting string as detailed above
Examples:
bgroup.cpp, buttons.cpp, events.cpp, font.cpp, hello.cpp, and timer.cpp.

void __fastcall fgl::FGWindow::RedrawControls void   ) 
 

Redraw controls.

void __fastcall fgl::FGWindow::RemoveControl FGControl ctrl  ) 
 

Removes the control from window (button, etc.).

bool __fastcall fgl::FGWindow::RemoveControl FGControlBoxIterator  iter,
FGControl ctrl
 

Removes the control from window (button, etc.).

void __fastcall fgl::FGWindow::RemoveControls FGControlBoxIterator  iter  ) 
 

Removes all the controls from window (buttons, listoboxes, editboxes etc.).

void __fastcall fgl::FGWindow::RemoveControls void   ) 
 

Removes all the controls from window (buttons, listoboxes, editboxes etc.).

void __fastcall fgl::FGWindow::ResetChange void   )  [inline]
 

Marks the FGWindow state as 'NOT CHANGED'. Works together with notifycation on window close.

void fgl::FGWindow::RunHandler void   ) 
 

internal

void __fastcall fgl::FGWindow::SendEvent int  event,
int  x,
int  y,
int  ww,
int  hh
[inline]
 

The helper for event sending to the FGWindow.

void __fastcall fgl::FGWindow::SendEvent int  event,
int  key = 0,
int  x = 0,
int  y = 0
[inline]
 

The helper for event sending to the FGWindow.

void __fastcall fgl::FGWindow::SendToWindow FGEvent p  ) 
 

Send the event to the FGWindow handler.

void fgl::FGWindow::SetActive FGControl c  ) 
 

internal

void __fastcall fgl::FGWindow::SetChange void   )  [inline]
 

Marks the FGWindow state as 'CHANGED'. Works together with notifycation on window close.

void __fastcall fgl::FGWindow::SetIconPosition int  x,
int  y
[inline]
 

Sets the icon position.

void __fastcall fgl::FGWindow::SetInk FGPixel  i  )  [inline]
 

Sets the FGWindow foreground color for layout and default foreground color for drawing.

Examples:
font.cpp.

void __fastcall fgl::FGWindow::SetName const char *  s  ) 
 

Sets the new caption for the FGWindow.

Reimplemented from fgl::FGDrawBuffer.

Examples:
widget.cpp.

void __fastcall fgl::FGWindow::SetPaper FGPixel  p  )  [inline]
 

Sets the FGWindow background color for layout and default background color for drawing.

void __fastcall fgl::FGWindow::SetTabPage const char *  name  ) 
 

Sets the new current tab page.

Parameters:
name caption / id string
See also:
GetCurrentPage()

void fgl::FGWindow::ShowAll void   )  [static]
 

Deprecated:

MODAL_RETURN __fastcall fgl::FGWindow::ShowModal void   ) 
 

Run until window close or mrXXX happen.

bool __fastcall fgl::FGWindow::ShowNotify void   ) 
 

Shows a dialog for save changes if needed (window has set WNOTIFY and has been marked as changed (by SetChange()). If the window has set WNOTIFY flag but isn't changed then function sends NOTIFYEVENT to the window immediatelly and returns.

Returns:
true if notifycation has been performed else returns false.
See also:
TextEditor SetChange() ResetChange() WindowClose()

void fgl::FGWindow::StateLock void   )  [inline]
 

Lock the FGWindow to access from other threads.

void fgl::FGWindow::StateUnlock void   )  [inline]
 

Unlock the FGWindow to access from other threads.

void __fastcall fgl::FGWindow::WindowAttachIcon FGDrawBuffer ico  )  [inline]
 

Attaches the image as icon to the FGWindow.

Examples:
bitmap.cpp, and hello.cpp.

void __fastcall fgl::FGWindow::WindowBox int  x,
int  y,
int  a,
int  b,
unsigned  color = UNDEFINED_COLOR
 

Draws the filled box into the FGWindow. The output will takes rop from the current FGWindow values.

Parameters:
x x position
y y position
a width
b height
color foreground color
See also:
set_ppop()
Examples:
calc.cpp.

bool fgl::FGWindow::WindowClose void   ) 
 

Closes the FGWindow and release all the controls associated with it. This is a wrapper for window delete operator. You can still use operator delete that destroy window immediatelly and unconditionally but you lose a notify mechanism (WNOTIFYEVENT). WindowClose() test the window for 'changed' flag and WNOTIFY and shows a dialog "SAVE CHANGES?". For more see at TextEditor implementation where it is used.

Returns:
false if the window has been destroyed or true if still not.
See also:
~FGWindow TextEditor

void __fastcall fgl::FGWindow::WindowDrawArc int  x,
int  y,
double  ang1,
double  ang2,
int  r,
unsigned  color = UNDEFINED_COLOR
 

Draws a circular arc with centre x, y and radius r, in an anticlockwise direction starting from the angle a and ending when it reaches b. These values are specified in radian format, with M_PI*2 equal to a full circle. Zero is to the right of the centre point, and larger values rotate anticlockwise from there.

Parameters:
x x coordinate of the arc centre
y y coordinate of the arc centre
ang1 starting angle
ang2 ending angle
r radius in pixels
color color

void __fastcall fgl::FGWindow::WindowDrawCircle int  x,
int  y,
int  r,
unsigned  color = UNDEFINED_COLOR
 

Draws the circle into the FGWindow. The output will takes rop from the current FGWindow values.

Parameters:
x x position
y y position
r radius
color foreground color
See also:
set_ppop()

void __fastcall fgl::FGWindow::WindowDrawEllipse int  x,
int  y,
int  rx,
int  ry,
unsigned  color = UNDEFINED_COLOR
 

Draws the ellipse into the FGWindow. The output will takes rop from the current FGWindow values.

Parameters:
x x position
y y position
rx X radius
ry Y radius
color foreground color
See also:
set_ppop()

void __fastcall fgl::FGWindow::WindowDrawPolygon const FGPointArray vertices,
unsigned  col = UNDEFINED_COLOR
 

Draws a convex polygon in the FGWindow.

Parameters:
vertices FGPointArray object contained vertices of polygon
col foreground color
Returns:
the rectangle of polygon
See also:
set_ppop() FGPointArray

void __fastcall fgl::FGWindow::WindowFillCircle int  x,
int  y,
int  r,
unsigned  color = UNDEFINED_COLOR
 

Draws the filled circle into the FGWindow. The output will takes rop from the current FGWindow values.

Parameters:
x x position
y y position
r radius
color foreground color
See also:
set_ppop()

void __fastcall fgl::FGWindow::WindowFillEllipse int  x,
int  y,
int  rx,
int  ry,
unsigned  color = UNDEFINED_COLOR
 

Draws the filled ellipse into the FGWindow. The output will takes rop from the current FGWindow values.

Parameters:
x x position
y y position
rx X radius
ry Y radius
color foreground color
See also:
set_ppop()

FGRect __fastcall fgl::FGWindow::WindowFillPolygon const FGPointArray vertices,
unsigned  col = UNDEFINED_COLOR
 

Draws a filled convex polygon in the FGWindow.

Parameters:
vertices FGPointArray object contained vertices of polygon
col foreground color
Returns:
the rectangle of polygon
See also:
set_ppop() FGPointArray

FGRect __fastcall fgl::FGWindow::WindowFillTriangle int  x1,
int  y1,
int  x2,
int  y2,
int  x3,
int  y3,
unsigned  col = UNDEFINED_COLOR
 

Draws a filled triangle to the FGWindow.

Parameters:
x1 x position of first vertice
y1 y position of first vertice
x2 x position of second vertice
y2 y position of second vertice
x3 x position of third vertice
y3 y position of third vertice
col foreground color
Returns:
the rectangle of triangle
See also:
set_ppop()

bool __fastcall fgl::FGWindow::WindowFlushInput void   )  [inline]
 

Flushes the input line if one is currently edited.

Returns:
true if any input flushed or false if there is nothing to do.

void __fastcall fgl::FGWindow::WindowFocus void   ) 
 

switches the FGWindow to the front - it get focus.

void __fastcall fgl::FGWindow::WindowGetBitmap int  x,
int  y,
int  xs,
int  ys,
int  w,
int  h,
FGDrawBuffer p
 

Gets a rectangle area from the FGWindow int an in-memory bitmap.

Parameters:
x source x position
y source y position
xs target x position
ys target y position
w the width of source area
h the height of source area
p the pointer to the source bitmap

int __fastcall fgl::FGWindow::WindowIconize int  ,
int 
 

Iconize the FGWindow at the exact position.

int __fastcall fgl::FGWindow::WindowIconize void   ) 
 

Iconize the FGWindow at its icon position or if not available, at the mouse position.

void __fastcall fgl::FGWindow::WindowLine int  x,
int  y,
int  a,
int  b,
unsigned  color = UNDEFINED_COLOR
 

Draws the line into the FGWindow. The output will takes rop from the current FGWindow values.

Parameters:
x start x position
y start y position
a end x position
b end y position
color foreground color
See also:
set_ppop()

void __fastcall fgl::FGWindow::WindowLock void   )  [inline]
 

Lock the FGWindow for the immediate update to the screen. This lock disable the FGWindow redrawing on the screen until WindowUnlock() is called. Useful when you draw many small objects at once and you want optimize for speed.

Note:
this is not related to threading

void __fastcall fgl::FGWindow::WindowMove int  nx,
int  ny
 

Moves FGWindow at the new position.

Parameters:
nx the delta of (new_x-old_x) positions
ny the delta of (new_y-old_y) positions

void __fastcall fgl::FGWindow::WindowPatternLine int  x,
int  y,
int  a,
int  b,
FGPattern p = &PatternDot
 

Draws the patterned line into the FGWindow. The output will takes rop from the current FGWindow values.

Parameters:
x x position
y y position
a width
b height
p the Pattern object
See also:
set_ppop()

Pattern

void __fastcall fgl::FGWindow::WindowPatternRect int  x,
int  y,
int  a,
int  b,
FGPattern pat
 

Draws the patterned rectangle into the FGWindow. The output will takes rop from the current FGWindow values.

Parameters:
x x position
y y position
a width
b height
pat the Pattern object
See also:
set_ppop()

Pattern

void __fastcall fgl::FGWindow::WindowPixel int  x,
int  y,
unsigned  color = UNDEFINED_COLOR
 

Draws the pixel into the FGWindow. The output will takes rop from the current FGWindow values.

Parameters:
x start x position
y start y position
color foreground color
See also:
set_ppop()
Examples:
rad_main.cpp.

void __fastcall fgl::FGWindow::WindowPutBitmap int  x,
int  y,
int  xs,
int  ys,
int  w,
int  h,
FGDrawBuffer p
 

Draws a rectangle in-memory bitmap to the FGWindow. Function clips all coordinates and sizes correctly. If the target area is bigger than source area, then image will be tilted.

Note:
the ROP and the ALPHA of source bitmap is used.
Parameters:
x target x position
y target y position
xs source x position
ys source y position
w the width of source area
h the height of source area
p the pointer to the source bitmap
See also:
FGDrawBuffer::bitblit() set_ppop() SetAlpha()
Examples:
bitmap.cpp.

void __fastcall fgl::FGWindow::WindowRect int  x,
int  y,
int  a,
int  b,
unsigned  color = UNDEFINED_COLOR
 

Draws the rectangle into the FGWindow. The output will takes rop from the current FGWindow values.

Parameters:
x x position
y y position
a width
b height
color foreground color
See also:
set_ppop()
Examples:
calc.cpp.

void __fastcall fgl::FGWindow::WindowRepaint int  xr,
int  yr,
int  w,
int  h
 

actualize window at relative coors in it

void __fastcall fgl::FGWindow::WindowRepaintUser int  xr,
int  yr,
int  w,
int  h
 

redraws rectangle area in a user space of the FGWindow

void __fastcall fgl::FGWindow::WindowResize int  dx,
int  dy
 

Resizes the FGWindow.

Parameters:
dx the delta of (new_w-old_w) widths
dy the delta of (new_h-old_h) heights

void __fastcall fgl::FGWindow::WindowScrollDown int  xx,
int  yy,
int  ww,
int  hh,
int  about
 

Scrolls-down the FGWindow about n-pixels.

Parameters:
xx start x position
yy start y position
ww the width of scrolled block
hh the height of scrolled block
about the size to scroll

void __fastcall fgl::FGWindow::WindowScrollLeft int  xx,
int  yy,
int  ww,
int  hh,
int  about
 

Scrolls-left the FGWindow about n-pixels.

Parameters:
xx start x position
yy start y position
ww the width of scrolled block
hh the height of scrolled block
about the size to scroll

void __fastcall fgl::FGWindow::WindowScrollRight int  xx,
int  yy,
int  ww,
int  hh,
int  about
 

Scrolls-right the FGWindow about n-pixels.

Parameters:
xx start x position
yy start y position
ww the width of scrolled block
hh the height of scrolled block
about the size to scroll

void __fastcall fgl::FGWindow::WindowScrollUp int  xx,
int  yy,
int  ww,
int  hh,
int  about
 

Scrolls-up the FGWindow about n-pixels.

Parameters:
xx start x position
yy start y position
ww the width of scrolled block
hh the height of scrolled block
about the size to scroll

bool __fastcall fgl::FGWindow::WindowSetWorkRect int  x,
int  y,
int  w,
int  h
 

sets the new client space area in the FGWindow, i.e. clipping for drawing.

Parameters:
x new top left corner coordinate in x
y new top left corner coordinate in y
w a new width
h a new height

void __fastcall fgl::FGWindow::WindowShape int  sx,
int  sy,
int  wx,
int  wy
 

Resizes the FGWindow and/or changes the FGWindow 's position.

Parameters:
sx a new x position
sy a new y position
wx a new width
wy a new height

void __fastcall fgl::FGWindow::WindowSpline FGPoint  points[4],
unsigned  color = UNDEFINED_COLOR
 

Draws a bezier spline using the four control points specified in the points array. The bezier curve is specified by the four x/y control points in the points array: points[0] and points[1] contain the coordinates of the first control point, points[2] and points[3] are the second point, etc. FGControl points 0 and 3 are the ends of the spline, and points 1 and 2 are guides. The curve probably won't pass through points 1 and 2, but they affect the shape of the curve between points 0 and 3 (the lines p0-p1 and p2-p3 are tangents to the spline). The easiest way to think of it is that the curve starts at p0, heading in the direction of p1, but curves round so that it arrives at p3 from the direction of p2. In addition to their role as graphics primitives, spline curves can be useful for constructing smooth paths around a series of control points.

long __fastcall fgl::FGWindow::WindowStatus long  status  )  [protected]
 

internal

void __fastcall fgl::FGWindow::WindowStatusBar int  x,
const char *  s,
int  c = CBLACK
 

Print a text string to the status bar.

Parameters:
x x position
s null terminated string
c foreground color

void __fastcall fgl::FGWindow::WindowText int  x,
int  y,
const char *  s,
FGFontProperty f,
unsigned  color,
unsigned  bk
 

Draws an ascii text with TTF font described by FontProperty.

Parameters:
x x position
y y position
s an ascii text string by null
f a font face object
color foreground
bk background
Note:
this function depends on truetype fonts functionality provided by 'freetype2' library (www.freetype.org). You can enable TTF support in the OpenGUI by editing 'config.mak' file. See the installation PDF file.
See also:
FGFontProperty

void __fastcall fgl::FGWindow::WindowText int  x,
int  y,
const char *  s,
unsigned  Ink = UNDEFINED_COLOR,
unsigned  Paper = UNDEFINED_COLOR
 

Draws the text to the FGWindow. The output will takes font and rop from the current FGWindow values.

Parameters:
x x position
y y position
s standard C string taht will be printed-out
Ink foreground color
Paper background color
See also:
set_ppop()

set_font()

Examples:
buttons.cpp, and calc.cpp.

void __fastcall fgl::FGWindow::WindowTextUnicode int  x,
int  y,
const unsigned short *  s,
FGFontProperty f,
unsigned  color,
unsigned  bk
 

Draws an ascii text with TTF font described by FontProperty.

Parameters:
x x position
y y position
s 16bit text wide string terminated by null
f a font face object
color foreground
bk background
Note:
this function depends on truetype fonts functionality provided by 'freetype2' library (www.freetype.org). You can enable TTF support in the OpenGUI by editing 'config.mak' file. See the installation PDF file.
See also:
FGFontProperty
Examples:
ttf.cpp.

void __fastcall fgl::FGWindow::WindowTextUTF8 int  x,
int  y,
const char *  s,
FGFontProperty f,
unsigned  color,
unsigned  bk
 

Draws an ascii text with TTF font described by FontProperty.

Parameters:
x x position
y y position
s an UTF8 text string by null
f a font face object
color foreground
bk background
Note:
this function depends on truetype fonts functionality provided by 'freetype2' library (www.freetype.org). You can enable TTF support in the OpenGUI by editing 'config.mak' file. See the installation PDF file.
See also:
FGFontProperty

void __fastcall fgl::FGWindow::WindowUnLock void   ) 
 

Unlock (and update on the screen if needed) the Locked ( WindowLock() ) FGWindow.

Note:
this is not related to threading

void __fastcall fgl::FGWindow::WindowVirtualRoot int  sx,
int  sy,
int  wx,
int  wy
[static]
 

This function will remap the root window to virtually any size and position relative to the top left corner. The call: FGWindow::WindowVirtualRoot(-1000,-1000, 2000, 2000); Creates an virtual root window with position [1000,1000] in a top left corner of screen.

Parameters:
sx x start position, 0 is top left position, you can use both, positive or negative values.
sy y start position, 0 is top left position, you can use both, positive or negative values.
wx the width, the values is from 1 up to some thousands, it is limited by size of VIDEORAM
wy the height, the values is from 1 up to some thousands, it is limited by size of VIDEORAM


Generated on Wed Feb 9 11:31:47 2005 for OpenGUI by  doxygen 1.4.0