Talk:CudaText API

From Lazarus wiki
Revision as of 21:03, 15 April 2017 by Alextp (talk | contribs) (→‎Dlg_proc (temp text): new section)
Jump to navigationJump to search
(no text)

Dlg_proc (temp text)

dlg_proc

dlg_proc(id_dialog, id_action, prop=, index=-1, index2=-1)

Create/work with dialogs. This is more advanced function that dlg_custom.

Form properties

  • "cap": str: Caption of form.
  • "x", "y": int: Position of form, left/top.
  • "w", "h": int: Size of form, width/height.
  • "w_min", "w_max": int: Constraints for width, min/max value.
  • "h_min", "h_max": int: Constraints for height, min/max value.
  • "resize": bool: If on, allows form to resize.

Control properties

  • "name": str: Some word-like string, name of control, to find control later by name.
  • "cap": str: Caption of control.
  • "en": bool: Enabled state.
  • "vis": bool: Visible state.
  • "font": str: Font props, in the form "font_name,int_font_size,int_font_color".
  • "hint": str: Hint (tooltip) for mouse-over.
  • "x", "y": int: Position, left/top.
  • "w", "h": int: Size, width/height.
  • "act": bool: Active state. If on, change of control value calls on_dlg event. Note: buttons are active by default.
  • "props": str: List of advanced control-specific props. Described in dlg_custom.
  • "items": str: Usually tab-separated items. Described in dlg_custom.
  • "val": str: Value of control. Described in dlg_custom.
  • "tag": str: Any string, set by plugin.
  • "callback": str: If not empty, active control calls this callback instead of on_dlg event. Has one of forms:
    • "module=mmm;cmd=nnn;" - to call method nnn (in class Command) in plugin mmm (mmm is usually subfolder in the "cudatext/py", but can be any module name)
    • "mmm.nnn" - the same, to call method, short form
    • "module=mmm;func=nnn;" - to call function nnn in root of module mmm