<!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>398</width>
            <height>341</height>
        </rect>
    </property>
    <property name="caption">
        <string>Key=&gt;Value ComboBox</string>
    </property>
    <property name="icon">
        <pixmap>image0</pixmap>
    </property>
    <property name="associations" stdset="0">
        <stringlist>
            <string></string>
            <string>_a[1] = "red"
_a[3] = "blue"
_a[5] = "green"
foreach i in _a do
  ListBox1.insertItem(i+"\t"+_a[i], -1)
end
ScriptObject36.execute
AboutDialog1.initialize("Key Value Combo", "", "0.1", "Copyright 2008")
AboutDialog1.addAuthor("Eric Laffoon", "Designer", "eric@kdewevdev.org", "http://kittyhooch.com")
AboutDialog1.setBugAddress("eric@kdewebdev.org")
AboutDialog1.setHomepage("http://kdewebdev.org")
AboutDialog1.setLicense("GPL_V2")
AboutDialog1.setDescription("This demonstrates how to make a ComboBox \n behave as a key value pair. It's \nparticularly useful for databases.")

PopupMenu1.insertMenuItem("Make new list", "PopupMenu1", 1)
PopupMenu1.insertMenuItem("Remove Item", "PopupMenu1", 2)
PopupMenu1.insertMenuItem("Move Item up", "PopupMenu1", 3)
PopupMenu1.insertMenuItem("Move Item down", "PopupMenu1", 4)
PopupMenu1.insertSeparator(5)
PopupMenu1.insertMenuItem("Remove Item from both", "PopupMenu1", 6)
PopupMenu1.insertMenuItem("Insert Item in same location", "PopupMenu1", 7)
PopupMenu1.insertSeparator(8)
PopupMenu1.insertMenuItem("Quick Help", "PopupMenu1", 9)
PopupMenu1.insertMenuItem("Help About", "PopupMenu1", 10)

</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="QLayoutWidget" row="1" column="0">
            <property name="name">
                <cstring>Layout27</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="Label">
                    <property name="name">
                        <cstring>Label18</cstring>
                    </property>
                    <property name="sizePolicy">
                        <sizepolicy>
                            <hsizetype>4</hsizetype>
                            <vsizetype>5</vsizetype>
                            <horstretch>0</horstretch>
                            <verstretch>0</verstretch>
                        </sizepolicy>
                    </property>
                    <property name="text">
                        <string>Select value</string>
                    </property>
                </widget>
                <widget class="ComboBox">
                    <property name="name">
                        <cstring>ComboBox10</cstring>
                    </property>
                </widget>
            </hbox>
        </widget>
        <widget class="QLayoutWidget" row="0" column="0">
            <property name="name">
                <cstring>Layout30</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="ListBox" row="1" column="0" rowspan="1" colspan="3">
                    <property name="name">
                        <cstring>ListBox1</cstring>
                    </property>
                    <property name="toolTip" stdset="0">
                        <string>Right click for menu</string>
                    </property>
                </widget>
                <widget class="QLayoutWidget" row="0" column="2">
                    <property name="name">
                        <cstring>Layout24</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="Label">
                            <property name="name">
                                <cstring>Label17</cstring>
                            </property>
                            <property name="sizePolicy">
                                <sizepolicy>
                                    <hsizetype>5</hsizetype>
                                    <vsizetype>4</vsizetype>
                                    <horstretch>0</horstretch>
                                    <verstretch>0</verstretch>
                                </sizepolicy>
                            </property>
                            <property name="text">
                                <string>value</string>
                            </property>
                        </widget>
                        <widget class="LineEdit">
                            <property name="name">
                                <cstring>LineEdit2</cstring>
                            </property>
                            <property name="associations" stdset="0">
                                <stringlist>
                                    <string></string>
                                </stringlist>
                            </property>
                        </widget>
                    </vbox>
                </widget>
                <widget class="QLayoutWidget" row="0" column="0">
                    <property name="name">
                        <cstring>Layout23</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="Label">
                            <property name="name">
                                <cstring>Label16</cstring>
                            </property>
                            <property name="sizePolicy">
                                <sizepolicy>
                                    <hsizetype>5</hsizetype>
                                    <vsizetype>4</vsizetype>
                                    <horstretch>0</horstretch>
                                    <verstretch>0</verstretch>
                                </sizepolicy>
                            </property>
                            <property name="text">
                                <string>Key</string>
                            </property>
                        </widget>
                        <widget class="LineEdit">
                            <property name="name">
                                <cstring>LineEdit1</cstring>
                            </property>
                        </widget>
                    </vbox>
                </widget>
                <widget class="ExecButton" row="0" column="1">
                    <property name="name">
                        <cstring>ExecButton28</cstring>
                    </property>
                    <property name="sizePolicy">
                        <sizepolicy>
                            <hsizetype>4</hsizetype>
                            <vsizetype>4</vsizetype>
                            <horstretch>0</horstretch>
                            <verstretch>0</verstretch>
                        </sizepolicy>
                    </property>
                    <property name="text">
                        <string></string>
                    </property>
                    <property name="pixmap">
                        <pixmap>image1</pixmap>
                    </property>
                    <property name="associations" stdset="0">
                        <stringlist>
                            <string>ListBox1.insertItem(LineEdit1.text+"\t"+LineEdit2.text, -1)</string>
                        </stringlist>
                    </property>
                </widget>
            </grid>
        </widget>
        <widget class="QLayoutWidget" row="2" column="0">
            <property name="name">
                <cstring>Layout31</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="StatusBar">
                    <property name="name">
                        <cstring>StatusBar5</cstring>
                    </property>
                </widget>
                <widget class="AboutDialog">
                    <property name="name">
                        <cstring>AboutDialog1</cstring>
                    </property>
                    <property name="associations" stdset="0">
                        <stringlist>
                            <string></string>
                        </stringlist>
                    </property>
                </widget>
                <widget class="ScriptObject">
                    <property name="name">
                        <cstring>ScriptObject36</cstring>
                    </property>
                    <property name="pixmap">
                        <pixmap>image2</pixmap>
                    </property>
                    <property name="associations" stdset="0">
                        <stringlist>
                            <string>array_clear("_a")
array_clear("_b")
c = ListBox1.count-1
ComboBox10.clear
for i = 0 to c do
  array_indexedFromString("x", ListBox1.item(i))
  if str_length(_a[x[0]]) &gt; 0 then
    message_error(x[0]+" is a duplicate key. Value \""+x[1]+"\" will not be inserted.")
  else
    _a[x[0]] = x[1]
    _b[i] = x[0]
    ComboBox10.insertItem(_a[_b[i]], i)
  endif
end</string>
                        </stringlist>
                    </property>
                </widget>
                <widget class="ScriptObject">
                    <property name="name">
                        <cstring>ScriptObject35</cstring>
                    </property>
                    <property name="pixmap">
                        <pixmap>image3</pixmap>
                    </property>
                    <property name="associations" stdset="0">
                        <stringlist>
                            <string>i = Self.Item(0)
StatusBar5.insertItem("index: "+i, 0)
StatusBar5.insertItem("key: "+_b[i], 1)
StatusBar5.insertItem("value from key: "+_a[_b[i]], 2)
</string>
                        </stringlist>
                    </property>
                </widget>
                <widget class="PopupMenu">
                    <property name="name">
                        <cstring>PopupMenu1</cstring>
                    </property>
                    <property name="associations" stdset="0">
                        <stringlist>
                            <string>m = Self.Item(0)
if m == 1 then //new list
  ScriptObject36.execute
elseif m == 2 then // remove
  ListBox1.removeItem(ListBox1.currentItem)
elseif m == 3 then // move up
  i = str_toint(ListBox1.currentItem)
  val = ListBox1.item(i)
  ListBox1.removeItem(i)
  ListBox1.insertItem(val, i-1)
elseif m == 4 then //move down
  i = str_toint(ListBox1.currentItem)
  val = ListBox1.item(i)
  ListBox1.removeItem(i)
  ListBox1.insertItem(val, i+1)
elseif m == 6 then //remove both
  ListBox1.removeItem(ListBox1.currentItem)
  i = ListBox1.currentItem
  ComboBox10.removeItem(i)
  array_indexedRemoveElements("_b", i)
elseif m == 7 then //insert in postion
  i = ListBox1.currentItem
  array_indexedFromString("x", ListBox1.selection)
  if str_length(_a[x[0]]) &gt; 0 then
    message_error(x[0]+" is a duplicate key. Value \""+x[1]+"\" will not be inserted.")
  else
    ComboBox10.insertItem(x[1], i)
    _a[x[0]] = x[1]
    array_indexedInsertElements("_b", i, x[0])
  endif
elseif m == 9 then //help 
  message_info("Look in the dialog initialization first. Middle click in design mode. Make sure you click on an item when doing specific things in the menu. You can recreate the arrays or add or remove from them using the menus. Look at the menu widget and the script with the check on it to see how it's done.\nThe values you see in the StatusBar are generated from arrays and never access the ComboBox. All information is generated from arrays and the ComboBox index.\nDon't forget to try adding items with duplicate keys and duplicate values and see what happens.")
elseif m == 10 then //help about
  AboutDialog1.execute
else
  message_error("Unrecognized menu action "+m)
endif</string>
                        </stringlist>
                    </property>
                </widget>
            </hbox>
        </widget>
    </grid>
</widget>
<images>
    <image name="image0">
        <data format="XPM.GZ" length="6350">[encoded data, 5268 characters]</data>
    </image>
    <image name="image1">
        <data format="XPM.GZ" length="417">789c65cecf4a03311006f0fb3e45d8dc1649773766db223e82d2a3201ef26fb25b680b5a0f22be7bf3cd547b7008617e99907cab4ebdec9e54b76a3ecefebc441567ffaebaf479387cbdbe3d7e37ed30aaeb6aef9ad6a8a89e4fc78c7eaebdeeb94062a6c1093338f6d60a0b6827779d26d05b226160baca09f4609888ec3da8c154a79b00ee41eac9650746e640eb6cc18539d2364b6063b40fc1ebdab0a34f5c3e8ac19c71c0d6981161d71ce566cf496f0ee232731571bd5f84721fef15a6bcc7ff95f2f79f597ef3eccdbfbc3f0fcd05558f6aff</data>
    </image>
    <image name="image2">
        <data format="XPM.GZ" length="2573">789ccdd4c94e1b411006e03b4f61513714fd999e7d14e510b22f10d60412e5d0b3b1180301033651de3dedeebfc8c2964ba4a8b1e5cf2e66aaaa6bfae1c2606b6569b0f070ee746cc77bcda0d9b5278385f66c349a7efef2f8dbdc7c1c0fdc5fe5dee71fcccdaf8e07cd60f9e8b09b41260e1245591d45de2774435fd02d7d189cc7f4573aa58774498fe88abea4f57a3b7447ef071711ddd0397d4e17c1c868cdbfa6993f22baa73f0597bc3eb669436fd25a9fa513febe4c67f412cdfcf09ed6fcded0ec073668f603af69cbfb1dd3ac078bb4d6f39466fff08466ffc0fd2cb5de57c195d6c7fdad581fb87f95d6774a733f71446bbd9c874aebe37e555a0ff7bf623dd8a3b51ece43a5f5709e2aada7a335ff36d8ea7ef5b4d693d37aff2ab8d6f99bd23a7facafd67c4c70a3f37646ebf54b9af5ca98d6ebefd23acfec57cbff17d6d3eafc1ed0badf42b35e61bf3aee87b0de8efd17f6a3d3e713b4ee7f11dceb3ca6dec6cd9bf10ecf93b9eadf5670d3f3f715efd8cd8f3f2c109ecfc4eabc7c086e8b28f18ebd5377bfd4fb9977e6e625f34e82bb9cfe18dc7774e85f6e75be427f4b371fa577e89775f7b7deebde75d545b577e85f6775de566736a6494da8c73fbf26b13a6f2fbd539b9890af7fde4c612b53784f694bfbf3c49456e7f15d709b9890dfdaccae5d651cfcdcbb6a8ab8f27eeb5df7451cf2f5e757dcd579eccf5ff8f330c9db2cc9bdfdfca55153a7e17e2f66cea2de645138bcff7efd3ff1105884fa1bb4f7c476e8b1e3d66e383fdcdabf35761f431cb888110e433e38c2b17b7dbd21f604a718e30ce7eef70bcd1f134c71892758fc2d76114ff10ccff1022f5dc4ab9ff5e235dee02ddeb9f725c62ee33d56b08a35f7fd3a36feec0f36f1011fb1856d7c42e45e1b3088dd3709526c5eef2732e428dc2adda74d54829944c44a7d53ffa5915a5abf3ae9c32718f75d73db7ec98eeccadecfe5eeb12337f4f82a7e885e0e7461284319dd350f72e8723ae23a76ba61377e9f1f39915319cb999cbb4f17f7cf9b4c5c165397f54426b74fd2aff172e9d61db1d7e2efbcf29ff17fb7fe79fcf747733f00356088d2</data>
    </image>
    <image name="image3">
        <data format="XPM.GZ" length="4142">789c8597595315c912c7dffd1484f9664ce49cdebbe3c67d90d50de4282078631eb2360105140e224ecc77bfd9ffac3e23e08c9d3cf08bccaacacaade0f7272b87bbdb2b4f7e7f74b590c5895ff1c772b9f2245c9f9dddfeef8ffffef9e87159aee84f31cc56cac7bf3d7a3c5facf8959d8bf338021d29d00cdfc8720b2e542ae8e7e072949199c0d528b0b7f5f528b06f963c80df2c5960df82db51a0df5d72009bbe53817ff21ddcab789cbfbb64d8cb97890bf3ff39d88d023e9db8e8c1761f3f0af6337d9885ac7fb664f3ff1b38cd5281fdf8e3c863788a068cf38ab2284bdc9f6fc05dd195f08fdf83fba237a643b0145261bda66a6457b8cae27101f685373df7e054a4cae2e7976cf9c3fee54c39813f1897b30afe12ee53d6655d233eb4056ecbb6b6fd709f3294a1b1fb07702c63637ae4b34c65aa3a30d657755537603e59b2d9235ed5500d2de227f0af72a3c0fe353856b1b3780958bd6f0ad87723a39c2c9f88575da8d87dea893b9c4fd84f8faf3acb37eaa36e55101ffe3a716ffb6f82877a68917f7a3b718ffa263b5f6ae92d3f1b6057bbd6f6433c9ba22907ab77d46753a958bdae83eba636ffe43358bfdef27533f160fdf3142c8d74761efaa5892ac8a7e0be4d6a526bf1fb34f2d82e1de2cdc7130f60c27e6dd55683e5730dac5f6f8c7cb55ddb89c5e30aacd912e819f96ba595def27b94d90bfc6107f6adefadff5e80938addbf1ab92b552c5fefc04dd73a8bef0cdc769d43fc6415dc77bdf9cfd7e0a0ed6ef306f5dca5be70163ff4dbd8eecef6dfcc5c9a9ee18fb65b61f1a5f3cc95b77a2ac1ad0af22ff0a71f3f8b1ff2d50f8a56cf2eb338bb3feaa3973e7acb47028761e6adde8b9187b1012cff37137bebe79dcc7d0013d68fe517900f467f0f8d9627e6016f6576c1f281fed474f5dee657cc3c78ab17d4c7d0a91efef0197818c4f623cccbc10dc1ecf925d80f31fb8f7ce9782a9cd5e302ac05ea2dfea837e9a4cbe7215fa201c91c330fc1ea1bfd278332e2cfb69fb859447e05fd2b4e9cb3fbdd660ec1f2bb074eae3066e453c7651badff185cba2aa07e69277313ec7ec887b66f637a467fb9c649b4f30670ab62f3683e71de0ffeb84ec5e287fa7683f3d1e629ea57dd8fd1f4b8af8bbe8ce6ff49e6ca58e01f9e1ff307f5e86bef12e2c598ffbed176b3fd31ffb5ddba68f582f7d7773e26f317f3c76bf633a39fbd8459e6c3cc45b2fbbe023b65f82b0760fdecbeb20d8e3e06eb4fd447a84701635e86364cf139cb1c92bd77e89fd0697959fda13f431f62b2fe427f8641ed6d7e6f649ef4974bb6fa36767196f5a8afe063952cbfa8e71062992cdeeb99277d9bb936967d700c395f729139457b3f0f8c6391ec7ea799a7f5889f5e3659fdd295b18e6b5b8f791b674bbecedc6646fdc762c9a8cff1b9b5f3783b7367f124f4b33e977db6c7f9b18e4366e4479f0bc9fea13f63abebad5eb633673de1bd8d5d7499f1fe471d67395ec86f1c3420a647bca2c498f5785fd47a966cdea33fe318408b4769ac7ab3af3217793fcc2fdd2db3983f49d9eeeb3397d91ef35777cb2ce877a5291f94798a37fa59b539be8cbf5f54db65c67baada1c4f46fda936b3a4cc39be82f747b59919f35129c793f17e24af62f5bfba64d3ef67cef114f44b4201417fb064b3dfcb3cc51bf5a49459ce33a7ac47bda734f17c3109130b3bf61c3872e20f7ccc277cfab77ebef8d19e3ff2273ee373bee0cffc852ff98a177ccd5ff9e61fecbff12d7fe7a7bcca6bbcaeb2c61bbcc95bfc8c9f3fb4e717fc925fa9c5fa1d59e36ddee1d7bcfbc07ece6ff82deff1fe1d39e0777cc847fcfeae3dcfb8e0922bddbfbe270db7dc71cfc35d7b62221272e4ef49a048893e3cb03fa6133ad5151fefc9273aa373bab86b3f5fd067fa429774450b95eb2ce36fa7f4956ee81bdddeb3ff4e4f69552dd674cd29adab9cea6fd7b4419bb4c5f430fef48c9ed30b7a49af7e906ddaa1d7b44bf39fd8bfa1b7b447fb1ad5a5d001bda3433afa597e75c57b9a51a11129b378aaa8a6e6e7f5a0f62d75d4d3200cd1375e5f71fff7eef7ede70b09a26349b3a6221fe4584ee4f45fed3fca273993f351785d2ee4b37cf9a77a86fda55cc94273772cd7f2556ee49bdcfeabfd77792aabb226ebb2219bb225cf7ef4e627f6cfe585bc9457b22d3bf25a76e9e817f67379236f654ff6e540dec9e12fed8fe4bdccf46fb1522afd87a4f9953d56b4baa693f968fbc0feafff3cfa3f5814f320</data>
    </image>
</images>
<connections>
    <connection>
        <sender>ListBox1</sender>
        <signal>contextMenuRequested(int,int)</signal>
        <receiver>PopupMenu1</receiver>
        <slot>popup(int,int)</slot>
    </connection>
    <connection>
        <sender>ComboBox10</sender>
        <signal>activated(int)</signal>
        <receiver>ScriptObject35</receiver>
        <slot>execute(int)</slot>
    </connection>
</connections>
<tabstops>
    <tabstop>LineEdit1</tabstop>
    <tabstop>LineEdit2</tabstop>
    <tabstop>ExecButton28</tabstop>
    <tabstop>ComboBox10</tabstop>
    <tabstop>ListBox1</tabstop>
</tabstops>
<layoutdefaults spacing="6" margin="11"/>
</UI>
