-
Notifications
You must be signed in to change notification settings - Fork 163
/
Copy pathFrameControls.h
112 lines (88 loc) · 3.26 KB
/
FrameControls.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/************************************************************************
* Copyright(c) 2022, One Unified. All rights reserved. *
* email: [email protected] *
* *
* This file is provided as is WITHOUT ANY WARRANTY *
* without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* *
* This software may not be used nor distributed without proper license *
* agreement. *
* *
* See the file LICENSE.txt for redistribution information. *
************************************************************************/
/*
* File: FrameControls.h
* Author: [email protected]
* Project: lib/TFVuTrading
* Created: February 11, 2022 15:42
*/
// floating frame with controls
#pragma once
#include <boost/serialization/version.hpp>
#include <boost/serialization/split_member.hpp>
#include <wx/wx.h>
namespace ou { // One Unified
namespace tf { // TradeFrame
#define SYMBOL_FRAMECONTROLS_IDNAME ID_FRAMECONTROLS
#define SYMBOL_FRAMECONTROLS_TITLE _("Frame Controls")
#define SYMBOL_FRAMECONTROLS_POSITION wxDefaultPosition
#define SYMBOL_FRAMECONTROLS_SIZE wxDefaultSize
#define SYMBOL_FRAMECONTROLS_STYLE wxRESIZE_BORDER|wxFRAME_TOOL_WINDOW|wxFRAME_FLOAT_ON_PARENT|wxFRAME_NO_TASKBAR|wxSTAY_ON_TOP|wxTAB_TRAVERSAL
class FrameControls: public wxFrame {
friend class boost::serialization::access;
public:
FrameControls();
FrameControls(
wxWindow* parent,
wxWindowID id = SYMBOL_FRAMECONTROLS_IDNAME,
const wxString& caption = SYMBOL_FRAMECONTROLS_TITLE,
const wxPoint& pos = SYMBOL_FRAMECONTROLS_POSITION,
const wxSize& size = SYMBOL_FRAMECONTROLS_SIZE,
long style = SYMBOL_FRAMECONTROLS_STYLE );
bool Create(
wxWindow* parent,
wxWindowID id = SYMBOL_FRAMECONTROLS_IDNAME,
const wxString& caption = SYMBOL_FRAMECONTROLS_TITLE,
const wxPoint& pos = SYMBOL_FRAMECONTROLS_POSITION,
const wxSize& size = SYMBOL_FRAMECONTROLS_SIZE,
long style = SYMBOL_FRAMECONTROLS_STYLE );
virtual ~FrameControls(void);
void Attach( wxWindow* );
protected:
private:
enum { ID_Null=wxID_HIGHEST,
ID_FRAMECONTROLS
};
wxBoxSizer* m_sizerFrame;
void Init();
void CreateControls();
static bool ShowToolTips();
//void OnDestroy( wxWindowDestroyEvent& event );
void OnClose( wxCloseEvent& event );
template<typename Archive>
void save( Archive& ar, const unsigned int version ) const {
wxPoint point = this->GetPosition();
ar & point.x;
ar & point.y;
wxSize size = this->GetSize();
ar & size.x;
ar & size.y;
}
template<typename Archive>
void load( Archive& ar, const unsigned int version ) {
int x, y;
ar & x;
ar & y;
wxPoint point( x, y );
ar & x;
ar & y;
wxSize size( x, y );
SetSize( size );
SetPosition( point );
}
BOOST_SERIALIZATION_SPLIT_MEMBER()
};
} // namespace tf
} // namespace ou
BOOST_CLASS_VERSION(ou::tf::FrameControls, 1)