483_uppsrc_2.diff

The diff file to apply for uppsrc directory (second patch) - Sender Ghost, 06/01/2013 10:30 AM

Download (2.48 KB)

View differences:

uppsrc/CtrlCore/lay.h 2013-06-01 11:48:44 +0400
14 14

  
15 15
#define LAYOUT(name, x, y)       template<class T> \
16 16
	                             struct With##name : public T, public name##__layid { \
17
										static UPP::Size GetLayoutSize() { return UPP::Ctrl::LayoutZoom(x, y); }
17
										static UPP::Size GetLayoutSize(bool zoom = true) \
18
										{ return zoom ? UPP::Ctrl::LayoutZoom(x, y) : UPP::Size(x, y); }
18 19
#define UNTYPED(variable, param)
19 20
#define ITEM(classname, var, param)     classname var;
20 21
#define END_LAYOUT               };
uppsrc/CtrlCore/TopWindow.h 2013-06-01 11:49:49 +0400
190 190
}
191 191

  
192 192
template <class T>
193
void CtrlLayout(T& ctrl) {
193
void CtrlLayout(T& ctrl, bool zoom = true) {
194 194
	InitLayout(ctrl, ctrl, ctrl, ctrl);
195
	Size sz = ctrl.AddFrameSize(T::GetLayoutSize());
195
	Size sz = ctrl.AddFrameSize(T::GetLayoutSize(zoom));
196 196
	ctrl.SetMinSize(sz);
197 197
	ctrl.SetRect(sz);
198 198
}
199 199

  
200 200
template <class T>
201
void CtrlLayout(T& ctrl, const char *title) {
202
	CtrlLayout(ctrl);
201
void CtrlLayout(T& ctrl, const char *title, bool zoom = true) {
202
	CtrlLayout(ctrl, zoom);
203 203
	ctrl.Title(title);
204 204
}
205 205

  
206 206
template <class T>
207
void CtrlLayoutOK(T& ctrl, const char *title) {
208
	CtrlLayout(ctrl, title);
207
void CtrlLayoutOK(T& ctrl, const char *title, bool zoom = true) {
208
	CtrlLayout(ctrl, title, zoom);
209 209
	ctrl.Acceptor(ctrl.ok, IDOK);
210 210
	ctrl.ok.Ok();
211 211
}
212 212

  
213 213
template <class T>
214
void CtrlLayoutCancel(T& ctrl, const char *title) {
215
	CtrlLayout(ctrl, title);
214
void CtrlLayoutCancel(T& ctrl, const char *title, bool zoom = true) {
215
	CtrlLayout(ctrl, title, zoom);
216 216
	ctrl.Rejector(ctrl.cancel, IDCANCEL);
217 217
	ctrl.cancel.Cancel();
218 218
}
219 219

  
220 220
template <class T>
221
void CtrlLayoutOKCancel(T& ctrl, const char *title) {
222
	CtrlLayoutOK(ctrl, title);
221
void CtrlLayoutOKCancel(T& ctrl, const char *title, bool zoom = true) {
222
	CtrlLayoutOK(ctrl, title, zoom);
223 223
	ctrl.Rejector(ctrl.cancel, IDCANCEL);
224 224
	ctrl.cancel.Cancel();
225 225
	ArrangeOKCancel(ctrl.ok, ctrl.cancel);
226 226
}
227 227

  
228 228
template <class T>
229
void CtrlLayoutExit(T& ctrl, const char *title) {
230
	CtrlLayout(ctrl, title);
229
void CtrlLayoutExit(T& ctrl, const char *title, bool zoom = true) {
230
	CtrlLayout(ctrl, title, zoom);
231 231
	ctrl.Acceptor(ctrl.exit, IDEXIT);
232 232
	ctrl.exit.Exit();
233 233
}