-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUWindowPageControl.uc
175 lines (138 loc) · 4.48 KB
/
UWindowPageControl.uc
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
class UWindowPageControl extends UWindowTabControl;
function ResolutionChanged(float W, float H)
{
local UWindowPageControlPage I;
for(I = UWindowPageControlPage(Items.Next); I != None; I = UWindowPageControlPage(I.Next))
if(I.Page != None && I != SelectedTab )
I.Page.ResolutionChanged(W, H);
if(SelectedTab != None)
UWindowPageControlPage(SelectedTab).Page.ResolutionChanged(W, H);
}
function NotifyQuitUnreal()
{
local UWindowPageControlPage I;
for(I = UWindowPageControlPage(Items.Next); I != None; I = UWindowPageControlPage(I.Next))
if(I.Page != None)
I.Page.NotifyQuitUnreal();
}
function NotifyBeforeLevelChange()
{
local UWindowPageControlPage I;
for(I = UWindowPageControlPage(Items.Next); I != None; I = UWindowPageControlPage(I.Next))
if(I.Page != None)
I.Page.NotifyBeforeLevelChange();
}
function NotifyAfterLevelChange()
{
local UWindowPageControlPage I;
for(I = UWindowPageControlPage(Items.Next); I != None; I = UWindowPageControlPage(I.Next))
if(I.Page != None)
I.Page.NotifyAfterLevelChange();
}
function GetDesiredDimensions(out float W, out float H)
{
local float MaxW, MaxH, TW, TH;
local UWindowPageControlPage I;
MaxW = 0;
MaxH = 0;
for(I = UWindowPageControlPage(Items.Next); I != None; I = UWindowPageControlPage(I.Next))
{
if(I.Page != None)
I.Page.GetDesiredDimensions(TW, TH);
if(TW > MaxW) MaxW = TW;
if(TH > MaxH) MaxH = TH;
}
W = MaxW;
H = MaxH + TabArea.WinHeight;
}
function BeforePaint(Canvas C, float X, float Y)
{
local float OldWinHeight;
local UWindowPageControlPage I;
OldWinHeight = WinHeight;
Super.BeforePaint(C, X, Y);
WinHeight = OldWinHeight;
for(I = UWindowPageControlPage(Items.Next); I != None; I = UWindowPageControlPage(I.Next))
LookAndFeel.Tab_SetTabPageSize(Self, I.Page);
}
function Paint(Canvas C, float X, float Y)
{
Super.Paint(C, X, Y);
LookAndFeel.Tab_DrawTabPageArea(Self, C, UWindowPageControlPage(SelectedTab).Page);
}
function UWindowPageControlPage AddPage(string Caption, class<UWindowPageWindow> PageClass, optional name ObjectName)
{
local UWindowPageControlPage P;
P = UWindowPageControlPage(AddTab(Caption));
P.Page = UWindowPageWindow(CreateWindow(PageClass, 0,
TabArea.WinHeight-(LookAndFeel.TabSelectedM.H-LookAndFeel.TabUnselectedM.H),
WinWidth, WinHeight-(TabArea.WinHeight-(LookAndFeel.TabSelectedM.H-LookAndFeel.TabUnselectedM.H)),,,ObjectName));
P.Page.OwnerTab = P;
if(P != SelectedTab)
P.Page.HideWindow();
else
if(UWindowPageControlPage(SelectedTab) != None && WindowIsVisible())
{
UWindowPageControlPage(SelectedTab).Page.ShowWindow();
UWindowPageControlPage(SelectedTab).Page.BringToFront();
}
return P;
}
function UWindowPageControlPage InsertPage(UWindowPageControlPage BeforePage, string Caption, class<UWindowPageWindow> PageClass, optional name ObjectName)
{
local UWindowPageControlPage P;
if(BeforePage == None)
return AddPage(Caption, PageClass);
P = UWindowPageControlPage(InsertTab(BeforePage, Caption));
P.Page = UWindowPageWindow(CreateWindow(PageClass, 0,
TabArea.WinHeight-(LookAndFeel.TabSelectedM.H-LookAndFeel.TabUnselectedM.H),
WinWidth, WinHeight-(TabArea.WinHeight-(LookAndFeel.TabSelectedM.H-LookAndFeel.TabUnselectedM.H)),,,ObjectName));
P.Page.OwnerTab = P;
if(P != SelectedTab)
P.Page.HideWindow();
else
if(UWindowPageControlPage(SelectedTab) != None && WindowIsVisible())
{
UWindowPageControlPage(SelectedTab).Page.ShowWindow();
UWindowPageControlPage(SelectedTab).Page.BringToFront();
}
return P;
}
function UWindowPageControlPage GetPage(string Caption)
{
return UWindowPageControlPage(GetTab(Caption));
}
function DeletePage(UWindowPageControlPage P)
{
P.Page.Close(True);
P.Page.HideWindow();
DeleteTab(P);
}
function Close(optional bool bByParent)
{
local UWindowPageControlPage I;
for(I = UWindowPageControlPage(Items.Next); I != None; I = UWindowPageControlPage(I.Next))
if(I.Page != None)
I.Page.Close(True);
Super.Close(bByParent);
}
function GotoTab(UWindowTabControlItem NewSelected, optional bool bByUser)
{
local UWindowPageControlPage I;
Super.GotoTab(NewSelected, bByUser);
for(I = UWindowPageControlPage(Items.Next);I != None;I = UWindowPageControlPage(I.Next))
{
if(I != NewSelected)
I.Page.HideWindow();
}
if(UWindowPageControlPage(NewSelected) != None)
UWindowPageControlPage(NewSelected).Page.ShowWindow();
}
function UWindowPageControlPage FirstPage()
{
return UWindowPageControlPage(Items.Next);
}
defaultproperties
{
ListClass=Class'UWindow.UWindowPageControlPage'
}