GG
|
A dialog box used to get a color selection from the user. More...
#include <ColorDlg.h>
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... | |
Structors | |
ColorDlg (X x, Y y, const boost::shared_ptr< Font > &font, Clr dialog_color, Clr border_color, Clr text_color=CLR_BLACK) | |
ColorDlg (X x, Y y, Clr original_color, const boost::shared_ptr< Font > &font, Clr dialog_color, Clr border_color, Clr text_color=CLR_BLACK) | |
ColorDlg () | |
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, boost::uint32_t key_code_point, Flags< ModKey > mod_keys) |
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 153 of file ColorDlg.h.
GG::ColorDlg::ColorDlg | ( | X | x, |
Y | y, | ||
const boost::shared_ptr< Font > & | font, | ||
Clr | dialog_color, | ||
Clr | border_color, | ||
Clr | text_color = CLR_BLACK |
||
) |
ctor
GG::ColorDlg::ColorDlg | ( | X | x, |
Y | y, | ||
Clr | original_color, | ||
const boost::shared_ptr< Font > & | font, | ||
Clr | dialog_color, | ||
Clr | border_color, | ||
Clr | text_color = CLR_BLACK |
||
) |
ctor
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.
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, |
boost::uint32_t | key_code_point, | ||
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.
Reimplemented from GG::Wnd.