User Interface Macros – Take On Helicopters

From Bohemia Interactive Community
Jump to navigation Jump to search
(Created page with "Category:Take On Helicopters: Editing Take On Helicopters offers unbinarized user interface macros and parent classes for anybody who wants to include them in their [[Config....")
 
m (Lou Montana moved page User Interface Macros to Take On Helicopters: User Interface Macros: Name standard)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Category:Take On Helicopters: Editing]]
{{TOC|side||2}}
Take On Helicopters offers unbinarized user interface macros and parent classes for anybody who wants to include them in their [[Config.cpp]] or [[Description.ext]].
{{tkoh}} offers unbinarized user interface macros and parent classes for anybody who wants to include them in their [[Config.cpp]] or [[Description.ext]].


Knowledge of [[PreProcessor Commands]] is required for use.
Knowledge of [[PreProcessor Commands]] is required for use.


{{Clear}}
== defineDIKCodes.inc ==
== defineDIKCodes.inc ==
#include "\hsim\UI_H\hpp\defineDIKCodes.inc"
 
<syntaxhighlight lang="cpp">
#include "\hsim\UI_H\hpp\defineDIKCodes.inc"
</syntaxhighlight>
DIK codes of every keyboard key. Useful for [[User Interface Event Handlers]] and button shortcuts.
DIK codes of every keyboard key. Useful for [[User Interface Event Handlers]] and button shortcuts.
=== Sample code ===
=== Sample code ===
shortcuts[] = {INPUT_CTRL_OFFSET + DIK_P}; {{codecomment|//--- Button is activated when Ctrl+S is pressed}}
 
<syntaxhighlight lang="cpp">
shortcuts[] = {INPUT_CTRL_OFFSET + DIK_P}; //--- Button is activated when Ctrl+S is pressed
</syntaxhighlight>




== defineResincl.inc ==
== defineResincl.inc ==
#include "\hsim\UI_H\hpp\defineResincl.inc"
 
Latest defined [[Dialog_Control#Constants|constants]] for use in [[Display]] and [[Control]] classes. Amont others contains control types, colors, grids
<syntaxhighlight lang="cpp">
#include "\hsim\UI_H\hpp\defineResincl.inc"
</syntaxhighlight>
Latest defined [[Arma: GUI Configuration#Constants|constants]] for use in [[Display]] and [[Control]] classes. Amongst others contains control types, colors, grids
 
=== Sample code ===
=== Sample code ===
shortcuts[] = {INPUT_CTRL_OFFSET + DIK_P}; {{codecomment|//--- Button is activated when Ctrl+S is pressed}}
 
<syntaxhighlight lang="cpp">
style = ST_LEFT + ST_MULTI; //--- Text in control can contain multiple lines and is alligned to left
</syntaxhighlight>




== defineCommon.inc ==
== defineCommon.inc ==
''Requires defineResincl.inc''
''Requires defineResincl.inc''
#include "\hsim\UI_H\hpp\defineCommon.inc"
<syntaxhighlight lang="cpp">
#include "\hsim\UI_H\hpp\defineCommon.inc"
</syntaxhighlight>
Game specific [[User Interface Grids|grids]], [[User Interface Colors|colors]], text sizes etc.
Game specific [[User Interface Grids|grids]], [[User Interface Colors|colors]], text sizes etc.
=== Sample code ===
=== Sample code ===
{{codecomment|//--- Control position alligned to defined grid}}
 
x = 1 * GUI_GRID_W + GUI_GRID_X;
<syntaxhighlight lang="cpp">
y = 18 * GUI_GRID_H + GUI_GRID_Y;
//--- Control position alligned to defined grid
w = 10 * GUI_GRID_W;
x = 1 * GUI_GRID_W + GUI_GRID_X;
h = 1 * GUI_GRID_H;
y = 18 * GUI_GRID_H + GUI_GRID_Y;
w = 10 * GUI_GRID_W;
h = 1 * GUI_GRID_H;
</syntaxhighlight>




== rscCommon.inc ==
== rscCommon.inc ==
''Requires defineResincl.inc and defineCommon.inc''
''Requires defineResincl.inc and defineCommon.inc''
#include "\hsim\UI_H\hpp\rscCommon.inc"
<syntaxhighlight lang="cpp">
Basic [[Dialog_Control#Controls|parent classes]].
#include "\hsim\UI_H\hpp\rscCommon.inc"
</syntaxhighlight>
Basic [[Arma: GUI Configuration#Controls|parent classes]].
 
=== Sample code ===
=== Sample code ===
{{codecomment|//--- Control inherited from RscText base class}}
 
class textColorG: RscText
<syntaxhighlight lang="cpp">
{
//--- Control inherited from RscText base class
};
class textColorG : RscText
{
};
</syntaxhighlight>
 
 
{{GameCategory|tkoh|Editing}}

Latest revision as of 16:12, 7 December 2024

Take On Helicopters offers unbinarized user interface macros and parent classes for anybody who wants to include them in their Config.cpp or Description.ext.

Knowledge of PreProcessor Commands is required for use.

defineDIKCodes.inc

#include "\hsim\UI_H\hpp\defineDIKCodes.inc"

DIK codes of every keyboard key. Useful for User Interface Event Handlers and button shortcuts.

Sample code

shortcuts[] = {INPUT_CTRL_OFFSET + DIK_P}; //--- Button is activated when Ctrl+S is pressed


defineResincl.inc

#include "\hsim\UI_H\hpp\defineResincl.inc"

Latest defined constants for use in Display and Control classes. Amongst others contains control types, colors, grids

Sample code

style = ST_LEFT + ST_MULTI; //--- Text in control can contain multiple lines and is alligned to left


defineCommon.inc

Requires defineResincl.inc

#include "\hsim\UI_H\hpp\defineCommon.inc"

Game specific grids, colors, text sizes etc.

Sample code

//--- Control position alligned to defined grid
x = 1 * GUI_GRID_W + GUI_GRID_X;
y = 18 * GUI_GRID_H + GUI_GRID_Y;
w = 10 * GUI_GRID_W;
h = 1 * GUI_GRID_H;


rscCommon.inc

Requires defineResincl.inc and defineCommon.inc

#include "\hsim\UI_H\hpp\rscCommon.inc"

Basic parent classes.

Sample code

//--- Control inherited from RscText base class
class textColorG : RscText
{
};