glictScrollbar Class Reference

#include <scrollbar.h>

Inheritance diagram for glictScrollbar:

glictContainer

List of all members.


Detailed Description

Widget with two buttons and a box that can be moved left or right using aforementioned buttons. (Buttons are not glictButtons).

Definition at line 28 of file scrollbar.h.


Public Member Functions

bool CastEvent (glictEvents evt, void *wparam, long lparam, void *returnvalue)
 Casts an event to the class, so it can process it. Example is mouseclick or mousedown.
int GetMax ()
int GetMin ()
unsigned int GetStep ()
int GetValue ()
 glictScrollbar ()
virtual void Paint ()
 Renders the element. Should contain call to CPaint().
void SetBGColor (float r, float g, float b, float a)
void SetMax (int newmax)
void SetMin (int newmin)
void SetStep (unsigned int newstep)
 How much is increased/decreased by each step.
void SetValue (int val)
virtual ~glictScrollbar ()

Private Attributes

glictColor bgcolor
bool highlightdn
bool highlightup
int max
int min
unsigned int step
int value

Friends

class glictContainer

Member Function Documentation

bool glictScrollbar::CastEvent ( glictEvents  evt,
void *  wparam,
long  lparam,
void *  returnvalue 
) [virtual]

Casts an event to the class, so it can process it. Example is mouseclick or mousedown.

Parameters:
evt Event that occured
*wparam Any kind of value that needs to be passed on to the function. (For example if a structure needs to be passed.)
lparam Numeric value that needed to be passed for event processing.
*returnvalue Return value, if any, will be stored here. If NULL, no return value shall be stored.
Returns:
Boolean value specifying if the event was processed at all. True means an event was caught by the widget, or by a child.
Unlike other UI libraries, this library has one philosophy and that is it does not like hooking to any of the windowing system's functions; it does not depend upon either GLUT, Windows, Linux or MacOS. Widgets are receiving user feedback upon being told that user made some. They are told this by the program that uses this library. Example of this action is that in, let's say, GLUT the program receives a call to mouse() function. Upon this, the program casts an event using this function to the widget which then processes what should actually happen. A button, for example, would upon a mouseclick call to OnClick function.

The thing is, this CastEvent function first tries to tell its children that the event happened, and upon being told by each of them that they didn't do anything with the event, goes on with processing it itself.

Container class does not do anything except pushing events on to DefaultCastEvent.

See also:
DefaultCastEvent()

Reimplemented from glictContainer.

Definition at line 167 of file scrollbar.cpp.

References glictContainer::DefaultCastEvent(), glictContainer::Focus(), glictContainer::GetVisible(), GLICT_MOUSECLICK, GLICT_MOUSEDOWN, GLICT_MOUSEUP, highlightdn, highlightup, max, min, step, value, glictContainer::x, and glictContainer::y.

Referenced by glictPanel::CastEvent().

void glictScrollbar::Paint (  )  [virtual]

Renders the element. Should contain call to CPaint().

(This description applies for the glictContainer::Paint(). If you are reading it for some other class, then its documentation is not written yet for this function.)

In glictContainer class, Paint does nothing except calling SetScissor() and CPaint(). This is because as a widget the container class does not render anything; it serves as a point of divergence for other classes. Other widgets should define their own procedure with these two calls as a minimum.

When writing a widget, put SetScissor() on the beginning of this function, and CPaint() on the end.

See also:
SetScissor(), CPaint()

Reimplemented from glictContainer.

Definition at line 59 of file scrollbar.cpp.

References glictColor::a, glictColor::b, bgcolor, glictContainer::CPaint(), glictColor::g, glictContainer::GetVisible(), glictFontRender(), glictFontSize(), highlightdn, highlightup, glictGlobalsClass::PaintRect(), glictColor::r, glictGlobalsClass::SetColor(), glictContainer::SetScissor(), glictGlobalsClass::translation, glictContainer::width, glictPos::x, and glictPos::y.


Member Data Documentation

int glictScrollbar::value [private]

Todo:
TODO (Khaos#2#) These should be floats.

Definition at line 52 of file scrollbar.h.

Referenced by CastEvent(), GetValue(), glictScrollbar(), and SetValue().


The documentation for this class was generated from the following files:
SourceForge.net Logo
generated with doxygen 1.5.3 on Mon Oct 29 18:09:27 2007