wxBitmap bmp_run(run_xpm);
wxBitmap bmp_delete(delete_xpm);
wxBitmap bmp_centerview(centerview_xpm);
+ wxBitmap bmp_complexbox(complexbox_xpm);
wxToolBar *toolbar = new wxToolBar(this, wxID_ANY);
toolbar->AddTool(ID_DELETEALL,_T("Delete all"),bmp_delete, wxNullBitmap, wxITEM_NORMAL,_T("Delete all boxes"), _T("Delete all boxes"));
toolbar->AddTool(ID_CENTERVIEW,_T("Center view"),bmp_centerview, wxNullBitmap, wxITEM_NORMAL,_T("Center view"), _T("Center view"));
toolbar->AddSeparator();
- toolbar->AddTool(ID_BTNCOMPLEXBOX,_T("Complex box"),bmp_centerview, wxNullBitmap, wxITEM_NORMAL,_T("Complex box"), _T("Complex box"));
+ toolbar->AddTool(ID_BTNCOMPLEXBOX,_T("Complex box"),complexbox_xpm, wxNullBitmap, wxITEM_NORMAL,_T("Complex box"), _T("Complex box"));
toolbar->SetToggle(ID_BTNCOMPLEXBOX,true);
+ toolbar->AddTool(ID_ADDCOMPLEXBOXINPUT,_T("Add input to Complex box"),bmp_centerview, wxNullBitmap, wxITEM_NORMAL,_T("Add input to Complex box"), _T("Add input to Complex box"));
+ toolbar->AddTool(ID_ADDCOMPLEXBOXOUTPUT,_T("Add output to Complex box"),bmp_centerview, wxNullBitmap, wxITEM_NORMAL,_T("Add output Complex box"), _T("Add output Complex box"));
+ toolbar->EnableTool(ID_ADDCOMPLEXBOXINPUT,false);
+ toolbar->EnableTool(ID_ADDCOMPLEXBOXOUTPUT,false);
toolbar->SetMargins( 2, 2 );
toolbar->Realize();
Connect(ID_RUN,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnExecuteActualDiagram));
Connect(ID_DELETEALL,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnDeleteAllBoxesActualDiagram));
Connect(ID_CENTERVIEW,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnCenterViewActualDiagram));
- Connect(ID_BTNCOMPLEXBOX,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnActivateComplexBox));
+ Connect(ID_BTNCOMPLEXBOX,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnClickBtnComplexBox));
+ Connect(ID_ADDCOMPLEXBOXINPUT,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnAddComplexBoxInput));
+ Connect(ID_ADDCOMPLEXBOXOUTPUT,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnAddComplexBoxOutput));
}
//=========================================================================
void wxGUIEditorGraphicBBS::OnCreateNewTab(wxCommandEvent& event)
{
- _tabsMgr->addNewTab();
+ _tabsMgr->addNewTab();
+ refreshToolbar();
}
//=========================================================================
//=========================================================================
+ void wxGUIEditorGraphicBBS::refreshToolbar()
+ {
+ wxToolBar* toolbar = GetToolBar();
+ if(_tabsMgr->isActualDiagramComplexBox())
+ {
+ toolbar->ToggleTool(ID_BTNCOMPLEXBOX,true);
+ }
+ else
+ {
+ toolbar->ToggleTool(ID_BTNCOMPLEXBOX,false);
+ }
+
+ bool temp = toolbar->GetToolState(ID_BTNCOMPLEXBOX);
+ if(temp)
+ {
+ toolbar->EnableTool(ID_ADDCOMPLEXBOXINPUT,true);
+ toolbar->EnableTool(ID_ADDCOMPLEXBOXOUTPUT,true);
+ }
+ else
+ {
+ toolbar->EnableTool(ID_ADDCOMPLEXBOXINPUT,false);
+ toolbar->EnableTool(ID_ADDCOMPLEXBOXOUTPUT,false);
+ }
+ }
+
+ //=========================================================================
+
void wxGUIEditorGraphicBBS::OnDeleteAllBoxesActualDiagram(wxCommandEvent& event)
{
wxMessageDialog *dial = new wxMessageDialog(NULL, wxT("Are you sure to delete all boxes of the diagram?"), wxT("Delete all boxes"), wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION);
//=========================================================================
- void wxGUIEditorGraphicBBS::OnActivateComplexBox(wxCommandEvent& event)
- {
+ void wxGUIEditorGraphicBBS::OnClickBtnComplexBox(wxCommandEvent& event)
+ {
+ wxToolBar* toolbar = GetToolBar();
+ bool temp = toolbar->GetToolState(ID_BTNCOMPLEXBOX);
+ if(temp)
+ {
+ toolbar->EnableTool(ID_ADDCOMPLEXBOXINPUT,true);
+ toolbar->EnableTool(ID_ADDCOMPLEXBOXOUTPUT,true);
+ _tabsMgr->setActualDiagramComplexBox(true);
+ }
+ else
+ {
+ toolbar->EnableTool(ID_ADDCOMPLEXBOXINPUT,false);
+ toolbar->EnableTool(ID_ADDCOMPLEXBOXOUTPUT,false);
+ _tabsMgr->setActualDiagramComplexBox(false);
+ }
+
+ }
+
+ //=========================================================================
+
+ void wxGUIEditorGraphicBBS::OnAddComplexBoxInput(wxCommandEvent& event)
+ {
+ }
+
+ //=========================================================================
+
+ void wxGUIEditorGraphicBBS::OnAddComplexBoxOutput(wxCommandEvent& event)
+ {
}
-
//=========================================================================