- Your Widget Set For OpenGL
Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | Related Pages

ufo::UStyle Class Reference

The style class provides the look and feel for common widgets. More...

#include <ustyle.hpp>

Inheritance diagram for ufo::UStyle:

ufo::UObject ufo::UCollectable ufo::UBasicStyle List of all members.

Public Types

enum  PrimitiveElement {
  PE_IndicatorArrowUp, PE_IndicatorArrowDown, PE_IndicatorArrowLeft, PE_IndicatorArrowRight,
  PE_IndicatorCheckBox, PE_IndicatorCheckBoxMask, PE_IndicatorRadioButton, PE_IndicatorRadioButtonMask,
  PE_IndicatorButtonDropDown, PE_TextCaret, PE_PanelButtonBevel, PE_PanelButtonTool,
  PE_PanelToolBar, PE_PanelWidget, PE_Frame, PE_FrameWindow,
  PE_FrameMenu, PE_FrameButtonBevel, PE_FrameDefaultButton, PE_FrameTabWidget,
  PE_FrameStatusBar, PE_FrameLineEdit, PE_FrameFocusRect, PE_Gripper
}
enum  ComponentElement {
  CE_Widget, CE_Compound, CE_Label, CE_StaticText,
  CE_Button, CE_ToolButton, CE_CheckBox, CE_RadioButton,
  CE_MenuItem, CE_MenuBarItem, CE_MenuTearOff, CE_ListBox,
  CE_LineEdit, CE_TextEdit, CE_TextWidget, CE_Separator,
  CE_ProgressBar, CE_ProgressBarGroove, CE_ProgressBarContents, CE_TabBarTab,
  CE_Splitter, CE_ComboBox, CE_SpinBox, CE_Slider,
  CE_TitleBar, CE_InternalFrame, CE_ScrollBar, CE_GroupBox
}
enum  SubControls {
  SC_None = 0, SC_ScrollBarHome = 1 << 0, SC_ScrollBarAddLine = 1 << 1, SC_ScrollBarSubLine = 1 << 2,
  SC_ScrollBarAddPage = 1 << 3, SC_ScrollBarSubPage = 1 << 4, SC_ScrollBarSlider = 1 << 5, SC_ScrollBarGroove = 1 << 6,
  SC_ScrollBarEnd = 1 << 7, SC_ScrollBarFirst = SC_ScrollBarHome, SC_ScrollBarLast = SC_ScrollBarEnd, SC_SpinBoxUp = 1 << 0,
  SC_SpinBoxDown = 1 << 1, SC_SpinBoxFrame = 1 << 2, SC_SpinBoxEditField = 1 << 3, SC_SpinBoxFirst = SC_SpinBoxUp,
  SC_SpinBoxLast = SC_SpinBoxEditField, SC_ComboBoxEditField = 1 << 0, SC_ComboBoxArrow = 1 << 1, SC_ComboBoxFrame = 1 << 2,
  SC_ComboBoxListBoxPopup = 1 << 3, SC_ComboBoxFirst = SC_ComboBoxEditField, SC_ComboBoxLast = SC_ComboBoxListBoxPopup, SC_SliderGroove = 1 << 0,
  SC_SliderHandle = 1 << 1, SC_SliderTickmarks = 1 << 2, SC_SliderFirst = SC_SliderGroove, SC_SliderLast = SC_SliderTickmarks,
  SC_ToolButton = 1 << 0, SC_ToolButtonMenu = 1 << 1, SC_TitleBarSysMenu = 1 << 0, SC_TitleBarMinButton = 1 << 1,
  SC_TitleBarMaxButton = 1 << 2, SC_TitleBarCloseButton = 1 << 3, SC_TitleBarLabel = 1 << 4, SC_TitleBarFirst = SC_TitleBarSysMenu,
  SC_TitleBarLast = SC_TitleBarLabel
}

Public Member Functions

virtual void paintPrimitive (UGraphics *g, PrimitiveElement elem, const URectangle &rect, const UStyleHints *hints, uint32_t widgetState)=0
virtual void paintComponent (UGraphics *g, ComponentElement elem, const URectangle &rect, const UStyleHints *hints, const UWidgetModel *model, UWidget *w=NULL)=0
virtual void paintBorder (UGraphics *g, uint32_t borderType, const URectangle &rect, const UStyleHints *hints, uint32_t widgetState)=0
virtual UInsets getBorderInsets (ComponentElement elem, const UStyleHints *hints)=0
virtual SubControls getSubControlAt (ComponentElement elem, const URectangle &rect, const UStyleHints *hints, const UWidgetModel *model, const UPoint &pos, UWidget *w=NULL)=0
virtual URectangle getSubControlBounds (ComponentElement elem, const URectangle &rect, const UStyleHints *hints, const UWidgetModel *model, SubControls subElem, UWidget *w=NULL)=0
virtual UInsets getInsets (ComponentElement elem, const UStyleHints *hints, const UWidgetModel *model, UWidget *w=NULL)=0
virtual UDimension getSizeFromContents (ComponentElement elem, const UDimension &contentsSize, const UStyleHints *hints, const UWidgetModel *model, UWidget *w=NULL)=0
virtual void paintCompound (UGraphics *g, const UStyleHints *hints, const std::string &text, UIcon *icon, const URectangle &rect, uint32_t widgetState, int acceleratorIndex=-1)=0
virtual UDimension getCompoundPreferredSize (const UStyleHints *hints, const std::string &text, UIcon *icon)=0
virtual void layoutCompound (const UStyleHints *hints, const std::string &text, UIcon *icon, const URectangle &viewRect, URectangle *textRect, URectangle *iconRect)=0
virtual void install (UWidget *w)=0
virtual void uninstall (UWidget *w)=0

Detailed Description

The style class provides the look and feel for common widgets.

Actually you do not have to have a certain widget for painting, just a model which describe its contents.

Author:
Johannes Schmidt


Member Function Documentation

virtual UInsets ufo::UStyle::getBorderInsets ComponentElement  elem,
const UStyleHints hints
[pure virtual]
 

Returns:
The insets used by a border.

Implemented in ufo::UBasicStyle.

virtual UDimension ufo::UStyle::getCompoundPreferredSize const UStyleHints hints,
const std::string &  text,
UIcon icon
[pure virtual]
 

Returns:
The preferred size for an icon with text

Implemented in ufo::UBasicStyle.

virtual UInsets ufo::UStyle::getInsets ComponentElement  elem,
const UStyleHints hints,
const UWidgetModel model,
UWidget w = NULL
[pure virtual]
 

Returns:
The insets used between content (like icons, text) and the actual widget bounds.

Implemented in ufo::UBasicStyle.

virtual UDimension ufo::UStyle::getSizeFromContents ComponentElement  elem,
const UDimension contentsSize,
const UStyleHints hints,
const UWidgetModel model,
UWidget w = NULL
[pure virtual]
 

May return a slightly enlarged dimension to add space for focus, styled borders or icons.

Implemented in ufo::UBasicStyle.

virtual SubControls ufo::UStyle::getSubControlAt ComponentElement  elem,
const URectangle rect,
const UStyleHints hints,
const UWidgetModel model,
const UPoint pos,
UWidget w = NULL
[pure virtual]
 

Returns:
The sub control at the given position or SC_None.

Implemented in ufo::UBasicStyle.

virtual URectangle ufo::UStyle::getSubControlBounds ComponentElement  elem,
const URectangle rect,
const UStyleHints hints,
const UWidgetModel model,
SubControls  subElem,
UWidget w = NULL
[pure virtual]
 

Returns:
The bounding rectangle of a sub control .

Implemented in ufo::UBasicStyle.

virtual void ufo::UStyle::install UWidget w  )  [pure virtual]
 

Stub method. Configures a widget to be used with this style. Not yet implementd.

Implemented in ufo::UBasicStyle.

virtual void ufo::UStyle::layoutCompound const UStyleHints hints,
const std::string &  text,
UIcon icon,
const URectangle viewRect,
URectangle textRect,
URectangle iconRect
[pure virtual]
 

Lays out an icon with text.

Implemented in ufo::UBasicStyle.

virtual void ufo::UStyle::paintBorder UGraphics g,
uint32_t  borderType,
const URectangle rect,
const UStyleHints hints,
uint32_t  widgetState
[pure virtual]
 

Paints a border.

Implemented in ufo::UBasicStyle.

virtual void ufo::UStyle::paintComponent UGraphics g,
ComponentElement  elem,
const URectangle rect,
const UStyleHints hints,
const UWidgetModel model,
UWidget w = NULL
[pure virtual]
 

Paints a component of a widget resp. the whole widget. For most components, this is only a call to paintModelBackground and paintModel.

Implemented in ufo::UBasicStyle.

virtual void ufo::UStyle::paintCompound UGraphics g,
const UStyleHints hints,
const std::string &  text,
UIcon icon,
const URectangle rect,
uint32_t  widgetState,
int  acceleratorIndex = -1
[pure virtual]
 

Paints an icon with text.

Implemented in ufo::UBasicStyle.

virtual void ufo::UStyle::paintPrimitive UGraphics g,
PrimitiveElement  elem,
const URectangle rect,
const UStyleHints hints,
uint32_t  widgetState
[pure virtual]
 

Paints a primitive element like arrows and frames.

Implemented in ufo::UBasicStyle.


The documentation for this class was generated from the following file:
The libUFO Project - written by Johannes Schmidt