本文由 @lonelyrains 出品,转载请注明出处。
文章链接: http://blog.csdn.net/lonelyrains/article/details/45243671
<?xml version="1.0" encoding="utf-8"?> <view> <viewType>mainView</viewType> <width>500</width> <height>400</height> <IsCenterToDeskTop>true<isCenterToDeskTop> <linearLayout orientation = "vertical"> <linearName>outline</linearName> <marginWidth>2%</marginWidth> <width>96%</width> <height>96%</height> <!--headline--> <linearLayout orientation = "horizontal"> <linearName>headline</linearName> <marginWidth>2%</marginWidth> <width>96%</width> <height>5%</height> <backgroundColor>#0001</backgroundColor> <imageView> <imageName>logoIco</imageName> <imageUrl>$(res)/logoIco.png</imageUrl> <contentLayout>center</contentLayout> <marginWidth>2%</marginWidth> <width>5%</width> <height>96%</height> </imageView> <textView> <marginWidth>2%</marginWidth> <width>70%</width> <height>96%</height> <textValue>$(CustomerName)$(DevName)$(ToolName)</textValue> </textView> <button> <id>btn_min</id> <action>onMin</action> <marginWidth>2%</marginWidth> <width>5%</width> <height>96%</height> <imageUrl>$(res)/btn_min.png</imageUrl> </button> <button> <id>btn_max</id> <action>onMax</action> <marginWidth>2%</marginWidth> <width>5%</width> <height>96%</height> <imageUrl>$(res)/btn_max.png</imageUrl> <isEnable>false</isEnable> </button> <button> <id>btn_close</id> <action>onClose</action> <marginWidth>2%</marginWidth> <width>5%</width> <height>96%</height> <imageUrl>$(res)/btn_close.png</imageUrl> </button> </linearLayout> <!--logo long--> <imageView> <imageName>logoLong</imageName> <imageUrl>$(res)/logoLong.png</imageUrl> <contentLayout>center</contentLayout> <marginWidth>2%</marginWidth> <width>96%</width> <height>30%</height> </imageView> <textView> <marginWidth>2%</marginWidth> <width>70%</width> <height>50%</height> <textValue>$(CustomerName)$(DevName)$(ToolName)</textValue> </textView> <linearLayout orientation = "horizontal"> <linearName>headline</linearName> <marginWidth>2%</marginWidth> <width>96%</width> <height>56%</height> <!--logo--> <listView> <id>listView_mainView</id> </listView> <!--btnlist--> <linearLayout orientation = "vertical"> <linearName>btnList</linearName> <marginWidth>2%</marginWidth> <width>36%</width> <height>56%</height> <button> <id>btn_change_name</id> <action>onChangeName</action> <marginWidth>2%</marginWidth> <width>96%</width> <height>10%</height> <isEnable>false</isEnable> </button> <button> <id>btn_view_devinfo</id> <action>onView devinfo </action> <marginWidth>2%</marginWidth> <width>96%</width> <height>10%</height> <isEnable>false</isEnable> </button> <button> <id>btn_init</id> <action>onInit</action> <marginWidth>2%</marginWidth> <width>96%</width> <height>10%</height> <isEnable>false</isEnable> </button> </linearLayout> </linearLayout> </linearLayout> </view>
<?xml version='1.0' encoding='utf-8'?> <event> <eventType>connect</eventType> <devIndex>3</devIndex> </event>
<?xml version='1.0' encoding='utf-8'?> <request> <requestType>createUI</requestType> <view> <viewType>mainView</viewType> <viewId>view_1</viewId> <viewParentId>desktop</viewParentId> <devList> <!—此处的id与viewType定义中的控件对应的id相同,表示填充到对应的id里--> <id>devList</id> <mapToUIId>listView_mainView</mapToUIId> <selectedId>dev_1</selectedId> <dev> <id>dev_1</id> <name>DevStd</name> <sn>DS20150415</sn> <imageUrl>$(res)/dev.png</imageUrl> <otherParamList> <param1> <id>param_1</id> <imageUrl>$(res)/param1.png</imageUrl> </param1> <param2> <id>param_2</id> <imageUrl>$(res)/param2.png</imageUrl> </param2> </otherParamList > </dev> </devList> <button> <id>btn_change_name</id> <isEnable>true</isEnable> </button> <button> <id>btn_view_devinfo</id> <isEnable>true</isEnable> </button> <button> <id>btn_init</id> <isEnable>true</isEnable> </button> </view> </request>
<?xml version='1.0' encoding='utf-8'?> <request> <requestType>updateUI</requestType> <view> <viewType>mainView</viewType> <viewIndex>view_1</viewIndex > <event>click</event > <listView> <id>listView_mainView</id> <selectedId>param_2</selectedId> </listView> </view> </request>
<?xml version='1.0' encoding='utf-8'?> <request> <requestType>updateUI</requestType> <view> <viewId>1</viewId> <viewType>mainView</viewType> <button> <id>btn_view_param2</id> <isEnable>true</isEnable> </button> </view> </request>
<?xml version='1.0' encoding='utf-8'?> <request> <requestType>createUI</requestType> <view> <viewType>changeLabelView</viewType> <viewId>view_2</viewId> <devList> <dev> <name>dev1</name> <id>dev1_devStd</id> <value>devStd</value> <mapToUIId>oldName</mapToUIId> </label> <sn> <id>DS20150415<id> <mapToUIId>sn</mapToUIId> </sn> </dev> </devList> </view> </request>
<?xml version='1.0' encoding='utf-8'?> <request> <requestType>updateDev</requestType> <dev> <id>dev1_devStd</id> </dev> <action>changeName</action> <paramList> <oldName>devStd</oldName> <newName>devStdNew</newName> </paramList> </request>