wxformbuilder generate the same file everytime we click generate code. every time the file is overwritten.
The idea is to separate the view from my code "control". I have to add in real time values to this wxchoice like , "COM1" for example.
To do so i derived from the view class, I could access to all the pointers to objects in the view.
now I d like to get this object and append a new wxstring from the derived class without editing the view class.
Code: Select all
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Jun 17 2015)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif //__BORLANDC__
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif //WX_PRECOMP
#include "GUIFrame.h"
///////////////////////////////////////////////////////////////////////////
GUIFrame::GUIFrame( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
mbar = new wxMenuBar( 0 );
fileMenu = new wxMenu();
wxMenuItem* menuFileQuit;
menuFileQuit = new wxMenuItem( fileMenu, idMenuQuit, wxString( wxT("&Quit") ) + wxT('\t') + wxT("Alt+F4"), wxT("Quit the application"), wxITEM_NORMAL );
fileMenu->Append( menuFileQuit );
mbar->Append( fileMenu, wxT("&File") );
helpMenu = new wxMenu();
wxMenuItem* menuHelpAbout;
menuHelpAbout = new wxMenuItem( helpMenu, idMenuAbout, wxString( wxT("&About") ) + wxT('\t') + wxT("F1"), wxT("Show info about this application"), wxITEM_NORMAL );
helpMenu->Append( menuHelpAbout );
mbar->Append( helpMenu, wxT("&Help") );
m_menu3 = new wxMenu();
mbar->Append( m_menu3, wxT("Data Acquisition") );
this->SetMenuBar( mbar );
statusBar = this->CreateStatusBar( 2, wxST_SIZEGRIP, wxID_ANY );
wxBoxSizer* bSizer4;
bSizer4 = new wxBoxSizer( wxVERTICAL );
m_hyperlink1 = new wxHyperlinkCtrl( this, wxID_ANY, wxT("-----------"), wxT("http://www.wxformbuilder.org"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
bSizer4->Add( m_hyperlink1, 0, wxALL, 5 );
wxBoxSizer* bSizer41;
bSizer41 = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* sbSizer5;
sbSizer5 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Serial Settings") ), wxHORIZONTAL );
wxGridSizer* gSizer5;
gSizer5 = new wxGridSizer( 0, 2, 0, 0 );
wxBoxSizer* bSizer10;
bSizer10 = new wxBoxSizer( wxHORIZONTAL );
m_staticText5 = new wxStaticText( sbSizer5->GetStaticBox(), wxID_ANY, wxT("Availibale Ports"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText5->Wrap( -1 );
bSizer10->Add( m_staticText5, 0, wxALL, 5 );
wxString m_choice3Choices[] = { wxT("COM1"), wxT("COM2"), wxT("COM3") };
int m_choice3NChoices = sizeof( m_choice3Choices ) / sizeof( wxString );
m_choice3 = new wxChoice( sbSizer5->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choice3NChoices, m_choice3Choices, 0 );
m_choice3->SetSelection( 0 );
bSizer10->Add( m_choice3, 1, wxALL, 5 );
gSizer5->Add( bSizer10, 1, wxEXPAND, 5 );
wxBoxSizer* bSizer11;
bSizer11 = new wxBoxSizer( wxHORIZONTAL );
m_staticText6 = new wxStaticText( sbSizer5->GetStaticBox(), wxID_ANY, wxT("BaudRate"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText6->Wrap( -1 );
bSizer11->Add( m_staticText6, 0, wxALL, 5 );
wxString m_choice4Choices[] = { wxT("9600"), wxT("19200"), wxT("115200") };
int m_choice4NChoices = sizeof( m_choice4Choices ) / sizeof( wxString );
m_choice4 = new wxChoice( sbSizer5->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choice4NChoices, m_choice4Choices, 0 );
m_choice4->SetSelection( 0 );
bSizer11->Add( m_choice4, 1, wxALL, 5 );
gSizer5->Add( bSizer11, 1, wxEXPAND, 5 );
sbSizer5->Add( gSizer5, 1, wxEXPAND, 5 );
bSizer41->Add( sbSizer5, 0, wxEXPAND, 5 );
bSizer4->Add( bSizer41, 1, wxEXPAND, 5 );
wxGridSizer* gSizer1;
gSizer1 = new wxGridSizer( 0, 2, 0, 0 );
wxStaticBoxSizer* sbSizer2;
sbSizer2 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Serial Transmit") ), wxVERTICAL );
wxBoxSizer* bSizer9;
bSizer9 = new wxBoxSizer( wxVERTICAL );
wxGridSizer* gSizer6;
gSizer6 = new wxGridSizer( 0, 2, 0, 0 );
bSizer9->Add( gSizer6, 1, wxEXPAND, 5 );
sbSizer2->Add( bSizer9, 1, wxEXPAND, 5 );
gSizer1->Add( sbSizer2, 1, wxEXPAND, 5 );
wxStaticBoxSizer* sbSizer4;
sbSizer4 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Serial Receive") ), wxVERTICAL );
wxBoxSizer* bSizer6;
bSizer6 = new wxBoxSizer( wxHORIZONTAL );
sbSizer4->Add( bSizer6, 1, wxEXPAND, 5 );
gSizer1->Add( sbSizer4, 1, wxEXPAND, 5 );
bSizer4->Add( gSizer1, 3, wxEXPAND, 5 );
wxBoxSizer* bSizer8;
bSizer8 = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* sbSizer9;
sbSizer9 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Log") ), wxVERTICAL );
bSizer8->Add( sbSizer9, 1, wxEXPAND, 5 );
bSizer4->Add( bSizer8, 1, wxEXPAND, 5 );
this->SetSizer( bSizer4 );
this->Layout();
// Connect Events
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( GUIFrame::OnClose ) );
this->Connect( menuFileQuit->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GUIFrame::OnQuit ) );
this->Connect( menuHelpAbout->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GUIFrame::OnAbout ) );
}
GUIFrame::~GUIFrame()
{
// Disconnect Events
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( GUIFrame::OnClose ) );
this->Disconnect( idMenuQuit, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GUIFrame::OnQuit ) );
this->Disconnect( idMenuAbout, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GUIFrame::OnAbout ) );
}