Files
odfstudio/wizards/source/scriptforge/python
Jean-Pierre Ledure 66a3b09fc3 ScriptForge (SFDialogs) create controls dynamically
The dialog service hosts now a bunch of methods
to create new controls dynamically in an existing
dialog predefined in the Basic IDE.

In other words, a dialog is initialized with controls
in the Basic IDE. New controls can be added at run-time
before or after the Execute() statement.

All the new methods have in common their first 2 arguments:
 ControlName
 Place: an (X, Y, Width, Height) array
        or a com.sun.star.awt.Rectangle

New methods:
 CreateButton(..., toggle, push)
 CreateCheckBox(..., multiline)
 CreateComboBox(..., border, dropdown, linecount)
 CreateCurrencyField(..., border, spinbutton, minvalue,
                     maxvalue, increment, accuracy)
 CreateDateField(..., border, dropdown, mindate, maxdate)
 CreateFileControl(..., border)
 CreateFixedLine(..., orientation)
 CreateFixedText(..., border, multiline, align, verticalalign)
 CreateFormattedField(..., border, spinbutton, minvalue,
                      maxvalue)
 CreateGroupBox(...)
 CreateImageControl(..., border, scale)
 CreateListBox(..., border, dropdown, linecount, multiselect)
 CreateNumericField(..., border, spinbutton, minvalue,
                    maxvalue, increment, accuracy)
 CreatePatternField(..., border, editmask, literalmask)
 CreateProgressBar(..., border, minvalue, maxvalue)
 CreateRadioButton(..., multiline)
 CreateScrollBar(..., orientation, border, minvalue, maxvalue)
 CreateTableControl(..., border, rowheaders, columnheaders,
                    scrollbars, gridlines)
 CreateTextField(..., border, multiline, maximumlength,
                 passwordcharacter)
 CreateTimeField(..., border, mintime, maxtime)
 CreateTreeControl(..., border)

All the methods return a SF_DialogControl instance.

The arguments have bben chosen based on functionality
rather than on layout. After the creatio of the control,
most properties and methods relevant to SF_DialogControl
objects are applicable. Also the XControlModel property
might contribute to layout refinements.

Other changes:
- The SF_DialogControl class receives next updatable
  properties: Border and TabIndex
- The dialogcontrol.SetTableData() receives an
  additional argument: rowheaderwidth
- The dialogcontrol.Resize() method without arguments
  resizes the control to its "preferred size", a size
  adjusted depending on its actual content

All the new functionalities are callable from both
Basic and Python user scripts.

Described changes will require a serios review of the
Dialog and DialogControl help pages.

Change-Id: I654eeae5456527bf14b1f4b43f04d176bbd830b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151896
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
2023-05-18 10:30:45 +02:00
..