-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExtensionConfig.cpp
More file actions
95 lines (86 loc) · 2.26 KB
/
ExtensionConfig.cpp
File metadata and controls
95 lines (86 loc) · 2.26 KB
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
#include "stdafx.h"
#include "ExtensionConfig.h"
#include "MainDialog.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
extern MainDialog* mainDialog;
ExtensionConfig::ExtensionConfig()
{
AddSettings();
}
ExtensionConfig::ExtensionConfig(const ExtensionConfig& other):
m_x(other.m_x),
m_y(other.m_y),
m_w(other.m_w),
m_h(other.m_h),
m_alwaysOnTop(other.m_alwaysOnTop),
m_tab(other.m_tab),
m_msSecondBack(other.m_msSecondBack),
m_msLoadOnStart(other.m_msLoadOnStart),
m_msStockFilePath(other.m_msStockFilePath),
m_msTimerMap(other.m_msTimerMap),
m_mdAccountId(other.m_mdAccountId),
m_mdSymbol(other.m_mdSymbol)
{
AddSettings();
}
void ExtensionConfig::AddSettings()
{
AddSetting("X", m_x);
AddSetting("Y", m_y);
AddSetting("W", m_w);
AddSetting("H", m_h);
AddSetting("AlwaysOnTop", m_alwaysOnTop);
AddSetting("Tab", m_tab);
AddSetting("MS_SecondBack", m_msSecondBack);
AddSetting("MS_LoadOnStart", m_msLoadOnStart);
AddSetting("MS_StockFilePath", m_msStockFilePath);
AddSetting("MS_TimerMap", m_msTimerMap);
AddSetting("MD_AccountId", m_mdAccountId);
AddSetting("MD_Symbol", m_mdSymbol);
}
ConfigBase* ExtensionConfig::Clone() const
{
ExtensionConfig* clone = new ExtensionConfig;
clone->Copy(*this);
return clone;
}
void ExtensionConfig::Copy(const ConfigBase& other)
{
// TakionConfig::Copy(other);
operator=((const ExtensionConfig&)other);
}
const ExtensionConfig& ExtensionConfig::operator=(const ExtensionConfig& other)
{
ConfigBase::operator=(other);
// m_orderReplaceTemplateVersion = other.m_orderReplaceTemplateVersion;
return *this;
}
void ExtensionConfig::Update()
{
ConfigBase::Update();
if(mainDialog)
{
// mainDialog->UpdateCurrentLeafSettings();
const CRect& frameRect = mainDialog->GetFrameRect();
m_x.SetValue(frameRect.left);
m_y.SetValue(frameRect.top);
m_w.SetValue((unsigned int)frameRect.Width());
m_h.SetValue((unsigned int)frameRect.Height());
TakionSettingDialog* leaf = mainDialog->GetCurrentLeaf();
if(leaf)
{
if(leaf->isModified())
{
leaf->UpdateSettings();
leaf->SetModified(false);
}
std::string tabPath;
if(leaf->GetTabPath(tabPath, false) && !tabPath.empty())
{
m_tab.SetValue(tabPath);
}
}
}
}