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

PG_Widget Class Reference

Base class of all widgets. More...

#include <pgwidget.h>

Inheritance diagram for PG_Widget:

Inheritance graph
[legend]
List of all members.

Public Types

enum  KeyAction {
  ACT_ACTIVATE, ACT_DEACTIVATE, ACT_OK, ACT_CANCEL,
  ACT_LEFT, ACT_RIGHT, ACT_UP, ACT_DOWN
}
 Keyevent actions. More...

Public Member Functions

 PG_Widget (PG_Widget *parent, const PG_Rect &rect=PG_Rect::null, bool bObjectSurface=false)
 Creates a PG_Widget with an internal object surface.
virtual ~PG_Widget ()
 Destroys a PG_Widget.
void LoadThemeStyle (const std::string &widgettype)
 Load a style from the theme definition.
virtual void LoadThemeStyle (const std::string &widgettype, const std::string &objectname)
 Load a style from the theme definition.
void StartWidgetDrag ()
 Start to drag a widget.
void WidgetDrag (int x, int y)
 Drag the widget to a given position (in screen coordinates).
void EndWidgetDrag (int x, int y)
 Finishes a drag operation.
bool MoveWidget (int x, int y, bool update=true)
 Move a widget.
bool MoveWidget (const PG_Rect &r, bool update=true)
 Move and resize widget.
virtual bool SizeWidget (Uint16 w, Uint16 h, bool update=true)
 Resize a widget.
PG_Point ClientToScreen (int x, int y)
 Convert a client (widget) coordinate to a screen position.
PG_Point ScreenToClient (int x, int y)
 Convert a screen position to a client (widget) coordinate.
SDL_Surface * GetWidgetSurface ()
 Return the pointer to the widget's drawing surface.
bool IsVisible ()
 Check if the object is visible.
PG_WidgetGetParent ()
 Get the parentwidget of a widget.
virtual void AddChild (PG_Widget *child)
 Add a clientwidget (which will be embedded into this widget).
virtual bool ProcessEvent (const SDL_Event *event, bool bModal=false)
 Process a native PG_ event.
void SetID (int id)
 Set the widgetid.
int GetID ()
 Return the widgetid.
PG_WidgetFindChild (int id, bool recursive=false)
 Find a child that is identified by the given ID.
PG_WidgetFindChild (const std::string &name, bool recursive=false)
 Find a child that is identified by the given name.
bool IsMouseInside ()
 Check if the mousepointer is currently inside the widget.
bool Redraw (bool update=true)
 Redraw the widget and all embedded child widgets.
virtual void Blit (bool recursive=true, bool restore=true)
 Blit the widget to the screen.
void Update (bool doBlit=true)
 Update the widget's screen area.
virtual void Show (bool fade=false)
 Make a widget visible (if you want a widget to show up the first time, use this method).
virtual void Hide (bool fade=false)
 Hide a widget.
bool IsInFrontOf (PG_Widget *)
 Check if the widget is in front of another one.
void SendToBack ()
 Send the widget back to the end of the list.
void BringToFront ()
 Reorder the widget in front of all others.
PG_WidgetGetToplevelWidget ()
 Get the toplevel widget.
void RecalcClipRect ()
virtual bool RestoreBackground (PG_Rect *clip=NULL, bool force=false)
 Restore the background (all widgets behind this one).
void SetVisible (bool visible)
 Set the visiblility of a widget with updating the screen contents.
void SetFadeSteps (int steps)
 Set the number of steps for fading in/out widgets.
void SetChildTransparency (Uint8 t)
 Set the transparency of all child widgets.
PG_RectListGetChildList ()
 Get a list of child widgets.
int GetChildCount ()
 Get the number of childwidgets.
void MoveRect (int x, int y)
virtual bool Action (KeyAction action)
void SetName (const std::string &name)
 Set the name for the widget.
const std::string & GetName ()
 Get the name for the widget.
bool LoadLayout (const std::string &name)
 Load layout from the XML file to the current widget.
bool LoadLayout (const std::string &name, void(*WorkCallback)(int now, int max))
 Load layout from the XML file to the current widget.
bool LoadLayout (const std::string &name, void(*WorkCallback)(int now, int max), void *UserSpace)
 Load layout from the XML file to the current widget.
void RemoveAllChilds ()
 Removes all childs.
void SetUserData (void *userdata, int size)
 Sets user data to the widget (malloc inside).
virtual int GetUserDataSize ()
 Sets user data to the widget (malloc inside).
virtual void GetUserData (void *userdata)
 Gets user data from the widget.
void ReleaseUserData ()
 Releases user data.
virtual bool RemoveChild (PG_Widget *child)
virtual void SetText (const std::string &text)
 Sets text.
void AddText (const std::string &text, bool update=false)
 Adds text.
virtual void SetTextFormat (const char *text,...)
 Sets formated text.
virtual const PG_String & GetText ()
 Returns text.
void GetTextSize (Uint16 &w, Uint16 &h, const std::string &text=PG_NULLSTR)
int GetTextWidth ()
int GetTextHeight ()
int GetFontAscender ()
int GetFontHeight ()
PG_Color GetFontColor ()
 Return the current text color.
PG_Color GetFontHighlightColor ()
void SetFontColor (const PG_Color &Color, bool bRecursive=false)
 Set font color.
void SetFontHighlightColor (const PG_Color &Color, bool bRecursive=false)
void SetFontAlpha (int Alpha, bool bRecursive=false)
 Set font transparency (!!!).
void SetFontStyle (PG_Font::Style Style, bool bRecursive=false)
 Set font style.
void SetFontSize (int Size, bool bRecursive=false)
 Set font size.
void SetFontIndex (int Index, bool bRecursive=false)
 Set font index.
void SetFontName (const std::string &Name, bool bRecursive=false)
 Set font name.
void SetSizeByText (int Width=0, int Height=0, const std::string &Text=PG_NULLSTR)
 Set widget size by size of text (should be used before Show() or AddWidget()).
int GetFontSize ()
 Get the size of the font.
PG_FontGetFont ()
 Get the current font parameters.
void SetFont (PG_Font *font)
 Set the current font parameters.
void DrawText (const PG_Rect &rect, const PG_String &text)
 Render text inside the widget.
void DrawText (int x, int y, const PG_String &text)
 Render text inside the widget.
void DrawText (int x, int y, const PG_String &text, const PG_Rect &cliprect)
 Render text inside the widget and clip to a given clipping rectangle.
void DrawText (const PG_Rect &rect, const PG_String &text, const PG_Color &c)
 Render text inside the widget and set the font color.
void DrawText (int x, int y, const PG_String &text, const PG_Color &c)
 Render text inside the widget and set the font color.
void DrawBorder (const PG_Rect &r, int size, bool up=true)
virtual void SetTransparency (Uint8 t, bool bRecursive=false)
 Set the transparency of the drawing object.
Uint8 GetTransparency ()
 Get the transparency of the drawing object.
void SetClipRect (const PG_Rect &r)
 Set the clipping rectangle for the object.
PG_RectGetClipRect ()
 Get the current clipping rectangle.
bool IsClippingEnabled ()
 Check if there is a clipping rectangle assigned to the object.
void GetClipRects (PG_Rect &src, PG_Rect &dst)
void GetClipRects (PG_Rect &src, PG_Rect &dst, const PG_Rect &displayrect)
void SetPixel (int x, int y, const PG_Color &c)
void DrawHLine (int x, int y, int w, const PG_Color &c)
void DrawVLine (int x, int y, int h, const PG_Color &c)
void DrawRectWH (int x, int y, int w, int h, const PG_Color &c)
void DrawLine (Uint32 x0, Uint32 y0, Uint32 x1, Uint32 y1, const PG_Color &color, Uint8 width=1)
virtual int RunModal ()
 Enter modal mode.
bool QuitModal ()
 Quit modal mode.
bool WillQuitModal ()
void StopQuitModal ()
void SetDirtyUpdate (bool bDirtyUpdate)
 Set the dirty update mode.
void UpdateOverlappingSiblings (bool enable, bool recursive=true)
 Set the sibling update mode.
bool GetDirtyUpdate ()
 return if the dirty update mode is enabled
virtual void eventMouseLeave ()
 eventhandler for mouse movements.
virtual void eventMouseEnter ()
 eventhandler for mouse movements.
void SetHidden (bool hidden)
bool IsHidden ()
void SetModalStatus (int status)
 Set the return status of the modal eventloop.
void EnableReceiver (bool enable, bool bRecursive=false)
void SetParent (PG_Widget *parent)
 change the parent of the widget.
void SetBorderSize (int b)
 Set the bordersize of the widget.
int GetBorderSize ()
 Get the bordersize of the widget.
void activateHotkey (int keymodifier)
 enables hotkey listening for the widget. Keymodifier is a bitmap of SDLMod values that must be pressed for the hotkey
int getHotkeyModifier ()

Static Public Member Functions

static void UpdateRect (const PG_Rect &r)
 Update a screen area.
static void UpdateScreen ()
 Update (render) the whole application screen.
static void HideAll ()
 Hide all widgets of an application.
static PG_WidgetFindWidgetFromPos (int x, int y)
static void BulkBlit ()
static PG_RectListGetWidgetList ()
 Get a list of all toplevel widgets.
static void GetTextSize (Uint16 &w, Uint16 &h, const PG_String &text, PG_Font *font)

Public Attributes

SignalMouseEnter sigMouseEnter
SignalMouseLeave sigMouseLeave

Protected Member Functions

virtual void eventMoveWidget (int x, int y)
 Callback for the MoveWidget event.
virtual void eventSizeWidget (Uint16 w, Uint16 h)
 Callback for the SizeWidget event.
virtual void eventDraw (SDL_Surface *surface, const PG_Rect &rect)
 overridable eventhandler to draw the object surface
virtual void eventBlit (SDL_Surface *surface, const PG_Rect &src, const PG_Rect &dst)
 overridable eventhandler to blit the widget contents to the screen
virtual void eventShow ()
 overridable eventhandler called whenever the widget gets shown.
virtual void eventHide ()
 overridable eventhandler called whenever the widget gets hidden.
virtual bool eventQuitModal (int id, PG_MessageObject *widget, unsigned long data)
 overridable eventhandler called when leaving a modal eventloop
void FadeOut ()
void FadeIn ()
bool AcceptEvent (const SDL_Event *event)
 Check if we can accept the event.
void RemoveFromWidgetList ()
void AddToWidgetList ()
PG_Char extractHotkey (const std::string &s)
bool extractAndStoreHotkey (const std::string &s)
bool checkForHotkey (const SDL_KeyboardEvent *key)

Static Protected Member Functions

static bool RenderText (SDL_Surface *Surface, const PG_Rect &ClipRect, int BaseLineX, int BaseLineY, const PG_String &Text, PG_Font *ParamIn)

Protected Attributes

SDL_Surface * my_srfObject
 pointer to the widgets drawing surface or NULL
PG_String my_text
 text attached to the widget
PG_Color my_colorBorder [2][2]
 array of border colors
int my_bordersize

Classes

class  SignalMouseEnter
class  SignalMouseLeave

Detailed Description

Base class of all widgets.

Author:
Alexander Pipelka
Provides graphics context and message handling functionality.

Theme support

This class provides themeing capabilities only for subclassed widgets.

widget type: none (managed through subclass)
object name: none (managed through subclass)

Theme sample:

        <widget>
                <type value="xxx"/>
                        <object>
                        <name value="xxx"/>
                        <property color="textcolor" value="0x00FFFFFF"/>
                        <property color="bordercolor0" value="0x00202020"/>
                        <property color="bordercolor1" value="0x00E0E0E0"/>
                        <property color="bordercolor0i" value="0x00202020"/>
                        <property color="bordercolor1i" value="0x00E0E0E0"/>
                </object>
        </widget>

Code:

Definition at line 81 of file pgwidget.h.


Member Enumeration Documentation

enum PG_Widget::KeyAction
 

Keyevent actions.

Enumeration values:
ACT_ACTIVATE  Widget got the input focus.
ACT_DEACTIVATE  Widget has lost the input focus.
ACT_OK  Widget action event (e.g. button press on a PG_Button object).
ACT_CANCEL  Widget cancel-action.
ACT_LEFT  Cursor left was pressed.
ACT_RIGHT  Cursor right was pressed.
ACT_UP  Cursor up was pressed.
ACT_DOWN  Cursor down was pressed.

Definition at line 86 of file pgwidget.h.


Constructor & Destructor Documentation

PG_Widget::PG_Widget PG_Widget parent,
const PG_Rect rect = PG_Rect::null,
bool  bObjectSurface = false
 

Creates a PG_Widget with an internal object surface.

Parameters:
parent the parentobject for the new widget or NULL if it is a toplevel widget (a parent widget will destroy all children upon its own destruction, also all children will be clipped to their parent's dimension)
rect initial position for the widget
bObjectSurface flag if a surface for the object should be created

Definition at line 89 of file pgwidget.cpp.

References AddChild(), AddToWidgetList(), PG_Draw::CreateRGBSurface(), PG_Application::DefaultFont, PG_WidgetDataInternal::font, GetName(), PG_WidgetDataInternal::havesurface, my_colorBorder, my_srfObject, PG_WidgetDataInternal::name, and PG_LogWRN().

Referenced by TextRenderer::addAbsPosition(), TextRenderer::addIndentation(), and TextRenderer::layout().

PG_Widget::~PG_Widget  )  [virtual]
 

Destroys a PG_Widget.

This is the destructor for the PG_Widget class

Definition at line 159 of file pgwidget.cpp.

References PG_WidgetDataInternal::childList, PG_WidgetDataInternal::font, GetParent(), PG_WidgetDataInternal::havesurface, Hide(), PG_WidgetDataInternal::inDestruct, my_srfObject, PG_LogWRN(), RemoveAllChilds(), RemoveFromWidgetList(), PG_FileArchive::UnloadSurface(), and PG_WidgetDataInternal::userdata.


Member Function Documentation

bool PG_Widget::AcceptEvent const SDL_Event *  event  )  [protected, virtual]
 

Check if we can accept the event.

Reimplemented from PG_MessageObject.

Definition at line 210 of file pgwidget.cpp.

References eventMouseEnter(), eventMouseLeave(), IsHidden(), IsVisible(), PG_WidgetDataInternal::mouseInside, PG_Rect::my_height, PG_Rect::my_width, PG_Rect::my_xpos, PG_Rect::my_ypos, and PG_WidgetDataInternal::rectClip.

bool PG_Widget::Action KeyAction  action  )  [virtual]
 

Reimplemented in PG_LineEdit.

Definition at line 996 of file pgwidget.cpp.

References ACT_ACTIVATE, ACT_DEACTIVATE, ACT_OK, PG_MessageObject::eventMouseButtonDown(), PG_MessageObject::eventMouseButtonUp(), eventMouseEnter(), eventMouseLeave(), PG_Rect::my_height, PG_Rect::my_width, PG_Rect::my_xpos, and PG_Rect::my_ypos.

Referenced by PG_Navigator::Action(), and PG_LineEdit::Action().

void PG_Widget::activateHotkey int  keymodifier  ) 
 

enables hotkey listening for the widget. Keymodifier is a bitmap of SDLMod values that must be pressed for the hotkey

Definition at line 1930 of file pgwidget.cpp.

References PG_MessageObject::eventKeyDown(), PG_Application::GetApp(), and PG_WidgetDataInternal::hotkeyModifier.

Referenced by Menu::Menu(), MessageDialog::MessageDialog(), and ViewTextQuery::ViewTextQuery().

void PG_Widget::AddChild PG_Widget child  )  [virtual]
 

Add a clientwidget (which will be embedded into this widget).

Parameters:
child the widget to add

Reimplemented in PG_DropDown, PG_ListBox, PG_RichEdit, PG_ScrollArea, PG_ScrollWidget, and PG_WidgetList.

Definition at line 291 of file pgwidget.cpp.

References _mid, PG_RectList::Add(), PG_WidgetDataInternal::childList, GetParent(), MoveRect(), PG_Rect::my_xpos, PG_Rect::my_ypos, RemoveFromWidgetList(), and PG_WidgetDataInternal::widgetParent.

Referenced by PG_WidgetList::AddChild(), PG_ScrollWidget::AddChild(), PG_ScrollArea::AddChild(), PG_DropDown::AddChild(), and PG_Widget().

void PG_Widget::AddText const std::string &  text,
bool  update = false
 

Adds text.

Parameters:
text Add text to the widget text
update Do the update

Definition at line 1216 of file pgwidget.cpp.

References GetText(), PG_WidgetDataInternal::heightText, my_text, SetText(), TXT_HEIGHT_UNDEF, and PG_WidgetDataInternal::widthText.

Referenced by XMLTextDoc().

void PG_Widget::AddToWidgetList  )  [protected]
 

Definition at line 202 of file pgwidget.cpp.

References PG_RectList::Add(), and GetParent().

Referenced by PG_Widget().

void PG_Widget::Blit bool  recursive = true,
bool  restore = true
[virtual]
 

Blit the widget to the screen.

Parameters:
recursive if true all embedded widget will also be blitted to screen
restore restore the background before blitting if true This function only performs a SDL_BlitSurface() the screen content will NOT be updated

Definition at line 704 of file pgwidget.cpp.

References PG_RectList::Blit(), PG_WidgetDataInternal::childList, eventBlit(), PG_WidgetDataInternal::hidden, my_srfObject, PG_Rect::my_xpos, PG_Rect::my_ypos, RecalcClipRect(), PG_WidgetDataInternal::rectClip, RestoreBackground(), PG_Rect::SetRect(), and PG_WidgetDataInternal::visible.

Referenced by PG_RectList::Blit(), FadeIn(), and FadeOut().

void PG_Widget::BringToFront  ) 
 

Reorder the widget in front of all others.

Definition at line 1148 of file pgwidget.cpp.

References PG_RectList::BringToFront(), GetParent(), and Update().

Referenced by ConfigurableWindow::ConfigurableWindow(), UnitInfoPanel::onClick(), Panel::Panel(), SelectFromMap::Show(), and NewGuiHost::showSmallIcons().

void PG_Widget::BulkBlit  )  [static]
 

Definition at line 872 of file pgwidget.cpp.

References PG_RectList::Blit(), and PG_Application::DrawCursor().

bool PG_Widget::checkForHotkey const SDL_KeyboardEvent *  key  )  [protected]
 

Definition at line 1946 of file pgwidget.cpp.

References PG_WidgetDataInternal::hotkey, and PG_WidgetDataInternal::hotkeyModifier.

Referenced by PG_Button::eventKeyDown().

PG_Point PG_Widget::ClientToScreen int  x,
int  y
 

Convert a client (widget) coordinate to a screen position.

Parameters:
x x - widgetcoordinate
y y - widgetcoordinate
Returns:
PG_Point structure with the screen position

Definition at line 283 of file pgwidget.cpp.

References PG_Rect::my_xpos, and PG_Rect::my_ypos.

Referenced by MapDisplayPG::eventBlit(), GraphWidget::eventBlit(), Weathercast::painter(), Weathercast::paintWeatherArea(), and MapDisplayPG::widget2screen().

void PG_Widget::DrawBorder const PG_Rect r,
int  size,
bool  up = true
 

Definition at line 1584 of file pgwidget.cpp.

References DrawHLine(), DrawVLine(), IsVisible(), and my_colorBorder.

Referenced by PG_Window::eventBlit(), PG_ThemeWidget::eventBlit(), PG_Button::eventBlit(), and PG_ThemeWidget::eventDraw().

void PG_Widget::DrawHLine int  x,
int  y,
int  w,
const PG_Color c
 

Definition at line 1663 of file pgwidget.cpp.

References PG_Application::GetScreen(), PG_Application::ScreenLocker::lock(), PG_Color::MapRGB(), my_srfObject, PG_Rect::my_xpos, PG_Rect::my_ypos, PG_MAX, PG_MIN, PG_WidgetDataInternal::rectClip, and PG_Rect::SetRect().

Referenced by DrawBorder(), DrawRectWH(), and PG_ColorSelector::PG_ColorBox::eventBlit().

void PG_Widget::DrawLine Uint32  x0,
Uint32  y0,
Uint32  x1,
Uint32  y1,
const PG_Color color,
Uint8  width = 1
 

Definition at line 1749 of file pgwidget.cpp.

References PG_Draw::DrawLine(), PG_Application::GetScreen(), my_srfObject, PG_Rect::my_xpos, and PG_Rect::my_ypos.

void PG_Widget::DrawRectWH int  x,
int  y,
int  w,
int  h,
const PG_Color c
 

Definition at line 1740 of file pgwidget.cpp.

References DrawHLine(), and DrawVLine().

void PG_Widget::DrawText int  x,
int  y,
const PG_String &  text,
const PG_Color c
 

Render text inside the widget and set the font color.

Parameters:
x x-position where the text should appear
y y-position where the text should appear
text pointer to text string
c color of the rendered text

Definition at line 1506 of file pgwidget.cpp.

References DrawText(), and PG_Rect::PG_Rect().

void PG_Widget::DrawText const PG_Rect rect,
const PG_String &  text,
const PG_Color c
 

Render text inside the widget and set the font color.

Parameters:
rect rectangle where the text should appear
text pointer to text string
c color of the rendered text

Definition at line 1501 of file pgwidget.cpp.

References DrawText(), and SetFontColor().

void PG_Widget::DrawText int  x,
int  y,
const PG_String &  text,
const PG_Rect cliprect
 

Render text inside the widget and clip to a given clipping rectangle.

Parameters:
x x-position where the text should appear
y y-position where the text should appear
text pointer to text string
cliprect text bounding rectangle

Definition at line 1488 of file pgwidget.cpp.

References PG_WidgetDataInternal::font, GetFontAscender(), PG_Application::GetScreen(), my_srfObject, PG_Rect::my_xpos, PG_Rect::my_ypos, and PG_FontEngine::RenderText().

void PG_Widget::DrawText int  x,
int  y,
const PG_String &  text
 

Render text inside the widget.

Parameters:
x x-position where the text should appear
y y-position where the text should appear
text pointer to text string

Definition at line 1484 of file pgwidget.cpp.

References DrawText(), and PG_Rect::PG_Rect().

void PG_Widget::DrawText const PG_Rect rect,
const PG_String &  text
 

Render text inside the widget.

Parameters:
rect rectangle where the text should appear
text pointer to text string

Definition at line 1476 of file pgwidget.cpp.

References PG_WidgetDataInternal::font, GetFontAscender(), PG_Application::GetScreen(), PG_Rect::Height(), my_srfObject, PG_Rect::my_xpos, PG_Rect::my_ypos, PG_Rect::PG_Rect(), PG_WidgetDataInternal::rectClip, RenderText(), and PG_Rect::Width().

Referenced by DrawText(), PG_ProgressBar::eventBlit(), PG_PopupMenu::eventBlit(), PG_Label::eventBlit(), PG_ColumnItem::eventBlit(), and PG_Button::eventBlit().

void PG_Widget::DrawVLine int  x,
int  y,
int  h,
const PG_Color c
 

Definition at line 1702 of file pgwidget.cpp.

References PG_Application::GetScreen(), PG_Application::ScreenLocker::lock(), PG_Color::MapRGB(), my_srfObject, PG_Rect::my_xpos, PG_Rect::my_ypos, PG_MAX, PG_MIN, PG_WidgetDataInternal::rectClip, and PG_Rect::SetRect().

Referenced by DrawBorder(), DrawRectWH(), and PG_ColorSelector::PG_ColorBox::eventBlit().

void PG_Widget::EnableReceiver bool  enable,
bool  bRecursive = false
 

Definition at line 1910 of file pgwidget.cpp.

References EnableReceiver(), PG_MessageObject::EnableReceiver(), GetChildList(), and PG_Rect::next().

Referenced by EnableReceiver(), PG_RadioButton::PG_RadioButton(), and PG_Window::PG_Window().

void PG_Widget::EndWidgetDrag int  x,
int  y
 

Finishes a drag operation.

Parameters:
x x endposition
y y endposition

Definition at line 848 of file pgwidget.cpp.

References PG_WidgetDataInternal::ptDragStart, WidgetDrag(), PG_Point::x, and PG_Point::y.

void PG_Widget::eventBlit SDL_Surface *  surface,
const PG_Rect src,
const PG_Rect dst
[protected, virtual]
 

overridable eventhandler to blit the widget contents to the screen

Parameters:
surface pointer to SDL_Surface to be blitted
src source rectangle (client coordinates)
dst destination rectangle (screen coordinates) Override this eventhandler to perform custom blitting behaviour (without drawing onto the widget surface).

Reimplemented in GraphWidget, DamageBarWidget, StoringPosition, SelectionWidget, PG_Button, PG_ColorSelector::PG_ColorBox, PG_ColumnItem, PG_Image, PG_Label, PG_LineEdit, PG_ListBoxItem, PG_MultiLineEdit, PG_PopupMenu, PG_ProgressBar, PG_RichEdit, PG_ThemeWidget, PG_Window, MainScreenWidget, MapDisplayPG, SpecialDisplayWidget, SpecialInputWidget, Emboss, and BarGraphWidget.

Definition at line 1559 of file pgwidget.cpp.

References PG_Draw::BlitSurface(), PG_Application::GetScreen(), PG_LogDBG(), and PG_WidgetDataInternal::transparency.

Referenced by Blit(), PG_ThemeWidget::eventBlit(), PG_ListBoxItem::eventBlit(), PG_Label::eventBlit(), PG_Image::eventBlit(), MapDisplayPG::eventBlit(), and Update().

void PG_Widget::eventDraw SDL_Surface *  surface,
const PG_Rect rect
[protected, virtual]
 

overridable eventhandler to draw the object surface

Parameters:
surface the widgets drawing surface.
rect rectangle to draw within. This eventhandler is called whenevener the widget contents should be redrawn.
Note:
Only widgets with drawing surfaces (see the constructor) will call this eventhandler.

Reimplemented in ExperienceOverview, DiplomaticModeChooser< SelectionType >, PG_Image, PG_Label, PG_ThemeWidget, and SelectionItemWidget.

Definition at line 1763 of file pgwidget.cpp.

Referenced by Redraw().

void PG_Widget::eventHide  )  [protected, virtual]
 

overridable eventhandler called whenever the widget gets hidden.

Reimplemented in PG_DropDown, PG_LineEdit, PG_ListBoxBaseItem, PG_PopupMenu, and LayoutablePanel.

Definition at line 280 of file pgwidget.cpp.

Referenced by LayoutablePanel::eventHide(), PG_PopupMenu::eventHide(), Hide(), and SetVisible().

void PG_Widget::eventMouseEnter  )  [virtual]
 

eventhandler for mouse movements.

This overrideable handler is called everytime the mouse cursor is entering the widget area.

Reimplemented in WeaponInfoLine, GuiButton, SmallGuiButton, PG_Button, PG_ListBoxBaseItem, PG_PopupMenu, and PG_RadioButton.

Definition at line 257 of file pgwidget.cpp.

References sigMouseEnter.

Referenced by AcceptEvent(), Action(), PG_RadioButton::eventMouseEnter(), PG_PopupMenu::eventMouseEnter(), PG_Button::eventMouseEnter(), and Show().

void PG_Widget::eventMouseLeave  )  [virtual]
 

eventhandler for mouse movements.

This overrideable handler is called everytime the mouse cursor is leaving the widget area.

Reimplemented in WeaponInfoLine, GuiButton, SmallGuiButton, PG_Button, PG_ListBoxBaseItem, PG_PopupMenu, and PG_RadioButton.

Definition at line 263 of file pgwidget.cpp.

References GetParent(), PG_WidgetDataInternal::mouseInside, and sigMouseLeave.

Referenced by AcceptEvent(), Action(), PG_RadioButton::eventMouseLeave(), PG_PopupMenu::eventMouseLeave(), PG_ListBoxBaseItem::eventMouseLeave(), PG_Button::eventMouseLeave(), and Hide().

void PG_Widget::eventMoveWidget int  x,
int  y
[protected, virtual]
 

Callback for the MoveWidget event.

Parameters:
x new x position
y new y position This virtual function can be used to implement custom behavior for MoveWidget events.

Reimplemented in PG_DropDown, PG_PopupMenu, and LayoutablePanel.

Definition at line 1765 of file pgwidget.cpp.

Referenced by LayoutablePanel::eventMoveWidget(), PG_PopupMenu::eventMoveWidget(), and MoveRect().

bool PG_Widget::eventQuitModal int  id,
PG_MessageObject widget,
unsigned long  data
[protected, virtual]
 

overridable eventhandler called when leaving a modal eventloop

Parameters:
id id of the widget that send the quit signal
widget pointer to the widget
data event specific data
Returns:
true if the message was processed

Reimplemented from PG_MessageObject.

Definition at line 1550 of file pgwidget.cpp.

References PG_WidgetDataInternal::quitModalLoop.

Referenced by QuitModal().

void PG_Widget::eventShow  )  [protected, virtual]