Difference between revisions of "Talk:CudaText API"
From Lazarus wiki
Jump to navigationJump to searchLine 2: | Line 2: | ||
− | dlg_custom(title, size_x, size_y, text) | + | dlg_custom(title, size_x, size_y, text, focused) |
Shows dialog with controls of many types. | Shows dialog with controls of many types. | ||
Line 17: | Line 17: | ||
** "button" | ** "button" | ||
* "pos": position of control, ","-separated values: left, top, right, bottom (e.g. "10,10,300,20") | * "pos": position of control, ","-separated values: left, top, right, bottom (e.g. "10,10,300,20") | ||
− | * "cap": caption of control | + | * "cap": caption of control (not for all) |
− | * "items": | + | * "items": for combo, listbox: "\t"-separated items |
− | + | * "val": value of control (not for all): | |
− | * "val": value of control: | + | ** for check: "1"/"0" for on/off |
− | ** for check: " | + | ** for edit: text |
− | ** for edit: text | ||
** for combo, listbox: index of selected item (as str) | ** for combo, listbox: index of selected item (as str) | ||
+ | |||
+ | Param focused is index of control (in text) which is focused on show. | ||
Dialog is closed by any button. Gets 2-tuple: (used_button_index, state_text), where state_text is "\n"-separated values of controls (same count of values as in text). Gets None if cancelled by "x". | Dialog is closed by any button. Gets 2-tuple: (used_button_index, state_text), where state_text is "\n"-separated values of controls (same count of values as in text). Gets None if cancelled by "x". | ||
[[User:Alextp|Alextp]] | [[User:Alextp|Alextp]] |
Revision as of 16:07, 12 December 2015
Proposed
dlg_custom(title, size_x, size_y, text, focused)
Shows dialog with controls of many types.
Param text is "\n"-separated items, one item per control. Each item is chr(1)-separated subitems. Each subitem is s_name+"="+s_value. Possible names (and names' values):
- "type": type of control, values:
- "label"
- "check"
- "edit"
- "combo"
- "listbox"
- "splitter"
- "button"
- "pos": position of control, ","-separated values: left, top, right, bottom (e.g. "10,10,300,20")
- "cap": caption of control (not for all)
- "items": for combo, listbox: "\t"-separated items
- "val": value of control (not for all):
- for check: "1"/"0" for on/off
- for edit: text
- for combo, listbox: index of selected item (as str)
Param focused is index of control (in text) which is focused on show.
Dialog is closed by any button. Gets 2-tuple: (used_button_index, state_text), where state_text is "\n"-separated values of controls (same count of values as in text). Gets None if cancelled by "x".