Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
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// - title is ""
8// - marginTop is
9// - intendedHeight ends up to be the tab's actual height, or at least close
10// - titleFontSize is 0
11// - marginTop cancels out as much of titleHeight as needed (that is, it should be actualMarginTop - titleHeight)
12// To ensure the latter, you best create all tabs FIRST and insert the tabbed
13// control to your dialog THEN - with the right height
14//
15// a subclass may help with using this as a tab
16
17#include "inputcontainer.qh"
19 METHOD(Dialog, configureDialog, void(entity)); // no runtime configuration, all parameters are given in the code!
20 METHOD(Dialog, fill, void(entity)); // to be overridden by user to fill the dialog with controls
21 METHOD(Dialog, keyDown, float(entity, float, float, float));
23 METHOD(Dialog, addItemSimple, void(entity, float, float, float, float, entity, vector));
24
25 METHOD(Dialog, TD, void(entity, float, float, entity));
26 METHOD(Dialog, TDNoMargin, void(entity, float, float, entity, vector));
27 METHOD(Dialog, TDempty, void(entity, float));
30 METHOD(Dialog, gotoRC, void(entity, float, float));
31
33 ATTRIB(Dialog, closeButton, entity);
41
42 // to be customized
44 ATTRIB(Dialog, title, string, "Form1");
45 ATTRIB(Dialog, name, string, ""); // if set to a string without spaces this dialog can be opened via menu_cmd directmenu
46 ATTRIB(Dialog, color, vector, '1 0.5 1');
48 ATTRIB(Dialog, rows, float, 3);
49 ATTRIB(Dialog, columns, float, 2);
50
51 ATTRIB(Dialog, marginTop, float, 0); // pixels
52 ATTRIB(Dialog, marginBottom, float, 0); // pixels
53 ATTRIB(Dialog, marginLeft, float, 0); // pixels
54 ATTRIB(Dialog, marginRight, float, 0); // pixels
55 ATTRIB(Dialog, columnSpacing, float, 0); // pixels
56 ATTRIB(Dialog, rowSpacing, float, 0); // pixels
57 ATTRIB(Dialog, rowHeight, float, 0); // pixels
58 ATTRIB(Dialog, titleHeight, float, 0); // pixels
59 ATTRIB(Dialog, titleFontSize, float, 0); // pixels; if 0, title causes no margin
62
63 ATTRIB(Dialog, requiresConnection, bool, false); // set to true if the dialog requires a connection to be opened
64
65 ATTRIB(Dialog, backgroundImage, string);
67 ATTRIB(Dialog, closeButtonImage, string);
68
71
72void Dialog_Close(entity button, entity me);
73
float frame
primary framegroup animation (strength = 1 - lerpfrac - lerpfrac3 - lerpfrac4)
Definition anim.qh:6
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
float rowHeight
Definition dialog.qh:57
virtual void TD()
float columnSpacing
Definition dialog.qh:55
vector itemOrigin
Definition dialog.qh:35
vector itemSize
Definition dialog.qh:36
virtual void addItemSimple()
virtual void TDempty()
virtual void keyDown()
ATTRIB(Dialog, closeButton, entity)
virtual void TDNoMargin()
float borderLines
Definition dialog.qh:66
float marginLeft
Definition dialog.qh:53
virtual void configureDialog()
float firstColumn
Definition dialog.qh:40
bool isTabRoot
Definition dialog.qh:32
bool requiresConnection
Definition dialog.qh:63
virtual void TR()
virtual void setFirstColumn()
bool closable
Definition dialog.qh:43
float marginRight
Definition dialog.qh:54
vector itemSpacing
Definition dialog.qh:37
virtual void fill()
virtual void close()
float titleHeight
Definition dialog.qh:58
float marginTop
Definition dialog.qh:51
bool zoomedOutTitleBar
Definition dialog.qh:61
float marginBottom
Definition dialog.qh:52
float currentRow
Definition dialog.qh:38
float rows
Definition dialog.qh:48
float titleFontSize
Definition dialog.qh:59
float columns
Definition dialog.qh:49
float intendedWidth
Definition dialog.qh:47
float currentColumn
Definition dialog.qh:39
float zoomedOutTitleBarPosition
Definition dialog.qh:60
string title
Definition dialog.qh:44
string name
Definition dialog.qh:45
float intendedHeight
Definition dialog.qh:34
virtual void gotoRC()
float rowSpacing
Definition dialog.qh:56
vector color
Definition dialog.qh:46
#define true
Definition csprogsdefs.qh:5
#define false
Definition csprogsdefs.qh:6
bool hideMenuOnClose
Definition dialog.qh:74
void Dialog_Close(entity button, entity me)
Definition dialog.qc:7
#define CLASS(...)
Definition oo.qh:145
#define ENDCLASS(cname)
Definition oo.qh:281
#define METHOD(cname, name, prototype)
Definition oo.qh:269
vector
Definition self.qh:92