| 1 | [[PageOutline(1-5, Contents)]] |
---|
| 2 | = API Reference = |
---|
| 3 | This is mostly the same as the Python page. For only the differences with Python, see LINK HERE |
---|
| 4 | |
---|
| 5 | How to read: |
---|
| 6 | For methods, on the left is the return type, then a space, then the name of the method. In the parenthesis will be a comma separated list of parameters with a type, then a space, then a hopefully descriptive name. |
---|
| 7 | |
---|
| 8 | For properties, there will be a type to the left in parenthesis. Get and/or Set access are indicated in the last sentence. |
---|
| 9 | |
---|
| 10 | Types should be easy to decipher, with an exception where ''{}'' means a table and ''void'' means no type. |
---|
| 11 | |
---|
| 12 | == rocket Table == |
---|
| 13 | |
---|
| 14 | ''Context'' '''CreateContext'''(''string name'', ''Vector2i dimensions''):: |
---|
| 15 | Creates and returns a new context called ''name'', with initial dimensions of ''dimensions''. The name of the context must be unique; if it is not, ''nil'' will be returned |
---|
| 16 | |
---|
| 17 | ''bool'' '''LoadFontFace'''(''string font_path''):: |
---|
| 18 | Loads the font face at ''font_path''. The function will return true if the font face was loaded, false if not. |
---|
| 19 | |
---|
| 20 | ''void'' '''RegisterTag'''(''string tag_name'', ''ElementInstancer instancer''):: |
---|
| 21 | Registers a [wiki:documentation/LuaManual/ElementInstancer ElementInstancer] to instance when a specific XML tag is encountered in an RML file. |
---|
| 22 | |
---|
| 23 | {{{{} }}}'''contexts''':: |
---|
| 24 | A table of the active libRocket contexts. It can be indexed by string (in which case the context with the matching name is returned), or number (in which case the nth context is returned). |
---|
| 25 | |
---|
| 26 | == Basic Types == |
---|
| 27 | |
---|
| 28 | '''class''' [wiki:documentation/LuaManual/Vectors Vector2i]:: |
---|
| 29 | A two-dimensional integral vector. |
---|
| 30 | |
---|
| 31 | '''class''' [wiki:documentation/LuaManual/Vectors Vector2f]:: |
---|
| 32 | Constructs a two-dimensional floating-point vector. |
---|
| 33 | |
---|
| 34 | '''class''' [wiki:documentation/LuaManual/Colours Colourb]:: |
---|
| 35 | A colour with four channels, each from 0 to 255. |
---|
| 36 | |
---|
| 37 | '''class''' [wiki:documentation/LuaManual/Colours Colourf]:: |
---|
| 38 | A colour with four channels, each from 0 to 255. |
---|
| 39 | |
---|
| 40 | == Log == |
---|
| 41 | |
---|
| 42 | ''void'' '''Message'''(''logtype type'', ''string message''):: |
---|
| 43 | Sends a log message to libRocket (and the attached debugger if present). This is not called from an instance of a Log object, just ''Log.Message''.[[br]] |
---|
| 44 | type should be one of: |
---|
| 45 | * Log.logtype.always |
---|
| 46 | * Log.logtype.error |
---|
| 47 | * Log.logtype.warning |
---|
| 48 | * Log.logtype.info |
---|
| 49 | * Log.logtype.debug |
---|
| 50 | |
---|
| 51 | == DataSource == |
---|
| 52 | IS THIS RIGHT? |
---|
| 53 | '''class''' DataSource(''name'') |
---|
| 54 | |
---|
| 55 | Abstract DataSource Interface. |
---|
| 56 | |
---|
| 57 | '''GetNumRows'''(''table_name''):: |
---|
| 58 | Return the number of rows in the given table |
---|
| 59 | |
---|
| 60 | '''GetRow'''(''table_name'', ''index'', ''columns''):: |
---|
| 61 | Return a list of the column values in string form |
---|
| 62 | |
---|
| 63 | '''NotifyRowAdd'''(''table_name'', ''first_row_added'', ''num_rows_added''):: |
---|
| 64 | Notify listeners that rows have been added to the data source. |
---|
| 65 | |
---|
| 66 | '''NotifyRowRemove'''(''table_name'', ''first_row_removed'', ''num_rows_removed''):: |
---|
| 67 | Notify listeners that rows have been removed from the data source. |
---|
| 68 | |
---|
| 69 | '''NotifyRowChange'''(''table_name'', ''first_row_changed'', ''num_rows_changed''):: |
---|
| 70 | Notify listeners that rows have been changed on the data source. |
---|
| 71 | |
---|
| 72 | '''NotifyRowChange'''(''table_name''):: |
---|
| 73 | Notify listeners that all rows on the data source have changed. |
---|
| 74 | |
---|
| 75 | == Element == |
---|
| 76 | |
---|
| 77 | '''class''' Element |
---|
| 78 | |
---|
| 79 | The ''Element'' class has no constructor; it must be instantiated through a ''[wiki:documentation/PythonManual/APIReference#Document Document]'' object instead. It has the following methods and properties: |
---|
| 80 | |
---|
| 81 | '''AddEventListener'''(''event'', ''listener''[, ''in_capture_phase'']):: |
---|
| 82 | Attaches ''listener'' to this element, listening for occurrences of ''event'' in either the bubble or capture phase. If not specified, ''in_capture_phase'' will default to False.[[br]]''NOTE: Events added from python cannot be removed.'' |
---|
| 83 | |
---|
| 84 | '''AppendChild'''(''element''):: |
---|
| 85 | Appends ''element'' as a child to this element. |
---|
| 86 | |
---|
| 87 | '''Blur'''():: |
---|
| 88 | Removes input focus from this element. |
---|
| 89 | |
---|
| 90 | '''Click'''():: |
---|
| 91 | Fakes a click on this element. |
---|
| 92 | |
---|
| 93 | '''DispatchEvent'''(''event'', ''parameters'', ''interruptible''):: |
---|
| 94 | Dispatches an event to this element. The event is of type ''event''. Parameters to the event are given in the dictionary ''parameters''; the dictionary must only contain string keys and floating-point, integer or string values. ''interruptible'' determines if the event can be forced to stop propagation early. |
---|
| 95 | |
---|
| 96 | '''Focus'''():: |
---|
| 97 | Gives input focus to this element. |
---|
| 98 | |
---|
| 99 | '''GetAttribute'''(''name''):: |
---|
| 100 | Returns the value of the attribute named ''name''. If no such attribute exists, the empty string will be returned. |
---|
| 101 | |
---|
| 102 | '''GetElementById'''(''id''):: |
---|
| 103 | Returns the descendant element with an id of ''id''. |
---|
| 104 | |
---|
| 105 | '''GetElementsByTagName'''(''tag_name''):: |
---|
| 106 | Returns a list of all descendant elements with the tag of ''tag_name''. |
---|
| 107 | |
---|
| 108 | '''HasAttribute'''(''name''):: |
---|
| 109 | Returns True if the element has a value for the attribute named ''name'', False if not. |
---|
| 110 | |
---|
| 111 | '''HasChildNodes'''():: |
---|
| 112 | Returns True if the element has at least one child node, false if not. |
---|
| 113 | |
---|
| 114 | '''InsertBefore'''(''element'', ''adjacent_element''):: |
---|
| 115 | Inserts the element ''element'' as a child of this element, directly before ''adjacent_element'' in the list of children. |
---|
| 116 | |
---|
| 117 | '''IsClassSet'''(''name''):: |
---|
| 118 | Returns true if the class ''name'' is set on the element, false if not. |
---|
| 119 | |
---|
| 120 | '''RemoveAttribute'''(''name''):: |
---|
| 121 | Removes the attribute named ''name'' from the element. |
---|
| 122 | |
---|
| 123 | '''RemoveChild'''(''element''):: |
---|
| 124 | Removes the child element ''element'' from this element. |
---|
| 125 | |
---|
| 126 | '''ReplaceChild'''(''inserted_element'', ''replaced_element''):: |
---|
| 127 | Replaces the child element ''replaced_element'' with ''inserted_element'' in this element's list of children. If ''replaced_element'' is not a child of this element, ''inserted_element'' will be appended onto the list instead. |
---|
| 128 | |
---|
| 129 | '''ScrollIntoView'''(''align_with_top''):: |
---|
| 130 | Scrolls this element into view if its ancestors have hidden overflow. If ''align_with_top'' is True, the element's top edge will be aligned with the top (or as close as possible to the top) of its ancestors' viewing windows. If False, its bottom edge will be aligned to the bottom. |
---|
| 131 | |
---|
| 132 | '''SetAttribute'''(''name'', ''value''):: |
---|
| 133 | Sets the value of the attribute named ''name'' to ''value''. |
---|
| 134 | |
---|
| 135 | '''SetClass'''(''name'', ''value''):: |
---|
| 136 | Sets (if ''value'' is true) or clears (if ''value'' is false) the class ''name'' on the element. |
---|
| 137 | |
---|
| 138 | '''attributes''':: |
---|
| 139 | The array of attributes on the element. Each element has the read-only properties ''name'' and ''value''. Read-only. |
---|
| 140 | |
---|
| 141 | '''child_nodes''':: |
---|
| 142 | The array of child nodes on the element. Read-only. |
---|
| 143 | |
---|
| 144 | '''class_name''':: |
---|
| 145 | The space-separated list of classes on the element. |
---|
| 146 | |
---|
| 147 | '''client_left''':: |
---|
| 148 | The distance between the left border edge and the left client edge of the element. Read-only. |
---|
| 149 | |
---|
| 150 | '''client_height''':: |
---|
| 151 | The height of the element's client area. Read-only. |
---|
| 152 | |
---|
| 153 | '''client_top''':: |
---|
| 154 | The distance between the top border edge and the top client edge of the element. Read-only. |
---|
| 155 | |
---|
| 156 | '''client_width''':: |
---|
| 157 | The width of the element's client area. Read-only. |
---|
| 158 | |
---|
| 159 | '''first_child''':: |
---|
| 160 | The first child of the element, or None if the client has no children. Read-only. |
---|
| 161 | |
---|
| 162 | '''id''':: |
---|
| 163 | The ID of the element, or the empty string if the element has no ID. |
---|
| 164 | |
---|
| 165 | '''inner_rml''':: |
---|
| 166 | The element's RML content. |
---|
| 167 | |
---|
| 168 | '''last_child''':: |
---|
| 169 | The last child of the element, or None if the client has no children. Read-only. |
---|
| 170 | |
---|
| 171 | '''next_sibling''':: |
---|
| 172 | The element's next sibling, or None if it is the last sibling. Read-only. |
---|
| 173 | |
---|
| 174 | '''offset_height''':: |
---|
| 175 | The height of the element, excluding margins. Read-only. |
---|
| 176 | |
---|
| 177 | '''offset_left''':: |
---|
| 178 | The distance between the element's offset parent's left border edge and this element's left border edge. Read-only. |
---|
| 179 | |
---|
| 180 | '''offset_parent''':: |
---|
| 181 | The element's offset parent. Read only. |
---|
| 182 | |
---|
| 183 | '''offset_top''':: |
---|
| 184 | The distance between the element's offset parent's top border edge and this element's top border edge. Read-only. |
---|
| 185 | |
---|
| 186 | '''offset_width''':: |
---|
| 187 | The width of the element, excluding margins. Read-only. |
---|
| 188 | |
---|
| 189 | '''owner_document''':: |
---|
| 190 | The document this element is part of. Read-only. |
---|
| 191 | |
---|
| 192 | '''parent_node''':: |
---|
| 193 | The element this element is directly parented to. Read-only. |
---|
| 194 | |
---|
| 195 | '''previous_sibling''':: |
---|
| 196 | The element's previous sibling, or None if it is the first sibling. Read-only. |
---|
| 197 | |
---|
| 198 | '''scroll_height''':: |
---|
| 199 | The height of this element's content. This will be at least as high as the client height. Read-only. |
---|
| 200 | |
---|
| 201 | '''scroll_left''':: |
---|
| 202 | The offset between the left edge of this element's client area and the left edge of the content area. |
---|
| 203 | |
---|
| 204 | '''scroll_top''':: |
---|
| 205 | The offset between the top edge of this element's client area and the top edge of the content area. |
---|
| 206 | |
---|
| 207 | '''scroll_width''':: |
---|
| 208 | The width of this element's content. This will be at least as wide as the client width. Read-only. |
---|
| 209 | |
---|
| 210 | '''style''':: |
---|
| 211 | An object used to access this element's style information. Individual RCSS properties can be accessed by using the name of the property as a Python property on the object itself (ie, element.style.width = "40px"). |
---|
| 212 | |
---|
| 213 | '''tag_name''':: |
---|
| 214 | The tag name used to instance this element. Read-only. |
---|
| 215 | |
---|
| 216 | == ElementText == |
---|
| 217 | |
---|
| 218 | '''class''' IElementText |
---|
| 219 | |
---|
| 220 | ''IElementText'' derives from ''Element''. ''IElementText'' is an interface, and therefore cannot be instanced directly. A concrete ''ElementText'' must be instantiated through a ''[wiki:documentation/PythonManual/APIReference#Document Document]'' object instead. It has the following property: |
---|
| 221 | |
---|
| 222 | '''text''':: |
---|
| 223 | The raw text content of the text element in UTF-8 encoding. |
---|
| 224 | |
---|
| 225 | == Document == |
---|
| 226 | |
---|
| 227 | '''class''' Document |
---|
| 228 | |
---|
| 229 | ''Document'' derives from ''Element''. ''Document'' has no constructor; it must be instantiated through a ''[wiki:documentation/PythonManual/APIReference#Context Context]'' object instead, either by loading an external RML file or creating an empty document. It has the following methods and properties: |
---|
| 230 | |
---|
| 231 | '''PullToFront'''():: |
---|
| 232 | Pulls the document in front of other documents within its context with a similar z-index. |
---|
| 233 | |
---|
| 234 | '''PushToBack'''():: |
---|
| 235 | Pushes the document behind other documents within its context with a similar z-index. |
---|
| 236 | |
---|
| 237 | '''Show'''([''flags'']):: |
---|
| 238 | Shows the document. ''flags'' is either ''NONE'', ''FOCUS'' or ''MODAL''. ''flags'' defaults to ''FOCUS''. |
---|
| 239 | |
---|
| 240 | '''Hide'''():: |
---|
| 241 | Hides the document. |
---|
| 242 | |
---|
| 243 | '''Close'''():: |
---|
| 244 | Hides and closes the document, destroying its contents. |
---|
| 245 | |
---|
| 246 | '''CreateElement'''(''tag_name''):: |
---|
| 247 | Instances an element with a tag of ''tag_name''. |
---|
| 248 | |
---|
| 249 | '''CreateTextNode'''(''text''):: |
---|
| 250 | Instances a text element containing the string ''text''. |
---|
| 251 | |
---|
| 252 | '''title''':: |
---|
| 253 | The title of the document, as initially set by the <title> tag in the document's header. |
---|
| 254 | |
---|
| 255 | '''context''':: |
---|
| 256 | The context the document belongs to. Read-only. |
---|
| 257 | |
---|
| 258 | == Event == |
---|
| 259 | |
---|
| 260 | '''class''' Event |
---|
| 261 | |
---|
| 262 | The Event class has no constructor; it is generated internally. It has the following methods and properties: |
---|
| 263 | |
---|
| 264 | '''StopPropagation'''():: |
---|
| 265 | Stops the propagation of the event through the event cycle, if allowed. |
---|
| 266 | |
---|
| 267 | '''current_element''':: |
---|
| 268 | The element the event has propagated to. Read-only. |
---|
| 269 | |
---|
| 270 | '''type''':: |
---|
| 271 | The string name of the event. Read-only. |
---|
| 272 | |
---|
| 273 | '''target_element''':: |
---|
| 274 | The element the event was originally targeted at. Read-only. |
---|
| 275 | |
---|
| 276 | '''parameters''':: |
---|
| 277 | A dictionary like object containing all the parameters in the event. |
---|
| 278 | |
---|
| 279 | == Context == |
---|
| 280 | |
---|
| 281 | '''class''' Context |
---|
| 282 | |
---|
| 283 | The ''Context'' class has no constructor; it must be instantiated through the ''CreateContext()'' function. It has the following methods and properties: |
---|
| 284 | |
---|
| 285 | '''AddEventListener'''(''event'', ''script'', ''element_context'', ''in_capture_phase''):: |
---|
| 286 | Adds the inline Python script, ''script'', as an event listener to the context. ''element_context'' is an optional Element; if it is not None, then the script will be executed as if it was bound to that element. |
---|
| 287 | |
---|
| 288 | '''AddMouseCursor'''(''cursor_document''):: |
---|
| 289 | Adds a cursor document loaded by another context into this context. The cursor document will be returned. |
---|
| 290 | |
---|
| 291 | '''CreateDocument'''(''tag''):: |
---|
| 292 | Creates a new document with the tag name of ''tag''. |
---|
| 293 | |
---|
| 294 | '''LoadDocument'''(''document_path''):: |
---|
| 295 | Attempts to load a document from the RML file found at ''document_path''. If successful, the document will be returned with a reference count of one. |
---|
| 296 | |
---|
| 297 | '''LoadMouseCursor'''(''cursor_document_path''):: |
---|
| 298 | Attempts to load a document from the RML file found at ''cursor_document_path'' as a cursor. If successful, the cursor's document will be returned with a reference count of one. |
---|
| 299 | |
---|
| 300 | '''Render'''():: |
---|
| 301 | Renders the context. |
---|
| 302 | |
---|
| 303 | '''ShowMouseCursor'''(''show''):: |
---|
| 304 | If ''show'' is True, this shows the mouse cursor, otherwise hides it. |
---|
| 305 | |
---|
| 306 | '''UnloadAllDocuments'''():: |
---|
| 307 | Closes all documents currently loaded with the context. |
---|
| 308 | |
---|
| 309 | '''UnloadAllMouseCursors'''():: |
---|
| 310 | Unloads all cursors currently loaded with the context. |
---|
| 311 | |
---|
| 312 | '''UnloadDocument'''(''document''):: |
---|
| 313 | Unloads a specific document within the context. |
---|
| 314 | |
---|
| 315 | '''UnloadMouseCursor'''(''cursor_name''):: |
---|
| 316 | Unloads a specific cursor by name. |
---|
| 317 | |
---|
| 318 | '''Update'''():: |
---|
| 319 | Updates the context. |
---|
| 320 | |
---|
| 321 | '''dimensions''':: |
---|
| 322 | The dimensions of the context, as a ''Vector2i'' type. |
---|
| 323 | |
---|
| 324 | '''documents''':: |
---|
| 325 | Returns an array of the documents within the context. This can be looked up as an array or a dictionary. Read-only. |
---|
| 326 | |
---|
| 327 | '''focus_element''':: |
---|
| 328 | Returns the leaf of the context's focus tree. Read-only. |
---|
| 329 | |
---|
| 330 | '''hover_element''':: |
---|
| 331 | Returns the element under the context's cursor. Read-only. |
---|
| 332 | |
---|
| 333 | '''name''':: |
---|
| 334 | The name of the context, specified at construction. Read-only. |
---|
| 335 | |
---|
| 336 | '''root_element''':: |
---|
| 337 | Returns the context's root element. Read-only. |
---|
| 338 | |
---|
| 339 | = Controls API Reference = |
---|
| 340 | |
---|
| 341 | == ElementForm == |
---|
| 342 | |
---|
| 343 | '''class''' ElementForm |
---|
| 344 | |
---|
| 345 | ''ElementForm'' derives from ''Element''. The form element has the following method: |
---|
| 346 | |
---|
| 347 | '''Submit'''(''submit_value''):: |
---|
| 348 | Submits the form with a submit value of ''submit_value''. |
---|
| 349 | |
---|
| 350 | == ElementFormControl == |
---|
| 351 | |
---|
| 352 | '''class''' IElementFormControl |
---|
| 353 | |
---|
| 354 | ''IElementFormControl'' derives from ''Element''. The form element control has the following properties: |
---|
| 355 | |
---|
| 356 | '''disabled''':: |
---|
| 357 | The disabled status of the control, either True or False. |
---|
| 358 | |
---|
| 359 | '''name''':: |
---|
| 360 | The name of the control, initial set with the "name" attribute. |
---|
| 361 | |
---|
| 362 | '''value''':: |
---|
| 363 | The current value of the control. |
---|
| 364 | |
---|
| 365 | == ElementFormControlSelect == |
---|
| 366 | |
---|
| 367 | '''class''' ElementFormControlSelect |
---|
| 368 | |
---|
| 369 | ''ElementFormControlSelect'' derives from ''IElementFormControl''. The control has the following methods and properties: |
---|
| 370 | |
---|
| 371 | '''Add'''(''rml'', ''value''[, ''before'']):: |
---|
| 372 | Adds a new option to the select box. The new option has the string value of ''value'' and is represented by the elements created by the RML string ''rml''. The new option will be inserted by the index specified by ''before''; if this is out of bounds (the default), then the new option will be appended onto the list. The index of the new option will be returned. |
---|
| 373 | |
---|
| 374 | '''Remove'''(''index''):: |
---|
| 375 | Removes an existing option from the selection box. |
---|
| 376 | |
---|
| 377 | '''options''':: |
---|
| 378 | The array of options available in the select box. Each entry in the array has the property ''value'', the string value of the option, and ''element'', the root of the element hierarchy that represents the option in the list. |
---|
| 379 | |
---|
| 380 | '''selection''':: |
---|
| 381 | The index of the currently selected option. |
---|
| 382 | |
---|
| 383 | == ElementFormControlDataSelect == |
---|
| 384 | |
---|
| 385 | '''class''' ElementFormControlDataSelect |
---|
| 386 | |
---|
| 387 | ''ElementFormControlDataSelect'' derives from ''ElementFormControlSelect''. It has the following additional method: |
---|
| 388 | |
---|
| 389 | '''SetDataSource'''(''data_source_name''):: |
---|
| 390 | Sets the name and table of the new data source to be used by the select box. |
---|
| 391 | |
---|
| 392 | == ElementFormControlInput == |
---|
| 393 | |
---|
| 394 | '''class''' ElementFormControlInput |
---|
| 395 | |
---|
| 396 | ''ElementFormControlInput'' derives from ''IElementFormControl''. The control has the following properties, only appropriate on the relevant types: |
---|
| 397 | |
---|
| 398 | '''checked''':: |
---|
| 399 | Relevant for ''radio'' and ''checkbox'' types. The checked status of the input. |
---|
| 400 | |
---|
| 401 | '''max_length''':: |
---|
| 402 | Relevant for ''text'' types. The maximum number of characters permitted in the text field. |
---|
| 403 | |
---|
| 404 | '''size''':: |
---|
| 405 | Relevant for ''text'' types. The approximate number of characters the text field shows horizontally at once. |
---|
| 406 | |
---|
| 407 | '''max''':: |
---|
| 408 | Relevant for ''range'' types. The value of the control on the bottom / right of the slider. |
---|
| 409 | |
---|
| 410 | '''min''':: |
---|
| 411 | Relevant for ''range'' types. The value of the control on the top / left of the slider. |
---|
| 412 | |
---|
| 413 | '''step''':: |
---|
| 414 | Relevant for ''range'' types. The step the control's value changes in. |
---|
| 415 | |
---|
| 416 | == ElementFormControlTextArea == |
---|
| 417 | |
---|
| 418 | '''class''' ElementFormControlTextArea |
---|
| 419 | |
---|
| 420 | ''ElementFormControlTextArea'' derives from ''IElementFormControl''. The control has the following properties: |
---|
| 421 | |
---|
| 422 | '''cols''':: |
---|
| 423 | The approximate number of characters the text area shows horizontally at once. |
---|
| 424 | |
---|
| 425 | '''max_length''':: |
---|
| 426 | The maximum number of characters permitted in the text area. |
---|
| 427 | |
---|
| 428 | '''rows''':: |
---|
| 429 | The number of lines the text area shows at once. |
---|
| 430 | |
---|
| 431 | '''word_wrap''':: |
---|
| 432 | True if lines are split to fit into the text area, False if not. |
---|
| 433 | |
---|
| 434 | == ElementTabSet == |
---|
| 435 | |
---|
| 436 | '''class''' ElementTabSet |
---|
| 437 | |
---|
| 438 | ''ElementTabSet'' derives from ''Element''. The control has the following methods and properties: |
---|
| 439 | |
---|
| 440 | '''SetPanel'''(''index'', ''rml''):: |
---|
| 441 | Sets the contents of a panel to the RML content ''rml''. If ''index'' is out-of-bounds, a new panel will be added at the end. |
---|
| 442 | |
---|
| 443 | '''SetTab'''(''index'', ''rml''):: |
---|
| 444 | Sets the contents of a tab to the RML content ''rml''. If ''index'' is out-of-bounds, a new tab will be added at the end. |
---|
| 445 | |
---|
| 446 | '''active_tab''':: |
---|
| 447 | Index of the active panel. |
---|
| 448 | |
---|
| 449 | '''num_tabs''':: |
---|
| 450 | |
---|
| 451 | The number of tabs in the tab set. Read-only. |
---|
| 452 | |
---|
| 453 | == ElementDataGrid == |
---|
| 454 | |
---|
| 455 | '''class'' ElementDataGrid |
---|
| 456 | |
---|
| 457 | ''ElementDataGrid'' derives from ''Element''. The data grid has the following methods and properties: |
---|
| 458 | |
---|
| 459 | '''AddColumn'''(''fields'', ''formatter'', ''initial_width'', ''header_rml''):: |
---|
| 460 | Adds a new column to the data grid. The column will read the columns ''fields'' (in CSV format) from the grid's data source, processing it through the data formatter named ''formatter''. ''header_rml'' specifies the RML content of the column's header. |
---|
| 461 | |
---|
| 462 | '''SetDataSource'''(''data_source_name''):: |
---|
| 463 | Sets the name and table of the new data source to be used by the data grid. |
---|
| 464 | |
---|
| 465 | '''rows''':: |
---|
| 466 | Returns an array containing all the rows in the data grid. |
---|
| 467 | |
---|
| 468 | == ElementDataGridRow == |
---|
| 469 | |
---|
| 470 | '''class''' ElementDataGridRow |
---|
| 471 | |
---|
| 472 | ''ElementDataGridRow'' derives from ''Element''. The data grid row has the following properties: |
---|
| 473 | |
---|
| 474 | '''row_expanded''':: |
---|
| 475 | The expanded state of the row, either True or False. |
---|
| 476 | |
---|
| 477 | '''parent_relative_index''':: |
---|
| 478 | The index of the row, relative to its parent row. So if you are the third row in your parent, then it will be 3. |
---|
| 479 | |
---|
| 480 | '''table_relative_index''':: |
---|
| 481 | The index of the row, relative to the data grid it is in. This takes into account all previous rows and their children. |
---|
| 482 | |
---|
| 483 | '''parent_row''':: |
---|
| 484 | The parent row of this row. None if it at the top level. |
---|
| 485 | |
---|
| 486 | '''parent_grid''':: |
---|
| 487 | The data grid that this row belongs to. |