Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
|
#include <picker.h>
Classes | |
struct | DisplayCell |
Public Member Functions | |
void | saveOpenCategories (std::list< std::list< std::string > > &idList) const |
int | restoreOpenCategories (const std::list< std::list< std::string > > &idList) |
virtual void | draw (void) |
virtual PickerCells * | cells (void) |
virtual const PickerCells * | cells (void) const |
virtual void | selectCell (PickerCell *cell, bool scroll=false) |
virtual PickerCell * | selectedCell (void) |
virtual int | selectedItem (void) |
virtual void | scrollToCell (const PickerCell *cell, bool middle=false) |
virtual void | setMustRecalc (void) |
virtual float | extraCellHeight (void) |
virtual void | setExtraCellHeight (float f) |
virtual GFXColor | selectionColor (void) |
virtual void | setSelectionColor (const GFXColor &c) |
virtual GFXColor | selectionTextColor (void) |
virtual void | setSelectionTextColor (const GFXColor &c) |
virtual GFXColor | highlightColor (void) |
virtual void | setHighlightColor (const GFXColor &c) |
virtual GFXColor | highlightTextColor (void) |
virtual void | setHighlightTextColor (const GFXColor &c) |
virtual Size | textMargins (void) |
virtual void | setTextMargins (const Size &s) |
virtual void | setScroller (Scroller *s) |
virtual bool | processMouseDown (const InputEvent &event) |
virtual bool | processMouseUp (const InputEvent &event) |
virtual bool | processMouseMove (const InputEvent &event) |
virtual bool | processCommand (const EventCommandId &command, Control *control) |
Picker (void) | |
virtual | ~Picker (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 | processKeyDown (const InputEvent &event) |
virtual bool | processKeyUp (const InputEvent &event) |
virtual void | processUnfocus (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 | |
float | totalCellHeight (void) |
PickerCell * | cellForMouse (const Point &p) |
virtual void | recalcDisplay (void) |
void | addListToDisplay (PickerCells *list, int level) |
![]() | |
virtual void | drawBackground (void) |
Protected Attributes | |
PickerCells * | m_cells |
GFXColor | m_selectionColor |
GFXColor | m_selectionTextColor |
GFXColor | m_highlightColor |
GFXColor | m_highlightTextColor |
float | m_extraCellHeight |
Size | m_textMargins |
PickerCell * | m_cellPressed |
const PickerCell * | m_highlightedCell |
PickerCell * | m_selectedCell |
Scroller * | m_scroller |
size_t | m_scrollPosition |
bool | m_needRecalcDisplay |
std::vector< DisplayCell > | m_displayCells |
![]() | |
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 |
Picker::Picker | ( | void | ) |
|
virtual |
Definition at line 414 of file picker.cpp.
|
protected |
Definition at line 252 of file picker.cpp.
References PickerCells::cellAt(), PickerCell::children(), PickerCells::count(), PickerCell::hideChildren(), i, and m_displayCells.
Referenced by recalcDisplay().
|
protected |
Definition at line 196 of file picker.cpp.
References float_to_int(), index, Rect::inside(), m_displayCells, Control::m_rect, m_scrollPosition, Rect::top(), totalCellHeight(), and Point::y.
Referenced by processMouseDown(), processMouseMove(), and processMouseUp().
|
inlinevirtual |
Definition at line 110 of file picker.h.
References m_cells.
Referenced by BaseComputer::loadBuyUpgradeControls(), BaseComputer::loadListPicker(), restoreOpenCategories(), saveOpenCategories(), and BaseComputer::scrollToItem().
|
inlinevirtual |
|
virtual |
Implements Control.
Definition at line 117 of file picker.cpp.
References Picker::DisplayCell::cell, CHILD_INDENT_FACTOR, PaintText::draw(), Control::drawBackground(), drawRect(), GUI_CLEAR(), Size::height, i, Rect::inset(), isClear(), m_displayCells, Control::m_font, m_highlightColor, m_highlightedCell, m_highlightTextColor, m_needRecalcDisplay, Control::m_rect, m_scrollPosition, m_selectedCell, m_selectionColor, m_selectionTextColor, Control::m_textColor, m_textMargins, Rect::origin, Picker::DisplayCell::paintText, recalcDisplay(), Control::rect(), PaintText::setColor(), PaintText::setFont(), PaintText::setRect(), PaintText::setText(), Rect::size, PickerCell::text(), PickerCell::textColor(), Control::textColor(), totalCellHeight(), Size::width, Point::x, and Point::y.
|
inlinevirtual |
Definition at line 152 of file picker.h.
References m_extraCellHeight.
|
inlinevirtual |
Definition at line 182 of file picker.h.
References m_highlightColor.
|
inlinevirtual |
Definition at line 192 of file picker.h.
References m_highlightTextColor.
|
virtual |
Reimplemented from EventResponder.
Definition at line 327 of file picker.cpp.
References m_scroller, m_scrollPosition, EventResponder::processCommand(), and Scroller::scrollPosition().
|
virtual |
Reimplemented from EventResponder.
Definition at line 338 of file picker.cpp.
References cellForMouse(), InputEvent::code, VegaConfig::getVariable(), globalEventManager(), Control::hitTest(), LEFT_MOUSE_BUTTON, InputEvent::loc, m_cellPressed, m_scroller, XMLSupport::parse_int(), EventResponder::processMouseDown(), EventManager::pushResponder(), Scroller::scrollPosition(), EventResponder::setModal(), Scroller::setScrollPosition(), vs_config, WHEELDOWN_MOUSE_BUTTON, and WHEELUP_MOUSE_BUTTON.
|
virtual |
Reimplemented from EventResponder.
Definition at line 383 of file picker.cpp.
References cellForMouse(), InputEvent::loc, and m_highlightedCell.
|
virtual |
Reimplemented from EventResponder.
Definition at line 362 of file picker.cpp.
References cellForMouse(), InputEvent::code, globalEventManager(), LEFT_MOUSE_BUTTON, InputEvent::loc, m_cellPressed, EventResponder::processMouseUp(), EventManager::removeResponder(), selectCell(), and EventResponder::setModal().
|
protectedvirtual |
Definition at line 271 of file picker.cpp.
References addListToDisplay(), float_to_int(), Size::height, m_cells, m_displayCells, m_needRecalcDisplay, Control::m_rect, m_scroller, m_scrollPosition, Scroller::setRangeValues(), Scroller::setScrollPosition(), Rect::size, and totalCellHeight().
Referenced by draw(), scrollToCell(), and selectCell().
int Picker::restoreOpenCategories | ( | const std::list< std::list< std::string > > & | idList) |
Definition at line 88 of file picker.cpp.
References cells(), PickerCells::cellWithId(), PickerCell::children(), PickerCells::count(), selectCell(), selectedCell(), PickerCell::setHideChildren(), and setMustRecalc().
Referenced by BaseComputer::refresh().
void Picker::saveOpenCategories | ( | std::list< std::list< std::string > > & | idList) | const |
Definition at line 82 of file picker.cpp.
References cells(), m_selectedCell, and PickerCells::saveOpenCategories().
Referenced by BaseComputer::refresh().
|
virtual |
Definition at line 292 of file picker.cpp.
References float_to_int(), Size::height, i, m_displayCells, m_needRecalcDisplay, Control::m_rect, m_scroller, m_scrollPosition, recalcDisplay(), SCROLL_EDGE_EXTRA, Scroller::setScrollPosition(), Rect::size, and totalCellHeight().
Referenced by BaseComputer::scrollToItem(), and selectCell().
|
virtual |
Definition at line 210 of file picker.cpp.
References PickerCells::cellAt(), PickerCell::children(), PickerCells::count(), PickerCell::hideChildren(), m_selectedCell, recalcDisplay(), scrollToCell(), EventResponder::sendCommand(), PickerCell::setHideChildren(), and setMustRecalc().
Referenced by BaseComputer::buyUpgrade(), processMouseUp(), UpgradeOperationMountDialog::processWindowCommand(), restoreOpenCategories(), BaseComputer::scrollToItem(), and BaseComputer::updateTransactionControlsForSelection().
|
inlinevirtual |
Definition at line 123 of file picker.h.
References m_selectedCell.
Referenced by NavComputer::actionAnd(), NavComputer::actionChain(), NavComputer::actionNot(), NavComputer::actionOr(), NavComputer::actionRemoveCriteria(), BaseComputer::loadSavePickerChangedSelection(), BaseComputer::newsPickerChangedSelection(), NavComputer::pathListerChangedSelection(), BaseComputer::pickerChangedSelection(), UpgradeOperationMountDialog::processWindowCommand(), restoreOpenCategories(), BaseComputer::scrollToItem(), BaseComputer::selectedItem(), and BaseComputer::updateTransactionControlsForSelection().
|
virtual |
Definition at line 180 of file picker.cpp.
References PickerCells::cellAt(), PickerCells::count(), i, m_cells, and m_selectedCell.
Referenced by ListQuestionDialog::processWindowCommand().
|
inlinevirtual |
Definition at line 162 of file picker.h.
References m_selectionColor.
|
inlinevirtual |
Definition at line 172 of file picker.h.
References m_selectionTextColor.
|
inlinevirtual |
Definition at line 156 of file picker.h.
References m_extraCellHeight.
|
inlinevirtual |
Definition at line 186 of file picker.h.
References c, and m_highlightColor.
Referenced by NavComputer::constructControls(), BaseComputer::constructControls(), and ListQuestionDialog::CreateControlsForListWindow().
|
inlinevirtual |
Definition at line 196 of file picker.h.
References c, and m_highlightTextColor.
Referenced by NavComputer::constructControls(), BaseComputer::constructControls(), and ListQuestionDialog::CreateControlsForListWindow().
|
inlinevirtual |
Definition at line 142 of file picker.h.
References m_needRecalcDisplay.
Referenced by SimplePicker::clear(), restoreOpenCategories(), BaseComputer::scrollToItem(), and selectCell().
|
virtual |
Definition at line 320 of file picker.cpp.
References m_scroller, and EventResponder::setCommandTarget().
Referenced by NavComputer::constructControls(), BaseComputer::constructControls(), and ListQuestionDialog::CreateControlsForListWindow().
|
inlinevirtual |
Definition at line 166 of file picker.h.
References c, and m_selectionColor.
Referenced by NavComputer::constructControls(), BaseComputer::constructControls(), and ListQuestionDialog::CreateControlsForListWindow().
|
inlinevirtual |
Definition at line 176 of file picker.h.
References c, and m_selectionTextColor.
|
inlinevirtual |
Definition at line 206 of file picker.h.
References m_textMargins.
Referenced by NavComputer::constructControls(), BaseComputer::constructControls(), and ListQuestionDialog::CreateControlsForListWindow().
|
inlinevirtual |
Definition at line 202 of file picker.h.
References m_textMargins.
|
inlineprotected |
Definition at line 229 of file picker.h.
References m_extraCellHeight, Control::m_font, and Font::size().
Referenced by cellForMouse(), draw(), recalcDisplay(), and scrollToCell().
|
protected |
Definition at line 269 of file picker.h.
Referenced by SimplePicker::clear(), processMouseDown(), and processMouseUp().
|
protected |
Definition at line 262 of file picker.h.
Referenced by SimplePicker::addCell(), cells(), SimplePicker::clear(), recalcDisplay(), selectedItem(), and SimplePicker::SimplePicker().
|
protected |
Definition at line 275 of file picker.h.
Referenced by addListToDisplay(), cellForMouse(), draw(), Picker(), recalcDisplay(), and scrollToCell().
|
protected |
Definition at line 267 of file picker.h.
Referenced by extraCellHeight(), setExtraCellHeight(), and totalCellHeight().
|
protected |
Definition at line 265 of file picker.h.
Referenced by draw(), highlightColor(), and setHighlightColor().
|
protected |
Definition at line 270 of file picker.h.
Referenced by SimplePicker::clear(), draw(), and processMouseMove().
|
protected |
Definition at line 266 of file picker.h.
Referenced by draw(), highlightTextColor(), and setHighlightTextColor().
|
protected |
Definition at line 274 of file picker.h.
Referenced by draw(), recalcDisplay(), scrollToCell(), and setMustRecalc().
|
protected |
Definition at line 272 of file picker.h.
Referenced by processCommand(), processMouseDown(), recalcDisplay(), scrollToCell(), and setScroller().
|
protected |
Definition at line 273 of file picker.h.
Referenced by cellForMouse(), draw(), processCommand(), recalcDisplay(), and scrollToCell().
|
protected |
Definition at line 271 of file picker.h.
Referenced by SimplePicker::clear(), draw(), saveOpenCategories(), selectCell(), selectedCell(), and selectedItem().
|
protected |
Definition at line 263 of file picker.h.
Referenced by draw(), selectionColor(), and setSelectionColor().
|
protected |
Definition at line 264 of file picker.h.
Referenced by draw(), selectionTextColor(), and setSelectionTextColor().
|
protected |
Definition at line 268 of file picker.h.
Referenced by draw(), setTextMargins(), and textMargins().