diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | e9ae80694875f869892f13f4fcaf1170a00dea41 (patch) | |
tree | aa2f8d8a217e2d376224c8d46b7397b68d35de2d /kommander/examples/tutorial | |
download | tdewebdev-e9ae80694875f869892f13f4fcaf1170a00dea41.tar.gz tdewebdev-e9ae80694875f869892f13f4fcaf1170a00dea41.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kommander/examples/tutorial')
20 files changed, 3081 insertions, 0 deletions
diff --git a/kommander/examples/tutorial/Makefile.am b/kommander/examples/tutorial/Makefile.am new file mode 100644 index 00000000..e654bdd2 --- /dev/null +++ b/kommander/examples/tutorial/Makefile.am @@ -0,0 +1,10 @@ +execkmdrdir = ${kde_datadir}/kmdr-editor/editor/tutorial + +execkmdr_SCRIPTS = append.kmdr calc.kmdr dcop.kmdr globals.kmdr loop.kmdr progressbar.kmdr slots.kmdr \ + strings.kmdr tree.kmdr arrays.kmdr cmdline.kmdr dialogs.kmdr initialize.kmdr picview.kmdr settings.kmdr \ + statusbar.kmdr table.kmdr widgets.kmdr + + +tutorialdir = ${kde_datadir}/kmdr-editor/editor/tutorial +tutorial_DATA = README + diff --git a/kommander/examples/tutorial/README b/kommander/examples/tutorial/README new file mode 100644 index 00000000..658503e0 --- /dev/null +++ b/kommander/examples/tutorial/README @@ -0,0 +1,123 @@ +Those example illustrate various Kommander features. + +In the future they would be used together with Kommander tutorials. +For now, only brief information is available + + +* GLOBALS.KMDR +Shows using global and setGlobal DCOP calls to provide global +variables for script. +Functions/concepts: +- global +- setGlobal +- changeWidgetText + +* DCOP.KMDR +Shows how to use both local and external DCOP calls to communicate +with external application (here: KMail). +Functions/concepts: +- external DCOP +- addListItem +- enableWidget +- @selectedWidgetText +- @widgetText + +* SLOTS.KMDR +Shows how to use connections/slots to handle events. Both population and +standard slots are used. +- slots/connections +- populate() + +* SETTINGS.KMDR +Shows how to use @readSetting and @writeSetting functions to write/restore +widget content. Also, shows how to use populate() slot to initialize widget +content. +Functions/concepts: +- @readSetting +- @writeSetting +- populate() +- slots/connections +- destroy + +* APPEND.KMDR +Shows how you can append text to TextEdit, and how you can use it to display +formatted text. +Functions/concepts: +- changeWidetText +- RichTextEdit + +* CMDLINE.KMDR +Shows how you can pass parameters to Kommander dialog via command-line. +Also, shows how to change list content and button text. +Functions/concepts: +- command-line arguments +- global +- changeWidgetText +- addListItem +- clearList + +* INITIALIZE.KMDR +Shows how you can use 'initialization' and 'destroy' scripts of main +dialog to initialize and store some settings. +Functions/concepts: +- initialization +- destroy +- readSetting +- writeSetting + +* ARRAY.KMDR +Shows how to use assocative arrays to store and restore information +associated with container items. +Functions/concepts: +- @Array functions + +* STRINGS.KMDR +Shows how to use string-handling functions +Functions/concepts: +- @String functions +- rich text editor + +* TREE.KMDR +Shows how to use tree widget +- tree widget +- FileSelector +- initialization +- env + +* WIDGETS.KMDR +Shows how to get widget information +- type method +- children method + +* STATUSBAR.KMDR +Shows how to use statusbar widget +- statusbar widget +- populate + +* LOOP.KMDR +Shows how to use internal loops +- for +- forEach + +* CALC.KMDR +Shows how to use @expr function to do some calculations +- expr +- String.replace + +* PICVIEW.KMDR +Shows how to use PixmapLabel widget using populate() function +- PixmapLabel +- populate +- FileSelector +- slots/connections + +* TABLE.KMDR +Shows how to use Table widget +- insertRow +- insertColumn +- currentRow +- currentColumn +- setColumnCaption +- setRowCaption +- removeRow +- removeColumn diff --git a/kommander/examples/tutorial/append.kmdr b/kommander/examples/tutorial/append.kmdr new file mode 100644 index 00000000..fe22a4c3 --- /dev/null +++ b/kommander/examples/tutorial/append.kmdr @@ -0,0 +1,115 @@ +<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> +<class>Form1</class> +<widget class="Dialog"> + <property name="name"> + <cstring>Form1</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>379</width> + <height>272</height> + </rect> + </property> + <property name="caption"> + <string>Append date</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string></string> + </stringlist> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>11</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="TextEdit" row="0" column="0"> + <property name="name"> + <cstring>TextEdit1</cstring> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string>@widgetText</string> + </stringlist> + </property> + </widget> + <widget class="QLayoutWidget" row="1" column="0"> + <property name="name"> + <cstring>Layout2</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <spacer> + <property name="name"> + <cstring>Spacer1</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>30</width> + <height>0</height> + </size> + </property> + </spacer> + <widget class="ExecButton"> + <property name="name"> + <cstring>ExecButton1</cstring> + </property> + <property name="text"> + <string>Insert date</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string>DATE="Button pressed: <i>`date`</i>" +TEXT='@TextEdit1'"$DATE" +dcop @dcopid KommanderIf changeWidgetText TextEdit1 "$TEXT" +</string> + </stringlist> + </property> + <property name="writeStdout"> + <bool>true</bool> + </property> + </widget> + <spacer> + <property name="name"> + <cstring>Spacer3</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>30</width> + <height>0</height> + </size> + </property> + </spacer> + </hbox> + </widget> + </grid> +</widget> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/kommander/examples/tutorial/arrays.kmdr b/kommander/examples/tutorial/arrays.kmdr new file mode 100644 index 00000000..dd4b18c6 --- /dev/null +++ b/kommander/examples/tutorial/arrays.kmdr @@ -0,0 +1,204 @@ +<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> +<class>Form1</class> +<widget class="Dialog"> + <property name="name"> + <cstring>Form1</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>386</width> + <height>206</height> + </rect> + </property> + <property name="caption"> + <string>Program array</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string></string> + <string>@Array.setValue(Programs, kcalc, KDE calculator) +@Array.setValue(Programs, kwrite, Advanced editor) +@Array.setValue(Programs, ark, Archive tool) +@Array.setValue(Programs, kdict, Interface to online dictonaries) +</string> + <string></string> + </stringlist> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>11</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QLabel" row="0" column="0"> + <property name="name"> + <cstring>TextLabel2</cstring> + </property> + <property name="text"> + <string>Programs:</string> + </property> + </widget> + <widget class="ListBox" row="1" column="0"> + <item> + <property name="text"> + <string>kwrite</string> + </property> + </item> + <item> + <property name="text"> + <string>kcalc</string> + </property> + </item> + <item> + <property name="text"> + <string>kdict</string> + </property> + </item> + <item> + <property name="text"> + <string>ark</string> + </property> + </item> + <property name="name"> + <cstring>ListBox1</cstring> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string>@selectedWidgetText</string> + </stringlist> + </property> + </widget> + <widget class="LineEdit" row="2" column="0"> + <property name="name"> + <cstring>LineEdit1</cstring> + </property> + <property name="backgroundOrigin"> + <enum>ParentOrigin</enum> + </property> + <property name="readOnly"> + <bool>true</bool> + </property> + <property name="populationText"> + <string>@Array.value(Programs, @ListBox1)</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string></string> + </stringlist> + </property> + </widget> + <widget class="QLayoutWidget" row="3" column="0"> + <property name="name"> + <cstring>Layout4</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <spacer> + <property name="name"> + <cstring>Spacer6</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>30</width> + <height>0</height> + </size> + </property> + </spacer> + <widget class="ExecButton"> + <property name="name"> + <cstring>ExecButton1</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>0</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>&Run</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string>@exec(ListBox1) + +</string> + </stringlist> + </property> + </widget> + <widget class="ExecButton"> + <property name="name"> + <cstring>ExecButton1_2</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>0</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Run &All</string> + </property> + <property name="populationText"> + <string></string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string>@Array.keys(Programs)</string> + </stringlist> + </property> + </widget> + <spacer> + <property name="name"> + <cstring>Spacer5</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>30</width> + <height>0</height> + </size> + </property> + </spacer> + </hbox> + </widget> + </grid> +</widget> +<connections> + <connection> + <sender>ListBox1</sender> + <signal>selectionChanged()</signal> + <receiver>LineEdit1</receiver> + <slot>populate()</slot> + </connection> +</connections> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/kommander/examples/tutorial/calc.kmdr b/kommander/examples/tutorial/calc.kmdr new file mode 100644 index 00000000..5e0082f4 --- /dev/null +++ b/kommander/examples/tutorial/calc.kmdr @@ -0,0 +1,271 @@ +<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> +<class>Form1</class> +<widget class="Dialog"> + <property name="name"> + <cstring>Form1</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>577</width> + <height>305</height> + </rect> + </property> + <property name="caption"> + <string>Simple calculator</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string></string> + <string></string> + <string></string> + </stringlist> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>11</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QLayoutWidget" row="0" column="1"> + <property name="name"> + <cstring>Layout7</cstring> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QLabel"> + <property name="name"> + <cstring>TextLabel1</cstring> + </property> + <property name="text"> + <string>History:</string> + </property> + </widget> + <widget class="ListBox"> + <property name="name"> + <cstring>ListBox1</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>5</hsizetype> + <vsizetype>7</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>200</width> + <height>0</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>250</width> + <height>32767</height> + </size> + </property> + </widget> + <widget class="LineEdit"> + <property name="name"> + <cstring>LineEdit2</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>5</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>250</width> + <height>32767</height> + </size> + </property> + <property name="paletteBackgroundColor"> + <color> + <red>233</red> + <green>233</green> + <blue>233</blue> + </color> + </property> + <property name="readOnly"> + <bool>true</bool> + </property> + </widget> + <widget class="ExecButton"> + <property name="name"> + <cstring>ExecButton2</cstring> + </property> + <property name="text"> + <string>Cl&ear</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string>@ListBox1.clear +@LineEdit2.setText("Sum: 0")</string> + </stringlist> + </property> + </widget> + </vbox> + </widget> + <widget class="QLayoutWidget" row="0" column="0"> + <property name="name"> + <cstring>Layout4</cstring> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QLabel" row="2" column="0"> + <property name="name"> + <cstring>TextLabel2</cstring> + </property> + <property name="text"> + <string>Expression:</string> + </property> + </widget> + <widget class="QLayoutWidget" row="4" column="0"> + <property name="name"> + <cstring>Layout1</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <spacer> + <property name="name"> + <cstring>Spacer1</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>30</width> + <height>0</height> + </size> + </property> + </spacer> + <widget class="ExecButton"> + <property name="name"> + <cstring>ExecButton1</cstring> + </property> + <property name="text"> + <string>&Calculate</string> + </property> + <property name="autoDefault"> + <bool>false</bool> + </property> + <property name="default"> + <bool>true</bool> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string>@ListBox1.insertItem(@expr(@LineEdit1.text), -1) +@LineEdit1.clear +@LineEdit2.setText("Sum: @expr(@String.replace(@ListBox1.text, "\n", "+"))") +</string> + </stringlist> + </property> + </widget> + <spacer> + <property name="name"> + <cstring>Spacer2</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>30</width> + <height>0</height> + </size> + </property> + </spacer> + </hbox> + </widget> + <widget class="LineEdit" row="3" column="0"> + <property name="name"> + <cstring>LineEdit1</cstring> + </property> + </widget> + <spacer row="5" column="0"> + <property name="name"> + <cstring>Spacer3_2</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>0</width> + <height>91</height> + </size> + </property> + </spacer> + <spacer row="0" column="0"> + <property name="name"> + <cstring>Spacer3</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>0</width> + <height>91</height> + </size> + </property> + </spacer> + </grid> + </widget> + </grid> +</widget> +<tabstops> + <tabstop>LineEdit1</tabstop> + <tabstop>ExecButton1</tabstop> + <tabstop>ExecButton2</tabstop> + <tabstop>ListBox1</tabstop> +</tabstops> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/kommander/examples/tutorial/cmdline.kmdr b/kommander/examples/tutorial/cmdline.kmdr new file mode 100644 index 00000000..0db801d2 --- /dev/null +++ b/kommander/examples/tutorial/cmdline.kmdr @@ -0,0 +1,108 @@ +<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> +<class>Form1</class> +<widget class="Dialog"> + <property name="name"> + <cstring>Form1</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>462</width> + <height>340</height> + </rect> + </property> + <property name="caption"> + <string>Form1</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string></string> + </stringlist> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>11</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="ListBox" row="0" column="0" rowspan="1" colspan="3"> + <item> + <property name="text"> + <string>Usage: kmdr-executor cmdline.kmdr [BUTTON='title'] arg1 ...</string> + </property> + </item> + <property name="name"> + <cstring>ListBox1</cstring> + </property> + </widget> + <spacer row="1" column="0"> + <property name="name"> + <cstring>Spacer1</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>149</width> + <height>0</height> + </size> + </property> + </spacer> + <widget class="ExecButton" row="1" column="1"> + <property name="name"> + <cstring>ExecButton1</cstring> + </property> + <property name="text"> + <string>Read command line</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string># Put command-line arguments into list +dcop @dcopid KommanderIf clearList ListBox1 +VALUE=`dcop @dcopid KommanderIf global ARGS` +for i in $VALUE; do + dcop @dcopid KommanderIf addListItem ListBox1 "$i" 999 +done + +ARGS=`dcop @dcopid KommanderIf global ARGCOUNT` +dcop @dcopid KommanderIf addListItem ListBox1 "Arguments count: $ARGS" 999 + + +# Read button text +BUTTONTEXT=`dcop @dcopid KommanderIf global BUTTON` +if [ "$BUTTONTEXT" ]; then + dcop @dcopid KommanderIf changeWidgetText ExecButton1 "$BUTTONTEXT" +fi</string> + </stringlist> + </property> + </widget> + <spacer row="1" column="2"> + <property name="name"> + <cstring>Spacer3</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>148</width> + <height>0</height> + </size> + </property> + </spacer> + </grid> +</widget> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/kommander/examples/tutorial/dcop.kmdr b/kommander/examples/tutorial/dcop.kmdr new file mode 100644 index 00000000..9ceae259 --- /dev/null +++ b/kommander/examples/tutorial/dcop.kmdr @@ -0,0 +1,139 @@ +<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> +<class>Form1</class> +<widget class="Dialog"> + <property name="name"> + <cstring>Form1</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>399</width> + <height>247</height> + </rect> + </property> + <property name="caption"> + <string>KMail communication</string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>11</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="ListBox" row="0" column="0"> + <property name="name"> + <cstring>AccountListBox</cstring> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string>@selectedWidgetText</string> + </stringlist> + </property> + </widget> + <widget class="QLayoutWidget" row="1" column="0"> + <property name="name"> + <cstring>Layout2</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <spacer> + <property name="name"> + <cstring>Spacer3</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>30</width> + <height>0</height> + </size> + </property> + </spacer> + <widget class="ExecButton"> + <property name="name"> + <cstring>AccountButton</cstring> + </property> + <property name="text"> + <string>Get accounts</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string># Get list of accounts from KMail +LIST=`dcop kmail KMailIface accounts` + +# Add each account to the list and enable 'Check Account' button +if [ "$LIST" ]; then + for i in $LIST; do + dcop @dcopid KommanderIf addListItem AccountListBox "$i" 1000; + done + dcop @dcopid KommanderIf enableWidget CheckButton true +fi +</string> + </stringlist> + </property> + <property name="writeStdout"> + <bool>true</bool> + </property> + </widget> + <widget class="ExecButton"> + <property name="name"> + <cstring>CheckButton</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="text"> + <string>Check account</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string># Get current account +# Look at AccountListBox script to see how @AccountListBox is calculated + +dcop kmail KMailIface checkAccount @AccountListBox</string> + </stringlist> + </property> + <property name="writeStdout"> + <bool>true</bool> + </property> + </widget> + <spacer> + <property name="name"> + <cstring>Spacer2</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>30</width> + <height>0</height> + </size> + </property> + </spacer> + </hbox> + </widget> + </grid> +</widget> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/kommander/examples/tutorial/dialogs.kmdr b/kommander/examples/tutorial/dialogs.kmdr new file mode 100644 index 00000000..62c97bc0 --- /dev/null +++ b/kommander/examples/tutorial/dialogs.kmdr @@ -0,0 +1,198 @@ +<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> +<class>DialogTest</class> +<comment>This is my program</comment> +<author>Michał Rudolf</author> +<license>GPL</license> +<version>0.1</version> +<widget class="Dialog"> + <property name="name"> + <cstring>DialogTest</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>600</width> + <height>428</height> + </rect> + </property> + <property name="caption"> + <string>Test of Dialogs</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string></string> + <string></string> + <string></string> + </stringlist> + </property> + <property name="useInternalParser"> + <bool>true</bool> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>11</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="ExecButton" row="1" column="0"> + <property name="name"> + <cstring>ExecButton1</cstring> + </property> + <property name="text"> + <string>Run dialogs...</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string>message_info("This is a demonstration of various KDE dialogs", "Demo") +message_error("Cannot enter 3D mode") +if message_question("Do you want to continue?") <> 1 then + debug("Cancelled") +endif +if message_warning("Are you sure you want to continue?") <> 1 then + debug("Aborted") +endif + + +echo("Hello world!") +a = input_text("Input text", "Text", "Default text") +LineEdit1.setText(a) + +a = input_color +LineEdit2.setText(a) + +a = input_value("Input value", "Value", 10, 1, 100) +LineEdit3.setText(a) + +a = input_openfile +LineEdit4.setText(a) + +echo("This is a test too") +a = input_savefile +LineEdit5.setText(a) + +a = input_directory +LineEdit6.setText(a) + +a = input_openfiles +ListBox1.setText(a) + +</string> + </stringlist> + </property> + </widget> + <widget class="QLayoutWidget" row="0" column="0"> + <property name="name"> + <cstring>Layout1</cstring> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="Label" row="4" column="0"> + <property name="name"> + <cstring>Label6</cstring> + </property> + <property name="text"> + <string>File to save:</string> + </property> + </widget> + <widget class="Label" row="1" column="0"> + <property name="name"> + <cstring>Label2</cstring> + </property> + <property name="text"> + <string>Color:</string> + </property> + </widget> + <widget class="ListBox" row="6" column="1"> + <property name="name"> + <cstring>ListBox1</cstring> + </property> + </widget> + <widget class="Label" row="6" column="0"> + <property name="name"> + <cstring>Label5</cstring> + </property> + <property name="text"> + <string>Files to open:</string> + </property> + </widget> + <widget class="Label" row="5" column="0"> + <property name="name"> + <cstring>Label7</cstring> + </property> + <property name="text"> + <string>Directory:</string> + </property> + </widget> + <widget class="Label" row="2" column="0"> + <property name="name"> + <cstring>Label3</cstring> + </property> + <property name="text"> + <string>Value:</string> + </property> + </widget> + <widget class="LineEdit" row="0" column="1"> + <property name="name"> + <cstring>LineEdit1</cstring> + </property> + </widget> + <widget class="Label" row="3" column="0"> + <property name="name"> + <cstring>Label4</cstring> + </property> + <property name="text"> + <string>File to open:</string> + </property> + </widget> + <widget class="LineEdit" row="2" column="1"> + <property name="name"> + <cstring>LineEdit3</cstring> + </property> + </widget> + <widget class="LineEdit" row="3" column="1"> + <property name="name"> + <cstring>LineEdit4</cstring> + </property> + </widget> + <widget class="LineEdit" row="4" column="1"> + <property name="name"> + <cstring>LineEdit5</cstring> + </property> + </widget> + <widget class="LineEdit" row="1" column="1"> + <property name="name"> + <cstring>LineEdit2</cstring> + </property> + </widget> + <widget class="LineEdit" row="5" column="1"> + <property name="name"> + <cstring>LineEdit6</cstring> + </property> + </widget> + <widget class="Label" row="0" column="0"> + <property name="name"> + <cstring>Label1</cstring> + </property> + <property name="text"> + <string>Text:</string> + </property> + </widget> + </grid> + </widget> + </grid> +</widget> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/kommander/examples/tutorial/globals.kmdr b/kommander/examples/tutorial/globals.kmdr new file mode 100644 index 00000000..71cfad17 --- /dev/null +++ b/kommander/examples/tutorial/globals.kmdr @@ -0,0 +1,96 @@ +<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> +<class>Form1</class> +<widget class="Dialog"> + <property name="name"> + <cstring>Form1</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>250</width> + <height>122</height> + </rect> + </property> + <property name="caption"> + <string>Global variables demo</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string></string> + <string></string> + <string></string> + </stringlist> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>11</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QLayoutWidget" row="0" column="0"> + <property name="name"> + <cstring>Layout1</cstring> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="LineEdit"> + <property name="name"> + <cstring>LineEdit1</cstring> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string></string> + </stringlist> + </property> + </widget> + <widget class="ExecButton"> + <property name="name"> + <cstring>ExecButton1</cstring> + </property> + <property name="text"> + <string>Store current date</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string>@setGlobal(TEMPSIZE, "@exec(date)")</string> + </stringlist> + </property> + <property name="writeStdout"> + <bool>true</bool> + </property> + </widget> + <widget class="ExecButton"> + <property name="name"> + <cstring>ExecButton2</cstring> + </property> + <property name="text"> + <string>Restore date</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string>@LineEdit1.setText("@global(TEMPSIZE)")</string> + </stringlist> + </property> + <property name="writeStdout"> + <bool>true</bool> + </property> + </widget> + </vbox> + </widget> + </grid> +</widget> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/kommander/examples/tutorial/initialize.kmdr b/kommander/examples/tutorial/initialize.kmdr new file mode 100644 index 00000000..16ed360d --- /dev/null +++ b/kommander/examples/tutorial/initialize.kmdr @@ -0,0 +1,120 @@ +<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> +<class>InitializationDemo</class> +<widget class="Dialog"> + <property name="name"> + <cstring>InitializationDemo</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>461</width> + <height>108</height> + </rect> + </property> + <property name="caption"> + <string>Initialization and Destroy</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string></string> + <string>dcop @dcopid KommanderIf changeWidgetText OpenLabel "Opened: `date`" +CLOSE="@readSetting("CloseLabel", "Previously closed: never")" +dcop @dcopid KommanderIf changeWidgetText CloseLabel "$CLOSE" + </string> + <string>@writeSetting("CloseLabel", "Previously closed: @exec("date")")</string> + </stringlist> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>11</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QLayoutWidget" row="2" column="0"> + <property name="name"> + <cstring>Layout1</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <spacer> + <property name="name"> + <cstring>Spacer1</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>30</width> + <height>0</height> + </size> + </property> + </spacer> + <widget class="CloseButton"> + <property name="name"> + <cstring>CloseButton1</cstring> + </property> + <property name="text"> + <string>&Close</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string></string> + </stringlist> + </property> + </widget> + <spacer> + <property name="name"> + <cstring>Spacer2</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>30</width> + <height>0</height> + </size> + </property> + </spacer> + </hbox> + </widget> + <widget class="QLabel" row="1" column="0"> + <property name="name"> + <cstring>OpenLabel</cstring> + </property> + <property name="text"> + <string>Opened:</string> + </property> + </widget> + <widget class="QLabel" row="0" column="0"> + <property name="name"> + <cstring>CloseLabel</cstring> + </property> + <property name="text"> + <string>Previously closed:</string> + </property> + </widget> + </grid> +</widget> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/kommander/examples/tutorial/loop.kmdr b/kommander/examples/tutorial/loop.kmdr new file mode 100644 index 00000000..4aa799f1 --- /dev/null +++ b/kommander/examples/tutorial/loop.kmdr @@ -0,0 +1,114 @@ +<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> +<class>Form1</class> +<widget class="Dialog"> + <property name="name"> + <cstring>Form1</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>600</width> + <height>480</height> + </rect> + </property> + <property name="caption"> + <string>Looooop!</string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>11</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="ExecButton" row="1" column="0" rowspan="1" colspan="2"> + <property name="name"> + <cstring>ExecButton1</cstring> + </property> + <property name="text"> + <string>Enter loop!</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string>@forEach(i, @exec(ls)) + @TreeWidget1.insertItem(@i\t@exec(wc -c "@i" | cut -f 1 -d ' '), -1) +@end + +@for(olymp, 1900, 2006, 4) + @ListBox1.insertItem(@olymp, -1) +@end</string> + </stringlist> + </property> + </widget> + <widget class="TreeWidget" row="0" column="0"> + <column> + <property name="text"> + <string>File</string> + </property> + <property name="clickable"> + <bool>true</bool> + </property> + <property name="resizeable"> + <bool>true</bool> + </property> + </column> + <column> + <property name="text"> + <string>Size</string> + </property> + <property name="clickable"> + <bool>true</bool> + </property> + <property name="resizeable"> + <bool>true</bool> + </property> + </column> + <property name="name"> + <cstring>TreeWidget1</cstring> + </property> + <property name="fullWidth"> + <bool>true</bool> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string></string> + </stringlist> + </property> + </widget> + <widget class="QLayoutWidget" row="0" column="1"> + <property name="name"> + <cstring>Layout1</cstring> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QLabel"> + <property name="name"> + <cstring>TextLabel1</cstring> + </property> + <property name="text"> + <string>Olympiads:</string> + </property> + </widget> + <widget class="ListBox"> + <property name="name"> + <cstring>ListBox1</cstring> + </property> + </widget> + </vbox> + </widget> + </grid> +</widget> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/kommander/examples/tutorial/picview.kmdr b/kommander/examples/tutorial/picview.kmdr new file mode 100644 index 00000000..be75af7b --- /dev/null +++ b/kommander/examples/tutorial/picview.kmdr @@ -0,0 +1,148 @@ +<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> +<class>Form1</class> +<widget class="Dialog"> + <property name="name"> + <cstring>Form1</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>618</width> + <height>436</height> + </rect> + </property> + <property name="caption"> + <string>Picture viewer</string> + </property> + <property name="sizeGripEnabled"> + <bool>true</bool> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>11</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="Label" row="0" column="0"> + <property name="name"> + <cstring>Label1</cstring> + </property> + <property name="text"> + <string>Directory:</string> + </property> + </widget> + <widget class="Label" row="1" column="0" rowspan="1" colspan="2"> + <property name="name"> + <cstring>Label2</cstring> + </property> + <property name="text"> + <string>Images:</string> + </property> + </widget> + <widget class="FileSelector" row="0" column="1"> + <property name="name"> + <cstring>FileSelector1</cstring> + </property> + <property name="selectionType"> + <enum>Directory</enum> + </property> + </widget> + <widget class="QLayoutWidget" row="2" column="0" rowspan="1" colspan="2"> + <property name="name"> + <cstring>Layout2</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="ListBox"> + <property name="name"> + <cstring>ListBox1</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>0</hsizetype> + <vsizetype>7</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>200</width> + <height>0</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>200</width> + <height>32767</height> + </size> + </property> + <property name="populationText"> + <string>@exec(cd @FileSelector1.text && find * -name "*.jpg" -o -name "*.png" -o -name "*.gif" -o -name "*.bmp")</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string></string> + </stringlist> + </property> + </widget> + <widget class="PixmapLabel"> + <property name="name"> + <cstring>PixmapLabel1</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>2</hsizetype> + <vsizetype>2</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="frameShape"> + <enum>Box</enum> + </property> + <property name="scaledContents"> + <bool>true</bool> + </property> + <property name="populationText"> + <string>@FileSelector1.text/@ListBox1.selection</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string></string> + </stringlist> + </property> + </widget> + </hbox> + </widget> + </grid> +</widget> +<connections> + <connection> + <sender>FileSelector1</sender> + <signal>widgetTextChanged(const QString&)</signal> + <receiver>ListBox1</receiver> + <slot>populate()</slot> + </connection> + <connection> + <sender>ListBox1</sender> + <signal>highlighted(int)</signal> + <receiver>PixmapLabel1</receiver> + <slot>populate()</slot> + </connection> +</connections> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/kommander/examples/tutorial/progressbar.kmdr b/kommander/examples/tutorial/progressbar.kmdr new file mode 100644 index 00000000..397410cb --- /dev/null +++ b/kommander/examples/tutorial/progressbar.kmdr @@ -0,0 +1,192 @@ +<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> +<class>Form1</class> +<widget class="Dialog"> + <property name="name"> + <cstring>Form1</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>565</width> + <height>390</height> + </rect> + </property> + <property name="caption"> + <string>ProgressBar Demo</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string></string> + <string>@ProgressBar1.setVisible(false)</string> + <string></string> + </stringlist> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>11</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="ProgressBar" row="3" column="0" rowspan="1" colspan="5"> + <property name="name"> + <cstring>ProgressBar1</cstring> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string></string> + </stringlist> + </property> + </widget> + <widget class="TreeWidget" row="2" column="0" rowspan="1" colspan="5"> + <column> + <property name="text"> + <string>Source Tree</string> + </property> + <property name="clickable"> + <bool>true</bool> + </property> + <property name="resizeable"> + <bool>true</bool> + </property> + </column> + <item> + <property name="text"> + <string></string> + </property> + <property name="pixmap"> + <pixmap></pixmap> + </property> + </item> + <property name="name"> + <cstring>TreeWidget1</cstring> + </property> + <property name="allColumnsShowFocus"> + <bool>false</bool> + </property> + <property name="showSortIndicator"> + <bool>true</bool> + </property> + <property name="rootIsDecorated"> + <bool>true</bool> + </property> + <property name="populationText"> + <string></string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string></string> + </stringlist> + </property> + </widget> + <widget class="FileSelector" row="1" column="0" rowspan="1" colspan="5"> + <property name="name"> + <cstring>FileSelector1</cstring> + </property> + <property name="selectionType"> + <enum>Directory</enum> + </property> + </widget> + <widget class="StatusBar" row="5" column="0" rowspan="1" colspan="5"> + <property name="name"> + <cstring>StatusBar1</cstring> + </property> + </widget> + <spacer row="4" column="0"> + <property name="name"> + <cstring>Spacer10</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>191</width> + <height>0</height> + </size> + </property> + </spacer> + <spacer row="4" column="2"> + <property name="name"> + <cstring>Spacer11</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>191</width> + <height>0</height> + </size> + </property> + </spacer> + <widget class="ScriptObject" row="4" column="3"> + <property name="name"> + <cstring>progressLoop</cstring> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string>@# set up a loop using loop variable named "file" +@forEach(file, @exec(cd @FileSelector1.text && find * -maxdepth 0)) + @# set the scale using the generated @[loopvar]_count + @ProgressBar1.setMaximum(@file_count) + @# show file name in statusbar + @StatusBar1.setText(@file) + @TreeWidget1.insertItems(@exec(cd @FileSelector1.text && find @file -name "*"), -1) + @# use the generated @[loopvar]_index to update progressbar + @ProgressBar1.setText(@file_index) +@end +</string> + </stringlist> + </property> + </widget> + <widget class="ExecButton" row="4" column="1"> + <property name="name"> + <cstring>ExecButton25</cstring> + </property> + <property name="text"> + <string>Get Source Tree</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string>@TreeWidget1.clear + +@if(@String.isEmpty(@FileSelector1.text)) + @exec(kdialog --error "please select a directory, preferably not home as it will take time") +@endif + +@if(!@String.isEmpty(@FileSelector1.text)) + @ProgressBar1.setVisible(true) + @progressLoop.execute + @# this fails on kdewebdev 3.3.0 so leave off ".execute" + @ProgressBar1.setVisible(false) + @StatusBar1.setText("Source Tree Listed") +@endif</string> + </stringlist> + </property> + <property name="blockGUI"> + <enum>Button</enum> + </property> + </widget> + <widget class="Label" row="0" column="0" rowspan="1" colspan="5"> + <property name="name"> + <cstring>Label1</cstring> + </property> + <property name="text"> + <string>Select a directory to list it's tree ($HOME NOT recommended for time reasons)</string> + </property> + </widget> + </grid> +</widget> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/kommander/examples/tutorial/settings.kmdr b/kommander/examples/tutorial/settings.kmdr new file mode 100644 index 00000000..3079d6f9 --- /dev/null +++ b/kommander/examples/tutorial/settings.kmdr @@ -0,0 +1,177 @@ +<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> +<class>Form1</class> +<widget class="Dialog"> + <property name="name"> + <cstring>Form1</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>389</width> + <height>91</height> + </rect> + </property> + <property name="caption"> + <string>Storing settings</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string></string> + <string></string> + <string>@writeSetting("LastCommand", "@LineEdit1")</string> + </stringlist> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>11</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QLayoutWidget" row="0" column="0"> + <property name="name"> + <cstring>Layout1</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QLabel"> + <property name="name"> + <cstring>TextLabel1</cstring> + </property> + <property name="text"> + <string>Command:</string> + </property> + </widget> + <widget class="LineEdit"> + <property name="name"> + <cstring>LineEdit1</cstring> + </property> + <property name="populationText"> + <string>@readSetting("LastCommand", "kcalc")</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string>@widgetText</string> + </stringlist> + </property> + </widget> + </hbox> + </widget> + <widget class="QLayoutWidget" row="1" column="0"> + <property name="name"> + <cstring>Layout5</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <spacer> + <property name="name"> + <cstring>Spacer3</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>30</width> + <height>0</height> + </size> + </property> + </spacer> + <widget class="ExecButton"> + <property name="name"> + <cstring>ExecButton1</cstring> + </property> + <property name="minimumSize"> + <size> + <width>60</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string>&Run</string> + </property> + <property name="populationText"> + <string></string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string>@LineEdit1</string> + </stringlist> + </property> + <property name="writeStdout"> + <bool>true</bool> + </property> + </widget> + <widget class="CloseButton"> + <property name="name"> + <cstring>CloseButton1</cstring> + </property> + <property name="minimumSize"> + <size> + <width>60</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string>&Close</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string></string> + </stringlist> + </property> + </widget> + <spacer> + <property name="name"> + <cstring>Spacer4</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>30</width> + <height>0</height> + </size> + </property> + </spacer> + </hbox> + </widget> + </grid> +</widget> +<connections> + <connection> + <sender>LineEdit1</sender> + <signal>widgetOpened()</signal> + <receiver>LineEdit1</receiver> + <slot>populate()</slot> + </connection> +</connections> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/kommander/examples/tutorial/slots.kmdr b/kommander/examples/tutorial/slots.kmdr new file mode 100644 index 00000000..23ab2d09 --- /dev/null +++ b/kommander/examples/tutorial/slots.kmdr @@ -0,0 +1,200 @@ +<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> +<class>Form1</class> +<widget class="Dialog"> + <property name="name"> + <cstring>Form1</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>396</width> + <height>386</height> + </rect> + </property> + <property name="caption"> + <string>Archive viewer</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string></string> + </stringlist> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>11</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QLayoutWidget" row="0" column="0"> + <property name="name"> + <cstring>Layout1</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QLabel"> + <property name="name"> + <cstring>TextLabel1</cstring> + </property> + <property name="text"> + <string>Archive name:</string> + </property> + </widget> + <widget class="FileSelector"> + <property name="name"> + <cstring>FileSelector</cstring> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string>@widgetText</string> + </stringlist> + </property> + <property name="selectionFilter"> + <string>*.tar.gz</string> + <comment>Tar archives</comment> + </property> + </widget> + </hbox> + </widget> + <widget class="QLayoutWidget" row="1" column="0"> + <property name="name"> + <cstring>Layout2</cstring> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QLabel"> + <property name="name"> + <cstring>TextLabel2</cstring> + </property> + <property name="text"> + <string>List of files:</string> + </property> + </widget> + <widget class="ListBox"> + <property name="name"> + <cstring>FileListBox</cstring> + </property> + <property name="populationText"> + <string>@exec("tar tzf @FileSelector")</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string>@selectedWidgetText</string> + </stringlist> + </property> + </widget> + </vbox> + </widget> + <widget class="QLayoutWidget" row="2" column="0"> + <property name="name"> + <cstring>Layout3</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <spacer> + <property name="name"> + <cstring>Spacer1</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>30</width> + <height>0</height> + </size> + </property> + </spacer> + <widget class="ExecButton"> + <property name="name"> + <cstring>ExecButton1</cstring> + </property> + <property name="text"> + <string>View</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string>if [ "@FileSelector" -a "@FileListBox" ]; then + tar xzf "@FileSelector" -C /tmp "@FileListBox" + konqueror "/tmp/@FileListBox" +fi +</string> + </stringlist> + </property> + </widget> + <widget class="CloseButton"> + <property name="name"> + <cstring>CloseButton1</cstring> + </property> + <property name="text"> + <string>&Close</string> + </property> + </widget> + <spacer> + <property name="name"> + <cstring>Spacer2</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>30</width> + <height>0</height> + </size> + </property> + </spacer> + </hbox> + </widget> + </grid> +</widget> +<connections> + <connection> + <sender>FileSelector</sender> + <signal>widgetTextChanged(const QString&)</signal> + <receiver>FileListBox</receiver> + <slot>populate()</slot> + </connection> + <connection> + <sender>FileListBox</sender> + <signal>doubleClicked(QListBoxItem*)</signal> + <receiver>ExecButton1</receiver> + <slot>startProcess()</slot> + </connection> +</connections> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/kommander/examples/tutorial/statusbar.kmdr b/kommander/examples/tutorial/statusbar.kmdr new file mode 100644 index 00000000..d4f96e05 --- /dev/null +++ b/kommander/examples/tutorial/statusbar.kmdr @@ -0,0 +1,99 @@ +<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> +<class>Form1</class> +<widget class="Dialog"> + <property name="name"> + <cstring>Form1</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>536</width> + <height>225</height> + </rect> + </property> + <property name="caption"> + <string>StatusBar example</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string></string> + <string>@StatusBar2.setText(Welcome in this StatusBar demo...)</string> + <string></string> + </stringlist> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>11</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="StatusBar" row="2" column="0"> + <property name="name"> + <cstring>StatusBar2</cstring> + </property> + <property name="populationText"> + <string>@ListBox1.selection selected.</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string></string> + </stringlist> + </property> + </widget> + <widget class="ListBox" row="0" column="0"> + <item> + <property name="text"> + <string>Some item</string> + </property> + </item> + <item> + <property name="text"> + <string>Some other item</string> + </property> + </item> + <item> + <property name="text"> + <string>Another Item</string> + </property> + </item> + <item> + <property name="text"> + <string>One more Item</string> + </property> + </item> + <property name="name"> + <cstring>ListBox1</cstring> + </property> + </widget> + <widget class="ExecButton" row="1" column="0"> + <property name="name"> + <cstring>ExecButton1</cstring> + </property> + <property name="text"> + <string>Update status bar</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string>@StatusBar2.insertItem(This one was updated, 0) +@StatusBar2.insertItem(User: @exec(whoami), 1) +@StatusBar2.insertItem(@exec(date), 2)</string> + </stringlist> + </property> + </widget> + </grid> +</widget> +<connections> + <connection> + <sender>ListBox1</sender> + <signal>clicked(QListBoxItem*,const QPoint&)</signal> + <receiver>StatusBar2</receiver> + <slot>populate()</slot> + </connection> +</connections> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/kommander/examples/tutorial/strings.kmdr b/kommander/examples/tutorial/strings.kmdr new file mode 100644 index 00000000..1ef6a953 --- /dev/null +++ b/kommander/examples/tutorial/strings.kmdr @@ -0,0 +1,206 @@ +<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> +<class>Form1</class> +<widget class="Dialog"> + <property name="name"> + <cstring>Form1</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>522</width> + <height>447</height> + </rect> + </property> + <property name="caption"> + <string>String functions</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string></string> + <string></string> + <string></string> + </stringlist> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>11</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="TextEdit" row="1" column="0"> + <property name="name"> + <cstring>TextEdit1</cstring> + </property> + <property name="readOnly"> + <bool>true</bool> + </property> + <property name="populationText"> + <string>@Array.setValue(Bool, 1, yes) +@Array.setValue(Bool, 0, no) + +<h2>Kommander string functions</h2> +<b>Length:</b> @String.length("@LineEdit1")<br> +<b>First 5 chars:</b> @String.left("@LineEdit1", 5)<br> +<b>Last 5 chars:</b> @String.right("@LineEdit1", 5)<br> +<b>Chars from 6th to 10th:</b> @String.mid("@LineEdit1", 6, 5)<br> +<b>Remove spaces:</b> @String.remove("@LineEdit1", " ")<br> +<b>Replace spaces with *</b>: @String.replace("@LineEdit1", " ", *)<br> +<b>Uppercase:</b> @String.upper("@LineEdit1")<br> +<b>Lowercase:</b> @String.lower("@LineEdit1")<br> +<b>Is a number?:</b> @Array.value(Bool, @String.isNumber("@LineEdit1"))<br> +<b>Is empty?</b> @Array.value(Bool, @String.isEmpty("@LineEdit1"))<br> +<b>Contains "Kommander"?:</b> @String.contains("@LineEdit1", "Kommander")<br> +<b>Position of "Kommander":</b> @String.find("@LineEdit1", "Kommander")<br> +<b>Compare with "Kommander":</b> +@execBegin +if [ @String.compare("@LineEdit1", "Kommander") -lt 0 ];then + echo "Less than Kommander<br>" +elif [ @String.compare("@LineEdit1", "Kommander") -gt 0 ];then + echo "Greater than Kommander <br>" +elif [ @String.compare("@LineEdit1", "Kommander") -eq 0 ];then + echo "Equals Kommander <br>" +fi +@execEnd +<b>Case insensitive match with "Kommander":</b> +@execBegin +if [ @String.compare(@String.lower("@LineEdit1"), "kommander") -eq 0 ];then + echo "Match found<br>" +else + echo "Match failed<br>" +fi +@execEnd</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string></string> + </stringlist> + </property> + </widget> + <widget class="QLayoutWidget" row="0" column="0"> + <property name="name"> + <cstring>Layout1</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QLabel"> + <property name="name"> + <cstring>TextLabel1</cstring> + </property> + <property name="text"> + <string>Enter str&ing here:</string> + </property> + <property name="buddy" stdset="0"> + <cstring>LineEdit1</cstring> + </property> + </widget> + <widget class="LineEdit"> + <property name="name"> + <cstring>LineEdit1</cstring> + </property> + <property name="text"> + <string>I love Kommander!</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string>@widgetText</string> + </stringlist> + </property> + </widget> + </hbox> + </widget> + <widget class="QLayoutWidget" row="2" column="0"> + <property name="name"> + <cstring>Layout2</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <spacer> + <property name="name"> + <cstring>Spacer1</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>30</width> + <height>0</height> + </size> + </property> + </spacer> + <widget class="ExecButton"> + <property name="name"> + <cstring>ExecButton1</cstring> + </property> + <property name="text"> + <string>&Test</string> + </property> + <property name="populationText"> + <string></string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string></string> + </stringlist> + </property> + </widget> + <spacer> + <property name="name"> + <cstring>Spacer2</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>30</width> + <height>0</height> + </size> + </property> + </spacer> + </hbox> + </widget> + </grid> +</widget> +<connections> + <connection> + <sender>ExecButton1</sender> + <signal>clicked()</signal> + <receiver>TextEdit1</receiver> + <slot>populate()</slot> + </connection> +</connections> +<tabstops> + <tabstop>LineEdit1</tabstop> + <tabstop>ExecButton1</tabstop> + <tabstop>TextEdit1</tabstop> +</tabstops> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/kommander/examples/tutorial/table.kmdr b/kommander/examples/tutorial/table.kmdr new file mode 100644 index 00000000..a2c5986b --- /dev/null +++ b/kommander/examples/tutorial/table.kmdr @@ -0,0 +1,258 @@ +<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> +<class>Form1</class> +<widget class="Dialog"> + <property name="name"> + <cstring>Form1</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>629</width> + <height>313</height> + </rect> + </property> + <property name="caption"> + <string>Table Demo</string> + </property> + <widget class="Table"> + <column> + <property name="text"> + <string>0</string> + </property> + </column> + <column> + <property name="text"> + <string>1</string> + </property> + </column> + <row> + <property name="text"> + <string>0</string> + </property> + </row> + <row> + <property name="text"> + <string>1</string> + </property> + </row> + <row> + <property name="text"> + <string>2</string> + </property> + </row> + <row> + <property name="text"> + <string>3</string> + </property> + </row> + <row> + <property name="text"> + <string>4</string> + </property> + </row> + <property name="name"> + <cstring>Table</cstring> + </property> + <property name="geometry"> + <rect> + <x>10</x> + <y>10</y> + <width>400</width> + <height>240</height> + </rect> + </property> + <property name="resizePolicy"> + <enum>AutoOneFit</enum> + </property> + <property name="numRows"> + <number>5</number> + </property> + <property name="numCols"> + <number>2</number> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string></string> + </stringlist> + </property> + </widget> + <widget class="QLayoutWidget"> + <property name="name"> + <cstring>Layout3</cstring> + </property> + <property name="geometry"> + <rect> + <x>470</x> + <y>10</y> + <width>135</width> + <height>160</height> + </rect> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="ExecButton"> + <property name="name"> + <cstring>AddRowButton</cstring> + </property> + <property name="text"> + <string>Add row</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string>@Table.insertRow(@Table.currentRow, 1)</string> + </stringlist> + </property> + </widget> + <widget class="ExecButton"> + <property name="name"> + <cstring>AddColButton</cstring> + </property> + <property name="text"> + <string>Add column</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string>@Table.insertColumn(@Table.currentColumn, 1)</string> + </stringlist> + </property> + </widget> + <widget class="ExecButton"> + <property name="name"> + <cstring>ExecButton5</cstring> + </property> + <property name="text"> + <string>Remove row</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string>@Table.removeRow(@Table.currentRow, 1)</string> + </stringlist> + </property> + </widget> + <widget class="ExecButton"> + <property name="name"> + <cstring>ExecButton6</cstring> + </property> + <property name="text"> + <string>Remove Column</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string>@Table.removeColumn(@Table.currentColumn, 1)</string> + </stringlist> + </property> + </widget> + <spacer> + <property name="name"> + <cstring>Spacer1</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>0</width> + <height>30</height> + </size> + </property> + </spacer> + </vbox> + </widget> + <widget class="QLayoutWidget"> + <property name="name"> + <cstring>Layout4</cstring> + </property> + <property name="geometry"> + <rect> + <x>20</x> + <y>270</y> + <width>585</width> + <height>28</height> + </rect> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="ExecButton"> + <property name="name"> + <cstring>GetButton</cstring> + </property> + <property name="text"> + <string>Get text</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string>@CellText.setText(@Table.cellText(@Table.currentRow, + @Table.currentColumn))</string> + </stringlist> + </property> + </widget> + <widget class="LineEdit"> + <property name="name"> + <cstring>CellText</cstring> + </property> + </widget> + <widget class="ExecButton"> + <property name="name"> + <cstring>SetButton</cstring> + </property> + <property name="text"> + <string>Set text</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string>@Table.setCellText(@Table.currentRow, @Table.currentColumn, + @CellText.text)</string> + </stringlist> + </property> + </widget> + <widget class="ExecButton"> + <property name="name"> + <cstring>ColumnCaptionButton</cstring> + </property> + <property name="text"> + <string>Set column name</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string>@Table.setColumnCaption(@Table.currentColumn, @CellText.text)</string> + </stringlist> + </property> + </widget> + <widget class="ExecButton"> + <property name="name"> + <cstring>RowCaptionButton</cstring> + </property> + <property name="text"> + <string>Set row name</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string>@Table.setRowCaption(@Table.currentRow, @CellText.text)</string> + </stringlist> + </property> + </widget> + </hbox> + </widget> +</widget> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/kommander/examples/tutorial/tree.kmdr b/kommander/examples/tutorial/tree.kmdr new file mode 100644 index 00000000..bed87709 --- /dev/null +++ b/kommander/examples/tutorial/tree.kmdr @@ -0,0 +1,170 @@ +<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> +<class>Form1</class> +<widget class="Dialog"> + <property name="name"> + <cstring>Form1</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>600</width> + <height>528</height> + </rect> + </property> + <property name="caption"> + <string>File Tree</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string></string> + <string>@FileSelector1.setText(@env(HOME)) +@TreeWidget1.setText(@readSetting(FileTree, ""))</string> + <string>@writeSetting(FileTree, @TreeWidget1.text)</string> + </stringlist> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>11</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QLayoutWidget" row="2" column="0" rowspan="1" colspan="2"> + <property name="name"> + <cstring>Layout1</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="ExecButton"> + <property name="name"> + <cstring>ExecButton1</cstring> + </property> + <property name="text"> + <string>Add files from selected directory</string> + </property> + <property name="autoDefault"> + <bool>true</bool> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string>@TreeWidget1.clear +@TreeWidget1.insertItems(@exec(cd @FileSelector1.text && find * -name "*.kmdr"), -1)</string> + </stringlist> + </property> + </widget> + <widget class="ExecButton"> + <property name="name"> + <cstring>ExecButton2</cstring> + </property> + <property name="text"> + <string>Remove selected file from the list</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string>@TreeWidget1.removeItem(@TreeWidget1.currentItem)</string> + </stringlist> + </property> + </widget> + </hbox> + </widget> + <widget class="TreeWidget" row="0" column="0" rowspan="1" colspan="2"> + <column> + <property name="text"> + <string>File</string> + </property> + <property name="clickable"> + <bool>true</bool> + </property> + <property name="resizeable"> + <bool>true</bool> + </property> + </column> + <property name="name"> + <cstring>TreeWidget1</cstring> + </property> + <property name="rootIsDecorated"> + <bool>true</bool> + </property> + <property name="resizeMode"> + <enum>NoColumn</enum> + </property> + <property name="fullWidth"> + <bool>true</bool> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string></string> + </stringlist> + </property> + </widget> + <widget class="QLabel" row="1" column="0"> + <property name="name"> + <cstring>TextLabel1</cstring> + </property> + <property name="text"> + <string>Select directory:</string> + </property> + </widget> + <widget class="FileSelector" row="1" column="1"> + <property name="name"> + <cstring>FileSelector1</cstring> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string></string> + </stringlist> + </property> + <property name="selectionType"> + <enum>Directory</enum> + </property> + </widget> + <widget class="QLayoutWidget" row="3" column="0" rowspan="1" colspan="2"> + <property name="name"> + <cstring>Layout3</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="ExecButton"> + <property name="name"> + <cstring>ExecButton3</cstring> + </property> + <property name="text"> + <string>Find file:</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string>@TreeWidget1.setCurrentItem(@TreeWidget1.findItem(@LineEdit2.text))</string> + </stringlist> + </property> + </widget> + <widget class="LineEdit"> + <property name="name"> + <cstring>LineEdit2</cstring> + </property> + </widget> + </hbox> + </widget> + </grid> +</widget> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/kommander/examples/tutorial/widgets.kmdr b/kommander/examples/tutorial/widgets.kmdr new file mode 100644 index 00000000..9e6781c6 --- /dev/null +++ b/kommander/examples/tutorial/widgets.kmdr @@ -0,0 +1,133 @@ +<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> +<class>Form1</class> +<widget class="Dialog"> + <property name="name"> + <cstring>Form1</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>600</width> + <height>483</height> + </rect> + </property> + <property name="caption"> + <string>Widgets and types</string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>11</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="GroupBox" row="0" column="1" rowspan="3" colspan="1"> + <property name="name"> + <cstring>GroupBox1</cstring> + </property> + <property name="title"> + <string>Widgets</string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>11</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="SpinBoxInt" row="1" column="0"> + <property name="name"> + <cstring>SpinBoxInt1</cstring> + </property> + </widget> + <widget class="LineEdit" row="0" column="0"> + <property name="name"> + <cstring>LineEdit1</cstring> + </property> + </widget> + <widget class="RichTextEditor" row="2" column="0"> + <property name="name"> + <cstring>RichTextEditor1</cstring> + </property> + </widget> + </grid> + </widget> + <widget class="ExecButton" row="2" column="0"> + <property name="name"> + <cstring>WidgetShow</cstring> + </property> + <property name="text"> + <string>Show widgets</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string>@WidgetList.setText(@Form1.children(true))</string> + </stringlist> + </property> + </widget> + <widget class="ListBox" row="0" column="0"> + <property name="name"> + <cstring>WidgetList</cstring> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string></string> + </stringlist> + </property> + </widget> + <widget class="QLayoutWidget" row="1" column="0"> + <property name="name"> + <cstring>Layout1</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QLabel"> + <property name="name"> + <cstring>TextLabel1</cstring> + </property> + <property name="text"> + <string>Type:</string> + </property> + </widget> + <widget class="LineEdit"> + <property name="name"> + <cstring>WidgetType</cstring> + </property> + <property name="populationText"> + <string>@exec(dcop @dcopid KommanderIf type "@WidgetList.selection")</string> + </property> + <property name="associations" stdset="0"> + <stringlist> + <string></string> + </stringlist> + </property> + </widget> + </hbox> + </widget> + </grid> +</widget> +<connections> + <connection> + <sender>WidgetList</sender> + <signal>highlighted(int)</signal> + <receiver>WidgetType</receiver> + <slot>populate()</slot> + </connection> +</connections> +<layoutdefaults spacing="6" margin="11"/> +</UI> |