CT EDIT: Difference between revisions
m (Text replacement - "{{CT|intro" to "Category: Control Types {{CT|intro ") |
m (added comment on how to remove the frame around RscEdit) |
||
(4 intermediate revisions by 3 users not shown) | |||
Line 6: | Line 6: | ||
|value = 2 | |value = 2 | ||
|description = | |description = | ||
An '''edit'''able text '''box''', which allows the user to either enter text himself or to select and copy its content. | An '''edit'''able text '''box''', which allows the user to either enter text himself or to select and copy its content. | ||
[[ | |gallery=CT_EDIT.jpg{{!}}Two edit boxes with text. The upper one has some text selected. | ||
|commands = | CT EDIT code.png{{!}}[[CT_EDIT]] with the [[#autocomplete|autocomplete]] option. | ||
|commands = * [[endl]] (to insert line breaks) | |||
|events = | |events = | ||
}} | }} | ||
Line 31: | Line 32: | ||
|type1=Number | |type1=Number | ||
|value1=1 | |value1=1 | ||
|description=When 0, only LEFT | |description=When 0, only (optionally combined with {{Controls|SHIFT}}) {{Controls|LEFT}}, {{Controls|RIGHT}}, {{Controls|HOME}}, {{Controls|END}} and {{Controls|CTRL|C}} can be used | ||
}} | }} | ||
Line 100: | Line 101: | ||
text = ""; | text = ""; | ||
size = 0.2; | size = 0.2; | ||
style = ST_FRAME; | style = ST_FRAME; // use ST_NO_RECT to remove the small frame | ||
font = "RobotoCondensed"; | font = "RobotoCondensed"; | ||
shadow = 2; | shadow = 2; |
Latest revision as of 16:11, 3 June 2024
Control Types / MACRO (TYPE VALUE) | |
---|---|
Text/Image/Video |
CT_STATIC (0) | CT_EDIT (2) | CT_HTML (9) | CT_STRUCTURED_TEXT (13) |
Buttons |
CT_BUTTON (1) | CT_ACTIVETEXT (11) | CT_SHORTCUTBUTTON (16) | CT_CHECKBOX (77) | CT_XBUTTON (41) |
Lists |
CT_COMBO (4) | CT_TOOLBOX (6) | CT_CHECKBOXES (7) | CT_TREE (12) | CT_CONTROLS_TABLE (19) | CT_XCOMBO (44) | CT_LISTBOX (5) | CT_LISTNBOX (102) | CT_LISTNBOX_CHECKABLE (104) | CT_XLISTBOX (45) |
3D Objects |
CT_OBJECT (80) | CT_OBJECT_ZOOM (81) | CT_OBJECT_CONTAINER (82) | CT_OBJECT_CONT_ANIM (83) |
Maps |
CT_MAP (100) | CT_MAP_MAIN (101) |
Meta |
CT_SLIDER (3) | CT_XSLIDER (43) | CT_PROGRESS (8) | CT_CONTROLS_GROUP (15) | CT_WEBBROWSER (106) | CT_EXTENSION (107) |
Menu |
CT_CONTEXT_MENU (14) | CT_MENU (46) | CT_MENU_STRIP (47) |
Unknown |
CT_STATIC_SKEW (10) | CT_HITZONES (17) | CT_VEHICLETOGGLES (18) | CT_XKEYDESC (40) | CT_ANIMATED_TEXTURE (45) | CT_LINEBREAK (98) | CT_USER (99) | CT_ITEMSLOT (103) | CT_VEHICLE_DIRECTION (105) |
Introduction
An editable text box, which allows the user to either enter text himself or to select and copy its content.
Related commands & functions
- Commands: General
- Commands: UI Eventhandlers
- endl (to insert line breaks)
Related User Interface Eventhandlers
Alphabetical Order
#define CT_EDIT 2
A
autocomplete
- "" (no autocompletion)
- "scripting" (entered text will automatically be completed with matching script command)
- "general" (autocomplete will use some of the last entered words like the chat does)
String example:
autocomplete = "";
Number example:
autocomplete = 0;
C
canModify
- Type
- Number
- Description
- When 0, only (optionally combined with ⇧ Shift) ←, →, HOME, END and Ctrl + C can be used
canModify = 1;
colorActive
- Type
- Array
- Description
- n/a
colorActive[] = {0.23,0.35,0.42,0.9};
colorSelection
- Type
- Array
- Description
- The text selection highlight color.
colorSelection[] = {"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.13])","(profilenamespace getvariable ['GUI_BCG_RGB_G',0.54])","(profilenamespace getvariable ['GUI_BCG_RGB_B',0.21])",1};
F
forceDrawCaret
- Type
- Number
- Description
- When 1, the caret will be drawn even when control has no focus or is disabled.
forceDrawCaret = 1;
L
linespacing
- Type
- Number
- Description
- n/a
linespacing = 1;
M
maxChars
- Type
- Number
- Description
- The limit for how many characters could be displayed or entered, counting new line characters too.
maxChars = 3;
Default Classes
RscEdit
class RscEdit
{
deletable = 0;
fade = 0;
access = 0;
type = CT_EDIT;
x = 0;
y = 0;
h = 0.04;
w = 0.2;
colorBackground[] = {0,0,0,0};
colorText[] = {0.95,0.95,0.95,1};
colorDisabled[] = {1,1,1,0.25};
colorSelection[] =
{
"(profilenamespace getvariable ['GUI_BCG_RGB_R',0.13])",
"(profilenamespace getvariable ['GUI_BCG_RGB_G',0.54])",
"(profilenamespace getvariable ['GUI_BCG_RGB_B',0.21])",
1
};
autocomplete = "";
text = "";
size = 0.2;
style = ST_FRAME; // use ST_NO_RECT to remove the small frame
font = "RobotoCondensed";
shadow = 2;
sizeEx = GUI_TEXT_SIZE_MEDIUM;
canModify = 1;
tooltipColorText[] = {1,1,1,1};
tooltipColorBox[] = {1,1,1,1};
tooltipColorShade[] = {0,0,0,0.65};
};