趁热讲讲skin.xml支持的标签和attributes

上篇随笔讲解了skin.xml的大致结构,这次仔细的说说支持的标签和属性

 

#define NAME_WND                            _T("window")      //窗口   
#define NAME_BTN                            _T("button")      //按钮
#define NAME_CHECKBOX                        _T("checkbox")   //复选框
#define NAME_RADIOBTN                        _T("radiobutton")//单选
#define NAME_STATIC                            _T("static")   //静态文本框
#define NAME_PANEL                            _T("panel")     //面板(可作为控件容器)
#define NAME_SLIDER                            _T("slider")   //滑块
#define NAME_SCROLL                            _T("scroll")   //滚动条
#define NAME_SCROLL_BTN                        _T("scrolbtn") //滚动按钮
#define NAME_SCROLLVIEW                        _T("scrollview")//带滚动条的view(需要绑定滚动条)
#define NAME_LISTBOX                        _T("listbox")      //列表框
#define NAME_LISTBOX_ITEM                    _T("listboxitem") //列表框的条目
#define NAME_LIST                            _T("list")        //列表控件,多行多列,可拖动列,可排序,支持图标列,进度条列
#define NAME_LIST_ITEM                        _T("listitem")   //列表项
#define NAME_LIST_ROW                        _T("listrow")     //列表行
#define NAME_LIST_HEADE                        _T("listheader")//列表头
#define NAME_LIST_COLUMN                    _T("listcolumn")   //列表列
#define NAME_TREE_NODE                        _T("treenode")   //树节点
#define NAME_TREE                            _T("tree")        //树
#define NAME_EDIT                            _T("editor")      //编辑框,支持多行,单行
#define NAME_MENU                            _T("menu")        //菜单
#define NAME_MENU_ITEM                        _T("menuitem")   //菜单项
#define NAME_TIP                            _T("tip")          //tip窗口
#define NAME_LINK_BTN                        _T("linkbtn")     //连接按钮
#define NAME_COMBOBOX                        _T("combobox")    //下拉框
#define NAME_MSGBOX                            _T("messagebox")//消息框
#define NAME_TAB                            _T("tab")          //tab页
#define NAME_PROGRESS                        _T("progress")    //进度条
#define NAME_IMAGE                            _T("image")      //图片框
#define NAME_STEP_NUM_EDIT                    _T("stepint")    //数字带上下按钮的输入框
#define NAME_FLASHWND                        _T("flash")       //flash窗口
#define NAME_SWF                            _T("swf")          //flash控件

 

 通过上面的宏定义大致就可以看出支持的控件类型了。

 

下面是支持的attribute:

//属性名称
#define ATT_GROUP        _T("group")        //对控件进行分组 例如:radiobutton
#define ATT_TAB_INDEX    _T("tab")        //控件的tab顺序
#define ATT_NAME        _T("name")        //每个控件 窗口的唯一名称标识
#define ATT_TEXT        _T("text")
#define ATT_UPDATEHSL    _T("hsl")    //是否允许更新色调
#define ATT_ANCHOR        _T("anchor")    //铆钉方式

//控件位置铆钉说明
/*

anchor="LTLT" left以left为参考 top以top为参考 right以left为参考 bottom以top为参考
anchor的四个字母都可以是LRTB 依次表示 左上右下 在窗口拉伸的时候 计算坐标的参考对象
*/

#define ATT_POS                                                _T("pos")                            //替代上下左右相对数值
#define ATT_CENTER                                            _T("center")                        //居中模式
#define ATT_OFFSETX                                            _T("offsetx")                    //水平偏移
#define ATT_OFFSETY                                            _T("offsety")                    //垂直偏移
#define ATT_VISIBLE                                            _T("visible")
#define ATT_BG_COLOR                                        _T("bgcolor")                    //背静颜色,如果有贴图 忽略该项
#define ATT_BG_MODE                                            _T("bgmode")                    //背景模式
#define ATT_BG_BMP                                            _T("bgbmp")                        //字符串 使用“,”分割的图片名称
#define ATT_WIDTH                                            _T("width")                        //窗口宽度
#define ATT_HEIGHT                                            _T("height")                        //窗口高度
#define ATT_RESIZE                                            _T("resize")                        //是否可以修改窗口大小
#define ATT_HASCAPTION                                        _T("caption")                        //窗口是否有标题栏
#define ATT_ALIGN                                            _T("align")                        //文字的左中右对其
#define ATT_FONT_NAME                                        _T("fontname")                    //字体      注:文字由父控件 分发给自己的子控件 实现统一字体 最终都是窗口字体设置成默认字体
#define ATT_FONT_SIZE                                        _T("fontsize")                    //字体大小
#define    ATT_FONT_COLOR                                        _T("fontcolor")                    //文字颜色
#define ATT_MIN_WIDTH                                        _T("minwidth")                    //窗口最小宽度
#define ATT_MIN_HEIGHT                                        _T("minheight")                    //窗口最小高度
#define ATT_DISABLE                                            _T("disable")                        //控键是否是disable状态
#define ATT_SLID_TYPE                                        _T("slidtype")                    //slider类型 "h" or "v"
#define ATT_SLID_MAX                                        _T("slidmax")                        //slider的取值区间 slidmin-slidmax
#define ATT_SLID_MIN                                        _T("slidmin")    
#define ATT_SLID_BARBG                                        _T("slidbarbg")                    //slider滑块背景
#define ATT_SLID_SLOTBG                                        _T("slidslotbg")                    //slider滑槽背景
#define ATT_SLID_SLOTBG_MODE                                _T("slidslotmode")                //slider滑槽背景模式 tile或者one
#define ATT_SLID_POS                                        _T("slidpos")                        //slider滑块位置
#define ATT_SCROLL_BTNLT                                    _T("scrollbtnlt")                    //scroll的按钮
#define ATT_SCROLL_BTNRB                                    _T("scrollbtnrb")
#define ATT_SCROLL_BIND                                        _T("scrollbind")                    //scroll绑定到某个控件上 eg:list gride 会发送消息给相应控件
#define ATT_SCROLL_H                                        _T("scrollh")                        //横向滚动条 值为具体滚动条的name 要求滚动条 要配置在前面
#define ATT_SCROLL_V                                        _T("scrollv")
#define ATT_LIST_SHOW_HEAD                                    _T("showhead")                    //列表是否显示表头
#define ATT_ITEM_BG_COLOR                                    _T("itembgcolor")                //列表项item背景色
#define ATT_ITEM_BG_COLOR_SEL                                _T("itembgcolorsel")            //列表项item背景色
#define ATT_ITEM_BG_COLOR_FOCUS                                _T("itembgcolorfocus")        //列表项item背景色
#define ATT_LIST_LINE_COLOR                                    _T("linecolor")                //线条颜色
#define ATT_LSTHEAD_BG                                        _T("headbg")                        //列表表头的背景
#define ATT_LSTSPLIT                                        _T("splitbg")                        //列表头分割
#define ATT_TREE_EXPAND_ICO                                    _T("expandico")                //展开收缩的图标
#define ATT_EDIT_LINE                                        _T("line")                            //editor的单行与多行模式
#define ATT_EDIT_KIND                                        _T("kind")                            //edit的类型 num cha all
#define ATT_EDIT_BORDERCOLOR                                _T("borderclr")                        //边框颜色
#define ATT_EDIT_BORDERCOLORH                                _T("borderclrh")                    //边框颜色高亮
#define ATT_EDIT_READ_ONLY                                    _T("readonly")                        //edit只读
#define ATT_EDIT_PASSWORD                                    _T("password")                        //edit密码
#define ATT_BTN_TYPE                                        _T("type")                            //按钮的类型 一种或者两种状态(1,2)
#define ATT_BTN_TXT_CORNER                                    _T("txtrb")                            //按钮的文字是否在右下角显示
#define ATT_RADIO_SELECT                                    _T("select")                        //radiobtn是否选中
#define ATT_MENU_CION                                        _T("icon")                            //菜单item的icon
#define ATT_MENU_SPLIT                                        _T("split")                            //菜单item是否是分割符
#define ATT_SUB_MENU                                        _T("submenu")                    //菜单item的展开子菜单
#define ATT_TIP                                                _T("tip")                            //tip
#define ATT_LINK_COLOR_UNCLK                                _T("colorunclk")                //linkbutton未点击的颜色
#define ATT_LINK_COLOR_CLKED                                _T("colorclked")                //linkbutton点击过的颜色
#define ATT_LINK_CMD                                        _T("cmd")                            //link点击后shell执行的命令
#define ATT_COMBOBOX_ARROW                                    _T("arrow")                        //combobox的下拉按钮图片
#define ATT_COMBOBOX_EDIT                                    _T("edit")                        //edit是否支持输入框
#define ATT_COMBOBOX_DDSHOW_COUNT                            _T("ddcount")                    //下拉显示的Item数量 超过使用滚动条
#define ATT_COMBOBOX_DDBAR                                    _T("bar")                        //滑块        
#define ATT_ICON                                            _T("icon")                            //窗口的图标 数值是resource中的ID
#define ATT_CARD_NAMES                                        _T("cards")                            //tab支持的子空间组,顺序就是tab选项卡的顺序
#define ATT_CARD_NAMES_ID                                    _T("cardsid")                            //tab支持的子空间组,顺序就是tab选项卡的顺序
#define ATT_CARD_BTN_WIDTH                                    _T("cardwidth")                        //tab按钮的宽度
#define ATT_CARD_BTN_HEIGHT                                    _T("cardHeight")                    //tab按钮的高度
#define    ATT_CARD_BTN_BG                                        _T("cardbg")                        //card的背景
#define ATT_IMAGE_GIF                                        _T("gif")                            //image显示gif的时候使用的属性
#define ATT_AUTO_PLAY                                        _T("autoplay")                        //gif自动播放
#define ATT_UDNUM_MIN                                        _T("nummin")                        //数字框最小
#define ATT_UDNUM_MAX                                        _T("nummax")                        //数字框最大
#define ATT_UDNUM_STEP                                        _T("step")                            //数字框的步长
#define ATT_SWF_FILE                                        _T("swfsrc")                        //swf的文件源

 

 后面的文章我会在控件的介绍中详细介绍这些属性的使用。

posted @ 2011-05-28 23:32  健忘猪  阅读(588)  评论(0编辑  收藏  举报