Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
|
#include <newbutton.h>
Public Types | |
enum | { NORMAL_STATE =0, DOWN_STATE, HIGHLIGHT_STATE, DISABLED_STATE, FINAL_BUTTON_STATE =DISABLED_STATE } |
Public Member Functions | |
virtual int | drawingState (void) |
virtual void | setDrawingState (int newState) |
virtual EventCommandId | command (void) |
virtual void | setCommand (EventCommandId id) |
virtual std::string | label (void) |
virtual void | setLabel (std::string l) |
virtual GFXColor | highlightColor (void) |
virtual void | setHighlightColor (const GFXColor &c) |
virtual GFXColor | textHighlightColor (void) |
virtual void | setTextHighlightColor (const GFXColor &c) |
virtual GFXColor | downColor (void) |
virtual void | setDownColor (const GFXColor &c) |
virtual GFXColor | downTextColor (void) |
virtual void | setDownTextColor (const GFXColor &c) |
virtual float | shadowWidth (void) |
virtual void | setShadowWidth (float width) |
virtual float | variableBorderCycleTime (void) |
virtual void | setVariableBorderCycleTime (float cycleTime) |
virtual GFXColor | borderColor (void) |
virtual void | setBorderColor (const GFXColor &c) |
virtual GFXColor | endBorderColor (void) |
virtual void | setEndBorderColor (const GFXColor &c) |
virtual void | draw (void) |
virtual bool | processMouseDown (const InputEvent &event) |
virtual bool | processMouseUp (const InputEvent &event) |
NewButton (void) | |
virtual | ~NewButton (void) |
![]() | |
virtual Rect | rect (void) |
virtual void | setRect (const Rect &r) |
virtual bool | hitTest (const Point &p) |
virtual bool | hidden (void) |
virtual void | setHidden (bool h=true) |
virtual const std::string & | id (void) |
virtual void | setId (const std::string &newId) |
virtual GFXColor | color (void) |
virtual void | setColor (const GFXColor &c) |
virtual GFXColor | outlineColor (void) |
virtual void | setOutlineColor (const GFXColor &c) |
virtual GFXColor | textColor (void) |
virtual void | setTextColor (const GFXColor &c) |
virtual Font | font (void) |
virtual void | setFont (const Font &f) |
virtual bool | hasGroupChildren (void) |
Control (void) | |
virtual | ~Control (void) |
![]() | |
virtual bool | processCommand (const EventCommandId &command, Control *control) |
virtual bool | processKeyDown (const InputEvent &event) |
virtual bool | processKeyUp (const InputEvent &event) |
virtual void | processUnfocus (const InputEvent &event) |
virtual bool | processMouseMove (const InputEvent &event) |
virtual bool | processMouseDrag (const InputEvent &event) |
virtual void | sendCommand (const EventCommandId &command, Control *control) |
virtual void | setCommandTarget (EventResponder *responder) |
virtual void | setModal (bool modal) |
EventResponder (void) | |
virtual | ~EventResponder (void) |
Protected Member Functions | |
virtual void | sendButtonCommand (void) |
virtual void | drawCycleBorder (float lineWidth) |
![]() | |
virtual void | drawBackground (void) |
Protected Attributes | |
int | m_drawingState |
EventCommandId | m_commandId |
std::string | m_label |
bool | m_leftPressed |
GFXColor | m_highlightColor |
GFXColor | m_textHighlightColor |
GFXColor | m_downColor |
GFXColor | m_downTextColor |
float | m_shadowWidth |
float | m_variableBorderCycleTime |
GFXColor | m_borderColor |
GFXColor | m_endBorderColor |
PaintText | m_paintText |
GFXColor | m_currentCycleColor |
int | m_currentCycle |
int | m_cycleStepCount |
int | m_cycleDirection |
GFXColor | m_cycleColorDelta |
double | m_lastStepTime |
![]() | |
Rect | m_rect |
std::string | m_id |
GFXColor | m_color |
GFXColor | m_outlineColor |
GFXColor | m_textColor |
Font | m_font |
bool | m_hidden |
![]() | |
bool | m_modal |
EventResponder * | m_commandTarget |
Definition at line 34 of file newbutton.h.
anonymous enum |
Enumerator | |
---|---|
NORMAL_STATE | |
DOWN_STATE | |
HIGHLIGHT_STATE | |
DISABLED_STATE | |
FINAL_BUTTON_STATE |
Definition at line 38 of file newbutton.h.
NewButton::NewButton | ( | void | ) |
Definition at line 199 of file newbutton.cpp.
|
inlinevirtual |
Definition at line 163 of file newbutton.h.
|
inlinevirtual |
Definition at line 135 of file newbutton.h.
References m_borderColor.
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
virtual |
Implements Control.
Reimplemented in ScrollerButton.
Definition at line 38 of file newbutton.cpp.
References CENTER_JUSTIFY, Control::color(), DISABLED_STATE, DOWN_STATE, downColor(), downTextColor(), PaintText::draw(), drawCycleBorder(), drawLowRightShadow(), drawRect(), drawUpLeftShadow(), Control::font(), GUI_OPAQUE_BLACK(), GUI_OPAQUE_WHITE(), HIGHLIGHT_STATE, highlightColor(), isClear(), label(), m_drawingState, m_paintText, Control::m_rect, m_variableBorderCycleTime, NORMAL_STATE, PaintText::setColor(), PaintText::setFont(), PaintText::setJustification(), PaintText::setRect(), PaintText::setText(), shadowWidth(), Control::textColor(), and textHighlightColor().
Referenced by ScrollerButton::draw(), and setDrawingState().
|
protectedvirtual |
Definition at line 105 of file newbutton.cpp.
References GFXColor::a, GFXColor::b, CYCLE_STEPS_PER_SECOND, drawRectOutline(), float_to_int(), GFXColor::g, getNewTime(), m_borderColor, m_currentCycle, m_currentCycleColor, m_cycleColorDelta, m_cycleDirection, m_cycleStepCount, m_endBorderColor, m_lastStepTime, Control::m_rect, m_variableBorderCycleTime, and GFXColor::r.
Referenced by draw().
|
virtual |
Definition at line 153 of file newbutton.cpp.
References m_drawingState.
|
inlinevirtual |
Definition at line 145 of file newbutton.h.
References m_endBorderColor.
|
inlinevirtual |
|
inlinevirtual |
Definition at line 64 of file newbutton.h.
References m_label.
Referenced by ScrollerButton::draw(), and draw().
|
virtual |
Reimplemented from EventResponder.
Definition at line 165 of file newbutton.cpp.
References InputEvent::code, DOWN_STATE, globalEventManager(), LEFT_MOUSE_BUTTON, m_leftPressed, EventResponder::processMouseDown(), EventManager::pushResponder(), setDrawingState(), and EventResponder::setModal().
|
virtual |
Reimplemented from EventResponder.
Definition at line 178 of file newbutton.cpp.
References InputEvent::code, globalEventManager(), Control::hitTest(), LEFT_MOUSE_BUTTON, InputEvent::loc, m_leftPressed, NORMAL_STATE, EventResponder::processMouseUp(), EventManager::removeResponder(), sendButtonCommand(), setDrawingState(), and EventResponder::setModal().
|
protectedvirtual |
Definition at line 160 of file newbutton.cpp.
References m_commandId, and EventResponder::sendCommand().
Referenced by processMouseUp().
|
inlinevirtual |
Definition at line 139 of file newbutton.h.
References c, and m_borderColor.
Referenced by NavComputer::constructControls(), and BaseComputer::constructControls().
|
inlinevirtual |
Definition at line 58 of file newbutton.h.
References Control::id(), and m_commandId.
Referenced by Scroller::calcLayout(), BaseComputer::configureCargoCommitControls(), BaseComputer::configureUpgradeCommitControls(), NavComputer::constructControls(), BaseComputer::constructControls(), GameMenu::createControls(), Scroller::createControls(), CreateControlsForAlertWindow(), ListQuestionDialog::CreateControlsForListWindow(), CreateControlsForYesNoWindow(), BaseComputer::createModeButtons(), GameMenu::createNetworkControls(), NetActionConfirm::init(), NavComputer::RenameConfirm::init(), BaseComputer::LoadSaveQuitConfirm::init(), and BaseComputer::updateTransactionControlsForSelection().
|
inlinevirtual |
Definition at line 98 of file newbutton.h.
References c, and m_downColor.
Referenced by NavComputer::constructControls(), BaseComputer::constructControls(), GameMenu::createControls(), CreateControlsForAlertWindow(), ListQuestionDialog::CreateControlsForListWindow(), CreateControlsForYesNoWindow(), GameMenu::createNetworkControls(), NetActionConfirm::init(), NavComputer::RenameConfirm::init(), and BaseComputer::LoadSaveQuitConfirm::init().
|
inlinevirtual |
Definition at line 108 of file newbutton.h.
References c, and m_downTextColor.
Referenced by NavComputer::constructControls(), BaseComputer::constructControls(), GameMenu::createControls(), CreateControlsForAlertWindow(), ListQuestionDialog::CreateControlsForListWindow(), CreateControlsForYesNoWindow(), GameMenu::createNetworkControls(), NetActionConfirm::init(), NavComputer::RenameConfirm::init(), and BaseComputer::LoadSaveQuitConfirm::init().
|
virtual |
Definition at line 145 of file newbutton.cpp.
References draw(), and m_drawingState.
Referenced by processMouseDown(), and processMouseUp().
|
inlinevirtual |
Definition at line 149 of file newbutton.h.
References c, and m_endBorderColor.
Referenced by NavComputer::constructControls(), and BaseComputer::constructControls().
|
inlinevirtual |
Definition at line 78 of file newbutton.h.
References c, and m_highlightColor.
Referenced by NavComputer::constructControls(), BaseComputer::constructControls(), CreateControlsForAlertWindow(), ListQuestionDialog::CreateControlsForListWindow(), CreateControlsForYesNoWindow(), GameMenu::createNetworkControls(), NetActionConfirm::init(), NavComputer::RenameConfirm::init(), and BaseComputer::LoadSaveQuitConfirm::init().
|
inlinevirtual |
Definition at line 68 of file newbutton.h.
References m_label.
Referenced by BaseComputer::configureCargoCommitControls(), BaseComputer::configureUpgradeCommitControls(), NavComputer::constructControls(), BaseComputer::constructControls(), GameMenu::createControls(), CreateControlsForAlertWindow(), ListQuestionDialog::CreateControlsForListWindow(), CreateControlsForYesNoWindow(), BaseComputer::createModeButtons(), GameMenu::createNetworkControls(), NetActionConfirm::init(), NavComputer::RenameConfirm::init(), BaseComputer::LoadSaveQuitConfirm::init(), NavComputer::loadAbsoluteButton(), and BaseComputer::updateTransactionControlsForSelection().
|
inlinevirtual |
Definition at line 118 of file newbutton.h.
References m_shadowWidth, and width.
Referenced by NavComputer::constructControls(), and BaseComputer::constructControls().
|
inlinevirtual |
Definition at line 88 of file newbutton.h.
References c, and m_textHighlightColor.
|
inlinevirtual |
Definition at line 128 of file newbutton.h.
References m_cycleStepCount, and m_variableBorderCycleTime.
Referenced by NavComputer::constructControls(), and BaseComputer::constructControls().
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
Definition at line 124 of file newbutton.h.
References m_variableBorderCycleTime.
|
protected |
Definition at line 187 of file newbutton.h.
Referenced by borderColor(), drawCycleBorder(), and setBorderColor().
|
protected |
Definition at line 178 of file newbutton.h.
Referenced by command(), sendButtonCommand(), and setCommand().
|
protected |
Definition at line 193 of file newbutton.h.
Referenced by drawCycleBorder().
|
protected |
Definition at line 192 of file newbutton.h.
Referenced by drawCycleBorder().
|
protected |
Definition at line 196 of file newbutton.h.
Referenced by drawCycleBorder().
|
protected |
Definition at line 195 of file newbutton.h.
Referenced by drawCycleBorder().
|
protected |
Definition at line 194 of file newbutton.h.
Referenced by drawCycleBorder(), and setVariableBorderCycleTime().
|
protected |
Definition at line 183 of file newbutton.h.
Referenced by downColor(), and setDownColor().
|
protected |
Definition at line 184 of file newbutton.h.
Referenced by downTextColor(), and setDownTextColor().
|
protected |
Definition at line 177 of file newbutton.h.
Referenced by draw(), drawingState(), and setDrawingState().
|
protected |
Definition at line 188 of file newbutton.h.
Referenced by drawCycleBorder(), endBorderColor(), and setEndBorderColor().
|
protected |
Definition at line 181 of file newbutton.h.
Referenced by highlightColor(), and setHighlightColor().
|
protected |
Definition at line 179 of file newbutton.h.
Referenced by label(), and setLabel().
|
protected |
Definition at line 197 of file newbutton.h.
Referenced by drawCycleBorder().
|
protected |
Definition at line 180 of file newbutton.h.
Referenced by processMouseDown(), and processMouseUp().
|
protected |
Definition at line 189 of file newbutton.h.
Referenced by draw().
|
protected |
Definition at line 185 of file newbutton.h.
Referenced by setShadowWidth(), and shadowWidth().
|
protected |
Definition at line 182 of file newbutton.h.
Referenced by setTextHighlightColor(), and textHighlightColor().
|
protected |
Definition at line 186 of file newbutton.h.
Referenced by draw(), drawCycleBorder(), setVariableBorderCycleTime(), and variableBorderCycleTime().