GG
|
#include <Button.h>
Public Types | |
enum | ButtonState { BN_PRESSED, BN_UNPRESSED, BN_ROLLOVER } |
Signal Types | |
typedef boost::signal< void()> | ClickedSignalType |
Structors | |
Button (X x, Y y, X w, Y h, const std::string &str, const boost::shared_ptr< Font > &font, Clr color, Clr text_color=CLR_BLACK, Flags< WndFlag > flags=INTERACTIVE) | |
Button () |
Accessors | |
ClickedSignalType | ClickedSignal |
ButtonState | State () const |
const SubTexture & | UnpressedGraphic () const |
const SubTexture & | PressedGraphic () const |
const SubTexture & | RolloverGraphic () const |
Mutators | |
virtual void | Render () |
virtual void | SetColor (Clr c) |
void | SetState (ButtonState state) |
void | SetUnpressedGraphic (const SubTexture &st) |
void | SetPressedGraphic (const SubTexture &st) |
void | SetRolloverGraphic (const SubTexture &st) |
virtual void | LButtonDown (const Pt &pt, Flags< ModKey > mod_keys) |
virtual void | LDrag (const Pt &pt, const Pt &move, Flags< ModKey > mod_keys) |
virtual void | LButtonUp (const Pt &pt, Flags< ModKey > mod_keys) |
virtual void | LClick (const Pt &pt, Flags< ModKey > mod_keys) |
virtual void | MouseHere (const Pt &pt, Flags< ModKey > mod_keys) |
virtual void | MouseLeave () |
virtual void | RenderUnpressed () |
virtual void | RenderPressed () |
virtual void | RenderRollover () |
Additional Inherited Members | |
![]() | |
TextControl (X x, Y y, X w, Y h, const std::string &str, const boost::shared_ptr< Font > &font, Clr color=CLR_BLACK, Flags< TextFormat > format=FORMAT_NONE, Flags< WndFlag > flags=Flags< WndFlag >()) | |
TextControl (X x, Y y, const std::string &str, const boost::shared_ptr< Font > &font, Clr color=CLR_BLACK, Flags< TextFormat > format=FORMAT_NONE, Flags< WndFlag > flags=Flags< WndFlag >()) | |
virtual Pt | MinUsableSize () const |
const std::string & | Text () const |
Flags< TextFormat > | GetTextFormat () const |
Clr | TextColor () const |
bool | ClipText () const |
bool | SetMinSize () const |
template<class T > | |
void | operator>> (T &t) const |
template<class T > | |
T | GetValue () const |
operator const std::string & () const | |
bool | Empty () const |
CPSize | Length () const |
Pt | TextUpperLeft () const |
Pt | TextLowerRight () const |
virtual void | SetText (const std::string &str) |
virtual void | SizeMove (const Pt &ul, const Pt &lr) |
void | SetTextFormat (Flags< TextFormat > format) |
void | SetTextColor (Clr color) |
void | ClipText (bool b) |
void | SetMinSize (bool b) |
template<class T > | |
void | operator<< (T t) |
void | operator+= (const std::string &s) |
void | operator+= (char c) |
void | Clear () |
void | Insert (CPSize pos, char c) |
void | Insert (CPSize pos, const std::string &s) |
void | Erase (CPSize pos, CPSize num=CP1) |
void | Insert (std::size_t line, CPSize pos, char c) |
void | Insert (std::size_t line, CPSize pos, const std::string &s) |
void | Erase (std::size_t line, CPSize pos, CPSize num=CP1) |
![]() | |
TextControl () | |
const std::vector < Font::LineData > & | GetLineData () const |
const boost::shared_ptr< Font > & | GetFont () const |
bool | FitToText () const |
This is a basic button control.
Has three states: BN_UNPRESSED, BN_PRESSED, and BN_ROLLOVER. BN_ROLLOVER is when the cursor "rolls over" the button, without depressing it, allowing rollover effects on the button. To create a bitmap button, simply set the unpressed, pressed, and/or rollover graphics to the desired SubTextures.
the states of being for a GG::Button
ButtonState GG::Button::State | ( | ) | const |
Returns button state
|
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::TextControl.
void GG::Button::SetState | ( | ButtonState | state | ) |
Sets button state programmatically
Respond to left button down msg. A window receives this whenever any input device button changes from up to down while over the window.
Reimplemented from GG::Wnd.
|
protectedvirtual |
Respond to left button drag msg (even if this Wnd is not dragable). Drag messages are only sent to the window over which the button was pressed at the beginning of the drag. A window receives this whenever any input device button is down and the cursor is moving while over the window. The window will also receive drag messages when the mouse is being dragged outside the window's area.
Reimplemented from GG::Wnd.
Respond to release of left mouse button outside this Wnd, if it was originally depressed over this Wnd. A Wnd will receive an LButtonUp() message whenever a drag that started over its area ends, even if the cursor is not currently over the window when this happens.
Reimplemented from GG::Wnd.
Respond to release of left mouse button over this Wnd, if it was also originally depressed over this Wnd. A Wnd will receive an LButtonUp() message whenever a drag that started over its area ends over its area as well.
Reimplemented from GG::Wnd.
Respond to cursor moving about within the Wnd, or to cursor lingering within the Wnd for a long period of time. A MouseHere() message will not be generated the first time the cursor enters the window's area. In that case, a MouseEnter() message is generated.
Reimplemented from GG::Wnd.
|
protectedvirtual |
Respond to cursor leaving window's coords.
Reimplemented from GG::Wnd.