Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision |
dragengine:modules:dragonscript:xmlguitheme:widgetdesigner [2018/02/28 10:55] – [Window] dragonlord | dragengine:modules:dragonscript:xmlguitheme:widgetdesigner [2020/04/03 10:20] – url move dragonlord |
---|
Widget designers are always based directly or indirectly on a type. This type is the //Designer Prototype// and defines what instance of //WidgetDesigner// is used in the scripts. It is important to choose the right prototype for a designer since the widget type and widget designer type are closely linked. For example you can use a //Widget// type designer for all kinds of widgets but a //Button// type designer is only working on //Button// widgets or subclasses thereof. If you choose the wrong designer type a run-time invalid cast exception is likely thrown. | Widget designers are always based directly or indirectly on a type. This type is the //Designer Prototype// and defines what instance of //WidgetDesigner// is used in the scripts. It is important to choose the right prototype for a designer since the widget type and widget designer type are closely linked. For example you can use a //Widget// type designer for all kinds of widgets but a //Button// type designer is only working on //Button// widgets or subclasses thereof. If you choose the wrong designer type a run-time invalid cast exception is likely thrown. |
| |
The following prototypes are provided by default by the [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Designers_1_1WidgetDesigners.html|WidgetDesigners]] script class: | The following prototypes are provided by default by the [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Designers_1_1WidgetDesigners.html|WidgetDesigners]] script class: |
^ Name ^ Script Class ^ Target Widget Class ^ | ^ Name ^ Script Class ^ Target Widget Class ^ |
| Button | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Designers_1_1DefaultButtonDesigner.html|DefaultButtonDesigner]] | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Button.html|Button]] | | | [[#button|Button]] | [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Designers_1_1DefaultButtonDesigner.html|DefaultButtonDesigner]] | [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Button.html|Button]] | |
| CheckBox | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Designers_1_1DefaultCheckBoxDesigner.html|DefaultCheckBoxDesigner]] | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1CheckBox.html|CheckBox]] | | | [[#checkbox|CheckBox]] | [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Designers_1_1DefaultCheckBoxDesigner.html|DefaultCheckBoxDesigner]] | [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1CheckBox.html|CheckBox]] | |
| ComboBox | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Designers_1_1DefaultComboBoxDesigner.html|DefaultComboBoxDesigner]] | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1ComboBox.html|ComboBox]] | | | [[#combobox|ComboBox]] | [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Designers_1_1DefaultComboBoxDesigner.html|DefaultComboBoxDesigner]] | [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1ComboBox.html|ComboBox]] | |
| Desktop | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Designers_1_1DefaultWidgetDesigner.html|DefaultWidgetDesigner]] | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Desktop.html|Desktop]] | | | [[#widget|Desktop]] | [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Designers_1_1DefaultWidgetDesigner.html|DefaultWidgetDesigner]] | [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Desktop.html|Desktop]] | |
| Label | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Designers_1_1DefaultLabelDesigner.html|DefaultLabelDesigner]] | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Label.html|Label]] | | | [[#label|Label]] | [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Designers_1_1DefaultLabelDesigner.html|DefaultLabelDesigner]] | [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Label.html|Label]] | |
| ListBox | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Designers_1_1DefaultWidgetDesigner.html|DefaultWidgetDesigner]] | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1ListBox.html|ListBox]] | | | [[#widget|ListBox]] | [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Designers_1_1DefaultWidgetDesigner.html|DefaultWidgetDesigner]] | [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1ListBox.html|ListBox]] | |
| OptionBox | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Designers_1_1DefaultOptionBoxDesigner.html|DefaultOptionBoxDesigner]] | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1OptionBox.html|OptionBox]] | | | [[#optionbox|OptionBox]] | [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Designers_1_1DefaultOptionBoxDesigner.html|DefaultOptionBoxDesigner]] | [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1OptionBox.html|OptionBox]] | |
| PlayerChoiceEntry | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Designers_1_1DefaultLabelDesigner.html|DefaultLabelDesigner]] | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1OptionBox.html|OptionBox]] | | | [[#label|PlayerChoiceEntry]] | [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Designers_1_1DefaultLabelDesigner.html|DefaultLabelDesigner]] | [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1OptionBox.html|OptionBox]] | |
| ProgressBar | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Designers_1_1DefaultProgressBarDesigner.html|DefaultProgressBarDesigner]] | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1ProgressBar.html|ProgressBar]] | | | [[#progressbar|ProgressBar]] | [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Designers_1_1DefaultProgressBarDesigner.html|DefaultProgressBarDesigner]] | [[https://developer.dragondreams.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1ProgressBar.html|ProgressBar]] | |
| ScrollBar | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Designers_1_1DefaultScrollBarDesigner.html|DefaultScrollBarDesigner]] | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1ScrollBar.html|ScrollBar]] | | | [[#scrollbar|ScrollBar]] | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Designers_1_1DefaultScrollBarDesigner.html|DefaultScrollBarDesigner]] | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1ScrollBar.html|ScrollBar]] | |
| SpinButton | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Designers_1_1DefaultSpinButtonDesigner.html|DefaultSpinButtonDesigner]] | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1SpinButton.html|SpinButton]] | | | [[#spinbutton|SpinButton]] | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Designers_1_1DefaultSpinButtonDesigner.html|DefaultSpinButtonDesigner]] | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1SpinButton.html|SpinButton]] | |
| TextArea | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Designers_1_1DefaultTextAreaDesigner.html|DefaultTextAreaDesigner]] | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1TextArea.html|TextArea]] | | | [[#widget|TextArea]] | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Designers_1_1DefaultTextAreaDesigner.html|DefaultTextAreaDesigner]] | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1TextArea.html|TextArea]] | |
| TextField | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Designers_1_1DefaultTextFieldDesigner.html|DefaultTextFieldDesigner]] | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1TextField.html|TextField]] | | | [[#widget|TextField]] | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Designers_1_1DefaultTextFieldDesigner.html|DefaultTextFieldDesigner]] | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1TextField.html|TextField]] | |
| Widget | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Designers_1_1DefaultWidgetDesigner.html|DefaultWidgetDesigner]] | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Widget.html|Widget]] | | | [[#widget|Widget]] | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Designers_1_1DefaultWidgetDesigner.html|DefaultWidgetDesigner]] | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Widget.html|Widget]] | |
| Window | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Designers_1_1DefaultWindowDesigner.html|DefaultWindowDesigner]] | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Window.html|Window]] | | | [[#window|Window]] | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Designers_1_1DefaultWindowDesigner.html|DefaultWindowDesigner]] | [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Window.html|Window]] | |
| |
You can use custom prototypes by adding them to [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Designers_1_1WidgetDesigners.html|WidgetDesigners]] instance before loading gui themes. This is useful if you created custom widget subclasses requiring custom parameters. | You can use custom prototypes by adding them to [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1Designers_1_1WidgetDesigners.html|WidgetDesigners]] instance before loading gui themes. This is useful if you created custom widget subclasses requiring custom parameters. |
| |
^ Parameter Name ^ Supported parameter type ^ Description ^ | ^ Parameter Name ^ Supported parameter type ^ Description ^ |
| {state}.buttonDropDown | [[dragengine:modules:dragonscript:xmlguitheme:parameters#canvascreator|CanvasCreator]] | Canvas creator to draw drop down button | | | {state}.buttonDropDown | [[dragengine:modules:dragonscript:xmlguitheme:parameters#canvas_creator|CanvasCreator]] | Canvas creator to draw drop down button | |
| {state}.imageDropDown | [[dragengine:modules:dragonscript:xmlguitheme:parameters#image|Image]] | Image to use inside dropped down button | | | {state}.imageDropDown | [[dragengine:modules:dragonscript:xmlguitheme:parameters#image|Image]] | Image to use inside dropped down button | |
| |
| |
| ===== SpinButton ===== |
| Widget designer suitable for [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1SpinButton.html|SpinButton]] widgets and subclasses thereof. |
| |
| These additional parameters can be used. |
| |
| ^ Parameter Name ^ Supported parameter type ^ Description ^ |
| | size | [[dragengine:modules:dragonscript:xmlguitheme:parameters#integer|Integer]] | Fixed width in pixels of the spin button arrow buttons | |
| | buttonUp | [[dragengine:modules:dragonscript:xmlguitheme:parameters#widget_designer|WidgetDesigner]] | Widget designer to use for the up arrow button | |
| | buttonDown | [[dragengine:modules:dragonscript:xmlguitheme:parameters#widget_designer|WidgetDesigner]] | Widget designer to use for the down arrow button | |
| | {state}.imageUp | [[dragengine:modules:dragonscript:xmlguitheme:parameters#image|Image]] | Image to use for the up arrow button | |
| | {state}.imageDown | [[dragengine:modules:dragonscript:xmlguitheme:parameters#image|Image]] | Image to use for the down arrow button | |
| |
| |
| ===== ScrollBar ===== |
| Widget designer suitable for [[https://dragengine.rptd.ch/docs/dragonscript/scriptapi/latest/classDragengine_1_1Gui_1_1ScrollBar.html|ScrollBar]] widgets and subclasses thereof. |
| |
| These additional parameters can be used. |
| |
| ^ Parameter Name ^ Supported parameter type ^ Description ^ |
| | size | [[dragengine:modules:dragonscript:xmlguitheme:parameters#integer|Integer]] | Fixed width/height in pixels of the scroll bar depending on orientation | |
| | buttonUp | [[dragengine:modules:dragonscript:xmlguitheme:parameters#widget_designer|WidgetDesigner]] | Widget designer to use for the up arrow button | |
| | buttonDown | [[dragengine:modules:dragonscript:xmlguitheme:parameters#widget_designer|WidgetDesigner]] | Widget designer to use for the down arrow button | |
| | buttonLeft | [[dragengine:modules:dragonscript:xmlguitheme:parameters#widget_designer|WidgetDesigner]] | Widget designer to use for the left arrow button | |
| | buttonRight | [[dragengine:modules:dragonscript:xmlguitheme:parameters#widget_designer|WidgetDesigner]] | Widget designer to use for the right arrow button | |
| | {state}.imageUp | [[dragengine:modules:dragonscript:xmlguitheme:parameters#image|Image]] | Image to use for the up arrow button | |
| | {state}.imageDown | [[dragengine:modules:dragonscript:xmlguitheme:parameters#image|Image]] | Image to use for the down arrow button | |
| | {state}.imageLeft | [[dragengine:modules:dragonscript:xmlguitheme:parameters#image|Image]] | Image to use for the left arrow button | |
| | {state}.imageRight | [[dragengine:modules:dragonscript:xmlguitheme:parameters#image|Image]] | Image to use for the right arrow button | |
| | {state}.canvasFrame | [[dragengine:modules:dragonscript:xmlguitheme:parameters#canvas_creator|CanvasCreator]] | Canvas creator to use for the scroll area frame | |
| | {state}.canvasKnob | [[dragengine:modules:dragonscript:xmlguitheme:parameters#canvas_creator|CanvasCreator]] | Canvas creator to use for the scroll area knob | |
| | {state}.paddingKnobFrame | [[dragengine:modules:dragonscript:xmlguitheme:parameters#bordersize|BorderSize]] | Padding between scroll area knob and frame | |
| |