#include <pglabel.h>
Inheritance diagram for PG_Label:

Public Types | |
| enum | TextAlign { LEFT, CENTER, RIGHT } |
Public Member Functions | |
| PG_Label (PG_Widget *parent, const PG_Rect &r=PG_Rect::null, const std::string &text=PG_NULLSTR, const std::string &style="Label") | |
| Only constructor. | |
| ~PG_Label () | |
| Only destructor. | |
| void | LoadThemeStyle (const std::string &widgettype) |
| Load a style from the theme definition. | |
| void | LoadThemeStyle (const std::string &widgettype, const std::string &objectname) |
| Load a style from the theme definition. | |
| void | SetAlignment (TextAlign a) |
| Sets text alignment. | |
| SDL_Surface * | SetIcon (const std::string &filename) |
| SDL_Surface * | SetIcon (SDL_Surface *icon) |
| SDL_Surface * | GetIcon () |
| void | SetIndent (Uint16 indent) |
| Set the text indentation. | |
| Uint16 | GetIndent () |
| Returns the text indentation. | |
| 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()). | |
Protected Member Functions | |
| void | eventDraw (SDL_Surface *surface, const PG_Rect &rect) |
| Draw event handler. | |
| void | eventBlit (SDL_Surface *surface, const PG_Rect &src, const PG_Rect &dst) |
| overridable eventhandler to blit the widget contents to the screen | |
Protected Attributes | |
| SDL_Surface * | my_srfIcon |
Definition at line 47 of file pglabel.h.
|
|
|
|
||||||||||||||||||||
|
Only constructor.
Definition at line 37 of file pglabel.cpp. References LEFT, LoadThemeStyle(), my_srfIcon, and PG_Widget::SetText(). Referenced by ListBoxImageItem< SelectionType >::ListBoxImageItem(). |
|
|
Only destructor.
Definition at line 49 of file pglabel.cpp. References my_srfIcon, and PG_FileArchive::UnloadSurface(). |
|
||||||||||||||||
|
overridable eventhandler to blit the widget contents to the screen
Reimplemented from PG_Widget. Reimplemented in PG_ColumnItem, and PG_ListBoxItem. Definition at line 76 of file pglabel.cpp. References CENTER, PG_Widget::DrawText(), PG_Widget::eventBlit(), PG_Widget::GetClipRects(), PG_Widget::GetTextSize(), LEFT, PG_Rect::my_height, my_srfIcon, PG_Widget::my_text, PG_Rect::my_width, PG_Rect::my_xpos, PG_Rect::my_ypos, and RIGHT. Referenced by PG_ListBoxItem::eventBlit(). |
|
||||||||||||
|
Draw event handler.
Reimplemented from PG_Widget. Definition at line 124 of file pglabel.cpp. |
|
|
Definition at line 156 of file pglabel.cpp. References my_srfIcon. Referenced by PG_Window::GetIcon(), and SetSizeByText(). |
|
|
Returns the text indentation.
Definition at line 164 of file pglabel.cpp. Referenced by PG_ListBoxBaseItem::PG_ListBoxBaseItem(). |
|
||||||||||||
|
Load a style from the theme definition.
Reimplemented from PG_Widget. Reimplemented in PG_ListBoxItem. Definition at line 62 of file pglabel.cpp. References PG_PropStr::alignment, PG_Theme::FindString(), PG_Theme::GetAlignment(), PG_Application::GetTheme(), PG_PropStr::label, PG_Widget::LoadThemeStyle(), and PG_Widget::SetText(). |
|
|
Load a style from the theme definition.
Reimplemented from PG_Widget. Definition at line 55 of file pglabel.cpp. References PG_PropStr::Label. Referenced by PG_RadioButton::LoadThemeStyle(), PG_Label(), and PG_PropertyEditor::RegisterProperty(). |
|
|
|
Definition at line 131 of file pglabel.cpp. References my_srfIcon, PG_FileArchive::UnloadSurface(), and PG_Widget::Update(). |
|
|
Definition at line 144 of file pglabel.cpp. References PG_FileArchive::LoadSurface(), my_srfIcon, PG_FileArchive::UnloadSurface(), and PG_Widget::Update(). Referenced by PG_Window::SetIcon(), and SetLabelAtts(). |
|
|
Set the text indentation.
Definition at line 160 of file pglabel.cpp. Referenced by PG_ListBoxBaseItem::PG_ListBoxBaseItem(), PG_ListBox::SetIndent(), and SetLabelAtts(). |
|
||||||||||||||||
|
Set widget size by size of text (should be used before Show() or AddWidget()).
Reimplemented from PG_Widget. Definition at line 168 of file pglabel.cpp. References PG_Widget::GetFont(), GetIcon(), PG_FontEngine::GetTextSize(), PG_Rect::my_height, PG_Widget::my_text, PG_Rect::my_width, PG_MAX, PG_String, and PG_Widget::SetSizeByText(). Referenced by AddWeatherAreaDialog::AddWeatherAreaDialog(), AddWindChangeDialog::AddWindChangeDialog(), ChanceSettingsDialog::buildUpForm(), ChangePasswordDialog::ChangePasswordDialog(), ResourcePlacementDialog::ResourcePlacementDialog(), SaveGameBaseDialog::SaveGameBaseDialog(), PG_RadioButton::SetSizeByText(), WeatherDialog::WeatherDialog(), and WeatherPanel::WeatherPanel(). |
|
|
Definition at line 107 of file pglabel.h. Referenced by eventBlit(), PG_ColumnItem::eventBlit(), GetIcon(), PG_Label(), PG_ListBoxItem::PG_ListBoxItem(), SetIcon(), and ~PG_Label(). |
1.4.2