glictWindow Class Reference

#include <window.h>

Inheritance diagram for glictWindow:

glictContainer glictMessageBox

List of all members.


Detailed Description

A draggable window that can contain subelements. Similar to many other "windowing systems" (but a lot uglier and flatter).
Examples:

examples/memory/main.cpp, and examples/memory_sdl/main.cpp.

Definition at line 28 of file window.h.


Public Member Functions

virtual bool CastEvent (glictEvents evt, void *wparam, long lparam, void *returnvalue)
 Reacts to events in a way a window should.
void FixContainerOffsets ()
 Fixes container offsets. Should be used only internally.
 glictWindow ()
virtual void Paint ()
 Paints the window.
void SetBGColor (float r, float g, float b, float a)
virtual ~glictWindow ()

Private Attributes

glictColor bgcolor
bool mousedown
glictPanel panel
glictPos relmouse

Friends

class glictContainer

Member Function Documentation

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

Reacts to events in a way a window should.

Parameters:
evt Specifies the event being cast
wparam Specifies a pointer to the event-defined parameter
lparam Specifies a long value, an event-defined parameter
Reacts to events in a way a window should, meaning, it detects a click and a drag and possibly moves the window if they occured in specific locations. Also makes use of Container::DefaultCastEvent() for default parsing of events, or letting children widgets know of stuff that happened.

Bug:
Moving of this window by dragging has problems because of the containeroffsets if a window is a child of another window. Possibly a general problem with glictContainer::SetPos(). (See also, bugnote there)

Reimplemented from glictContainer.

Definition at line 176 of file window.cpp.

References glictContainer::cliptop, glictContainer::containeroffsety, glictContainer::DefaultCastEvent(), glictContainer::Focus(), glictContainer::GetEnabled(), glictContainer::GetVisible(), GLICT_MOUSECLICK, GLICT_MOUSEDOWN, GLICT_MOUSEUP, mousedown, relmouse, glictContainer::SetPos(), glictPos::x, glictContainer::x, glictPos::y, and glictContainer::y.

void glictWindow::FixContainerOffsets (  )  [virtual]

Fixes container offsets. Should be used only internally.

In case user sets a new skin, we need to fix container offsets. Each widget should redefine it and use appropriate skin element's properties.

This function should be used only internally.

Reimplemented from glictContainer.

Definition at line 245 of file window.cpp.

References glictContainer::containeroffsetx, glictContainer::containeroffsety, glictSkinner::GetLeftSize(), glictSkinner::GetTopSize(), glictPos::h, glictPos::w, glictGlobalsClass::windowBodySkin, and glictGlobalsClass::windowTitleSkin.

Referenced by glictMessageBox::glictMessageBox().

void glictWindow::Paint (  )  [virtual]

Paints the window.

Paints the widget called window, simulating looks of windows on other platforms (to a very plain and flat extent), and then calls CPaint() which will paint all the subwidgets.

See also:
glictContainer::Paint()

glictContainer::CPaint()

Todo:
Windows really need borders!

Reimplemented from glictContainer.

Reimplemented in glictMessageBox.

Definition at line 74 of file window.cpp.

References glictColor::a, glictColor::b, bgcolor, glictContainer::bottom, glictRect::bottom, glictContainer::containeroffsetx, glictContainer::containeroffsety, glictContainer::CPaint(), glictColor::g, glictSkinner::GetBottomSize(), glictSkinner::GetLeftSize(), glictSkinner::GetRightSize(), glictSkinner::GetTopSize(), glictContainer::GetVisible(), glictFontRender(), glictFontSize(), glictPos::h, glictContainer::height, glictContainer::left, glictRect::left, max, min, glictContainer::OnPaint, glictSkinner::Paint(), glictGlobalsClass::PaintRect(), glictColor::r, glictContainer::right, glictRect::right, glictGlobalsClass::SetColor(), glictContainer::SetScissor(), glictContainer::top, glictRect::top, glictGlobalsClass::Translatef(), glictGlobalsClass::translation, glictPos::w, glictContainer::width, glictGlobalsClass::windowBodySkin, glictGlobalsClass::windowTitleBgColor, glictGlobalsClass::windowTitleColor, glictGlobalsClass::windowTitleSkin, glictContainer::x, glictPos::x, and glictPos::y.

Referenced by glictMessageBox::Paint().


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