


This class is the base class for all themed widgets.
It handles various combinations of gradients and background images.
widget type: ThemeWidget (default)
object name: ThemeWidget
PG_Widget theme
<widget>
<type value="ThemeWidget"/>
<object>
<name value="ThemeWidget"/>
<filename name="background" value="default/back.bmp"/>
<property name="backmode" value="TILE"/>
<gradient name="gradient"
color0="0x00B0B1B6"
color1="0x0083838D"
color2="0x007B7B83"
color3="0x00585765"/>
<property name="blend" value="200"/>
<property name="transparency" value="0"/>
<property name="bordersize" value="1"/>
</object>
</widget>
Public Member Functions | |
| PG_ThemeWidget (PG_Widget *parent, const PG_Rect &r=PG_Rect::null, const char *style="ThemeWidget") | |
| Create a new PG_ThemeWidget object. | |
| PG_ThemeWidget (PG_Widget *parent, const PG_Rect &r, bool bCreateSurface, const char *style="ThemeWidget") | |
| Create a new PG_ThemeWidget object. | |
| ~PG_ThemeWidget () | |
| void | LoadThemeStyle (const char *widgettype) |
| Load a specific themestyle. | |
| void | LoadThemeStyle (const char *widgettype, const char *objectname) |
| Load a style from the theme definition. | |
| bool | SetBackground (const char *filename, int mode=BKMODE_TILE) |
| bool | SetBackground (const char *filename, int mode, const PG_Color &colorkey) |
| bool | SetBackground (SDL_Surface *surface, int mode=BKMODE_TILE) |
| Define a surface as background image (will not be freed). | |
| void | SetBackgroundBlend (Uint8 backblend) |
| Defines the "blend-level" of gradient & background. | |
| void | SetGradient (PG_Gradient &grad) |
| Set the background gradient. | |
| PG_Gradient | GetGradient () |
| Get the background gradient. | |
| void | SetBorderSize (int b) |
| Set the bordersize of the widget. | |
| int | GetBorderSize () |
| Get the bordersize of the widget. | |
| bool | LoadImage (const char *filename) |
| Display an image in the widget. | |
| bool | LoadImage (const char *filename, Uint32 key) |
| Display an image in the widget using a colorkey. | |
| bool | SetImage (SDL_Surface *image, bool bFreeImage=true) |
| Display an image in the widget. | |
| void | SetTransparency (Uint8 t, bool bRecursive=false) |
| Set the fransparency of the widget. | |
| void | SetSimpleBackground (bool simple) |
| void | SetBackgroundColor (const PG_Color &c) |
Static Public Member Functions | |
| SDL_Surface * | CreateThemedSurface (const PG_Rect &r, PG_Gradient *gradient, SDL_Surface *background, int bkmode, Uint8 blend) |
| Create a 'themed' surface. | |
| void | DeleteThemedSurface (SDL_Surface *surface) |
| Delete a themed surface. | |
Protected Member Functions | |
| void | eventSizeWidget (Uint16 w, Uint16 h) |
| Callback for the SizeWidget event. | |
| void | eventDraw (SDL_Surface *surface, const PG_Rect &rect) |
| overridable eventhandler to draw the object surface | |
| 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 | |
| bool | my_has_gradient |
| PG_Gradient | my_gradient |
| SDL_Surface * | my_background |
| SDL_Surface * | my_image |
| Uint8 | my_blendLevel |
| bool | my_backgroundFree |
| int | my_backgroundMode |
| int | my_bordersize |
|
||||||||||||||||
|
Create a new PG_ThemeWidget object.
|
|
||||||||||||||||||||
|
Create a new PG_ThemeWidget object.
|
|
|
|
|
||||||||||||||||||||||||
|
Create a 'themed' surface.
|
|
|
Delete a themed surface.
|
|
||||||||||||||||
|
overridable eventhandler to blit the widget contents to the screen
Reimplemented from PG_Widget. Reimplemented in PG_Image, PG_LineEdit, PG_PopupMenu, PG_ProgressBar, PG_RichEdit, and PG_Window. |
|
||||||||||||
|
overridable eventhandler to draw the object surface
Reimplemented from PG_Widget. Reimplemented in PG_Image. |
|
||||||||||||
|
Callback for the SizeWidget event.
Reimplemented from PG_Widget. Reimplemented in PG_ScrollBar, PG_ScrollWidget, and PG_Window. |
|
|
Get the bordersize of the widget.
|
|
|
Get the background gradient.
|
|
||||||||||||
|
Display an image in the widget using a colorkey.
|
|
|
Display an image in the widget.
|
|
||||||||||||
|
Load a style from the theme definition.
Reimplemented from PG_Widget. Reimplemented in PG_LineEdit, and PG_PopupMenu. |
|
|
Load a specific themestyle.
Reimplemented from PG_Widget. Reimplemented in PG_LineEdit, PG_MessageBox, PG_PopupMenu, PG_ProgressBar, PG_RadioButton, PG_ScrollBar, PG_ScrollWidget, PG_Slider, and PG_Window. |
|
||||||||||||
|
Define a surface as background image (will not be freed).
|
|
||||||||||||||||
|
|
|
||||||||||||
|
|
|
|
Defines the "blend-level" of gradient & background.
|
|
|
|
|
|
Set the bordersize of the widget.
|
|
|
Set the background gradient.
|
|
||||||||||||
|
Display an image in the widget.
|
|
|
|
|
||||||||||||
|
Set the fransparency of the widget.
Reimplemented from PG_Widget.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|