diff --git a/UserInterface/CMakeLists.txt b/UserInterface/CMakeLists.txt index bb23a6d..3cf1be1 100644 --- a/UserInterface/CMakeLists.txt +++ b/UserInterface/CMakeLists.txt @@ -24,8 +24,10 @@ TaskControl.h TaskControl.cxx MineControl.h MineControl.cxx +ControlManager.h +ControlManager.cxx ) add_executable(RelayFile ${MSOURCES}) -target_link_libraries(RelayFile PRIVATE wx::base wx::core) +target_link_libraries(RelayFile PRIVATE wx::base wx::core wx::aui) set_target_properties(RelayFile PROPERTIES WIN32_EXECUTABLE TRUE) \ No newline at end of file diff --git a/UserInterface/ControlManager.cxx b/UserInterface/ControlManager.cxx new file mode 100644 index 0000000..3fb9ea5 --- /dev/null +++ b/UserInterface/ControlManager.cxx @@ -0,0 +1,11 @@ +#include "ControlManager.h" + +ControlManager::ControlManager(wxWindow* parent) : parent_(parent), header_(nullptr), local_(nullptr) +{ +} + +void ControlManager::Init() +{ + header_ = new HeaderControl(parent_); + local_ = new LocalControl(parent_); +} \ No newline at end of file diff --git a/UserInterface/ControlManager.h b/UserInterface/ControlManager.h new file mode 100644 index 0000000..1b13127 --- /dev/null +++ b/UserInterface/ControlManager.h @@ -0,0 +1,23 @@ +#ifndef CONTROL_MANAGER_H +#define CONTROL_MANAGER_H + +#include "HeaderControl.h" +#include "LocalControl.h" +#include + +class ControlManager +{ +public: + ControlManager(wxWindow* parent); + ~ControlManager() = default; + +public: + void Init(); + +public: + wxWindow* parent_; + HeaderControl* header_; + LocalControl* local_; +}; + +#endif // CONTROL_MANAGER_H \ No newline at end of file diff --git a/UserInterface/HeaderControl.cxx b/UserInterface/HeaderControl.cxx index e69de29..d547e9d 100644 --- a/UserInterface/HeaderControl.cxx +++ b/UserInterface/HeaderControl.cxx @@ -0,0 +1,9 @@ +#include "HeaderControl.h" + +HeaderControl::HeaderControl(wxWindow* parent) : wxPanel(parent) +{ +} + +HeaderControl::~HeaderControl() +{ +} diff --git a/UserInterface/HeaderControl.h b/UserInterface/HeaderControl.h index 2ce01ce..3a2aff7 100644 --- a/UserInterface/HeaderControl.h +++ b/UserInterface/HeaderControl.h @@ -1,13 +1,13 @@ -#ifndef HEADERCONTORL_H -#define HEADERCONTORL_H +#ifndef HEADERCONTROL_H +#define HEADERCONTROL_H #include -class HeaderContorl : public wxPanel +class HeaderControl : public wxPanel { public: - HeaderContorl(wxWindow* parent); - ~HeaderContorl() override; + HeaderControl(wxWindow* parent); + ~HeaderControl() override; }; -#endif // HEADERCONTORL_H \ No newline at end of file +#endif // HEADERCONTROL_H \ No newline at end of file diff --git a/UserInterface/LocalControl.cxx b/UserInterface/LocalControl.cxx index 9d4c559..715e494 100644 --- a/UserInterface/LocalControl.cxx +++ b/UserInterface/LocalControl.cxx @@ -1,6 +1,6 @@ #include "LocalControl.h" -LocalControl::LocalControl(wxWindow* parent) +LocalControl::LocalControl(wxWindow* parent) : wxPanel(parent) { } diff --git a/UserInterface/LogControl.cxx b/UserInterface/LogControl.cxx index 1dc9240..7132c9b 100644 --- a/UserInterface/LogControl.cxx +++ b/UserInterface/LogControl.cxx @@ -1,6 +1,6 @@ #include "LogControl.h" -LogControl::LogControl(wxWindow* parent) +LogControl::LogControl(wxWindow* parent) : wxPanel(parent) { } diff --git a/UserInterface/MineControl.cxx b/UserInterface/MineControl.cxx index 051338a..611ff3f 100644 --- a/UserInterface/MineControl.cxx +++ b/UserInterface/MineControl.cxx @@ -1,6 +1,6 @@ #include "MineControl.h" -MineControl::MineControl(wxWindow* parent) +MineControl::MineControl(wxWindow* parent) : wxPanel(parent) { } diff --git a/UserInterface/OnLineControl.cxx b/UserInterface/OnLineControl.cxx index a0c8a81..b5520b6 100644 --- a/UserInterface/OnLineControl.cxx +++ b/UserInterface/OnLineControl.cxx @@ -1,6 +1,6 @@ #include "OnLineControl.h" -OnlineControl::OnlineControl(wxWindow* parent) +OnlineControl::OnlineControl(wxWindow* parent) : wxPanel(parent) { } diff --git a/UserInterface/RemoteControl.cxx b/UserInterface/RemoteControl.cxx index eb8b3c2..f9dc113 100644 --- a/UserInterface/RemoteControl.cxx +++ b/UserInterface/RemoteControl.cxx @@ -1,6 +1,6 @@ #include "RemoteControl.h" -RemoteControl::RemoteControl(wxWindow* parent) +RemoteControl::RemoteControl(wxWindow* parent) : wxPanel(parent) { } diff --git a/UserInterface/TaskControl.cxx b/UserInterface/TaskControl.cxx index 1850557..5dd47bb 100644 --- a/UserInterface/TaskControl.cxx +++ b/UserInterface/TaskControl.cxx @@ -1,6 +1,6 @@ #include "TaskControl.h" -TaskControl::TaskControl(wxWindow* parent) +TaskControl::TaskControl(wxWindow* parent) : wxPanel(parent) { } diff --git a/UserInterface/UserInterface.cxx b/UserInterface/UserInterface.cxx index 771dcc9..f32f3b0 100644 --- a/UserInterface/UserInterface.cxx +++ b/UserInterface/UserInterface.cxx @@ -2,20 +2,29 @@ UserInterface::UserInterface(const wxString& title) : wxFrame(nullptr, wxID_ANY, title, wxDefaultPosition, wxSize(800, 600)) { - + mgr_.SetManagedWindow(this); + InitUI(); + InitData(); } UserInterface::~UserInterface() { - + mgr_.UnInit(); } void UserInterface::InitUI() { + // Add Panel + controlMgr_ = std::make_shared(this); + controlMgr_->Init(); + mgr_.AddPane(controlMgr_->header_, wxAuiPaneInfo().Name("header").Caption("header")); + mgr_.AddPane(controlMgr_->local_, wxAuiPaneInfo().Name("local").Caption("local")); + + // update + mgr_.Update(); } void UserInterface::InitData() { - } diff --git a/UserInterface/UserInterface.h b/UserInterface/UserInterface.h index 4dca35f..157d6e0 100644 --- a/UserInterface/UserInterface.h +++ b/UserInterface/UserInterface.h @@ -1,8 +1,12 @@ #ifndef IUSERINTERFACE_H #define IUSERINTERFACE_H +#include +#include #include +#include "ControlManager.h" + class UserInterface final : public wxFrame { public: @@ -12,6 +16,10 @@ public: private: void InitUI(); void InitData(); + +private: + wxAuiManager mgr_; + std::shared_ptr controlMgr_; }; -#endif // IUSERINTERFACE_H \ No newline at end of file +#endif // IUSERINTERFACE_H \ No newline at end of file