control:基本架子控件。
This commit is contained in:
parent
4442ecd7e5
commit
f33eed6ddb
@ -4,6 +4,8 @@ project(RelayFile VERSION 0.1.0 LANGUAGES CXX)
|
|||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
|
set(CMAKE_PREFIX_PATH "D:/Program/Dev/wxWidgets")
|
||||||
|
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
add_compile_options(/utf-8)
|
add_compile_options(/utf-8)
|
||||||
endif()
|
endif()
|
||||||
|
@ -26,6 +26,16 @@ void ClientCore::Disconnect()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ClientCore::GetOnlineList(InfoClientVec& infoClientVec)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ClientCore::AskDirectory(const wxString& id, const wxString& path, DirFileInfoVec& dirInfoVec)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void ClientCore::OnSocketEvent(wxSocketEvent& event)
|
void ClientCore::OnSocketEvent(wxSocketEvent& event)
|
||||||
{
|
{
|
||||||
switch (event.GetSocketEvent()) {
|
switch (event.GetSocketEvent()) {
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
#ifndef CLIENTCORE_H
|
#ifndef CLIENTCORE_H
|
||||||
#define CLIENTCORE_H
|
#define CLIENTCORE_H
|
||||||
|
|
||||||
|
#include <InfoClient.hpp>
|
||||||
|
#include <InfoDirFile.hpp>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@ -16,8 +18,8 @@ public:
|
|||||||
void Disconnect();
|
void Disconnect();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool GetOnlineList(std::vector<wxString>& list);
|
bool GetOnlineList(InfoClientVec& infoClientVec);
|
||||||
bool AskDirectory(const wxString& id, const wxString& path);
|
bool AskDirectory(const wxString& id, const wxString& path, DirFileInfoVec& dirInfoVec);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void OnSocketEvent(wxSocketEvent& event);
|
void OnSocketEvent(wxSocketEvent& event);
|
||||||
|
28
Information/InfoClient.hpp
Normal file
28
Information/InfoClient.hpp
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#ifndef _InfoClient_hpp_
|
||||||
|
#define _InfoClient_hpp_
|
||||||
|
|
||||||
|
#include <cereal/archives/binary.hpp>
|
||||||
|
#include <cereal/types/memory.hpp>
|
||||||
|
#include <cereal/types/vector.hpp>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
struct InfoClient {
|
||||||
|
std::string id;
|
||||||
|
std::string name;
|
||||||
|
|
||||||
|
template <class Archive> void serialize(Archive& archive)
|
||||||
|
{
|
||||||
|
archive(CEREAL_NVP(id), CEREAL_NVP(name));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct InfoClientVec {
|
||||||
|
std::vector<InfoClient> vec;
|
||||||
|
|
||||||
|
template <class Archive> void serialize(Archive& archive)
|
||||||
|
{
|
||||||
|
archive(CEREAL_NVP(vec));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // _InfoClient_hpp_
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#include <cereal/archives/binary.hpp>
|
#include <cereal/archives/binary.hpp>
|
||||||
#include <cereal/types/memory.hpp>
|
#include <cereal/types/memory.hpp>
|
||||||
#include <cereal/types/unordered_map.hpp>
|
|
||||||
#include <cereal/types/vector.hpp>
|
#include <cereal/types/vector.hpp>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@ -1,13 +1,31 @@
|
|||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
|
||||||
project(RemoteTran LANGUAGES CXX)
|
project(RelayFile LANGUAGES CXX)
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
|
find_package(wxWidgets CONFIG REQUIRED)
|
||||||
|
|
||||||
set(MSOURCES
|
set(MSOURCES
|
||||||
UserInterface.h
|
UserInterface.h
|
||||||
UserInterface.cxx
|
UserInterface.cxx
|
||||||
main.cxx
|
main.cxx
|
||||||
|
HeaderControl.h
|
||||||
|
HeaderControl.cxx
|
||||||
|
LocalControl.h
|
||||||
|
LocalControl.cxx
|
||||||
|
RemoteControl.h
|
||||||
|
RemoteControl.cxx
|
||||||
|
LogControl.h
|
||||||
|
LogControl.cxx
|
||||||
|
OnLineControl.h
|
||||||
|
OnLineControl.cxx
|
||||||
|
TaskControl.h
|
||||||
|
TaskControl.cxx
|
||||||
|
MineControl.h
|
||||||
|
MineControl.cxx
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(UserInterface ${MSOURCES})
|
add_executable(RelayFile ${MSOURCES})
|
||||||
|
target_link_libraries(RelayFile PRIVATE wx::base wx::core)
|
||||||
|
set_target_properties(RelayFile PROPERTIES WIN32_EXECUTABLE TRUE)
|
0
UserInterface/HeaderControl.cxx
Normal file
0
UserInterface/HeaderControl.cxx
Normal file
13
UserInterface/HeaderControl.h
Normal file
13
UserInterface/HeaderControl.h
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#ifndef HEADERCONTORL_H
|
||||||
|
#define HEADERCONTORL_H
|
||||||
|
|
||||||
|
#include <wx/wx.h>
|
||||||
|
|
||||||
|
class HeaderContorl : public wxPanel
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
HeaderContorl(wxWindow* parent);
|
||||||
|
~HeaderContorl() override;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // HEADERCONTORL_H
|
9
UserInterface/LocalControl.cxx
Normal file
9
UserInterface/LocalControl.cxx
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#include "LocalControl.h"
|
||||||
|
|
||||||
|
LocalControl::LocalControl(wxWindow* parent)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
LocalControl::~LocalControl()
|
||||||
|
{
|
||||||
|
}
|
13
UserInterface/LocalControl.h
Normal file
13
UserInterface/LocalControl.h
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#ifndef LOCALCONTROL_H
|
||||||
|
#define LOCALCONTROL_H
|
||||||
|
|
||||||
|
#include <wx/wx.h>
|
||||||
|
|
||||||
|
class LocalControl : public wxPanel
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LocalControl(wxWindow* parent);
|
||||||
|
~LocalControl() override;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // LOCALCONTROL_H
|
9
UserInterface/LogControl.cxx
Normal file
9
UserInterface/LogControl.cxx
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#include "LogControl.h"
|
||||||
|
|
||||||
|
LogControl::LogControl(wxWindow* parent)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
LogControl::~LogControl()
|
||||||
|
{
|
||||||
|
}
|
13
UserInterface/LogControl.h
Normal file
13
UserInterface/LogControl.h
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#ifndef LOGCONTROL_H
|
||||||
|
#define LOGCONTROL_H
|
||||||
|
|
||||||
|
#include <wx/wx.h>
|
||||||
|
|
||||||
|
class LogControl : public wxPanel
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LogControl(wxWindow* parent);
|
||||||
|
~LogControl() override;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // LOGCONTROL_H
|
9
UserInterface/MineControl.cxx
Normal file
9
UserInterface/MineControl.cxx
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#include "MineControl.h"
|
||||||
|
|
||||||
|
MineControl::MineControl(wxWindow* parent)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
MineControl::~MineControl()
|
||||||
|
{
|
||||||
|
}
|
13
UserInterface/MineControl.h
Normal file
13
UserInterface/MineControl.h
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#ifndef MINECONTROL_H
|
||||||
|
#define MINECONTROL_H
|
||||||
|
|
||||||
|
#include <wx/wx.h>
|
||||||
|
|
||||||
|
class MineControl : public wxPanel
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
MineControl(wxWindow* parent);
|
||||||
|
~MineControl() override;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // MINECONTROL_H
|
9
UserInterface/OnLineControl.cxx
Normal file
9
UserInterface/OnLineControl.cxx
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#include "OnLineControl.h"
|
||||||
|
|
||||||
|
OnlineControl::OnlineControl(wxWindow* parent)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
OnlineControl::~OnlineControl()
|
||||||
|
{
|
||||||
|
}
|
13
UserInterface/OnLineControl.h
Normal file
13
UserInterface/OnLineControl.h
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#ifndef ONLINECONTROL_H
|
||||||
|
#define ONLINECONTROL_H
|
||||||
|
|
||||||
|
#include <wx/wx.h>
|
||||||
|
|
||||||
|
class OnlineControl : public wxPanel
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
OnlineControl(wxWindow* parent);
|
||||||
|
~OnlineControl() override;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // ONLINECONTROL_H
|
9
UserInterface/RemoteControl.cxx
Normal file
9
UserInterface/RemoteControl.cxx
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#include "RemoteControl.h"
|
||||||
|
|
||||||
|
RemoteControl::RemoteControl(wxWindow* parent)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
RemoteControl::~RemoteControl()
|
||||||
|
{
|
||||||
|
}
|
13
UserInterface/RemoteControl.h
Normal file
13
UserInterface/RemoteControl.h
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#ifndef REMOTECONTROL_H
|
||||||
|
#define REMOTECONTROL_H
|
||||||
|
|
||||||
|
#include <wx/wx.h>
|
||||||
|
|
||||||
|
class RemoteControl : public wxPanel
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
RemoteControl(wxWindow* parent);
|
||||||
|
~RemoteControl() override;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // REMOTECONTROL_H
|
9
UserInterface/TaskControl.cxx
Normal file
9
UserInterface/TaskControl.cxx
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#include "TaskControl.h"
|
||||||
|
|
||||||
|
TaskControl::TaskControl(wxWindow* parent)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
TaskControl::~TaskControl()
|
||||||
|
{
|
||||||
|
}
|
13
UserInterface/TaskControl.h
Normal file
13
UserInterface/TaskControl.h
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#ifndef TASKCONTROL_H
|
||||||
|
#define TASKCONTROL_H
|
||||||
|
|
||||||
|
#include <wx/wx.h>
|
||||||
|
|
||||||
|
class TaskControl : public wxPanel
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
TaskControl(wxWindow* parent);
|
||||||
|
~TaskControl() override;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // TASKCONTROL_H
|
@ -1,5 +1,21 @@
|
|||||||
#include "UserInterface.h"
|
#include "UserInterface.h"
|
||||||
|
|
||||||
|
UserInterface::UserInterface(const wxString& title) : wxFrame(nullptr, wxID_ANY, title, wxDefaultPosition, wxSize(800, 600))
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
UserInterface::~UserInterface()
|
UserInterface::~UserInterface()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void UserInterface::InitUI()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void UserInterface::InitData()
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
@ -1,10 +1,17 @@
|
|||||||
#ifndef _IUSERINTERFACE_H
|
#ifndef IUSERINTERFACE_H
|
||||||
#define _IUSERINTERFACE_H
|
#define IUSERINTERFACE_H
|
||||||
|
|
||||||
class UserInterface
|
#include <wx/wx.h>
|
||||||
|
|
||||||
|
class UserInterface final : public wxFrame
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
~UserInterface();
|
explicit UserInterface(const wxString& title);
|
||||||
|
~UserInterface() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void InitUI();
|
||||||
|
void InitData();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _IUSERINTERFACE_H
|
#endif // IUSERINTERFACE_H
|
@ -1,6 +1,15 @@
|
|||||||
#include "UserInterface.h"
|
#include "UserInterface.h"
|
||||||
|
|
||||||
int main()
|
class RelayFileApp : public wxApp
|
||||||
{
|
{
|
||||||
return 0;
|
public:
|
||||||
}
|
bool OnInit() override
|
||||||
|
{
|
||||||
|
auto* f = new UserInterface(wxT("RelayFile"));
|
||||||
|
f->Show();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
IMPLEMENT_APP(RelayFileApp);
|
||||||
|
DECLARE_APP(RelayFileApp);
|
Loading…
x
Reference in New Issue
Block a user