MUILIB支持组属性按钮,具体就是一组按钮中某个选中,则其他的按钮不选择,
典型的例子就是TAB控件里的头部按钮。
下面展示了三种不同样式的组属性按钮
XML配置代码
<Window size="400,260" caption="0,0,0,-1" showdirty="false" backalpha="250" bkcolor="#00000000" bkimage="@back">
<VertiPanel margin="20,20,20,20" childpadding="5" bkcolor="#01000000">
<VertiPanel bkcolor="#FFBAFFBE" bordersize="1,1,1,1">
<HorizPanel bordersize="1,1,1,1" height="26">
<Label textpadding="5,0,0,0" text="普通的组属性按钮" mouse="false" />
</HorizPanel>
<HorizPanel buttongroup="true" margin="5,5,5,5" childpadding="1">
<GroupButton grouped="true" selnormalimage="@button:sub_3" normalimage="@button:sub_1" hotimage="@button:sub_2" pushedimage="@button:sub_3" text="button1" estimatewidth="false" />
<GroupButton grouped="true" selnormalimage="@button:sub_3" normalimage="@button:sub_1" hotimage="@button:sub_2" pushedimage="@button:sub_3" text="button2" estimatewidth="false" />
<GroupButton grouped="true" selnormalimage="@button:sub_3" normalimage="@button:sub_1" hotimage="@button:sub_2" pushedimage="@button:sub_3" text="button3" estimatewidth="false" />
</HorizPanel>
</VertiPanel>
<VertiPanel bkcolor="#FFBAFFBE" bordersize="1,1,1,1">
<HorizPanel margin="5,0,0,0" bordersize="1,1,1,1" height="26">
<Label text="TAB控件头部样式的组按钮" mouse="false" />
</HorizPanel>
<HorizPanel buttongroup="true" margin="5,5,5,5" childpadding="2">
<GroupButton grouped="true" selnormalimage="@tab1:sub_4" selhotimage="@tab1:sub_5" normalimage="@tab1:sub_2" hotimage="@tab1:sub_3" text="button1" estimatewidth="false" />
<GroupButton grouped="true" selnormalimage="@tab1:sub_3" normalimage="@tab1:sub_1" hotimage="@tab1:sub_2" text="button2" estimatewidth="false" />
<GroupButton grouped="true" selnormalimage="@tab1:sub_3" normalimage="@tab1:sub_1" hotimage="@tab1:sub_2" text="button3" estimatewidth="false" />
</HorizPanel>
</VertiPanel>
<VertiPanel bkcolor="#FFBAFFBE" bordersize="1,1,1,1">
<HorizPanel margin="5,0,0,0" bordersize="1,1,1,1" height="26">
<Label text="带状态图标的组按钮" mouse="false" />
</HorizPanel>
<HorizPanel buttongroup="true" margin="5,5,5,5" childpadding="1">
<GroupButton grouped="true" selnormalimage="@tab2:sub_5" selhotimage="@tab2:sub_6" selpushedimage="@tab2:sub_7" selfocusedimage="@tab2:sub_8" selnormalicon="@ico3:sub_5" selhoticon="@ico3:sub_6" selpushedicon="@ico3:sub_7" selfocusedicon="@ico3:sub_8" normalimage="@tab2:sub_1" hotimage="@tab2:sub_2" pushedimage="@tab2:sub_3" focusedimage="@tab2:sub_4" normalicon="@ico3:sub_1" hoticon="@ico3:sub_2" pushedicon="@ico3:sub_3" focusedicon="@ico3:sub_4" />
<GroupButton grouped="true" selnormalimage="@tab2:sub_5" selhotimage="@tab2:sub_6" selpushedimage="@tab2:sub_7" selfocusedimage="@tab2:sub_8" selnormalicon="@ico2:sub_5" selhoticon="@ico2:sub_6" selpushedicon="@ico2:sub_7" selfocusedicon="@ico2:sub_8" normalimage="@tab2:sub_1" hotimage="@tab2:sub_2" pushedimage="@tab2:sub_3" focusedimage="@tab2:sub_4" normalicon="@ico2:sub_1" hoticon="@ico2:sub_2" pushedicon="@ico2:sub_3" focusedicon="@ico2:sub_4" />
<GroupButton grouped="true" selnormalimage="@tab2:sub_5" selhotimage="@tab2:sub_6" selpushedimage="@tab2:sub_7" selfocusedimage="@tab2:sub_8" selnormalicon="@ico1:sub_5" selhoticon="@ico1:sub_6" selpushedicon="@ico1:sub_7" selfocusedicon="@ico1:sub_8" normalimage="@tab2:sub_1" hotimage="@tab2:sub_2" pushedimage="@tab2:sub_3" focusedimage="@tab2:sub_4" normalicon="@ico1:sub_1" hoticon="@ico1:sub_2" pushedicon="@ico1:sub_3" focusedicon="@ico1:sub_4" />
</HorizPanel>
</VertiPanel>
</VertiPanel>
</Window> 运行效果截图如下
点击此处下载上图所示的资源包下载资源包后解压缩到目录中,使用MUIPlayer打开mui文件即可实时查看运行效果