控件清单

<xlue author='Thunder Corporation'  copyright='(C) Thunder Corporation.'  name='BoltNameTable' ><nametable class='BaseUI.ScrollBar.ScrollPosAni'  id='BaseUI.ScrollBar.ScrollPosAni.Template'  path='layout\ScrollBar.xml'  type='AnimationTemplate'/><nametable class=''  id='BaseUI.VScrollBar'  path='layout\ScrollBar.xml'  type='ObjectTemplate'/><nametable class='SpeedUpjiedian_Suc.bottom'  id='SpeedUpjiedian_Suc.bottom'  path='layout\SpeedUpResult.xml'  type='control'/><nametable class=''  id='Login.Menu'  path='layout\MenuPanel_Login.xml'  type='ObjectTreeTemplate'/><nametable class='MenuHostWnd'  id='Login.Menu.Wnd'  path='layout\MenuPanel_Login.xml'  type='HostWndTemplate'/><nametable class='FrameHostWnd'  id='FeedBackError.Wnd'  path='layout\FeedBackWndError.xml'  type='HostWndTemplate'/><nametable class='ObjectTreeTemplate'  id='FeedBackError.Manager'  path='layout\FeedBackWndError.xml'  type='ObjectTreeTemplate'/><nametable class='System.button'  id='System.button'  path='layout\SystemButton.xml'  type='control'/><nametable class='Close.button'  id='Close.button'  path='layout\CloseButton.xml'  type='control'/><nametable class='System.RichEdit'  id='System.RichEdit'  path='layout\RichEdit.xml'  type='control'/><nametable class='Thunder.System.ButtonEx.Ctrl'  id='Thunder.System.ButtonEx.Ctrl'  path='layout\SystemButtonEx.xml'  type='control'/><nametable class='Thunder.System.ItemEx'  id='Thunder.System.ItemEx'  path='layout\SystemButtonEx.xml'  type='control'/><nametable class='Game.button'  id='Game.button'  path='layout\GameButton.xml'  type='control'/><nametable class='Vip.button'  id='Vip.button'  path='layout\VipButton.xml'  type='control'/><nametable class='Help.button'  id='Help.button'  path='layout\HelpButton.xml'  type='control'/><nametable class='Tool.button'  id='Tool.button'  path='layout\ToolButton.xml'  type='control'/><nametable class='Menu.FeedBack'  id='Menu.FeedBack'  path='layout\FeedBack.xml'  type='control'/><nametable class='System.Menu'  id='System.Menu'  path='layout\Menu.xml'  type='control'/><nametable class='System.Skin'  id='System.Skin'  path='layout\Skin.xml'  type='control'/>
</xlue>

目录清单(部分)

素材

界面程序主窗口文件(MainWnd.xml,MainWnd.lua)

XML

<xlue><objtreetemplate  id="XL.MainObjTree" class="ObjectTreeTemplate"><attr><left>-200</left><top>-200</top><width>2000</width><height>2000</height></attr><obj id="app.bkg" class="LayoutObject"><attr><left>0</left><top>0</top><width>father.width</width><height>father.height</height></attr><children>                <obj id="bkg" class="ImageObject"><attr><left>0</left><top>0</top><width>father.width</width><height>father.height</height><image>bkg</image></attr><children><obj id="caption" class="CaptionObject"><attr><width>father.width</width><height>father.height</height><zorder>-1000</zorder></attr></obj><obj id="mainwnd.body" class="LayoutObject"><attr><left>8</left><top>8</top><width>father.width-16</width><height>father.height-16</height></attr><children><obj id="logo" class="ImageObject"><attr><left>540</left><top>20</top><width>197</width><height>37</height><image>logo</image></attr></obj><obj id="menu.feedback" class="Menu.FeedBack"><attr><left>father.width - 144</left><top>-8</top><width>28</width><height>31</height></attr><eventlist><event name="OnClick" file="MainWnd.lua" func="CreatFeedBackManager" /></eventlist></obj><obj id="system.menu" class="System.Menu"><attr><left>father.width - 88</left><top>-8</top><width>28</width><height>31</height></attr><eventlist><event name="OnClick" file="MainWnd.lua" func="CreatMenuManager" /></eventlist></obj><obj id="system.skin" class="System.Skin"><attr><left>father.width - 116</left><top>-8</top><width>28</width><height>31</height></attr></obj><obj id="Button.Layout" class="LayoutObject"><attr></attr><children><obj id="game.button" class="Game.button"><attr><left>0</left><top>0</top><width>70</width><height>80</height></attr><eventlist><event name="OnClick" file="MainWnd.lua" func="OnActiveTabChanged" /></eventlist></obj> <obj id="vip.button" class="Vip.button"><attr><left>90</left><top>0</top><width>70</width><height>80</height></attr><eventlist><event name="OnClick" file="MainWnd.lua" func="OnActiveTabChanged" /></eventlist></obj> <obj id="help.button" class="Help.button"><attr><left>180</left><top>0</top><width>70</width><height>80</height></attr><eventlist><event name="OnClick" file="MainWnd.lua" func="OnActiveTabChanged" /></eventlist></obj> <obj id="tool.button" class="Tool.button"><attr><left>270</left><top>0</top><width>70</width><height>80</height></attr><eventlist><event name="OnClick" file="MainWnd.lua" func="OnActiveTabChanged" /></eventlist></obj> </children></obj><obj id="MainPanel" class="Demo.MainPanel"><attr><left>-15</left><top>-98</top><width>father.width+30</width><height>father.height+25</height></attr></obj><obj id="vip.MainPanel" class="Vip.MainPanel"><attr><left>-15</left><top>-98</top><width>father.width+30</width><height>father.height+25</height></attr></obj><obj id="help.MainPanel" class="Help.MainPanel"><attr><left>-15</left><top>-98</top><width>father.width+30</width><height>father.height+25</height></attr></obj><obj id="tool.MainPanel" class="Tool.MainPanel"><attr><left>-15</left><top>-98</top><width>father.width+30</width><height>father.height+25</height></attr></obj> <obj id="mainwnd.sysbtn" class="Thunder.System.ButtonEx.Ctrl" ><attr><left>father.width - 60</left><top>-8</top><width>90</width><height>20</height><zorder>330</zorder>     <ItemWidthIsSame>false</ItemWidthIsSame></attr><eventlist><event name="OnClose" file="MainWnd.lua" func="OnClose" /><event name="OnInitControl" file="MainWnd.lua" func="OnSysBtnInitControl" /><event name="OnMinisize" file="MainWnd.lua" func="OnMinisize" /></eventlist></obj> </children></obj></children></obj></children>     <eventlist><!--定义事件响应时,如果方法被定义在同名的.xml.lua中同时方法名为事件名时,可以省略file 及 func属性,会损失加载效率, 不推荐--><event name="OnInitControl" file="MainWnd.lua" func="OnInitControl" /></eventlist>          </obj>    </objtreetemplate><hostwndtemplate id="XL.MainWnd" class="FrameHostWnd" ><attr> <mainwnd>1</mainwnd><title>Bolt</title><layered>1</layered><left>200</left> <top>100</top><!--注意这是容器窗口的大小,设置的要合理--><width>760</width><height>500</height><cacheleft>0</cacheleft> <cachetop>0</cachetop><cachewidth>1000</cachewidth><cacheheight>720</cacheheight><center>1</center><visible>1</visible><enable>1</enable><active>1</active><maxbox>0</maxbox><minbox>0</minbox><minwidth>100</minwidth><minheight>72</minheight><maxwidth>1000</maxwidth><maxheight>720</maxheight><appwindow>1</appwindow><topmost>1</topmost><fps>30</fps></attr><eventlist><event name="OnSize" file="MainWnd.lua" func="OnSize"/></eventlist>       </hostwndtemplate>
</xlue>

LUA

function OnSize(self, sizetype, width, height)local objectTree = self:GetBindUIObjectTree()local rootObject = objectTree:GetRootObject()rootObject:SetObjPos(0, 0, width, height)endfunction OnClose(self)local hostwndManager = XLGetObject("Xunlei.UIEngine.HostWndManager")local hostwnd = hostwndManager:GetHostWnd("Wizard.MainWnd.Instance")hostwndManager:RemoveHostWnd("Wizard.MainWnd.Instance")local objtreeManager = XLGetObject("Xunlei.UIEngine.TreeManager")  objtreeManager:DestroyTree("Wizard.MainObjTree.Instance")local myClassFactory = XLGetObject("HelloBolt.MyClass.Factory")local myClass = myClassFactory:CreateInstance()myClass:DeletIcon()os.exit(0)--local app = XLGetObject("Wizard.App")--app:Quit(0)
endfunction OnSysBtnInitControl(self)local hostwndManager = XLGetObject("Xunlei.UIEngine.HostWndManager")local hostwnd = hostwndManager:GetHostWnd("XL.MainWnd.Instance")local state = hostwnd:GetWindowState()
endfunction OnMinisize(self)local hostwndManager = XLGetObject("Xunlei.UIEngine.HostWndManager")local hostwnd = hostwndManager:GetHostWnd("XL.MainWnd.Instance")hostwnd:Min() --hostwnd:SetVisible(false)endfunction GetScreenPos(menuRoot, x, y)local left,top,right,bottom = menuRoot:GetObjPos()local width = right - leftlocal height = bottom - toplocal menuTree = menuRoot:GetOwner()local menuHostWnd = menuTree:GetBindHostWnd()local sleft, stop, sright, sbottom = menuHostWnd:GetMonitorRect(x, y)if x + width > sright thenx = x - widthendif y + height > sbottom theny = y - heightendreturn x, y, width, height
end
function OnMainWndRButtonUp(self, x, y)local templateMananger = XLGetObject("Xunlei.UIEngine.TemplateManager")               local menuTreeTemplate = templateMananger:GetTemplate("Wizard.Menu","ObjectTreeTemplate")local menuTree = menuTreeTemplate:CreateInstance("Wizard.Menu.Instance")local hostwndManager = XLGetObject("Xunlei.UIEngine.HostWndManager")local parent = hostwndManager:GetHostWnd("Wizard.MainWnd.Instance")local parentHandle = parent:GetWndHandle()local menuHostWndTemplate = templateMananger:GetTemplate("Wizard.Menu", "HostWndTemplate")local menuHostWnd = menuHostWndTemplate:CreateInstance("Wizard.Menu.Instance")menuHostWnd:BindUIObjectTree(menuTree)local menuContext = menuTree:GetUIObject("menu.root")x, y = parent:ClientPtToScreenPt(x,y)local left, top, width, height = GetScreenPos(menuContext, x, y)menuHostWnd:TrackPopupMenu(parentHandle, left, top, width, height)local objtreeManager = XLGetObject("Xunlei.UIEngine.TreeManager")    objtreeManager:DestroyTree("Wizard.Menu.Instance")hostwndManager:RemoveHostWnd("Wizard.Menu.Instance")
endfunction OnActiveTabChanged(self)
--XLMessageBox("sadfasf")--XLMessageBox(self:GetClass())local ownerTree = self:GetOwner()local buttonLayout=ownerTree:GetUIObject("Button.Layout")local mainPanel = ownerTree:GetUIObject("MainPanel")local vipPanel = ownerTree:GetUIObject("vip.MainPanel")local helpPanel = ownerTree:GetUIObject("help.MainPanel")local toolPanel = ownerTree:GetUIObject("tool.MainPanel")mainPanel:SetVisible(false)mainPanel:SetChildrenVisible(false)vipPanel:SetVisible(false)vipPanel:SetChildrenVisible(false)helpPanel:SetVisible(false)helpPanel:SetChildrenVisible(false)toolPanel:SetVisible(false)toolPanel:SetChildrenVisible(false)local vButton=ownerTree:GetUIObject("vip.button")local hButton=ownerTree:GetUIObject("help.button")local tButton=ownerTree:GetUIObject("tool.button")local gButton=ownerTree:GetUIObject("game.button")if self:GetClass() =="Game.button" thenmainPanel:SetVisible(true)mainPanel:SetChildrenVisible(true)vButton:SetState(0)hButton:SetState(0)tButton:SetState(0)vButton:SetOldState(0)hButton:SetOldState(0)tButton:SetOldState(0)elseif self:GetClass() == "Vip.button" then vipPanel:SetVisible(true)vipPanel:SetChildrenVisible(true)gButton:SetState(0)hButton:SetState(0)tButton:SetState(0)gButton:SetOldState(0)hButton:SetOldState(0)tButton:SetOldState(0)elseif self:GetClass() == "Help.button" thenhelpPanel:SetVisible(true)helpPanel:SetChildrenVisible(true)vButton:SetState(0)gButton:SetState(0)tButton:SetState(0)vButton:SetOldState(0)gButton:SetOldState(0)tButton:SetOldState(0)elseif self:GetClass() == "Tool.button" thentoolPanel:SetVisible(true)toolPanel:SetChildrenVisible(true)vButton:SetState(0)hButton:SetState(0)gButton:SetState(0)vButton:SetOldState(0)hButton:SetOldState(0)gButton:SetOldState(0)end
end
function OnInitControl(self)end
function CreatFeedBackManager(self)--实例化skin对象树local templateMananger = XLGetObject("Xunlei.UIEngine.TemplateManager")               local feedbackTreeTemplate = templateMananger:GetTemplate("FeedBack.Manager","ObjectTreeTemplate")local feedbackTree = feedbackTreeTemplate:CreateInstance("FeedBack.Manager.Instance")local hostwndManager = XLGetObject("Xunlei.UIEngine.HostWndManager")local parent = hostwndManager:GetHostWnd("XL.MainWnd.Instance")local parentHandle = parent:GetWndHandle()--实例化skin窗口local feedbackHostWndTemplate = templateMananger:GetTemplate("FeedBack.Wnd", "HostWndTemplate")local feedbackHostWnd = feedbackHostWndTemplate:CreateInstance("FeedBack.Wnd.Instance")--将skin对象树装在入窗口实例feedbackHostWnd:BindUIObjectTree(feedbackTree)feedbackHostWnd:Create()
end
--menuHostWnd=nil
isVisible=true
function CreatMenuManager(self)--实例化对象树local templateMananger = XLGetObject("Xunlei.UIEngine.TemplateManager")               local menuTreeTemplate = templateMananger:GetTemplate("XL.Menu","ObjectTreeTemplate")local menuTree = menuTreeTemplate:CreateInstance("XL.Menu.Instance")local hostwndManager = XLGetObject("Xunlei.UIEngine.HostWndManager")local parent = hostwndManager:GetHostWnd("XL.MainWnd.Instance")local parentHandle = parent:GetWndHandle()--实例化skin窗口local menuHostWndTemplate = templateMananger:GetTemplate("XL.Menu.Wnd", "HostWndTemplate")local menuHostWnd = menuHostWndTemplate:CreateInstance("XL.Menu.Wnd.Instance")--将skin对象树装在入窗口实例menuHostWnd:BindUIObjectTree(menuTree)local menuContext = menuTree:GetUIObject("menu.root")x, y = parent:ClientPtToScreenPt(x,y)local left,top,right,bottom = menuContext:GetObjPos()--local left, top, width, height = GetScreenPos(menuContext, x, y)--XLMessageBox(x.." "..y.." "..right.." "..bottom)menuHostWnd:TrackPopupMenu(parentHandle, x+670, y+40, right, bottom)--menuHostWnd:TrackPopupMenu(parentHandle, left, top, width, height)local objtreeManager = XLGetObject("Xunlei.UIEngine.TreeManager")    objtreeManager:DestroyTree("XL.Menu.Instance")hostwndManager:RemoveHostWnd("XL.Menu.Wnd.Instance")x=0y=0
end

基于BOLT的仿迅雷加速器界面开发(二)相关推荐

  1. DuiLib实现仿微信聊天界面(二)——解决RichEdit自适应高度问题

    前言 在上一篇文章中: DuiLib实现仿微信聊天界面 我们实现了仿微信的布局和简单的聊天列表: 但是,因为网易开源 NimDuiLib 的版本落后于其提供的Demo,同样的写法在开源DuiLib中就 ...

  2. 基于Springboot实现仿百度网盘开发

    项目编号:BS-PT-032 本项目基于Springboot开发实现,前端采用BootStrap开发实现,系统功能完整,交互性好,模仿百度网盘实现相关功能,比较适合做毕业设计使用,创意性强. 开发工具 ...

  3. 基于javaweb的仿天猫商城系统开发与设计.rar(论文+任务书+项目源码)

    1设计背景 1 1.1课题现状 1 1.2课题意义 1 2设计思路 2 2.1环境与工具 2 2.1.1 Idea工具 2 2.1.2 webStorm工具 2 2.1.3 Mysql 2 2.1.4 ...

  4. 基于Qt的类QQ气泡聊天的界面开发(二)

    http://blog.csdn.net/esonpo/article/details/25974999 1:使用Qt下面的QListview来实现QQ类似效果,差强人意 2:使用QWebview加载 ...

  5. html5 plus与vue,基于Html5 Plus + Vue + Mui 移动App 开发(二)

    基于Html5 Plus + Vue + Mui 移动App 开发(二) 界面效果: 本页面采用Html5 Plus + Vue + Mui 开发移动界面,本页面实现: 1.下拉刷新.上拉获取更多功能 ...

  6. 【【【超高仿】】】迅雷播放器教程 -- 总结——对界面开发介绍非常详细

    http://blog.csdn.net/qq316293804/article/details/14162539 版权声明:本文为博主原创文章,未经博主允许不得转载. 代码下载:http://dow ...

  7. 仿迅雷播放器教程 -- 基于VLC的MFC播放器 (6)

    代码下载: http://download.csdn.net/detail/qq316293804/6409417 昨天的教程里写着预计MFC播放器会隔得久一点,但是今晚仔细看了下VLC的常用代码,发 ...

  8. 仿迅雷播放器教程 -- C++ windows界面库对比(11)

    从上一篇文章中可以看出,C++的界面方向还很弱,没有任何一个界面库可以一统天下,所以才造成了界面库百家争鸣的情况. 从时间上看: 1.出来最早的是QT,1991年就有了. 2.VC++ 虽然1992年 ...

  9. 【基于zynq的卷积神经网络加速器设计】(一)熟悉vivado和fpga开发流程:使用Vivado硬件调试烧写hello-world led闪烁程序实现及vivado软件仿真

    HIGHLIGHT: vivado设计流程: note: 分析与综合 和 约束输入 可以调换顺序 [基于zynq的卷积神经网络加速器设计](一)熟悉vivado和fpga开发流程:使用Vivado硬件 ...

最新文章

  1. linux 文件查找命令集:find,locate,wheres,which,type
  2. 安卓app和iosapp开发有什么不同呢?-综合外链_想让卫星软件不“软” 给草根开发者提供的条件得“硬”...
  3. 网络工程师的经典爱情观
  4. 2020-12-09 深度学习 卷积神经网络结构分析
  5. NofairSync.tryAcquire
  6. 10-4 6-4 查询厂商“D“生产的PC和便携式电脑的平均价格 (10 分)思路+详解+测试用例
  7. 前端学习(3089):vue+element今日头条管理-关于接口的调错
  8. 2017-2018-20172309 《程序设计与数据结构》第五周学习总结
  9. TCP/IP 协议大致的概念
  10. R语言:多因素Cox回归森林图 (基于forestplot包) 森林图 cox可视化
  11. 2030影院群站专用苹果CMS10自适应手机电影整站源码影视模板下载
  12. shenyu2.5.0解决Exceeded limit on max bytes to buffer:262144
  13. xmarks不能同步和访问之解决办法
  14. 三进制计算机未来的发展趋势,如果研制出三进制计算机会怎样?
  15. 用友U8数据备份实例工作经验
  16. Dubbo笔记 ㉗ : 服务自省-提供者
  17. 牛客 小米校招 最大新整数 单调栈
  18. 读取身份证信息系统的程序编写
  19. iOS测试之接口测试总结
  20. phytool下载与使用(详解)

热门文章

  1. 关于Unity如何创建静态动画图片
  2. 2022, GECCO,Taylor Genetic Programming for Symbolic Regression
  3. Windows/Linux 开启端口监听
  4. 三国中谁的抗曹功劳最大?
  5. 笔记本更换SSD和光驱硬盘架
  6. LimeSDR USB 使用gqrx来收听FM广播
  7. linux系统设置开机启动,Linux开机启动系统选择设置
  8. android图片压缩办法总结
  9. 微信生成二维码长按识别
  10. AdminEx后台管理系统模板、用户权限管理设计、按钮级别