WaBis

walter.bislins.ch

CP: Vorlagen

Mit den folgenden Code-Ausschnitten können schnell Scripts mit ControlPanel Elementen erstellt werden:

Includes

#INCLUDE ControlPanel.inc

// Kurzversion

function UpdateAll() {
  Model.Update();
  ControlPanels.Update();
  ModelGraph.Redraw();
}

ControlPanels.NewPanel( {
    ModelRef: 'Model',
    OnModelChange: UpdateAll,
    PanelFormat: 'InputNormalWidth',
    NCols: 2,
    Format: 'std',
    Digits: 8
  }

).AddHeader( {
    Text: 'Header' + ControlPanels.SmallButtonR('Text','Function()','Blue'),
    ColSpan: 4
  }

).AddTextField( {
    Name: 'Name',
    Label: 'Label',
    Units: 'units',
  }

).Render();


ControlPanels.NewPanel()

ControlPanels.NewPanel( { 
  Name: 'Panel1',
  ModelRef: 'Model',
  NCols: 1, 
  OnModelChange: UpdateAll, 
  Format: 'fix0', 
  FormatTab: true,
  Digits: 2,
  ReadOnly: false, 
  Enabled: true,
  EnabledRef: 'prop',
  HiliChanges: false,
  DimmDefault: false,
  PanelFormat: 'InputNormalWidth'

} ).Add...( {

} ).Render();

ControlPanels.NewSliderPanel()

ControlPanels.NewSliderPanel( { 
  Name: 'SliderPanel1',
  ModelRef: 'Model',
  NCols: 1, 
  ValuePos: 'left',
  OnModelChange: UpdateAll, 
  Format: 'fix0', 
  Digits: 2,
  ReadOnly: false, 
  Enabled: true,
  EnabledRef: 'prop',
  HiliChanges: false,
  DimmDefault: false,
  PanelFormat: 'InputNormalWidth'

} ).Add...( {

} ).Render();

AddHeader()

} ).AddHeader( {
  Text: 'Header',
  ColSpan: 1,
  Attr: 'style=\"color: blue;\"'

} ).Add...( {

AddHtmlField()

} ).AddHtmlField( {
  Name: 'Field1',
  Label: 'Name',
  Html: 'HtmlText',
  ValueRef: 'ModelRef.Name',
  ColSpan: 1

} ).Add...( {

AddTextField()

} ).AddTextField( {
  Name: 'Field1',
  Label: 'Name',
  ColSpan: 1,
  ValueRef: 'ModelRef.Name',
  Format: 'fix0', 
  FormatRef: '',
  Digits: 2,
  DigitsRef: '',
  Mult: 1,
  MultRef: '',
  Units: '',
  UnitsRef: '',
  Description: '',
  Link: '',
  ReadOnly: false, 
  Enabled: true,
  EnabledRef: '',
  HiliChanges: false,
  DimmDefault: false

} ).Add...( {

AddSliderField()

} ).AddSliderField( {
  Name: 'Field1',
  Label: 'Name',
  Caption: '⇔',
  Color: 'red',
  ColSpan: 1,
  ValueRef: 'ModelRef.Name',
  Min: 0,
  Max: 1,
  Steps: 0,
  ReadOnly: false,
  Enabled: true,
  EnabledRef: '',
  BorderWidth: 1

} ).Add...( {

AddValueSliderField()

} ).AddValueSliderField( {
  Name: 'Field1',
  Label: 'Name',
  Caption: '⇔',
  Color: 'red',
  ColSpan: 1,
  ValueRef: 'ModelRef.Name',
  SliderValueRef: 'ModelRef.Name',
  Min: 0,
  Max: 1,
  Steps: 0,
  ReadOnly: false,
  SliderReadOnly: false,
  Enabled: true,
  EnabledRef: '',
  BorderWidth: 1

} ).Add...( {

AddCheckboxField()

} ).AddCheckboxField( {
  Name: 'Field1',
  Label: 'Name',
  NCols: Items.length,
  ColSpan: 1,
  Description: '',
  ReadOnly: false,
  Enabled: true,
  EnabledRef: '',
  Items: [
    {
      Name: 'CBName-0',
      ValueRef: 'ModelRef.Name',
      Text: 'Name',
      Value: 'Name',
      ReadOnly: false,
      Enabled: true,
      EnabledRef: ''
    }, {

    }
  ]

} ).Add...( {

AddRadiobuttonField()

} ).AddRadiobuttonField( {
  Name: 'Field1',
  Label: 'Name',
  ValueRef: 'ModelRef.Name',
  ValueType: 'str|int|num',
  NCols: Items.length,
  ColSpan: 1,
  Description: '',
  ReadOnly: false,
  Enabled: true,
  EnabledRef: '',
  Items: [
    {
      Name: 'RBName-0',
      Text: 'Name',
      Value: 'Name'|0
    }, {

    }
  ]

} ).Add...( {

Weitere Infos zur Seite
Erzeugt Donnerstag, 18. August 2016
von wabis
Zum Seitenanfang
Geändert Freitag, 19. Oktober 2018
von wabis