diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt index 0f84405..cdc0c15 100644 --- a/gui/CMakeLists.txt +++ b/gui/CMakeLists.txt @@ -10,6 +10,10 @@ set(PSOURCES main.cxx mainframe.cxx mainframe.h +design/basepanel.h +design/basepanel.cxx +mainpanel.h +mainpanel.cxx ) add_executable(gtransm ${PSOURCES}) diff --git a/gui/design/basepanel.cxx b/gui/design/basepanel.cxx new file mode 100644 index 0000000..882c37b --- /dev/null +++ b/gui/design/basepanel.cxx @@ -0,0 +1,21 @@ +#include "basepanel.h" + +CBasePanel::CBasePanel(wxWindow* parent) +{ +} + +void CBasePanel::Init() +{ + auto* topSizer = new wxBoxSizer(wxVERTICAL); + + auto* szL1 = new wxBoxSizer(wxHORIZONTAL); + + auto* lbIp = new wxStaticText(this, wxID_ANY, _("ServerIP:")); + edIp_ = new wxTextCtrl(this, wxID_ANY, _("")); + auto* lbPort = new wxStaticText(this, wxID_ANY, _("Port:")); + edPort_ = new wxTextCtrl(this, wxID_ANY, _("Port")); + szL1->Add(lbIp, 0, wxALL, 5); + szL1->Add(edIp_, 0, wxALL, 5); + szL1->Add(lbPort, 0, wxALL, 5); + szL1->Add(edPort_, 0, wxALL, 5); +} diff --git a/gui/design/basepanel.h b/gui/design/basepanel.h new file mode 100644 index 0000000..4ce1fcb --- /dev/null +++ b/gui/design/basepanel.h @@ -0,0 +1,19 @@ +#ifndef BASEMAIN_H +#define BASEMAIN_H + +#include + +class CBasePanel : public wxPanel +{ +public: + CBasePanel(wxWindow* parent); + +private: + void Init(); + +protected: + wxTextCtrl* edIp_{}; + wxTextCtrl* edPort_{}; +}; + +#endif // BASEMAIN_H \ No newline at end of file diff --git a/gui/mainframe.h b/gui/mainframe.h index a07ec11..16f2f68 100644 --- a/gui/mainframe.h +++ b/gui/mainframe.h @@ -2,6 +2,7 @@ #define MAINFRAME_H #include +#include "design/basepanel.h" class CMainFrame : public wxApp { diff --git a/gui/mainpanel.cxx b/gui/mainpanel.cxx new file mode 100644 index 0000000..fcea2f9 --- /dev/null +++ b/gui/mainpanel.cxx @@ -0,0 +1,5 @@ +#include "mainpanel.h" + +CMainPanel::CMainPanel(wxWindow* parent) : CBasePanel(parent) +{ +} diff --git a/gui/mainpanel.h b/gui/mainpanel.h new file mode 100644 index 0000000..cd12e6c --- /dev/null +++ b/gui/mainpanel.h @@ -0,0 +1,12 @@ +#ifndef MAINPANEL_H +#define MAINPANEL_H + +#include "design/basepanel.h" + +class CMainPanel : public CBasePanel +{ +public: + CMainPanel(wxWindow* parent); +}; + +#endif // MAINPANEL_H \ No newline at end of file