TwAppInit() 初始化控件系统
TwLayoutParseFile 解析某个加载的ini文件
TGetExecutePath 加载ini布局文件
TObjectGetFromName 获取控件名
TwSetCaption 设置控件的文字
TwUpdateShow()刷新界面
TObjectAddEventHandler 添加事件
TwEnable enable 控件
TwDisable disable 控件
TwHide 隐藏控件
TwShow 显示控件
TwDestroy 销毁某个页面
TwCreate 创建控件
TwMainLoop() 控件的消息循环
mMain = (TWidget*)TObjectGetFromName("wifi_main_window"); if(mMain == NULL){ TwLayoutParseFile(parent, TGetExecutePath("../etc/setup/layout_setup_wifi.ini")); mMain = (TWidget*)TObjectGetFromName("wifi_main_window"); } ... TwSetCaption(mPassword,cfg.PreSharedKey.c_str()); TwUpdateShow(); TObjectAddEventHandler(mRefresh, CLICKED, _refreshClicked, NULL);
TwTransSwitchLanguage 切换语言
ApVariant val = DataSaveControl::readSettingData(SetupStrIdConst::setupSysLang,ApVariant(SetupStrIdConst::setupLangChinese)); if(val.toString() == SetupStrIdConst::setupLangEnglish) { TwTransSwitchLanguage("zh_EN"); } else if(val.toString() == SetupStrIdConst::setupLangChinese) { TwTransSwitchLanguage("zh_CN"); }
TwWindowSetAlpha设置窗口的透明度(0-255)0为全透
TwWindowSetAlpha(m_videoWindow.video_main_window, 0);
TwChangeStyle改变控件的样式
TwChangeStyle((TWidget*)TObjectGetFromName("pic_playpause_btn"), "music_pause");