GG::ColorDlg Class Reference

a dialog box used to get a color selection from the user. More...

#include <ColorDlg.h>

Inheritance diagram for GG::ColorDlg:

GG::Wnd List of all members.

Structors

 ColorDlg (int x, int y, const boost::shared_ptr< Font > &font, Clr dialog_color, Clr border_color, Clr text_color=CLR_BLACK)
 ColorDlg (int x, int y, Clr original_color, const boost::shared_ptr< Font > &font, Clr dialog_color, Clr border_color, Clr text_color=CLR_BLACK)

Accessors

bool ColorWasSelected () const
Clr Result () const
const std::string & NewString (const std::string &str) const
const std::string & OldString (const std::string &str) const
const std::string & RedString (const std::string &str) const
const std::string & GreenString (const std::string &str) const
const std::string & BlueString (const std::string &str) const
const std::string & HueString (const std::string &str) const
const std::string & SaturationString (const std::string &str) const
const std::string & ValueString (const std::string &str) const
const std::string & AlphaString (const std::string &str) const
const std::string & OkString (const std::string &str) const
const std::string & CancelString (const std::string &str) const

Mutators

void SetNewString (const std::string &str)
void SetOldString (const std::string &str)
void SetRedString (const std::string &str)
void SetGreenString (const std::string &str)
void SetBlueString (const std::string &str)
void SetHueString (const std::string &str)
void SetSaturationString (const std::string &str)
void SetValueString (const std::string &str)
void SetAlphaString (const std::string &str)
void SetOkString (const std::string &str)
void SetCancelString (const std::string &str)
virtual void Render ()
virtual void KeyPress (Key key, Flags< ModKey > mod_keys)

Structors

 ColorDlg ()

Friends

struct ColorButtonClickFunctor

Classes

class  ColorButton
 the button used to select the custom colors in ColorDlg. More...
class  ColorDisplay
 a simple control that only displays a rectangle filled with the given color. More...

Detailed Description

a dialog box used to get a color selection from the user.

The user may select a certain number of custom colors, which will remain available for the duration of that run of the application in the ColorDlg's static space. If desired, an optional previous color can be provided to the ColorDlg ctor, which will cause this previous color to be shown next to the new color for comparison purposes.

Definition at line 155 of file ColorDlg.h.


Constructor & Destructor Documentation

GG::ColorDlg::ColorDlg ( int  x,
int  y,
const boost::shared_ptr< Font > &  font,
Clr  dialog_color,
Clr  border_color,
Clr  text_color = CLR_BLACK 
)

ctor

GG::ColorDlg::ColorDlg ( int  x,
int  y,
Clr  original_color,
const boost::shared_ptr< Font > &  font,
Clr  dialog_color,
Clr  border_color,
Clr  text_color = CLR_BLACK 
)

ctor

GG::ColorDlg::ColorDlg (  )  [protected]

default ctor


Member Function Documentation

bool GG::ColorDlg::ColorWasSelected (  )  const

returns true iff the user selected a color and then clicked the "Ok" button.

Otherwise, the color returned by Result() will be the original color if one was selected, or undefined if one was not.

Clr GG::ColorDlg::Result (  )  const

returns the color selected by the user, if the "Ok" button was used to close the dialog.

const std::string& GG::ColorDlg::NewString ( const std::string &  str  )  const

returns the text to use to label the new color to str Default: "New"

const std::string& GG::ColorDlg::OldString ( const std::string &  str  )  const

returns the text to use to label the old color to str Default: "Old"

const std::string& GG::ColorDlg::RedString ( const std::string &  str  )  const

returns the text to use to label the red slider to str Default: "R:"

const std::string& GG::ColorDlg::GreenString ( const std::string &  str  )  const

returns the text to use to label the green slider to str Default: "G:"

const std::string& GG::ColorDlg::BlueString ( const std::string &  str  )  const

returns the text to use to label the blue slider to str Default: "B:"

const std::string& GG::ColorDlg::HueString ( const std::string &  str  )  const

returns the text to use to label the hue slider to str Default: "H:"

const std::string& GG::ColorDlg::SaturationString ( const std::string &  str  )  const

returns the text to use to label the saturation slider to str Default: "S:"

const std::string& GG::ColorDlg::ValueString ( const std::string &  str  )  const

returns the text to use to label the value slider to str Default: "V:"

const std::string& GG::ColorDlg::AlphaString ( const std::string &  str  )  const

returns the text to use to label the alpha slider to str Default: "A:"

const std::string& GG::ColorDlg::OkString ( const std::string &  str  )  const

returns the text to use to label the ok button to str Default: "Ok"

const std::string& GG::ColorDlg::CancelString ( const std::string &  str  )  const

returns the text to use to label the cancel button to str Default: "Cancel"

void GG::ColorDlg::SetNewString ( const std::string &  str  ) 

sets the text to use to label the new color to str Default: "New"

void GG::ColorDlg::SetOldString ( const std::string &  str  ) 

sets the text to use to label the old color to str Default: "Old"

void GG::ColorDlg::SetRedString ( const std::string &  str  ) 

sets the text to use to label the red slider to str Default: "R:"

void GG::ColorDlg::SetGreenString ( const std::string &  str  ) 

sets the text to use to label the green slider to str Default: "G:"

void GG::ColorDlg::SetBlueString ( const std::string &  str  ) 

sets the text to use to label the blue slider to str Default: "B:"

void GG::ColorDlg::SetHueString ( const std::string &  str  ) 

sets the text to use to label the hue slider to str Default: "H:"

void GG::ColorDlg::SetSaturationString ( const std::string &  str  ) 

sets the text to use to label the saturation slider to str Default: "S:"

void GG::ColorDlg::SetValueString ( const std::string &  str  ) 

sets the text to use to label the value slider to str Default: "V:"

void GG::ColorDlg::SetAlphaString ( const std::string &  str  ) 

sets the text to use to label the alpha slider to str Default: "A:"

void GG::ColorDlg::SetOkString ( const std::string &  str  ) 

sets the text to use to label the ok button to str Default: "Ok"

void GG::ColorDlg::SetCancelString ( const std::string &  str  ) 

sets the text to use to label the cancel button to str Default: "Cancel"

virtual void GG::ColorDlg::Render (  )  [virtual]

draws this Wnd.

Note that Wnds being dragged for a drag-and-drop operation are rendered twice -- once in-place as normal, once in the location of the drag operation, attached to the cursor. Such Wnds may wish to render themselves differently in those two cases. To determine which render is being performed, they can call GUI::GetGUI()->RenderingDragDropWnds().

Reimplemented from GG::Wnd.

virtual void GG::ColorDlg::KeyPress ( Key  key,
Flags< ModKey >  mod_keys 
) [virtual]

respond to down-keystrokes (focus window only).

A window may receive KeyPress() messages passed up to it from its children. For instance, Control-derived classes pass KeyPress() messages to their Parent() windows by default.

Note:
Though mouse clicks consist of a press and a release, all Control classes by default respond immediately to KeyPress(), not KeyRelease(); in fact, by default no Wnd class does anything at all on a KeyRelease event.

Reimplemented from GG::Wnd.


The documentation for this class was generated from the following file:
Generated on Wed Mar 26 14:35:42 2008 for GG by  doxygen 1.5.2