creaContours_lib
interfToolsSpreadPanel Class Reference

#include <interfToolsSpreadPanel.h>

Inheritance diagram for interfToolsSpreadPanel:
Collaboration diagram for interfToolsSpreadPanel:

Public Member Functions

 interfToolsSpreadPanel (wxWindow *parent, int sizex, int sizey, wxEvtHandler *evtHandler)
 
 ~interfToolsSpreadPanel ()
 
void addContourCheckBox (std::string id)
 
void removeContourCheckBox (std::string id)
 

Private Member Functions

wxPanel * initializeRadioBox ()
 
wxPanel * initializeButton (std::string path, std::string nom)
 
wxPanel * initializeAddRemoveContour ()
 

Private Attributes

wxPanel * resetbuttxt
 
wxPanel * gobuttxt
 
wxPanel * radiobox
 
wxPanel * addremovecont
 
wxScrolledWindow * scrollwin
 
wxFlexGridSizer * checkboxsizer
 
std::vector< std::string > checkvect
 

Detailed Description

Definition at line 39 of file interfToolsSpreadPanel.h.

Constructor & Destructor Documentation

interfToolsSpreadPanel::interfToolsSpreadPanel ( wxWindow *  parent,
int  sizex,
int  sizey,
wxEvtHandler *  evtHandler 
)

Definition at line 28 of file interfToolsSpreadPanel.cxx.

References addremovecont, gobuttxt, initializeAddRemoveContour(), initializeButton(), initializeRadioBox(), radiobox, and resetbuttxt.

29  : wxPanel(parent, -1, wxDefaultPosition, wxSize(sizex, sizey), wxBORDER_THEME){
30  wxFlexGridSizer* flexsizer = new wxFlexGridSizer(3,1,2,2);
31  this->SetSizer(flexsizer, true);
32  this->SetAutoLayout( true );
33 
34  resetbuttxt = initializeButton("data/Icons/reset.png", "Reset");
35 
36  wxFlexGridSizer* flexsizer1 = new wxFlexGridSizer(1,2,2,2);
39  flexsizer1->Add(radiobox,wxFIXED_MINSIZE);
40  flexsizer1->Add(addremovecont,wxEXPAND | wxALIGN_CENTRE_VERTICAL);
41 
42  gobuttxt = initializeButton("data/Icons/Go.png", "Go");
43 
44  flexsizer->Add(resetbuttxt, wxFIXED_MINSIZE);
45  flexsizer->Add(flexsizer1, wxFIXED );
46  flexsizer->Add(gobuttxt, wxFIXED_MINSIZE);
47 
48 
49  this->Layout();
50 
51 }

Here is the call graph for this function:

interfToolsSpreadPanel::~interfToolsSpreadPanel ( )

Definition at line 54 of file interfToolsSpreadPanel.cxx.

55 {
56 }

Member Function Documentation

void interfToolsSpreadPanel::addContourCheckBox ( std::string  id)

Adds a new checkbox to the scrolledwindow using the checkboxsizer id of contour

Definition at line 113 of file interfToolsSpreadPanel.cxx.

References checkboxsizer, checkvect, and scrollwin.

Referenced by interfMainPanel::addContourCheckBox().

113  {
114 
115 
116  wxCheckBox* check = new wxCheckBox(scrollwin, -1, wxString(id.c_str(),wxConvUTF8), wxDefaultPosition, wxDefaultSize, 0,
117  wxDefaultValidator, wxString(id.c_str(),wxConvUTF8));
118 
119  checkvect.push_back(id);
120 
121  checkboxsizer->Add(check, wxFIXED_MINSIZE | wxALIGN_LEFT );
122  scrollwin->Layout();
123  checkboxsizer->Layout();
124 
125 }

Here is the caller graph for this function:

wxPanel * interfToolsSpreadPanel::initializeAddRemoveContour ( )
private

initializes the panel that has all the contours that exist in the interface every time a contour is added into the scene, it must be added into this panel for all the contours it must exist a check box beside the contour. This checkbox controls the contours that are going to be used in the spread function.

Definition at line 96 of file interfToolsSpreadPanel.cxx.

References checkboxsizer, and scrollwin.

Referenced by interfToolsSpreadPanel().

96  {
97 
98  wxPanel* panel = new wxPanel(this, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE |wxVSCROLL , wxString(_T("")));
99 
100  scrollwin = new wxScrolledWindow(panel, -1, wxDefaultPosition, wxSize(80,50), wxVSCROLL, wxString(_T("")));
101 
102  checkboxsizer = new wxFlexGridSizer(0,1,2,2);
103 
104 
105  scrollwin->SetSizer(checkboxsizer, true);
106  scrollwin->SetAutoLayout( false );
107  //scrollwin->SetInitialSize(wxSize(200,200));
108 
109 
110  return panel;
111 }

Here is the caller graph for this function:

wxPanel * interfToolsSpreadPanel::initializeButton ( std::string  path,
std::string  nom 
)
private

initializes the button and the text to be displayed it returns a panel with both components

Parameters
Pathof the image to be used in the button
nomtext to be displayed at right of the button

Definition at line 69 of file interfToolsSpreadPanel.cxx.

Referenced by interfToolsSpreadPanel().

69  {
70 
71 
72  wxPanel* panel = new wxPanel(this, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T("")));
73 
74  wxFlexGridSizer* flexsizer = new wxFlexGridSizer(1,2,2,2);
75  panel->SetSizer(flexsizer, true);
76  panel->SetAutoLayout( true );
77 
78  wxBitmap* bitmap = new wxBitmap(wxString(path.c_str(),wxConvUTF8), wxBITMAP_TYPE_PNG);
79 
80  wxBitmapButton* bitmapbutton = new wxBitmapButton(panel, -1, *bitmap, wxDefaultPosition, wxDefaultSize,
81  wxBU_AUTODRAW, wxDefaultValidator, wxString(_T("")));
82 
83 
84  wxStaticText* statictext = new wxStaticText(panel, -1, wxString(nom.c_str(),wxConvUTF8), wxDefaultPosition,
85  wxDefaultSize, wxALIGN_CENTRE, wxString(nom.c_str(),wxConvUTF8));
86 
87 
88  flexsizer->Add(bitmapbutton, wxFIXED_MINSIZE);
89  flexsizer->Add(statictext, wxALIGN_CENTRE_VERTICAL | wxALIGN_CENTER_HORIZONTAL |wxEXPAND);
90 
91  panel->Layout();
92 
93  return panel;
94 }

Here is the caller graph for this function:

wxPanel * interfToolsSpreadPanel::initializeRadioBox ( )
private

initializes the radio box to display the options of the spread method.

Definition at line 58 of file interfToolsSpreadPanel.cxx.

Referenced by interfToolsSpreadPanel().

58  {
59  wxPanel* panel = new wxPanel(this, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxString(_T("")));
60  wxString lstOptions[3];
61  lstOptions[0]=_T("A");
62  lstOptions[1]=_T("B");
63  lstOptions[2]=_T("C");
64  wxRadioBox* _spreadMethodRadiobox = new wxRadioBox(panel, -1, _T("Method"), wxDefaultPosition, wxSize(45,80), 3 , lstOptions, 3, wxRA_SPECIFY_ROWS);
65  _spreadMethodRadiobox->SetSelection(2);
66  return panel;
67 }

Here is the caller graph for this function:

void interfToolsSpreadPanel::removeContourCheckBox ( std::string  id)

Removes a checkbox from the list of checkboxes in the flexsizer (checkboxsizer) id of contour

Definition at line 127 of file interfToolsSpreadPanel.cxx.

References checkboxsizer, and checkvect.

Referenced by interfMainPanel::removeContourCheckBox().

127  {
128 
129  int index=-1;
130  for(int i = 0; i < checkvect.size(); i++){
131  std::string temp = checkvect[i];
132  if(id == temp){
133  index = i;
134  }
135  }
136  if( index != -1){
137  if(checkboxsizer->Remove(index)){
138  checkboxsizer->Layout();
139  }else{
140  throw "The checkbox could not be removed";
141  }
142  }
143 }

Here is the caller graph for this function:

Member Data Documentation

wxPanel* interfToolsSpreadPanel::addremovecont
private

Definition at line 64 of file interfToolsSpreadPanel.h.

Referenced by interfToolsSpreadPanel().

wxFlexGridSizer* interfToolsSpreadPanel::checkboxsizer
private
std::vector<std::string> interfToolsSpreadPanel::checkvect
private

Definition at line 68 of file interfToolsSpreadPanel.h.

Referenced by addContourCheckBox(), and removeContourCheckBox().

wxPanel* interfToolsSpreadPanel::gobuttxt
private

Definition at line 62 of file interfToolsSpreadPanel.h.

Referenced by interfToolsSpreadPanel().

wxPanel* interfToolsSpreadPanel::radiobox
private

Definition at line 63 of file interfToolsSpreadPanel.h.

Referenced by interfToolsSpreadPanel().

wxPanel* interfToolsSpreadPanel::resetbuttxt
private

Definition at line 61 of file interfToolsSpreadPanel.h.

Referenced by interfToolsSpreadPanel().

wxScrolledWindow* interfToolsSpreadPanel::scrollwin
private

Definition at line 66 of file interfToolsSpreadPanel.h.

Referenced by addContourCheckBox(), and initializeAddRemoveContour().


The documentation for this class was generated from the following files: