logo
Main Page | Namespaces | Classes | Compounds | Files | Compound Members | Related

GUIToolkit::GUIControl Class Reference

Mandatory class for administrating every GUI. More...

#include <GUIControl.h>

List of all members.

Public Methods

 GUIControl (HINSTANCE my_hInstance, int my_nCmdShow)
 ~GUIControl ()
 Destructor.

void MessageLoop ()
 Call this infinite loop, when UI is setup.

int Register (Component *m)
 Every component must register. Done in Component Constructor.

std::string getUniqueName ()
 To generate a new Windows class a unique name is needed.

void RegisterEvents (Component *m, EventHandler *e)
 Set EventHandler to Component.

int RegisterRaw (Component *m)
void RegisterManualDraw (HWND hwnd, Component *m)
 @Is this used?

void DEBUG (std::string t)
 Prints to ErrorTextBox;.

void DEBUG (char t[])
 Prints to ErrorTextBox;.

void DEBUG (int t)
 Prints to ErrorTextBox;.


Static Public Methods

LRESULT CALLBACK WndProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 A Static callback routine. Used by windows event handling.

std::string my_itos (int i)
 Conversion.


Public Attributes

MSG Msg
HINSTANCE hInstance
 Passed from WINMAIN.

int nCmdShow
 Passed from WINMAIN.

HWND firstWindow
 When 'firstWindow' is closed, the application terminates.

TextBoxErrorTextBox
 Windows programs usually dont emply a console. Use this for error reporting in conjunction with the DEBUG routines.


Static Public Attributes

GUIControl * GUIInstance = 0


Detailed Description

Mandatory class for administrating every GUI.

The GUIControl takes care of eventhandling and keeps track of UI components. Always start by creating an instance of this class.

Definition at line 27 of file GUIControl.h.


Constructor & Destructor Documentation

GUIToolkit::GUIControl::GUIControl HINSTANCE    my_hInstance,
int    my_nCmdShow
 

Pass parameters from WinMain or DLLMain. If these parameters are not available call with my_nCmdShow = SW_SHOWDEFAULT and my_hInstance = GetModuleHandle(NULL). (This could be critical under non XP-environments)

Todo:
add apropriate default constructor.

Definition at line 26 of file GUIControl.cpp.

References firstWindow, GUIInstance, hInstance, and nCmdShow.


Member Function Documentation

std::string GUIToolkit::GUIControl::my_itos int    i [static]
 

Conversion.

Todo:
Obsolete.

Definition at line 19 of file GUIControl.cpp.

Referenced by DEBUG().

int GUIToolkit::GUIControl::RegisterRaw Component   m
 

Raw components (that is, DirectX component) must call this

Todo:
is this the way?

Definition at line 219 of file GUIControl.cpp.


Member Data Documentation

GUIControl * GUIToolkit::GUIControl::GUIInstance = 0 [static]
 

We need a static callback routine in order to satisfy windows. But we also need a nice object, that the static routine can access. Therefore we have a static pointer to a dynamic object. This means there can be only ONE instance of GUIControl (since it accessed through GUIInstance) Awfull Hack, but neccesary.

Definition at line 17 of file GUIControl.cpp.

Referenced by GUIControl(), and WndProc().


The documentation for this class was generated from the following files:
Syntopia Project. Visit the web page, or the SourceForge page.
Docs made by Doxygen. Email: Mikael Christensen