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

fgl::FGControl Class Reference

#include <fastgl.h>

Inheritance diagram for fgl::FGControl:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

The predecessor for the all widgets.

This family of graphics controls contains the class FGPushButton, FGCheckBox, FGEditBox and Base menu. It is child objects of class Controls, which is a child object of base class FGBaseGui. There is a more information. NOTE: All of the FGControl class objects and its parents are on the create time automatically attached with its FGWindow. When a FGWindow is destroyed, Controls are destroyed either automatically. Don't delete it explicitly!

void call_back_procedure(CallBack cb)
{
    ... // your code
}
Examples:

bgroup.cpp, buttons.cpp, calc.cpp, connect.cpp, fgv.cpp, pane.cpp, radio.cpp, and timer.cpp.


Public Member Functions

virtual void draw (void)
virtual void SetName (const char *s)
virtual void OnActivate (void)
void SetKey (int k)
int GetKey (void) const
void Enable (void)
void Disable (void)
virtual void ClickUp (int a)
void SetTrigger (int a)
int GetTrigger (void) const
FGWindowGetOwner (void) const
int GetLocalId () const
void SetInk (FGPixel i)
void SetPaper (FGPixel p)
void SetFont (unsigned f)
void SetHandler (ControlCall w)
void AttachSignalName (const char *val)
const char * GetSignalName ()
virtual const double ToDouble () const
virtual const int ToInteger () const
virtual const char * ToString () const

Static Public Member Functions

static void Close (CallBack cb)
static void Quit (CallBack cb)

Protected Member Functions

 FGControl (int xs, int ys, int ws, int hs, const char *nm, ObjectType typ, int key, FGWindow *, ControlCall f, FGPixel p, FGPixel i, void *user_data)
int GetXr (void)
int GetYr (void)
void Underscore (int xo, int yo, int c)
void update_owner (void)
virtual void ClickDown (void)
virtual void WheelSpin (int)
virtual void GetHints (int &xx, int &yy, int &ww, int &hh)
virtual void DrawAsSelected (void)
bool IsYourTabPage (void)
bool IsSelected (void)
virtual FGPixel GetColorOfFrame (void) const

Protected Attributes

int local_id
int key
ControlCall fnc
FGWindowowner
FGButtonGroupgrp
char * closure_name


Member Function Documentation

void fgl::FGControl::AttachSignalName const char *  val  ) 
 

Set event name.

void fgl::FGControl::ClickUp int  a  )  [virtual]
 

Change the state of the object to state "active" (as you as click with mouse at one). It is a good choice if you want input to the FGEditBox immediately without clicking at one.

Reimplemented in fgl::FGEditBox.

Examples:
rad_main.cpp.

void fgl::FGControl::Close CallBack  cb  )  [static]
 

You can use this static method as predefined callback when you can close the parent FGWindow.

            my_window->AddBaseMenu("Close the window", 'C', FGControl::Close);

void fgl::FGControl::Disable void   ) 
 

Changes the state of the object (draws it as grayed and don't allows activate one).

Reimplemented in fgl::FGEditBox.

Examples:
buttons.cpp, and rad_main.cpp.

virtual void fgl::FGControl::draw void   )  [inline, virtual]
 

Redraws whole the object.

Reimplemented in fgl::FGImage, fgl::FGPushButton, fgl::FGCheckBox, fgl::FGRadioButton, and fgl::FGEditBox.

void fgl::FGControl::Enable void   ) 
 

Changes the state of the object (draws it as normal and allows activate one).

Examples:
rad_main.cpp.

int fgl::FGControl::GetKey void   )  const [inline]
 

Returns current 'hotkey'.

Examples:
rad_main.cpp.

int fgl::FGControl::GetLocalId  )  const [inline]
 

Each FGControl in the FGWindow has local ID. You can use this ID with handling ACCELEVENT by example. The all controls have local id. This value goes from 0 to .., for each window and its control items. For example: when window contains 5 buttons, then these buttons have local id values from 0 to 4,according to the order of its creating. This is useful for fast and easy testing which button (when you use one call-back procedure for more buttons i.e.).

Examples:
bgroup.cpp, and rad_main.cpp.

FGWindow* fgl::FGControl::GetOwner void   )  const [inline]
 

Returns the parent Widget, i.e. window that contains this FGControl.

Examples:
bgroup.cpp, and radio.cpp.

const char* fgl::FGControl::GetSignalName  )  [inline]
 

Get event name.

int fgl::FGControl::GetTrigger void   )  const [inline]
 

Returns the state of the FGControl (TRUE or FALSE).

virtual void fgl::FGControl::OnActivate void   )  [inline, virtual]
 

Callback on the FGControl activation by user by click or hotkey pressing. You can override this in child object.

void fgl::FGControl::Quit CallBack  cb  )  [static]
 

You can use this static method as predefined callback when you can close the parent FGWindow.

            my_window->AddBaseMenu("Quit the Application", 'C', Quit::Close);

void fgl::FGControl::SetFont unsigned  f  )  [inline]
 

Set new background color and redraws object.

void fgl::FGControl::SetHandler ControlCall  w  )  [inline]
 

Set a new handler for object.

Examples:
rad_main.cpp.

void fgl::FGControl::SetInk FGPixel  i  )  [inline]
 

Set new foreground color and redraws object.

void fgl::FGControl::SetKey int  k  )  [inline]
 

Change the 'hotkey' of the object.

Examples:
buttons.cpp, and rad_main.cpp.

virtual void fgl::FGControl::SetName const char *  s  )  [inline, virtual]
 

Change the name of the object and redraws one.

Reimplemented from fgl::FGDrawBuffer.

Examples:
buttons.cpp, rad_main.cpp, and radio.cpp.

void fgl::FGControl::SetPaper FGPixel  p  )  [inline]
 

Set new background color and redraws object.

void fgl::FGControl::SetTrigger int  a  )  [inline]
 

With this procedure you can change the state of the two-state (ON/OFF) switches.

Examples:
rad_main.cpp.

virtual const double fgl::FGControl::ToDouble  )  const [inline, virtual]
 

Dynamic cast.

Reimplemented in fgl::FGEditBox.

virtual const int fgl::FGControl::ToInteger  )  const [inline, virtual]
 

Dynamic cast.

Reimplemented in fgl::FGEditBox.

virtual const char* fgl::FGControl::ToString  )  const [inline, virtual]
 

Dynamic cast.

Reimplemented in fgl::FGEditBox.

void fgl::FGControl::update_owner void   )  [protected]
 

Redraws a whole FGControl in a parents FGWindow.


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