22{
23 m_toolBar = new wxToolBar(this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
24 (vertical ? wxTB_VERTICAL : wxTB_HORIZONTAL) | wxTB_FLAT | wxTB_NODIVIDER);
25 m_toolBar->SetToolBitmapSize(wxSize(32, 32));
26
27 wxString imgPath = Paths::GetDataPath() + "/images/elements/";
28
29 m_toolBar->AddTool(ID_ADDMENU_BUS, _("Bus"), wxBitmap(imgPath + "bus.png", wxBITMAP_TYPE_PNG), _("Add a bus at the circuit"));
30 m_toolBar->AddSeparator();
31
32 m_toolBar->AddTool(ID_ADDMENU_LINE, _("Line"), wxBitmap(imgPath + "line.png", wxBITMAP_TYPE_PNG), _("Add a power line at the circuit"));
33 m_toolBar->AddTool(ID_ADDMENU_TRANSFORMER, _("Transformer"), wxBitmap(imgPath + "transformer.png", wxBITMAP_TYPE_PNG), _("Add a transformer at the circuit"));
34
35
36 m_toolBar->AddTool(ID_ADDMENU_GENERATOR, _("Generator"), wxBitmap(imgPath + "generator.png", wxBITMAP_TYPE_PNG), _("Add a generator at the circuit"));
37 m_toolBar->AddTool(ID_ADDMENU_INDMOTOR, _("Induction motor"), wxBitmap(imgPath + "indmotor.png", wxBITMAP_TYPE_PNG), _("Add an induction motor at the circuit"));
38 m_toolBar->AddTool(ID_ADDMENU_SYNCCOMP, _("Synchronous compensator"), wxBitmap(imgPath + "synccomp.png", wxBITMAP_TYPE_PNG), _("Add a synchronous compensator at the circuit"));
39 m_toolBar->AddSeparator();
40
41 m_toolBar->AddTool(ID_ADDMENU_LOAD, _("Load"), wxBitmap(imgPath + "load.png", wxBITMAP_TYPE_PNG), _("Add a load at the circuit"));
42 m_toolBar->AddTool(ID_ADDMENU_CAPACITOR, _("Capacitor"), wxBitmap(imgPath + "capacitor.png", wxBITMAP_TYPE_PNG), _("Add a shunt capacitor at the circuit"));
43 m_toolBar->AddTool(ID_ADDMENU_INDUCTOR, _("Inductor"), wxBitmap(imgPath + "inductor.png", wxBITMAP_TYPE_PNG), _("Add a shunt inductor at the circuit"));
44 m_toolBar->AddSeparator();
45
46 m_toolBar->AddTool(ID_ADDMENU_HARMCURRENT, _("Harmonic current"), wxBitmap(imgPath + "harmcurrent.png", wxBITMAP_TYPE_PNG), _("Add a harmonic current source at the circuit"));
47 m_toolBar->AddTool(ID_ADDMENU_EMTELEMENT, _("EMT Element"), wxBitmap(imgPath + "emtelement.png", wxBITMAP_TYPE_PNG), _("Add an electromagnetic transient element"));
48 m_toolBar->AddSeparator();
49
50 m_toolBar->AddTool(ID_ADDMENU_TEXT, _("Label"), wxBitmap(imgPath + "text.png", wxBITMAP_TYPE_PNG), _("Add a linked element label"));
51
52 m_toolBar->Realize();
53
54 m_toolBar->Bind(wxEVT_TOOL, &ElementsToolBar::OnToolClicked, this);
55
56 wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
57 sizer->Add(m_toolBar, 1, wxEXPAND);
58 SetSizerAndFit(sizer);
59}