From 48e9b36e6c10df5fe33c2c905f01e1a033969b25 Mon Sep 17 00:00:00 2001 From: taynpg Date: Wed, 2 Apr 2025 10:36:48 +0800 Subject: [PATCH] =?UTF-8?q?add=EF=BC=9A=E6=B7=BB=E5=8A=A0=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E5=9F=BA=E6=9C=AC=E6=9E=B6=E5=AD=90=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gui/CMakeLists.txt | 4 ++++ gui/design/basepanel.cxx | 21 +++++++++++++++++++++ gui/design/basepanel.h | 19 +++++++++++++++++++ gui/mainframe.h | 1 + gui/mainpanel.cxx | 5 +++++ gui/mainpanel.h | 12 ++++++++++++ 6 files changed, 62 insertions(+) create mode 100644 gui/design/basepanel.cxx create mode 100644 gui/design/basepanel.h create mode 100644 gui/mainpanel.cxx create mode 100644 gui/mainpanel.h 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