aui:使用aui显示。
This commit is contained in:
parent
f33eed6ddb
commit
611b71074b
@ -24,8 +24,10 @@ TaskControl.h
|
|||||||
TaskControl.cxx
|
TaskControl.cxx
|
||||||
MineControl.h
|
MineControl.h
|
||||||
MineControl.cxx
|
MineControl.cxx
|
||||||
|
ControlManager.h
|
||||||
|
ControlManager.cxx
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(RelayFile ${MSOURCES})
|
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)
|
set_target_properties(RelayFile PROPERTIES WIN32_EXECUTABLE TRUE)
|
11
UserInterface/ControlManager.cxx
Normal file
11
UserInterface/ControlManager.cxx
Normal file
@ -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_);
|
||||||
|
}
|
23
UserInterface/ControlManager.h
Normal file
23
UserInterface/ControlManager.h
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#ifndef CONTROL_MANAGER_H
|
||||||
|
#define CONTROL_MANAGER_H
|
||||||
|
|
||||||
|
#include "HeaderControl.h"
|
||||||
|
#include "LocalControl.h"
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
class ControlManager
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ControlManager(wxWindow* parent);
|
||||||
|
~ControlManager() = default;
|
||||||
|
|
||||||
|
public:
|
||||||
|
void Init();
|
||||||
|
|
||||||
|
public:
|
||||||
|
wxWindow* parent_;
|
||||||
|
HeaderControl* header_;
|
||||||
|
LocalControl* local_;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // CONTROL_MANAGER_H
|
@ -0,0 +1,9 @@
|
|||||||
|
#include "HeaderControl.h"
|
||||||
|
|
||||||
|
HeaderControl::HeaderControl(wxWindow* parent) : wxPanel(parent)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
HeaderControl::~HeaderControl()
|
||||||
|
{
|
||||||
|
}
|
@ -1,13 +1,13 @@
|
|||||||
#ifndef HEADERCONTORL_H
|
#ifndef HEADERCONTROL_H
|
||||||
#define HEADERCONTORL_H
|
#define HEADERCONTROL_H
|
||||||
|
|
||||||
#include <wx/wx.h>
|
#include <wx/wx.h>
|
||||||
|
|
||||||
class HeaderContorl : public wxPanel
|
class HeaderControl : public wxPanel
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
HeaderContorl(wxWindow* parent);
|
HeaderControl(wxWindow* parent);
|
||||||
~HeaderContorl() override;
|
~HeaderControl() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // HEADERCONTORL_H
|
#endif // HEADERCONTROL_H
|
@ -1,6 +1,6 @@
|
|||||||
#include "LocalControl.h"
|
#include "LocalControl.h"
|
||||||
|
|
||||||
LocalControl::LocalControl(wxWindow* parent)
|
LocalControl::LocalControl(wxWindow* parent) : wxPanel(parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "LogControl.h"
|
#include "LogControl.h"
|
||||||
|
|
||||||
LogControl::LogControl(wxWindow* parent)
|
LogControl::LogControl(wxWindow* parent) : wxPanel(parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "MineControl.h"
|
#include "MineControl.h"
|
||||||
|
|
||||||
MineControl::MineControl(wxWindow* parent)
|
MineControl::MineControl(wxWindow* parent) : wxPanel(parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "OnLineControl.h"
|
#include "OnLineControl.h"
|
||||||
|
|
||||||
OnlineControl::OnlineControl(wxWindow* parent)
|
OnlineControl::OnlineControl(wxWindow* parent) : wxPanel(parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "RemoteControl.h"
|
#include "RemoteControl.h"
|
||||||
|
|
||||||
RemoteControl::RemoteControl(wxWindow* parent)
|
RemoteControl::RemoteControl(wxWindow* parent) : wxPanel(parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "TaskControl.h"
|
#include "TaskControl.h"
|
||||||
|
|
||||||
TaskControl::TaskControl(wxWindow* parent)
|
TaskControl::TaskControl(wxWindow* parent) : wxPanel(parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,20 +2,29 @@
|
|||||||
|
|
||||||
UserInterface::UserInterface(const wxString& title) : wxFrame(nullptr, wxID_ANY, title, wxDefaultPosition, wxSize(800, 600))
|
UserInterface::UserInterface(const wxString& title) : wxFrame(nullptr, wxID_ANY, title, wxDefaultPosition, wxSize(800, 600))
|
||||||
{
|
{
|
||||||
|
mgr_.SetManagedWindow(this);
|
||||||
|
InitUI();
|
||||||
|
InitData();
|
||||||
}
|
}
|
||||||
|
|
||||||
UserInterface::~UserInterface()
|
UserInterface::~UserInterface()
|
||||||
{
|
{
|
||||||
|
mgr_.UnInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
void UserInterface::InitUI()
|
void UserInterface::InitUI()
|
||||||
{
|
{
|
||||||
|
// Add Panel
|
||||||
|
controlMgr_ = std::make_shared<ControlManager>(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()
|
void UserInterface::InitData()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,12 @@
|
|||||||
#ifndef IUSERINTERFACE_H
|
#ifndef IUSERINTERFACE_H
|
||||||
#define IUSERINTERFACE_H
|
#define IUSERINTERFACE_H
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
#include <wx/aui/aui.h>
|
||||||
#include <wx/wx.h>
|
#include <wx/wx.h>
|
||||||
|
|
||||||
|
#include "ControlManager.h"
|
||||||
|
|
||||||
class UserInterface final : public wxFrame
|
class UserInterface final : public wxFrame
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -12,6 +16,10 @@ public:
|
|||||||
private:
|
private:
|
||||||
void InitUI();
|
void InitUI();
|
||||||
void InitData();
|
void InitData();
|
||||||
|
|
||||||
|
private:
|
||||||
|
wxAuiManager mgr_;
|
||||||
|
std::shared_ptr<ControlManager> controlMgr_;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // IUSERINTERFACE_H
|
#endif // IUSERINTERFACE_H
|
Loading…
x
Reference in New Issue
Block a user