Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

sjgui::CWndCtrlBase Class Reference

Base class for build in controls. More...

#include <wndctrl.h>

Inheritance diagram for sjgui::CWndCtrlBase:

sjgui::CWnd sjgui::classic::CWndCtrl sjgui::modern::CWndCtrl List of all members.

Public Member Functions

void SetBorderSize (int i)
 Set border size.

int GetBorderSize ()
 Get border size.

GLfloat * GetBgSelColor ()
 Get background selection color.

GLfloat * GetBgColor ()
 Get background color.

GLfloat * GetShadowColor ()
 Get shadow color.

void SetShadowColor (GLfloat *pC)
 Set shadow color.

void SetBgColor (GLfloat R, GLfloat G, GLfloat B, GLfloat A=1.0f)
 Set background color.

void SetBgColor (GLfloat *pC)
 Set background color.

void SetBgSelColor (GLfloat R, GLfloat G, GLfloat B, GLfloat A=1.0f)
 Get background selection color.

void SetBgSelColor (GLfloat *pC)
 Get background selection color.

void DrawBorder (bool b=true)
 Set draw border flag.

bool IsDrawBorder ()
 Get draw border flag.

void SetBorderLightColor (GLfloat *pC)
 Set border light color.

void SetBorderDarkColor (GLfloat *pC)
 Set border dark color.


Protected Member Functions

virtual void OnUpdatePos ()
 Updates position of the window.


Protected Attributes

GLfloat m_ShadowColor [4]
 Color of the shadow.

GLfloat m_BgColor [4]
 Background color.

GLfloat m_BgSelColor [4]
 Background color under selection.

GLfloat m_BorderLightColor [4]
 Border color from the light side.

GLfloat m_BorderDarkColor [4]
 Border color from the dark side.

int m_iBorderSize
 Border size, should not be negative.


Detailed Description

Base class for build in controls.

Adds color information: background color, background color when selected, and color of the shadow for the control. It is a base class for widgets of gui, most of them do require this information.

Author:
Alexander Shyrokov
Version:
Revision
1.1.1.1


Member Function Documentation

virtual void sjgui::CWndCtrlBase::OnUpdatePos  )  [inline, protected, virtual]
 

Updates position of the window.

Is called from UpdatePos() function. If you draw something on the screen and do not want to recalculate absolute position of the drawn primitives you can precalculate them using this function. Window is defined by position of the upper-left corner and widht with height. Position is relative to the parent window position, so to draw anything on the screen you would need to reset viewport or add parent positon to the current position, I decided to store absolute postion of the window also, so during the drawing I have exact values, but this means that if parent changes its position child windows should update their absolute positions too. That is why this function is implemented. Note that changing size should will require call of Reshape() to take an effect.

If you want original behavior of the base class to be preserved you should call it directly. For example if you derive your class directly from CWnd then you should put the following line at the top of your function:

     return CWnd::OnUpdatePos();
This function is called when you change position or size of the window.
See also:
UpdatePos

Reimplemented from sjgui::CWnd.


The documentation for this class was generated from the following file:
sjgui logo
Quick Links:

 News
 Description
 Screen Shots
 Projects
 Downloads
 Source Code
 Help/FAQ
 Want to help?
 Credits
 Disclaimer


Documentation:

 Documentation
 Reference
 Lessons


Useful links:

sjcomp logo
sjcomp

opengl logo

nehe logo

SourceForge.net Logo

Last modified:


Started by Alexander Shyrokov. Generated at Wed Apr 28 12:31:07 2004 for the sjgui by doxygen 1.3.1. SourceForge.net Logo