From 1088617b8f1c31af3ad6a87f9934f7a55240b3a2 Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Mon, 12 Sep 2016 18:49:00 -0300 Subject: Bus form under implementation [2] --- Project/Bus.cpp | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'Project/Bus.cpp') diff --git a/Project/Bus.cpp b/Project/Bus.cpp index d85b6e0..a684ed4 100644 --- a/Project/Bus.cpp +++ b/Project/Bus.cpp @@ -8,6 +8,15 @@ Bus::Bus(wxPoint2DDouble position) : Element() SetPosition(position); } +Bus::Bus(wxPoint2DDouble position, wxString name) +{ + m_width = 100.0; + m_height = 5.0; + SetPosition(position); + + m_electricalData.name = name; +} + Bus::~Bus() {} void Bus::Draw(wxPoint2DDouble translation, double scale) const { @@ -166,15 +175,14 @@ bool Bus::GetContextMenu(wxMenu& menu) return true; } -bool Bus::ShowForm(wxWindow* parent) +bool Bus::ShowForm(wxWindow* parent, Element* element) { - BusForm* busForm = new BusForm(parent); - if(busForm->ShowModal() == wxID_OK){ - - busForm->Destroy(); - return true; + BusForm* busForm = new BusForm(parent, this); + if(busForm->ShowModal() == wxID_OK) { + busForm->Destroy(); + return true; } - - busForm->Destroy(); + + busForm->Destroy(); return false; } -- cgit