Screen scaffolding: controls: Difference between revisions

From OpenPetra Wiki
Jump to navigation Jump to search
(Deprecated: this only applied to the winforms client)
Tag: Replaced
 
(103 intermediate revisions by 8 users not shown)
Line 1: Line 1:
== Control Hierarchy ==
Deprecated: this only applied to the winforms client
=== Root Control ===
Usually, the first Pagecontrl (tab), GroupBox (grp), User contrl (uco), or Panel (pnl). Sometimes, especially with inheritance of the forms, this does not work. So you can set the attribute RootControl=true for the control that you want to be the root.
 
(this behaviour is implemented in Ict.Tools.CodeGeneration.TCodeStorage.GetRootControl)
 
== Layout of Controls ==
* use Dock=Fill, or Dock=Top, or Dock=Bottom
* use Panels (pnl) to group controls
* by default, the controls are arranged vertically (each control below the previous control)
* to have the controls in one row, use ControlsOrientation:horizontal
 
== Control Types ==
* pnl: Panel
* uco: User defined control; needs attribute Type with the value containing the full namespace for the control, eg:
        ucoPersonnelTabSet:
            Type: Ict.Petra.Client.MPartner.Gui.TUC_PartnerEdit_PersonnelTabSet
* tab: Page Control, consisting of tpg (tabbed pages)
* grp: Groupbox
* chk: Checkbox
* grd: Grid control
* btn: Button
* nud: Numeric Up/Down
** has a second label LabelUnit, which can be optionally set
* txt: normal edit field
** special behaviour for Type=PartnerKey and Type=Extract
* rbt: simple radio button
* rgr: radio button group
** this can contain several other controls in Controls list, which will create radiobuttons with the controls for each item
** or can just contain text in value OptionalValues, which will create radiobuttons for each text
* chk: checkbox
** can have a list of dependent other controls in Controls list
* rng: enter 2 values that define a range
** this is basically a special panel
* cmb: Combobox; usually uses Ict.Common.Controls.TCmbAutoComplete
** attribute '''OptionalValues''' defines the values of the combobox; prepend the default option with equals sign
*** sample: <code>OptionalValues: [=Days, Weeks, Months]</code>
** attribute '''List''': this will load the values from the server (and use a cache as well); it will use cmbAutoPopulatedComboBox instead of TCmbAutoComplete
*** possible values for list: eg. CurrencyCodeList
*** sample: <code>cmbCurrency: {Label=&Currency, DataField=AApSupplier.CurrencyCode, List=CurrencyCodeList}</code>
** attribute '''AutoComplete''': this will store the entered search strings in the user defaults
*** <code>cmbSupplierCode: {Label=S&earch Supplier, AutoComplete=SupplierSearchHistory, Tooltip=Search by supplier name or partner key}</code>
 
== Data Binding ==
We don't use .Net databinding, but the generator wires the data.
* You can use the attribute '''MainEditTable''' that will try to match each control to the field in the table with the same name.
* You can specifically bind data with '''DataField''', either with the data table name or just the field name.
** sample: <code>DataField=AApSupplier.CurrencyCode</code>
=== special lookups ===
* '''PartnerShortNameLookup''': this is for printing the partner short name on a screen; usually this is readonly; but you need to specify that with '''ReadOnly=true'''
** sample: <code>txtSupplierName: {Label=Current Supplier, ReadOnly=true, PartnerShortNameLookup=AApDocument.PartnerKey}</code>
 
=== special behaviour ===
* if you link a boolean database field to a combobox with 2 values, it will match the value (first value is false, second value is true).
** sample: <br/> <code>OptionalValues: [=Invoice, Credit Note]<br/>DataField: CreditNoteFlag</code>
 
== Events ==
* attribute '''OnChange''' points to a function that is called if the value in the control changes
** sample: <code>dtpDateIssued: {Label=&Date Issued, OnChange=UpdateCreditTerms}</code>
* attribute '''Action''' points to an action that is executed for Click etc
** sample: <code>mniNewSupplier: {Action=actNewSupplier}</code>
* attribute '''ActionClick'''/'''ActionDoubleClick''' points to a function that is called if the control is clicked
** sample: <code>grdSupplierResult: {Dock=Fill, ActionDoubleClick=actSupplierTransactions, SelectedRowActivates=cndSelectedSupplier}</code>
* attribute '''SelectedRowActivates''': activate a condition/action, which other actions can depend on

Latest revision as of 03:48, 22 Haziran 2023

Deprecated: this only applied to the winforms client