RuleView Class Reference

Presentation class for the rules. More...

#include <ruleView.hpp>

Collaboration diagram for RuleView:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 RuleView (wxWindow *parent, wxWindowID id, RuleManager *controller)
 Constructor.
virtual ~RuleView ()
 Destructor.
void updateGrids (Grid initial, Grid final, bool changed)
 Updates the grids of the canvas.
void updateList (wxArrayString strings)
 Updates the rule listbox.
void selectRule (unsigned int rule)
 Selects a rule from the listbox.
void errorMsg (wxString message)
 Shows an error message.
bool msgYesNo (wxString message)
 Shows a yes/no selection dialog.
void setListMessage (int id, wxString message)
 Sets a special message for a rule in a listbox.
void resetListItem (int id)
 Sets the default message for a listbox item.

Private Member Functions

void initControls ()
 Control initialization.
void initSizers ()
 Sizers (layout) initialization.
void OnClick (LayoutCanvasEvent &event)
 LayoutCanvas click event method.
void OnSelection (wxCommandEvent &event)
 Listbox selection method.
void OnNewRule (wxCommandEvent &event)
 New rule button click method.
void OnRemove (wxCommandEvent &event)
 Remove rule button click method.
void OnCopy (wxCommandEvent &event)
 Copy grid button click method.
void OnSave (wxCommandEvent &event)
 Save button click method.
void OnSaveAs (wxCommandEvent &event)
 Save as button click method.
void OnOpen (wxCommandEvent &event)
 Open button click method.
void OnCheck (wxCommandEvent &event)
 Check rules button click method.

Private Attributes

RuleManagercontroller
 Main application controller.
wxStaticText * labelTitle
wxStaticText * labelRule
wxStaticText * labelInitialLayout
wxStaticText * labelFinalLayout
wxBitmapButton * buttonNew
wxBitmapButton * buttonSave
wxBitmapButton * buttonSaveAs
wxBitmapButton * buttonRemove
wxBitmapButton * buttonOpen
wxBitmapButton * buttonCopy
wxButton * buttonCheck
wxListBox * listRules
LayoutCanvascanvasInitial
LayoutCanvascanvasFinal

Detailed Description

Presentation class for the rules.

This is the presentation layer class for the rule collection.

Author:
Bernat Rāfales Mulet <the_bell@users.sourceforge.net>
Version:
Revision
1.17

Definition at line 37 of file ruleView.hpp.


Constructor & Destructor Documentation

RuleView::RuleView wxWindow *  parent,
wxWindowID  id,
RuleManager controller
 

Constructor.

Parameters:
parent the parent window.
id the window identifier.
controller the rule controller.

Definition at line 66 of file ruleView.cpp.

RuleView::~RuleView  )  [virtual]
 

Destructor.

Definition at line 77 of file ruleView.cpp.


Member Function Documentation

void RuleView::errorMsg wxString  message  ) 
 

Shows an error message.

Parameters:
message the error message.

Definition at line 336 of file ruleView.cpp.

void RuleView::initControls  )  [private]
 

Control initialization.

Definition at line 83 of file ruleView.cpp.

References buttonCheck, buttonCopy, buttonNew, buttonOpen, buttonRemove, buttonSave, buttonSaveAs, canvasFinal, canvasInitial, ID_BUTTON_CHECK, ID_BUTTON_COPY, ID_BUTTON_NEW, ID_BUTTON_OPEN, ID_BUTTON_REMOVE, ID_BUTTON_SAVE, ID_BUTTON_SAVEAS, ID_CANVAS_FINAL, ID_CANVAS_INITIAL, ID_LISTRULES, labelFinalLayout, labelInitialLayout, and listRules.

void RuleView::initSizers  )  [private]
 

Sizers (layout) initialization.

Definition at line 121 of file ruleView.cpp.

References buttonCheck, buttonCopy, buttonNew, buttonOpen, buttonRemove, buttonSave, buttonSaveAs, canvasFinal, canvasInitial, labelFinalLayout, labelInitialLayout, and listRules.

bool RuleView::msgYesNo wxString  message  ) 
 

Shows a yes/no selection dialog.

Parameters:
message the question to be asked.
Returns:
True if the user selectes yes, false otherwise.

Definition at line 361 of file ruleView.cpp.

Referenced by RuleManager::openFile().

void RuleView::OnCheck wxCommandEvent &  event  )  [private]
 

Check rules button click method.

Parameters:
event the event.

Definition at line 375 of file ruleView.cpp.

References RuleManager::checkRules(), and controller.

Here is the call graph for this function:

void RuleView::OnClick LayoutCanvasEvent event  )  [private]
 

LayoutCanvas click event method.

The event canvas is identified and passed as a parameter to the controller.

Parameters:
event the event.

Definition at line 180 of file ruleView.cpp.

References RuleManager::cellChanged(), controller, LayoutCanvasEvent::getX(), LayoutCanvasEvent::getY(), ID_CANVAS_INITIAL, and nINITIAL.

Here is the call graph for this function:

void RuleView::OnCopy wxCommandEvent &  event  )  [private]
 

Copy grid button click method.

Parameters:
event the event.

Definition at line 306 of file ruleView.cpp.

References controller, and RuleManager::copyGrids().

Here is the call graph for this function:

void RuleView::OnNewRule wxCommandEvent &  event  )  [private]
 

New rule button click method.

Parameters:
event the event.

Definition at line 202 of file ruleView.cpp.

References controller, and RuleManager::newRule().

Here is the call graph for this function:

void RuleView::OnOpen wxCommandEvent &  event  )  [private]
 

Open button click method.

Parameters:
event the event.

Definition at line 350 of file ruleView.cpp.

References controller, and RuleManager::openFile().

Here is the call graph for this function:

void RuleView::OnRemove wxCommandEvent &  event  )  [private]
 

Remove rule button click method.

Parameters:
event the event.

Definition at line 280 of file ruleView.cpp.

References controller, and RuleManager::removeRule().

Here is the call graph for this function:

void RuleView::OnSave wxCommandEvent &  event  )  [private]
 

Save button click method.

Parameters:
event the event.

Definition at line 316 of file ruleView.cpp.

References controller, and RuleManager::saveFile().

Here is the call graph for this function:

void RuleView::OnSaveAs wxCommandEvent &  event  )  [private]
 

Save as button click method.

Parameters:
event the event.

Definition at line 326 of file ruleView.cpp.

References controller, and RuleManager::saveFileAs().

Here is the call graph for this function:

void RuleView::OnSelection wxCommandEvent &  event  )  [private]
 

Listbox selection method.

Parameters:
event the event.

Definition at line 259 of file ruleView.cpp.

References buttonRemove, buttonSave, controller, and RuleManager::ruleSelected().

Here is the call graph for this function:

void RuleView::resetListItem int  id  ) 
 

Sets the default message for a listbox item.

Parameters:
id the rule identifier.

Definition at line 399 of file ruleView.cpp.

References listRules.

void RuleView::selectRule unsigned int  rule  ) 
 

Selects a rule from the listbox.

Parameters:
rule the rule identifier.

Definition at line 290 of file ruleView.cpp.

References buttonRemove, buttonSave, and listRules.

Referenced by RuleManager::appendRules(), RuleManager::clean(), RuleManager::newRule(), and RuleManager::openPFile().

void RuleView::setListMessage int  id,
wxString  message
 

Sets a special message for a rule in a listbox.

Parameters:
id the rule identifier.
message the special message to add.

Definition at line 386 of file ruleView.cpp.

References listRules.

void RuleView::updateGrids Grid  initial,
Grid  final,
bool  changed
 

Updates the grids of the canvas.

Parameters:
initial the grid for the initial layout.
final the grid for the final layout.
changed if true, cell transitions are disabled.

Definition at line 235 of file ruleView.cpp.

References canvasFinal, canvasInitial, and LayoutCanvas::setGrid().

Referenced by RuleManager::newRule(), and RuleManager::updateGrids().

Here is the call graph for this function:

void RuleView::updateList wxArrayString  strings  ) 
 

Updates the rule listbox.

Parameters:
strings the string array.

Definition at line 246 of file ruleView.cpp.

References buttonRemove, buttonSave, buttonSaveAs, and listRules.


Member Data Documentation

wxButton* RuleView::buttonCheck [private]
 

Definition at line 81 of file ruleView.hpp.

Referenced by initControls(), and initSizers().

wxBitmapButton* RuleView::buttonCopy [private]
 

Definition at line 80 of file ruleView.hpp.

Referenced by initControls(), and initSizers().

wxBitmapButton* RuleView::buttonNew [private]
 

Definition at line 75 of file ruleView.hpp.

Referenced by initControls(), and initSizers().

wxBitmapButton* RuleView::buttonOpen [private]
 

Definition at line 79 of file ruleView.hpp.

Referenced by initControls(), and initSizers().

wxBitmapButton* RuleView::buttonRemove [private]
 

Definition at line 78 of file ruleView.hpp.

Referenced by initControls(), initSizers(), OnSelection(), selectRule(), and updateList().

wxBitmapButton* RuleView::buttonSave [private]
 

Definition at line 76 of file ruleView.hpp.

Referenced by initControls(), initSizers(), OnSelection(), selectRule(), and updateList().

wxBitmapButton* RuleView::buttonSaveAs [private]
 

Definition at line 77 of file ruleView.hpp.

Referenced by initControls(), initSizers(), and updateList().

LayoutCanvas* RuleView::canvasFinal [private]
 

Definition at line 86 of file ruleView.hpp.

Referenced by initControls(), initSizers(), and updateGrids().

LayoutCanvas* RuleView::canvasInitial [private]
 

Definition at line 85 of file ruleView.hpp.

Referenced by initControls(), initSizers(), and updateGrids().

RuleManager* RuleView::controller [private]
 

Main application controller.

Definition at line 65 of file ruleView.hpp.

Referenced by OnCheck(), OnClick(), OnCopy(), OnNewRule(), OnOpen(), OnRemove(), OnSave(), OnSaveAs(), and OnSelection().

wxStaticText* RuleView::labelFinalLayout [private]
 

Definition at line 72 of file ruleView.hpp.

Referenced by initControls(), and initSizers().

wxStaticText* RuleView::labelInitialLayout [private]
 

Definition at line 71 of file ruleView.hpp.

Referenced by initControls(), and initSizers().

wxStaticText* RuleView::labelRule [private]
 

Definition at line 70 of file ruleView.hpp.

wxStaticText* RuleView::labelTitle [private]
 

Definition at line 69 of file ruleView.hpp.

wxListBox* RuleView::listRules [private]
 

Definition at line 84 of file ruleView.hpp.

Referenced by initControls(), initSizers(), resetListItem(), selectRule(), setListMessage(), and updateList().


The documentation for this class was generated from the following files:
Generated on Sat Sep 2 00:00:13 2006 for NanoComp by  doxygen 1.4.6