Program: wxMaracas
Module: $RCSfile: CutModelMainPanel.cxx,v $
Language: C++
-Date: $Date: 2010/02/24 13:56:06 $
-Version: $Revision: 1.6 $
+Date: $Date: 2010/03/05 17:54:39 $
+Version: $Revision: 1.7 $
Copyright: (c) 2002, 2003
License:
//RaC 5-02-2010 Add tabs
_notebook = new wxAuiNotebook(this,wxID_ANY,wxDefaultPosition,wxDefaultSize,wxAUI_NB_TOP |wxAUI_NB_TAB_MOVE | wxAUI_NB_SCROLL_BUTTONS);
- _notebook->AddPage(new ToolBarCutModel(_notebook),"Cutter",true);
+ _notebook->AddPage(new ToolBarCutModel(_notebook),_T("Cutter"),true);
//_wxauimanager->AddPane(new ToolBarCutModel(this),paneinfo.ToolbarPane().Top());
_wxauimanager->AddPane(_notebook,paneinfo.Center());
addPolygonCutterTab();
btnExecutePolygonCut->Enable(false);
_notebook->GetPage(0)->Enable(false);
_radioinsideout->Enable(false);
- lblMessagePolygon->SetLabel("Drawing polygon...");
+ lblMessagePolygon->SetLabel(_T("Drawing polygon..."));
}
else
{
btnExecutePolygonCut->Enable(true);
_notebook->GetPage(0)->Enable(true);
_radioinsideout->Enable(true);
- lblMessagePolygon->SetLabel("Contour saved! Click on Execute Cut");
+ lblMessagePolygon->SetLabel(_T("Contour saved! Click on Execute Cut"));
}
cutmanager->UpdatePolygon(_isCheck);
//RaC
-void CutModelMainPanel::onExecuteCutPolygon(){
+void CutModelMainPanel::onExecuteCutPolygon()
+{
//Cuts Polygon
cutmanager->ExecuteCutPolygon(_radioinsideout->GetSelection());
- lblMessagePolygon->SetLabel("No contour drawed");
-
+ lblMessagePolygon->SetLabel(_T("No contour drawed"));
}
showErrorDialog(e.getCause());
}
}
-void CutModelMainPanel::ShowCurrentPanel(int id){
- for(int i = 0; i < viewpanels.size();i++){
+
+void CutModelMainPanel::ShowCurrentPanel(int id)
+{
+ int i;
+ for(i = 0; i < (int) viewpanels.size();i++){
if(viewpanels[i]->getId()==id){
_wxauimanager->GetPane(viewpanels[i]).Show(true);
cutmanager->RefreshActor(id);
}
-CutModelView* CutModelMainPanel::getModelView(int id)throw( CutModelException){
-
+CutModelView* CutModelMainPanel::getModelView(int id)throw( CutModelException)
+{
CutModelView* current = NULL;
- for(int i = 0; i < viewpanels.size();i++){
- if(viewpanels[i]->getId()==id){
+ int i;
+ for(i = 0; i < (int)viewpanels.size();i++)
+ {
+ if(viewpanels[i]->getId()==id)
+ {
current = viewpanels[i];
}
}
- if(current == NULL){
+ if(current == NULL)
+ {
std::string s = "Id not found";
throw CutModelException(s);
}
return current;
}
-void CutModelMainPanel::onUndo(){
+
+void CutModelMainPanel::onUndo()
+ {
try{
checkInvariant();
int result = cutmanager->Undo();
}
void CutModelMainPanel::ExecuteAll(){
- for(int i = 0; i < viewpanels.size(); i++){
+ int i;
+ for(i = 0; i < (int)viewpanels.size(); i++){
viewpanels[i]->ExecuteCut();
}
panel->SetSizer(sizer);
sizer->AddSpacer(20);
- wxCheckBox *item = new wxCheckBox(panel,10,"Draw Polygon",wxDefaultPosition,wxDefaultSize,0,wxDefaultValidator,"");
+ wxCheckBox *item = new wxCheckBox(panel,10,_T("Draw Polygon"),wxDefaultPosition,wxDefaultSize,0,wxDefaultValidator,_T("") );
item->SetValue(false);
Connect(item->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED,(wxObjectEventFunction)(&PolygonCutterEventHandlerCutModel::onCheckChanged));
sizer->Add(item, 0, wxALIGN_LEFT);
- lblMessagePolygon = new wxStaticText(panel,30,"No contour drawed",wxDefaultPosition,wxDefaultSize,0,"");
+ lblMessagePolygon = new wxStaticText(panel,30,_T("No contour drawed"),wxDefaultPosition,wxDefaultSize,0,_T("") );
sizer->Add(lblMessagePolygon, 0, wxALIGN_LEFT);
wxString choices0[2];
_radioinsideout = new wxRadioBox(panel,-1,_T(""), wxDefaultPosition, wxDefaultSize,2,choices0);
sizer->Add(_radioinsideout, wxALIGN_LEFT);
- btnExecutePolygonCut = new wxButton(panel,20,"Execute Cut",wxDefaultPosition,wxDefaultSize,0,wxDefaultValidator,"");
+ btnExecutePolygonCut = new wxButton(panel,20,_T("Execute Cut"),wxDefaultPosition,wxDefaultSize,0,wxDefaultValidator,_T("") );
Connect(btnExecutePolygonCut->GetId(), wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)(&PolygonCutterEventHandlerCutModel::onExecuteCutPolygon));
sizer->Add(btnExecutePolygonCut, 0, wxALIGN_LEFT);
- _notebook->AddPage(panel, "Polygon Cutter", false);
+ _notebook->AddPage(panel, _T("Polygon Cutter"), false);
}