SCV  4.2.1
Simple Components for Visual
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
scv::ColorScheme Class Reference

Functionality to customize SCV component color themes. More...

#include <ColorScheme.h>

Inheritance diagram for scv::ColorScheme:
Singleton< T >

Public Types

enum  Target {
  CURSOR, TEXT, TEXTSELECTION, TEXTSELECTED,
  BACKGROUND, MENUBAR, PROGRESSBAR, SEPARATOR,
  TEXTFIELD, CONTEXTMENU, CONTEXTMENUFONT, PANEL,
  SCROLLPANEL, MAINCOMPONENTS, OVERCOMPONENTS, HOLDCOMPONENTS,
  FONT, s_nComponents
}
 Possible color values that can be customized. More...
 
enum  SchemeStyle {
  SCVDEFAULT, WARCRAFT, WINDOWS, OSX,
  CLEAN
}
 Predefined color schemes. More...
 

Public Member Functions

void loadScheme (ColorScheme::SchemeStyle style)
 Load a predefined SCV color scheme.
 
void setColor (ColorScheme::Target target, const Color4f &color)
 Sets a color value in the color scheme.
 
const Color4fgetColor (ColorScheme::Target target) const
 Returns component's current color in the color scheme.
 
void applyColor (const Color4f &color)
 Prepares the graphics system to draw a component with the specified color. Should be called only by widget implementations.
 
void applyColor (ColorScheme::Target target)
 Prepares to draw component with specified color target.
 
void applyColor (ColorScheme::Target target, float w)
 Prepares to draw a component with the specified color target, brightened/darkened by the value w.
 
void applyDefaultModulate ()
 

Friends

class Singleton< ColorScheme >
 

Additional Inherited Members

- Static Public Member Functions inherited from Singleton< T >
static void setInstance (T *instance)
 
static T * getInstance ()
 
static void destroyInstance ()
 
- Protected Member Functions inherited from Singleton< T >
 Singleton (void)
 
virtual ~Singleton (void)
 
 Singleton (const Singleton &source)
 
- Static Protected Attributes inherited from Singleton< T >
static T * _instance = 0
 

Detailed Description

Functionality to customize SCV component color themes.

Since it's a Singleton class, it must be acessed via getInstance().

Example:

scv::ColorScheme::getInstance()->loadScheme(scv::ColorScheme::scvDefault);

Member Enumeration Documentation

Predefined color schemes.

Enumerator:
SCVDEFAULT 
WARCRAFT 
WINDOWS 
OSX 
CLEAN 

Possible color values that can be customized.

Enumerator:
CURSOR 

SCV cursor.

TEXT 

Text color.

TEXTSELECTION 

Color of text selection rectangle.

TEXTSELECTED 

Color of selected text.

BACKGROUND 

Main window background.

MENUBAR 

widget

PROGRESSBAR 

ProgressBar widget.

SEPARATOR 

Separator widget.

TEXTFIELD 

TextField widget.

CONTEXTMENU 

Context menus.

CONTEXTMENUFONT 

Context menu text.

PANEL 

Panel background.

SCROLLPANEL 

Scrollable panel background.

MAINCOMPONENTS 
OVERCOMPONENTS 
HOLDCOMPONENTS 
FONT 

General text.

s_nComponents 

Total number of color settings.

Member Function Documentation

void scv::ColorScheme::applyColor ( const Color4f color)

Prepares the graphics system to draw a component with the specified color. Should be called only by widget implementations.

void scv::ColorScheme::applyColor ( ColorScheme::Target  target)

Prepares to draw component with specified color target.

void scv::ColorScheme::applyColor ( ColorScheme::Target  target,
float  w 
)

Prepares to draw a component with the specified color target, brightened/darkened by the value w.

void scv::ColorScheme::applyDefaultModulate ( )
const Color4f & scv::ColorScheme::getColor ( ColorScheme::Target  target) const

Returns component's current color in the color scheme.

void scv::ColorScheme::loadScheme ( ColorScheme::SchemeStyle  style)

Load a predefined SCV color scheme.

void scv::ColorScheme::setColor ( ColorScheme::Target  target,
const Color4f color 
)

Sets a color value in the color scheme.

Parameters
targetColor scheme entry that should be modified.
colorNew color of component.

Friends And Related Function Documentation

friend class Singleton< ColorScheme >
friend

The documentation for this class was generated from the following files: