Changes between Version 2 and Version 3 of GUI_-_Properties


Ignore:
Timestamp:
Jul 9, 2021, 1:55:32 PM (3 years ago)
Author:
Langbart
Comment:

added placeholder_color and placeholder_text; removed input_init_value_destroyed_at_focus

Legend:

Unmodified
Added
Removed
Modified
  • GUI_-_Properties

    v2 v3  
    44  myobject.color = newcolor;
    55}}}
    6 
    7 Now the important part is this, the above can be done with not just properties, there is for instance a way to fetch the parent by typing "myobject.parent" also. This is, however, not a setting and won't be listed below. It is taken care of solely when talking about the GUI's Javascript interface.
    8 {{Template:TODO|Gee|Add link to javascript interface.}}
     6Now the important part is this, the above can be done with not just properties, there is for instance a way to fetch the parent by typing "myobject.parent" also. This is, however, not a setting and won't be listed below. It is taken care of solely when talking about the GUI's Javascript interface. {{Template:TODO|Gee|Add link to javascript interface.}}
    97
    108The '''default''' values are used to save space. Know the '''defaults''', and know your '''styles'''' defaults, and you'll have a lot cleaner XML files.
    119
    1210= Foundation Settings =
    13 
    1411The '''Foundation Settings''' are the premise of any object, they differ from '''Base Settings''' as they cannot be changed.
    1512
     
    4340
    4441= Base Settings =
    45 
    4642Settings shared between all types of object.
    4743
     
    5046 * value: [wiki:GUI_-_Data_Types#bool bool] "(true|false)"
    5147
    52 If set to '''false''', the child's position, size and "height" (z) is relative to its parent's coordinates; they are calculated as delta values added to its parent's values ("0 0 100% 100%" would set it to the dimensions of its parent, and it could not exceed that border). 
     48If set to '''false''', the child's position, size and "height" (z) is relative to its parent's coordinates; they are calculated as delta values added to its parent's values ("0 0 100% 100%" would set it to the dimensions of its parent, and it could not exceed that border).
    5349
    5450This is handy when you want to link the position of an object(s) to another object. For example, a group of buttons could then be shifted in position by a few pixels without having to separately update each control's size value.
     
    8278 * value: [wiki:GUI_-_Data_Types#name name]
    8379
    84 Hotkey variables are declared in an appropriate .cfg file (such as binaries/config/system.cfg) by prefixing the variable with "hotkey." 
     80Hotkey variables are declared in an appropriate .cfg file (such as binaries/config/system.cfg) by prefixing the variable with "hotkey."
    8581
    8682Object properties do not require the prefix, so if the .cfg variable is declared as ''hotkey.toggle.fps'', reference it using the object property ''hotkey="toggle.fps"''.
     
    108104An object's "Z value" specifies its drawing order. An object with a higher Z will be layered on top of an object with a lower Z.
    109105
    110 By default, all root (parentless) objects have a Z value of "0". Children will - if not manually set - have the value of its parent's Z plus 10. 
     106By default, all root (parentless) objects have a Z value of "0". Children will - if not manually set - have the value of its parent's Z plus 10.
    111107
    112108Since Z values are set automatically, this should only need to be specified in rare circumstances (such as when two siblings overlap each other). Generally just defining the objects in sequence should layer them in the right order.
    113109
    114110= Extended Settings =
    115 
    116111Settings that are only used by certain types of object.
    117112
     
    125120 * default: *
    126121 * value: [wiki:GUI_-_Data_Types#float float]
     122
    127123{{Template:TODO|Gee|* Just add a default value to the default style and update this.}}
    128124
     
    144140  <object name="whatever" type="text">This is the caption</object>
    145141}}}
    146 
    147142It is however called the caption when stored as a property of the object, and can be accessed as such through JS script:
    148143
     
    151146  whatever.caption = "Some other text"
    152147}}}
    153 
    154148Captions are special strings that can accept a number of formatting tags. See the [wiki:GUI_-_Text_Renderer Text Renderer] sections for more information.
    155149
     
    158152 * value: [wiki:GUI_-_Data_Types#bool bool] "(true|false)"
    159153
    160 If set to "false", the control uses its "sprite*" properties to determine which artwork is displayed. (An empty box, for example.)
    161 If set to "true", the control uses its "sprite2*" properties to determine which artwork is displayed. (A checked box, for example.)
     154If set to "false", the control uses its "sprite*" properties to determine which artwork is displayed. (An empty box, for example.) If set to "true", the control uses its "sprite2*" properties to determine which artwork is displayed. (A checked box, for example.)
    162155
    163156== cell_id ==
     
    172165 * default: *
    173166 * value: [wiki:GUI_-_Data_Types#float float]
     167
    174168{{Template:TODO|Gee|* Just add a default value to the default style and update this.}}
    175169
     
    181175 * default: *
    182176 * value: [wiki:GUI_-_Data_Types#float float]
     177
    183178{{Template:TODO|Gee|* Just add a default value to the default style and update this.}}
    184179
    185 In Windows, the size of a dropdown is specified as the perimeter of the whole control when opened, and then the height when closed is set to one row. This manually specifies this value, so the size of the dropdown is the size when closed. 
     180In Windows, the size of a dropdown is specified as the perimeter of the whole control when opened, and then the height when closed is set to one row. This manually specifies this value, so the size of the dropdown is the size when closed.
    186181
    187182Check out the [wiki:GUI_-_Drop-down Drop-down] for an image of this.
     
    197192== fov_wedge_color ==
    198193{{Template:TODO|Gee|I know this is for the Minimap control, but I can't see it ever being used in the code.}}
    199 
    200 == input_init_value_destroyed_at_focus ==
    201 '''Not yet implemented.''' 
    202  * default: "false"
    203  * value: [wiki:GUI_-_Data_Types#bool bool] "(true|false)"
    204 
    205 Used by the input box. If set to true, the initial caption of the input box (eg "Insert Text Here") is removed the first time the control is clicked.
    206194
    207195== list ==
     
    216204 * Default: *
    217205 * Value: [wiki:GUI_-_Data_Types#int int]
     206
    218207{{Template:TODO|Gee|* Just add a default value to the default style and update this.}}
    219208
     
    226215Should the [wiki:GUI_-_Input Input] control word-wrap or scroll horizontally when reaching the right edge? True and it'll continue on the next row.
    227216
     217== placeholder_color ==
     218 * default: "0 0 0"
     219 * value: [wiki:GUI_-_Data_Types#color color]
     220
     221Specifies the color of the initial label in the input field (e.g. "255 255 255" for white text). For more information about color settings, see [wiki:GUI_-_Data_Types#color color].
     222
     223== placeholder_text ==
     224 * default: "null"
     225 * value: [wiki:GUI_-_Data_Types#string string]
     226
     227Used by the input field. If set, an initial label is displayed in the input field (e.g. "Insert text here"), which is removed when the first text is entered.
     228
    228229== scrollbar ==
    229230 * default: "false"
    230231 * value: [wiki:GUI_-_Data_Types#bool bool] "(true|false)"
    231232
    232 If set to "true", the control displays its attached scrollbar at all times, not just when the length of its caption exceeds the size of the object.
    233 '''Not yet implemented.''' As of now, there's no automatic detection that will make a scrollbar appear only when needed.
     233If set to "true", the control displays its attached scrollbar at all times, not just when the length of its caption exceeds the size of the object. '''Not yet implemented.''' As of now, there's no automatic detection that will make a scrollbar appear only when needed.
    234234
    235235== scrollbar_style ==
     
    313313 * value: [wiki:GUI_-_Data_Types#name name]
    314314
    315 Used by controls that can be switched to another state or consist of more than one sprite. This specifies the "secondary sprite" used when the object is in its secondary mode. 
     315Used by controls that can be switched to another state or consist of more than one sprite. This specifies the "secondary sprite" used when the object is in its secondary mode.
    316316
    317317== sprite2_disabled ==
     
    348348 * default: "left" ("center" for type "button")
    349349 * value: [wiki:GUI_-_Data_Types#enum enum] "(left|center|right)"
     350
    350351'''Not yet implemented.''' The button does not have a special default on this value.
    351352
     
    355356 * default: "top" ("center" for types "button", "checkbox" and "radiobutton")
    356357 * value: [wiki:GUI_-_Data_Types#enum enum] "(top|center|bottom)"
     358
    357359'''Not yet implemented.''' The button, checkbox and radiobutton does not have a special default on this value.
    358360
     
    409411 * value: [wiki:GUI_-_Data_Types#string string]
    410412
    411 Specifies the name of the style of tooltip to display when this object is "hovered". 
     413Specifies the name of the style of tooltip to display when this object is "hovered".
    412414
    413415If not specified, the object uses the tooltip called ''default''.
     
    419421 * value: [wiki:GUI_-_Data_Types#bool bool] "(true|false)"
    420422
    421 Specifies whether to mask text (like in a password field). 
     423Specifies whether to mask text (like in a password field).
    422424
    423425== mask_char ==
     
    425427 * value: [wiki:GUI_-_Data_Types#string string]
    426428
    427 Specifies what character to mask text with if mask is true. 
     429Specifies what character to mask text with if mask is true.