ForbiddenPatternView Class Reference

Presentation layer class for the forbidden patterns. More...

#include <forbiddenPatternView.hpp>

Collaboration diagram for ForbiddenPatternView:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ForbiddenPatternView (wxWindow *parent, wxWindowID id, ForbiddenPatternManager *controller)
 Constructor.
virtual ~ForbiddenPatternView ()
 Destructor.
void updateGrids (Grid grid, bool changed)
 Grid update method.
void updateList (wxArrayString strings)
 Sets the items of the pattern listbox.
void selectFP (unsigned int rule)
 Selects a pattern.
bool msgYesNo (wxString message)
 User selection method.
void errorMsg (wxString message)
 Shows an error message.
void setListMessage (int id, wxString message)
 Set a string for an item of the listbox.
void resetListItem (int id)
 Sets the default string to a listbox item.

Private Member Functions

void initControls ()
 Window controls initialization.
void initSizers ()
 Sizers initialization.
void OnClick (LayoutCanvasEvent &event)
 Canvas click event.
void OnNew (wxCommandEvent &event)
 New button event.
void OnSelection (wxCommandEvent &event)
 Pattern selection event.
void OnRemove (wxCommandEvent &event)
 Remove button event.
void OnSave (wxCommandEvent &event)
 Save button event.
void OnSaveAs (wxCommandEvent &event)
 Save As button event.
void OnOpen (wxCommandEvent &event)
 Open button event.
void OnCheck (wxCommandEvent &event)
 Check button event.

Private Attributes

ForbiddenPatternManagercontroller
wxStaticText * labelTitle
wxStaticText * labelFP
wxBitmapButton * buttonNew
wxBitmapButton * buttonOpen
wxBitmapButton * buttonSave
wxBitmapButton * buttonSaveAs
wxBitmapButton * buttonRemove
wxButton * buttonCheck
wxListBox * listFP
LayoutCanvascanvas

Detailed Description

Presentation layer class for the forbidden patterns.

Main view for the forbidden patterns of the system. Receives petitions from the user and asks the controller to do the job.

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

Definition at line 38 of file forbiddenPatternView.hpp.


Constructor & Destructor Documentation

ForbiddenPatternView::ForbiddenPatternView wxWindow *  parent,
wxWindowID  id,
ForbiddenPatternManager controller
 

Constructor.

Parameters:
parent the parent window.
id the window identifier.
controller the forbidden pattern controller.

Definition at line 60 of file forbiddenPatternView.cpp.

ForbiddenPatternView::~ForbiddenPatternView  )  [virtual]
 

Destructor.

Definition at line 71 of file forbiddenPatternView.cpp.


Member Function Documentation

void ForbiddenPatternView::errorMsg wxString  message  ) 
 

Shows an error message.

Parameters:
message the error message to be shown.

Definition at line 337 of file forbiddenPatternView.cpp.

void ForbiddenPatternView::initControls  )  [private]
 

Window controls initialization.

All the window controls are initialized in this method.

Definition at line 80 of file forbiddenPatternView.cpp.

References buttonCheck, buttonNew, buttonOpen, buttonRemove, buttonSave, buttonSaveAs, canvas, ID_BUTTON_CHECK, ID_BUTTON_NEW, ID_BUTTON_OPEN, ID_BUTTON_REMOVE, ID_BUTTON_SAVE, ID_BUTTON_SAVEAS, ID_CANVAS, ID_LISTFP, and listFP.

void ForbiddenPatternView::initSizers  )  [private]
 

Sizers initialization.

All the sizers (the window layout) is done in this method.

Definition at line 112 of file forbiddenPatternView.cpp.

References buttonCheck, buttonNew, buttonOpen, buttonRemove, buttonSave, buttonSaveAs, canvas, and listFP.

bool ForbiddenPatternView::msgYesNo wxString  message  ) 
 

User selection method.

The user is asked for a yes/no selection.

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

Definition at line 323 of file forbiddenPatternView.cpp.

Referenced by ForbiddenPatternManager::openFile().

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

Check button event.

Method called when the check button is clicked.

Parameters:
event the event.

Definition at line 352 of file forbiddenPatternView.cpp.

References ForbiddenPatternManager::checkPatterns(), and controller.

Here is the call graph for this function:

void ForbiddenPatternView::OnClick LayoutCanvasEvent event  )  [private]
 

Canvas click event.

Method called when a click event on the layout canvas is emitted.

Parameters:
event the event.

Definition at line 164 of file forbiddenPatternView.cpp.

References ForbiddenPatternManager::cellChanged(), controller, LayoutCanvasEvent::getX(), and LayoutCanvasEvent::getY().

Here is the call graph for this function:

void ForbiddenPatternView::OnNew wxCommandEvent &  event  )  [private]
 

New button event.

Method called when the user clicks on the new button.

Parameters:
event the event.

Definition at line 175 of file forbiddenPatternView.cpp.

References controller, and ForbiddenPatternManager::newFP().

Here is the call graph for this function:

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

Open button event.

Method called when the open button is clicked.

Parameters:
event the event.

Definition at line 311 of file forbiddenPatternView.cpp.

References controller, and ForbiddenPatternManager::openFile().

Here is the call graph for this function:

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

Remove button event.

Method called when the remove button is clicked.

Parameters:
event the event.

Definition at line 233 of file forbiddenPatternView.cpp.

References controller, and ForbiddenPatternManager::removeFP().

Here is the call graph for this function:

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

Save button event.

Method called when the save button is clicked.

Parameters:
event the event.

Definition at line 289 of file forbiddenPatternView.cpp.

References controller, and ForbiddenPatternManager::saveFile().

Here is the call graph for this function:

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

Save As button event.

Method called when the save as button is clicked.

Parameters:
event the event.

Definition at line 300 of file forbiddenPatternView.cpp.

References controller, and ForbiddenPatternManager::saveFileAs().

Here is the call graph for this function:

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

Pattern selection event.

Method called when the user selects a pattern.

Parameters:
event the event.

Definition at line 210 of file forbiddenPatternView.cpp.

References buttonRemove, buttonSave, buttonSaveAs, controller, and ForbiddenPatternManager::FPSelected().

Here is the call graph for this function:

void ForbiddenPatternView::resetListItem int  id  ) 
 

Sets the default string to a listbox item.

Resets the default message to be shown on an item of the listbox.

Parameters:
id the index of the item to be reset.

Definition at line 378 of file forbiddenPatternView.cpp.

References listFP.

void ForbiddenPatternView::selectFP unsigned int  FP  ) 
 

Selects a pattern.

Selects the pattern on the listbox.

Parameters:
FP the pattern identifier to be selected.

Definition at line 271 of file forbiddenPatternView.cpp.

References buttonRemove, buttonSave, buttonSaveAs, and listFP.

Referenced by ForbiddenPatternManager::appendFPs(), ForbiddenPatternManager::clean(), ForbiddenPatternManager::newFP(), and ForbiddenPatternManager::openPFile().

void ForbiddenPatternView::setListMessage int  id,
wxString  message
 

Set a string for an item of the listbox.

Allows to set a specific string to an item of the listbox.

Parameters:
id the index of the item of the listbox.
message the string to be set on the item.

Definition at line 364 of file forbiddenPatternView.cpp.

References listFP.

void ForbiddenPatternView::updateGrids Grid  grid,
bool  changed
 

Grid update method.

This method updates the canvas of the pattern grid.

Parameters:
grid the grid to be shown.
changed true if the grid is of the same pattern or another one.

Definition at line 245 of file forbiddenPatternView.cpp.

References canvas, and LayoutCanvas::setGrid().

Referenced by ForbiddenPatternManager::newFP(), and ForbiddenPatternManager::updateGrids().

Here is the call graph for this function:

void ForbiddenPatternView::updateList wxArrayString  strings  ) 
 

Sets the items of the pattern listbox.

Method called when the remove button is clicked.

Parameters:
strings the items to be listed.

Definition at line 256 of file forbiddenPatternView.cpp.

References buttonRemove, buttonSave, buttonSaveAs, and listFP.


Member Data Documentation

wxButton* ForbiddenPatternView::buttonCheck [private]
 

Definition at line 75 of file forbiddenPatternView.hpp.

Referenced by initControls(), and initSizers().

wxBitmapButton* ForbiddenPatternView::buttonNew [private]
 

Definition at line 70 of file forbiddenPatternView.hpp.

Referenced by initControls(), and initSizers().

wxBitmapButton* ForbiddenPatternView::buttonOpen [private]
 

Definition at line 71 of file forbiddenPatternView.hpp.

Referenced by initControls(), and initSizers().

wxBitmapButton* ForbiddenPatternView::buttonRemove [private]
 

Definition at line 74 of file forbiddenPatternView.hpp.

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

wxBitmapButton* ForbiddenPatternView::buttonSave [private]
 

Definition at line 72 of file forbiddenPatternView.hpp.

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

wxBitmapButton* ForbiddenPatternView::buttonSaveAs [private]
 

Definition at line 73 of file forbiddenPatternView.hpp.

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

LayoutCanvas* ForbiddenPatternView::canvas [private]
 

Definition at line 79 of file forbiddenPatternView.hpp.

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

ForbiddenPatternManager* ForbiddenPatternView::controller [private]
 

Definition at line 64 of file forbiddenPatternView.hpp.

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

wxStaticText* ForbiddenPatternView::labelFP [private]
 

Definition at line 67 of file forbiddenPatternView.hpp.

wxStaticText* ForbiddenPatternView::labelTitle [private]
 

Definition at line 66 of file forbiddenPatternView.hpp.

wxListBox* ForbiddenPatternView::listFP [private]
 

Definition at line 78 of file forbiddenPatternView.hpp.

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


The documentation for this class was generated from the following files:
Generated on Fri Sep 1 23:57:18 2006 for NanoComp by  doxygen 1.4.6