-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTabPageLinux.cpp
More file actions
106 lines (77 loc) · 2.34 KB
/
Copy pathTabPageLinux.cpp
File metadata and controls
106 lines (77 loc) · 2.34 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
96
97
98
99
100
101
102
103
104
105
106
#include "TabPageLinux.h"
TabPageLinux::TabPageLinux( window wd,MainFormBase* parentForm )
:
TabPageBase( wd,parentForm )
{
MainSetup( "vertical < weight = 19% placeEmpty_00>"
" < weight = 10% placeLabelHead margin = [0%,5%,0%,5%]>"
" < weight = 20% placeLabel margin = [0%,5%,0%,5%]>"
" < weight = 2% placeEmpty_01>"
" < weight = 20% placeButtons gap = 2%>"
" < weight = 19% placeEmpty_02>" );
}
TabPageLinux::~TabPageLinux()
{
}
void TabPageLinux::InitTabPage()
{
// setup gtc
m_gtc.Initialize( TABPAGE_LINUX_FILEPATH_BASE );
m_gtc.FetchRequests();
m_gtc.GetInstancesByOS();
for( int i = 0; i < 2; ++i )
{
auto p = std::make_shared<button>( *this );
m_vButtons.push_back( p );
}
auto pCurBtn = m_vButtons[ 0 ];
m_place.field( "placeButtons" ) << *pCurBtn;
pCurBtn->events().click( [ this ]{
m_gtc.ConnectToInstance( 0 );
// DC:
// m_gtc.DisconnectFromInstance();
// m_parent->SwitchToTabPage( 0 );
} );
pCurBtn = m_vButtons[ 1 ];
m_place.field( "placeButtons" ) << *pCurBtn;
pCurBtn->events().click( [ this ](){
m_parent->ChangeTabPage( 1,5 );
} );
for( int i = 0; i < 2; ++i )
{
auto p = std::make_shared<label>( *this );
m_vLabels.push_back( p );
}
auto pCurLbl = m_vLabels[ 0 ];
m_place.field( "placeLabelHead" ) << *pCurLbl;
pCurLbl = m_vLabels[ 1 ];
m_place.field( "placeLabel" ) << *pCurLbl;
}
void TabPageLinux::UpdateStringsWidgets()
{
std::string basePath = TABPAGE_LINUX_FILEPATH_BASE + GET_CURLANGUAGE_STR + "/";
//---------//
// BUTTONS //
//---------//
std::vector<std::string> buttonStrings = FIO_ReadFromFileToVector( basePath + FILE_BUTTONS );
auto pCurBtn = m_vButtons[ 0 ];
auto pCurBtnText = buttonStrings[ 0 ];
pCurBtn->caption( ( pCurBtnText ) );
pCurBtn = m_vButtons[ 1 ];
pCurBtnText = buttonStrings[ 1 ];
pCurBtn->caption( ( pCurBtnText ) );
//--------//
// LABELS //
//--------//
std::vector<std::string> labelStrings = FIO_ReadFromFileToVector( basePath + FILE_LABELS );
auto pCurLbl = m_vLabels[ 0 ];
auto pCurLblText = labelStrings[ 0 ];
pCurLbl->format( true );
pCurLbl->caption( ( "<bold,size=12>" + pCurLblText + "</>" ) );
pCurLbl = m_vLabels[ 1 ];
pCurLblText = labelStrings[ 1 ];
pCurLbl->caption( ( pCurLblText ) );
}
void TabPageLinux::UpdateStringsModalForms()
{
}