creaContours_lib
wxContour_ButtonsBar Class Reference

#include <wxContour_ButtonsBar.h>

Inheritance diagram for wxContour_ButtonsBar:
Collaboration diagram for wxContour_ButtonsBar:

Public Member Functions

 wxContour_ButtonsBar (wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTB_HORIZONTAL|wxNO_BORDER, const wxString &name=wxPanelNameStr)
 
 ~wxContour_ButtonsBar ()
 
void onActionButtonPressed (wxCommandEvent &event)
 
void sendEnvent (WXTYPE theEventType)
 
void setWxEventHandler (wxEvtHandler *theEventHandler)
 

Private Attributes

wxEvtHandler * _eventHandler
 
wxButton * _createContour_Button
 
wxButton * _delete_Button
 
wxButton * _hideContour_Button
 
wxButton * _show_Button
 
wxButton * _copy_Button
 
wxButton * _paste_Button
 
wxButton * _change_Button
 
wxButton * _spread_Button
 
wxButton * _select_Button
 
wxButton * _edit_Button
 
wxButton * _undo_Button
 
wxButton * _redo_Button
 
wxButton * _save_Button
 
wxButton * _open_Button
 
wxButton * _automatiqueSegmentation_Button
 
wxButton * _informationContour_Button
 
wxButton * _interfaceConfiguration_Button
 
wxButton * _interfaceTest_Button
 

Detailed Description

file wxContour_ButtonsBar.h

Definition at line 62 of file wxContour_ButtonsBar.h.

Constructor & Destructor Documentation

wxContour_ButtonsBar::wxContour_ButtonsBar ( wxWindow *  parent,
wxWindowID  id,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = wxTB_HORIZONTAL | wxNO_BORDER,
const wxString &  name = wxPanelNameStr 
)

Definition at line 59 of file wxContour_ButtonsBar.cxx.

References _automatiqueSegmentation_Button, _change_Button, _copy_Button, _createContour_Button, _delete_Button, _informationContour_Button, _interfaceConfiguration_Button, _interfaceTest_Button, _open_Button, _paste_Button, _save_Button, _spread_Button, wxContour_ActionCommandsID::AUTOMATIQUESEGMENTATION_TOOL, wxContour_ActionCommandsID::CHANGE_TOOL, wxContour_ActionCommandsID::COPY_TOOL, wxContour_ActionCommandsID::CREATE_TOOL, wxContour_ActionCommandsID::DELETE_TOOL, wxContour_ActionCommandsID::INFORMATIONCONTOUR_TOOL, wxContour_ActionCommandsID::INTERFACECONFIGURATION_TOOL, onActionButtonPressed(), wxContour_ActionCommandsID::OPEN_TOOL, wxContour_ActionCommandsID::PASTE_TOOL, wxContour_ActionCommandsID::SAVE_TOOL, wxContour_ActionCommandsID::SPREAD_TOOL, and wxContour_ActionCommandsID::TEST_TOOL.

61  :wxPanel( parent, id)//, pos, size, style, name)
62  {
63  //SetToolBitmapSize(wxSize(16,16));
64  std::string as = (char)wxContour_ActionCommandsID::CREATE_TOOL +"";
65  _createContour_Button = new wxButton( this, -1, _T("+ New Contour"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxString(as.c_str(),wxConvUTF8));
66 // _createContour_Button->SetToolTip(_T("CTRL-N"));
67  Connect( _createContour_Button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed );
68 
70  _delete_Button = new wxButton( this, -1, _T("+ Delete"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxString(as.c_str(),wxConvUTF8));
71  _delete_Button->SetToolTip(_T("BACK SPACE or DELETE key"));
72  Connect( _delete_Button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed );
73 
74 /*
75  _hideContour_Button = new wxButton( this, -1, "Hide Contour", wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxContour_ActionCommandsID::HIDE_TOOL );
76  Connect( _hideContour_Button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed );
77 
78  _show_Button = new wxButton( this, -1, _T("Show"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxContour_ActionCommandsID::SHOW_TOOL );
79  Connect( _show_Button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed );
80 */
82  _copy_Button = new wxButton( this, -1, _T("Copy"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxString(as.c_str(),wxConvUTF8));
83  _copy_Button->SetToolTip(_T("CTRL-C"));
84  Connect( _copy_Button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed );
85 
87  _paste_Button = new wxButton( this, -1, _T("Paste"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxString(as.c_str(),wxConvUTF8));
88  _paste_Button->SetToolTip(_T("CTRL-V"));
89  Connect( _paste_Button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed );
90 
92  _change_Button = new wxButton( this, -1, _T(" <--> "), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxString(as.c_str(),wxConvUTF8));
93  _change_Button->SetToolTip(_T("CTRL-K"));
94  Connect( _change_Button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed );
95 
97  _save_Button = new wxButton( this, -1, _T("Save"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxString(as.c_str(),wxConvUTF8));
98  _save_Button->SetToolTip(_T("CTRL-S"));
99  Connect( _save_Button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed );
100 
102  _open_Button = new wxButton( this, -1, _T("Open"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxString(as.c_str(),wxConvUTF8));
103  _open_Button->SetToolTip(_T("CTRL-O"));
104  Connect( _open_Button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed );
105 
107  _spread_Button = new wxButton( this, -1, _T("+ Spread"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxString(as.c_str(),wxConvUTF8));
108 // _spread_Button->SetToolTip(_T("CTRL-XXXXXXX"));
109  Connect( _spread_Button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed );
110 
112  _automatiqueSegmentation_Button = new wxButton( this, -1, _T("+ Segmentation"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxString(as.c_str(),wxConvUTF8));
113 // _automatiqueSegmentation_Button->SetToolTip(_T("CTRL-XXXXXXX"));
114  Connect( _automatiqueSegmentation_Button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed );
115 
117  _informationContour_Button = new wxButton( this, -1, _T("+ Information"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxString(as.c_str(),wxConvUTF8));
118 // _informationContour_Button->SetToolTip(_T("CTRL-XXXXXXX"));
119  Connect( _informationContour_Button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed );
120 
122  _interfaceConfiguration_Button = new wxButton( this, -1, _T("+ Configuration"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxString(as.c_str(),wxConvUTF8));
123 // _informationContour_Button->SetToolTip(_T("CTRL-XXXXXXX"));
124  Connect( _interfaceConfiguration_Button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed );
125 
126 
127 //Test button Methods A-B-C in Juan Carlos Prieto 22-09-08
129  _interfaceTest_Button = new wxButton( this, -1, _T("+ Test"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxString(as.c_str(),wxConvUTF8));
130 // _informationContour_Button->SetToolTip(_T("CTRL-XXXXXXX"));
131  Connect( _interfaceTest_Button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed );
132 
133 
134 /*
135  _spread_Button = new wxButton( this, -1, _T("Spread"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxContour_ActionCommandsID::SPREAD_TOOL );
136  Connect( _spread_Button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed );
137  _select_Button = new wxButton( this, -1, _T("Select"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxContour_ActionCommandsID::SELECT_TOOL );
138  Connect( _select_Button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed );
139 
140  _edit_Button = new wxButton( this, -1, _T("Edit"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxContour_ActionCommandsID::EDIT_TOOL );
141  Connect( _edit_Button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed );
142 
143  _undo_Button = new wxButton( this, -1, _T("Undo"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxContour_ActionCommandsID::UNDO_TOOL );
144  Connect( _undo_Button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed );
145 
146  _redo_Button = new wxButton( this, -1, _T("Redo"), wxDefaultPosition, wxDefaultSize, 0,wxDefaultValidator, wxContour_ActionCommandsID::REDO_TOOL );
147  Connect( _redo_Button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &wxContour_ButtonsBar:: onActionButtonPressed );
148 */
149  wxFlexGridSizer * panelSizer = new wxFlexGridSizer(9);
150  panelSizer -> Add( _createContour_Button, 1, wxGROW );
151 /*
152  panelSizer -> Add( _hideContour_Button, 1, wxGROW );
153  panelSizer -> Add( _show_Button, 1, wxGROW );
154 */
155  panelSizer -> Add( _change_Button , 1, wxGROW );
156  panelSizer -> Add( _copy_Button , 1, wxGROW );
157  panelSizer -> Add( _paste_Button , 1, wxGROW );
158  panelSizer -> Add( _delete_Button , 1, wxGROW );
159  panelSizer -> Add( _save_Button , 1, wxGROW );
160  panelSizer -> Add( _open_Button , 1, wxGROW );
161  panelSizer -> Add( _spread_Button , 1, wxGROW );
162  panelSizer -> Add( _automatiqueSegmentation_Button , 1, wxGROW );
163  panelSizer -> Add( _informationContour_Button , 1, wxGROW );
164  panelSizer -> Add( _interfaceConfiguration_Button , 1, wxGROW );
165  panelSizer -> Add( _interfaceTest_Button , 1, wxGROW );
166 
167 /*
168  panelSizer -> Add( _select_Button, 1, wxGROW );
169  panelSizer -> Add( _edit_Button, 1, wxGROW );
170  panelSizer -> Add( _undo_Button, 1, wxGROW );
171  panelSizer -> Add( _redo_Button, 1, wxGROW );
172 */
173 
174  SetSizer( panelSizer );
175 /*
176  this->AddControl( _createContour_Button );
177  AddSeparator();
178  this->AddControl( _hideContour_Button );
179 */
180  SetSize( wxSize( 1500, 80));
181  this->SetAutoLayout( true );
182  this->Layout();
183  }

Here is the call graph for this function:

wxContour_ButtonsBar::~wxContour_ButtonsBar ( )

Definition at line 185 of file wxContour_ButtonsBar.cxx.

References _eventHandler.

186  {
187  _eventHandler = NULL;
188  /*delete _createContour_Button;
189  delete _delete_Button;
190  delete _hideContour_Button;
191  delete _show_Button;
192  delete _copy_Button;
193  delete _paste_Button;
194  delete _spread_Button;
195  delete _select_Button;
196  delete _edit_Button;
197  delete _undo_Button;
198  delete _redo_Button;*/
199  }

Member Function Documentation

void wxContour_ButtonsBar::onActionButtonPressed ( wxCommandEvent &  event)

Definition at line 203 of file wxContour_ButtonsBar.cxx.

References _eventHandler.

Referenced by wxContour_ButtonsBar().

204  {
205  if(_eventHandler!=NULL)
206  {
207  std::string theStr = std::string( ((wxButton *)event.GetEventObject())->GetName().ToAscii());
208  const char * toolCommand = theStr.c_str();
209  event.SetId( GetId() );
210  event.SetEventObject( this );
211  event.SetClientData( (void *) toolCommand);
212  _eventHandler->ProcessEvent( event );
213  }
214  }

Here is the caller graph for this function:

void wxContour_ButtonsBar::sendEnvent ( WXTYPE  theEventType)

Definition at line 219 of file wxContour_ButtonsBar.cxx.

References _eventHandler.

220  {
221  wxCommandEvent cevent( theEventType, GetId() );
222  cevent.SetEventObject( this );
223  _eventHandler->ProcessEvent( cevent );
224  }
void wxContour_ButtonsBar::setWxEventHandler ( wxEvtHandler *  theEventHandler)

Definition at line 244 of file wxContour_ButtonsBar.cxx.

References _eventHandler.

245  {
246  _eventHandler = theEventHandler;
247  }

Member Data Documentation

wxButton* wxContour_ButtonsBar::_automatiqueSegmentation_Button
private

Definition at line 123 of file wxContour_ButtonsBar.h.

Referenced by wxContour_ButtonsBar().

wxButton* wxContour_ButtonsBar::_change_Button
private

Definition at line 115 of file wxContour_ButtonsBar.h.

Referenced by wxContour_ButtonsBar().

wxButton* wxContour_ButtonsBar::_copy_Button
private

Definition at line 113 of file wxContour_ButtonsBar.h.

Referenced by wxContour_ButtonsBar().

wxButton* wxContour_ButtonsBar::_createContour_Button
private

Definition at line 109 of file wxContour_ButtonsBar.h.

Referenced by wxContour_ButtonsBar().

wxButton* wxContour_ButtonsBar::_delete_Button
private

Definition at line 110 of file wxContour_ButtonsBar.h.

Referenced by wxContour_ButtonsBar().

wxButton* wxContour_ButtonsBar::_edit_Button
private

Definition at line 118 of file wxContour_ButtonsBar.h.

wxEvtHandler* wxContour_ButtonsBar::_eventHandler
private
wxButton* wxContour_ButtonsBar::_hideContour_Button
private

Definition at line 111 of file wxContour_ButtonsBar.h.

wxButton* wxContour_ButtonsBar::_informationContour_Button
private

Definition at line 124 of file wxContour_ButtonsBar.h.

Referenced by wxContour_ButtonsBar().

wxButton* wxContour_ButtonsBar::_interfaceConfiguration_Button
private

Definition at line 125 of file wxContour_ButtonsBar.h.

Referenced by wxContour_ButtonsBar().

wxButton* wxContour_ButtonsBar::_interfaceTest_Button
private

Definition at line 126 of file wxContour_ButtonsBar.h.

Referenced by wxContour_ButtonsBar().

wxButton* wxContour_ButtonsBar::_open_Button
private

Definition at line 122 of file wxContour_ButtonsBar.h.

Referenced by wxContour_ButtonsBar().

wxButton* wxContour_ButtonsBar::_paste_Button
private

Definition at line 114 of file wxContour_ButtonsBar.h.

Referenced by wxContour_ButtonsBar().

wxButton* wxContour_ButtonsBar::_redo_Button
private

Definition at line 120 of file wxContour_ButtonsBar.h.

wxButton* wxContour_ButtonsBar::_save_Button
private

Definition at line 121 of file wxContour_ButtonsBar.h.

Referenced by wxContour_ButtonsBar().

wxButton* wxContour_ButtonsBar::_select_Button
private

Definition at line 117 of file wxContour_ButtonsBar.h.

wxButton* wxContour_ButtonsBar::_show_Button
private

Definition at line 112 of file wxContour_ButtonsBar.h.

wxButton* wxContour_ButtonsBar::_spread_Button
private

Definition at line 116 of file wxContour_ButtonsBar.h.

Referenced by wxContour_ButtonsBar().

wxButton* wxContour_ButtonsBar::_undo_Button
private

Definition at line 119 of file wxContour_ButtonsBar.h.


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