Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

ItemSelectorWidget Class Reference

#include <selectionwindow.h>

Inheritance diagram for ItemSelectorWidget:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 ItemSelectorWidget (PG_Widget *parent, const PG_Rect &r, SelectionItemFactory *itemFactory)
void constrainNames (bool constrain)
int getItemNum () const
void reLoad (bool show=false)
void resetNamesearch ()
 ~ItemSelectorWidget ()

Public Attributes

SigC::Signal1< void, const
SelectionWidget * > 
sigItemSelected
SigC::Signal1< void, ASCStringnameEntered
SigC::Signal0< bool > sigQuitModal

Protected Member Functions

bool moveSelection (int amount)
bool eventKeyDown (const SDL_KeyboardEvent *key)
 Overridable Eventhandler for a SDL_KeyboardEvent message.
void itemSelected (const SelectionWidget *w, bool mouse)
void markItem (const SelectionWidget *w)
bool isItemMarked (const SelectionWidget *w)
bool locateObject (const ASCString &name)
bool nameMatch (const SelectionWidget *selection, const ASCString &name)

Constructor & Destructor Documentation

ItemSelectorWidget::ItemSelectorWidget PG_Widget parent,
const PG_Rect r,
SelectionItemFactory itemFactory
 

Definition at line 225 of file selectionwindow.cpp.

References SelectionItemFactory::getDefaultItem(), PG_Rect::Height(), markItem(), PG_Rect::PG_Rect(), reLoad(), PG_Widget::SetTransparency(), and PG_Rect::Width().

ItemSelectorWidget::~ItemSelectorWidget  ) 
 

Definition at line 297 of file selectionwindow.cpp.


Member Function Documentation

void ItemSelectorWidget::constrainNames bool  constrain  ) 
 

Definition at line 240 of file selectionwindow.cpp.

Referenced by FileSelectionWindow::FileSelectionWindow().

bool ItemSelectorWidget::eventKeyDown const SDL_KeyboardEvent *  key  )  [protected, virtual]
 

Overridable Eventhandler for a SDL_KeyboardEvent message.

This handler is called when a key changed it's state from unpressed to pressed. The default implementation returns 'false' which indicates that this message is not processed by this object.

Parameters:
key SDL_KeyboardEvent message
Returns:
Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.

Reimplemented from PG_MessageObject.

Definition at line 90 of file selectionwindow.cpp.

References PG_Widget::GetText(), itemSelected(), locateObject(), moveSelection(), nameEntered, nameMatch(), PG_LineEdit::SendBackspace(), and PG_LineEdit::SendChar().

int ItemSelectorWidget::getItemNum  )  const [inline]
 

Definition at line 126 of file selectionwindow.h.

Referenced by ChooseTech::ok().

bool ItemSelectorWidget::isItemMarked const SelectionWidget w  )  [protected]
 

Definition at line 182 of file selectionwindow.cpp.

void ItemSelectorWidget::itemSelected const SelectionWidget w,
bool  mouse
[protected]
 

Definition at line 168 of file selectionwindow.cpp.

References SelectionItemFactory::itemSelected(), sigItemSelected, and PG_Widget::Update().

Referenced by eventKeyDown(), and reLoad().

bool ItemSelectorWidget::locateObject const ASCString name  )  [protected]
 

Definition at line 187 of file selectionwindow.cpp.

References markItem(), nameMatch(), PG_ScrollWidget::ScrollToWidget(), and PG_Widget::Update().

Referenced by eventKeyDown().

void ItemSelectorWidget::markItem const SelectionWidget w  )  [protected]
 

Definition at line 175 of file selectionwindow.cpp.

References SelectionItemFactory::itemMarked().

Referenced by ItemSelectorWidget(), locateObject(), and reLoad().

bool ItemSelectorWidget::moveSelection int  amount  )  [protected]
 

Definition at line 54 of file selectionwindow.cpp.

References resetNamesearch(), PG_ScrollWidget::ScrollToWidget(), and PG_Widget::Update().

Referenced by eventKeyDown().

bool ItemSelectorWidget::nameMatch const SelectionWidget selection,
const ASCString name
[protected]
 

Definition at line 200 of file selectionwindow.cpp.

References SelectionWidget::getName(), and ASCString::toLower().

Referenced by eventKeyDown(), and locateObject().

void ItemSelectorWidget::reLoad bool  show = false  ) 
 

Definition at line 245 of file selectionwindow.cpp.

References PG_ScrollWidget::GetScrollPosX(), PG_ScrollWidget::GetScrollPosY(), PG_Rect::Height(), SelectionWidget::itemMarked, itemSelected(), SelectionWidget::itemSelected, markItem(), PG_Rect::PG_Rect(), SelectionItemFactory::restart(), PG_ScrollWidget::ScrollTo(), SelectionWidget::setSelectionCallback(), PG_ThemeWidget::SetTransparency(), PG_Widget::Show(), SelectionItemFactory::spawnNextItem(), and PG_Rect::Width().

Referenced by ItemSelectorWidget(), ItemSelectorWindow::reLoad(), and VehicleProduction_SelectionWindow::reLoadAndUpdate().

void ItemSelectorWidget::resetNamesearch  ) 
 

Definition at line 292 of file selectionwindow.cpp.

References PG_LineEdit::SetText().

Referenced by moveSelection(), and ItemSelectorWindow::RunModal().


Member Data Documentation

SigC::Signal1<void,ASCString> ItemSelectorWidget::nameEntered
 

Definition at line 122 of file selectionwindow.h.

Referenced by eventKeyDown(), and FileSelectionWindow::FileSelectionWindow().

SigC::Signal1<void,const SelectionWidget*> ItemSelectorWidget::sigItemSelected
 

Definition at line 121 of file selectionwindow.h.

Referenced by itemSelected(), and ItemSelectorWindow::ItemSelectorWindow().

SigC::Signal0<bool> ItemSelectorWidget::sigQuitModal
 

Definition at line 123 of file selectionwindow.h.

Referenced by FileSelectionWindow::FileSelectionWindow(), ItemSelectorWindow::ItemSelectorWindow(), MessageSelectionWindow::MessageSelectionWindow(), and VehicleProduction_SelectionWindow::VehicleProduction_SelectionWindow().


The documentation for this class was generated from the following files:
Generated on Tue Jun 24 02:17:50 2008 for Advanced Strategic Command by  doxygen 1.4.2