Xonotic
dialog.qh
Go to the documentation of this file.
1 #pragma once
2 
3 // Note: this class is called Dialog, but it can also handle a tab under the following conditions:
4 // - isTabRoot is 0
5 // - backgroundImage is the tab's background
6 // - closable is 0
7 // - rootDialog is 0
8 // - title is ""
9 // - marginTop is
10 // - intendedHeight ends up to be the tab's actual height, or at least close
11 // - titleFontSize is 0
12 // - marginTop cancels out as much of titleHeight as needed (that is, it should be actualMarginTop - titleHeight)
13 // To ensure the latter, you best create all tabs FIRST and insert the tabbed
14 // control to your dialog THEN - with the right height
15 //
16 // a subclass may help with using this as a tab
17 
18 #include "inputcontainer.qh"
20  METHOD(Dialog, configureDialog, void(entity)); // no runtime configuration, all parameters are given in the code!
21  METHOD(Dialog, fill, void(entity)); // to be overridden by user to fill the dialog with controls
22  METHOD(Dialog, keyDown, float(entity, float, float, float));
23  METHOD(Dialog, close, void(entity));
24  METHOD(Dialog, addItemSimple, void(entity, float, float, float, float, entity, vector));
25 
26  METHOD(Dialog, TD, void(entity, float, float, entity));
27  METHOD(Dialog, TDNoMargin, void(entity, float, float, entity, vector));
28  METHOD(Dialog, TDempty, void(entity, float));
29  METHOD(Dialog, setFirstColumn, void(entity, float));
30  METHOD(Dialog, TR, void(entity));
31  METHOD(Dialog, gotoRC, void(entity, float, float));
32 
33  ATTRIB(Dialog, isTabRoot, float, 1);
34  ATTRIB(Dialog, closeButton, entity);
35  ATTRIB(Dialog, intendedHeight, float, 0);
36  ATTRIB(Dialog, itemOrigin, vector, '0 0 0');
37  ATTRIB(Dialog, itemSize, vector, '0 0 0');
38  ATTRIB(Dialog, itemSpacing, vector, '0 0 0');
39  ATTRIB(Dialog, currentRow, float, 0);
40  ATTRIB(Dialog, currentColumn, float, 0);
41  ATTRIB(Dialog, firstColumn, float, 0);
42 
43  // to be customized
44  ATTRIB(Dialog, closable, float, 1);
45  ATTRIB(Dialog, title, string, "Form1");
46  ATTRIB(Dialog, name, string, ""); // if set to a string without spaces this dialog can be opened via menu_cmd directmenu
47  ATTRIB(Dialog, color, vector, '1 0.5 1');
48  ATTRIB(Dialog, intendedWidth, float, 0);
49  ATTRIB(Dialog, rows, float, 3);
50  ATTRIB(Dialog, columns, float, 2);
51 
52  ATTRIB(Dialog, marginTop, float, 0); // pixels
53  ATTRIB(Dialog, marginBottom, float, 0); // pixels
54  ATTRIB(Dialog, marginLeft, float, 0); // pixels
55  ATTRIB(Dialog, marginRight, float, 0); // pixels
56  ATTRIB(Dialog, columnSpacing, float, 0); // pixels
57  ATTRIB(Dialog, rowSpacing, float, 0); // pixels
58  ATTRIB(Dialog, rowHeight, float, 0); // pixels
59  ATTRIB(Dialog, titleHeight, float, 0); // pixels
60  ATTRIB(Dialog, titleFontSize, float, 0); // pixels; if 0, title causes no margin
61  ATTRIB(Dialog, zoomedOutTitleBarPosition, float, 0);
62  ATTRIB(Dialog, zoomedOutTitleBar, float, 0);
63 
64  ATTRIB(Dialog, requiresConnection, float, 0); // set to true if the dialog requires a connection to be opened
65 
66  ATTRIB(Dialog, backgroundImage, string);
67  ATTRIB(Dialog, borderLines, float, 1);
68  ATTRIB(Dialog, closeButtonImage, string);
69 
70  ATTRIB(Dialog, hideMenuOnClose, bool, false);
71 
74 
75 void Dialog_Close(entity button, entity me);
vector color
Definition: dialog.qh:19
CLASS(Object) Object
Definition: oo.qh:318
entity() spawn
#define METHOD(cname, name, prototype)
Definition: oo.qh:257
#define ATTRIB(...)
Definition: oo.qh:136
void Dialog_Close(entity button, entity me)
Definition: dialog.qc:7
vector(float skel, float bonenum) _skel_get_boneabs_hidden
#define ENDCLASS(cname)
Definition: oo.qh:269
float frame
primary framegroup animation (strength = 1 - lerpfrac - lerpfrac3 - lerpfrac4)
Definition: anim.qh:6