Skip to content

Commit

Permalink
增强WndCheckBox用户体验 文字也可响应鼠标事件
Browse files Browse the repository at this point in the history
  • Loading branch information
tinymins committed Nov 12, 2014
1 parent e0dcd0a commit 0fa5298
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 12 deletions.
6 changes: 5 additions & 1 deletion .Framework/src/MY.UI.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1572,7 +1572,11 @@ function _MY.UI:size(nWidth, nHeight)
end
pcall(function()
if ele.type=="WndCheckBox" then

ele.wnd:SetSize(nHeight, nHeight)
ele.txt:SetSize(nWidth - nHeight - 1, nHeight)
ele.hdl:SetRelPos(nHeight + 1, 0)
ele.hdl:SetSize(nWidth, nHeight)
ele.hdl:FormatAllItemPos()
elseif ele.type=="WndComboBox" then
local w, h= ele.cmb:GetSize()
ele.cmb:SetRelPos(nWidth-w-5, math.ceil((nHeight - h)/2))
Expand Down
15 changes: 9 additions & 6 deletions .Framework/ui/WndCheckBox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ UnChecking=3
Image=ui\Image\button\CommonButton_1.UITex
$Tip=
ShowTipType=0
DummyWnd=1

[Handle_Total]
._WndType=Handle
Expand All @@ -48,8 +49,9 @@ FirstItemPosType=0
Left=0
Top=0
PosType=0
Width=1
Height=1
Width=146
Height=25
EventID=512

[Text_Default]
._WndType=Text
Expand All @@ -59,11 +61,12 @@ FontSpacing=0
Alpha=255
$Text=
Left=26
Top=4
Top=0
PosType=0
Width=120
Height=24
Height=25
FontScheme=18
ShowAll=1
AutoEtc=0
ShowAll=0
AutoEtc=1
VAlign=1

2 changes: 1 addition & 1 deletion ScreenShot/src/MY_ScreenShot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ _MY_ScreenShot.OnPanelActive = function(wnd)
ui:children("#WndEditBox_SsRoot"):text(MY_ScreenShot.GetConfig("szFilePath"))
end

ui:append("WndCheckBox_UseGlobal", "WndCheckBox"):children("#WndCheckBox_UseGlobal"):pos(30,30)
ui:append("WndCheckBox_UseGlobal", "WndCheckBox"):children("#WndCheckBox_UseGlobal"):pos(30,30):width(200)
:text(_L["use global config"]):tip(_L['Check to use global config, otherwise use private setting.'])
:check(function(bChecked) MY_ScreenShot.bUseGlobalConfig = bChecked fnRefreshPanel(ui) end)
:check(MY_ScreenShot.bUseGlobalConfig)
Expand Down
6 changes: 3 additions & 3 deletions Toolbox/src/MY_Toolbox.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1194,21 +1194,21 @@ _MY_ToolBox.OnPanelActive = function(wnd)
y = y + 30
for id, cache in pairs(_Cache.InfoTip) do
local cfg = Config.InfoTip[id]
ui:append("WndCheckBox_InfoTip_"..id, "WndCheckBox"):children("#WndCheckBox_InfoTip_"..id):pos(x, y)
ui:append("WndCheckBox_InfoTip_"..id, "WndCheckBox"):children("#WndCheckBox_InfoTip_"..id):pos(x, y):width(100)
:text(cache.title):check(cfg.bEnable or false)
:check(function(bChecked)
cfg.bEnable = bChecked
_MY_ToolBox.ReloadInfoTip()
end)
x = x + 90
ui:append("WndCheckBox_InfoTipTitle_"..id, "WndCheckBox"):children("#WndCheckBox_InfoTipTitle_"..id):pos(x, y)
ui:append("WndCheckBox_InfoTipTitle_"..id, "WndCheckBox"):children("#WndCheckBox_InfoTipTitle_"..id):pos(x, y):width(60)
:text(_L['title']):check(cfg.bShowTitle or false)
:check(function(bChecked)
cfg.bShowTitle = bChecked
_MY_ToolBox.ReloadInfoTip()
end)
x = x + 40
ui:append("WndCheckBox_InfoTipBg_"..id, "WndCheckBox"):children("#WndCheckBox_InfoTipBg_"..id):pos(x, y)
ui:append("WndCheckBox_InfoTipBg_"..id, "WndCheckBox"):children("#WndCheckBox_InfoTipBg_"..id):pos(x, y):width(60)
:text(_L['background']):check(cfg.bShowBg or false)
:check(function(bChecked)
cfg.bShowBg = bChecked
Expand Down
2 changes: 1 addition & 1 deletion XLifeBar/XLifeBar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ _Cache.OnPanelActive = function(wnd)
:check(function(bChecked) XLifeBar.bEnabled = bChecked _XLifeBar.Reset(true) end)
-- 使用所有角色公共设置
ui:append("WndCheckBox_GlobalConfig", "WndCheckBox"):children("#WndCheckBox_GlobalConfig")
:pos(x+110,y):text(_L["use global config"])
:width(200):pos(x+110,y):text(_L["use global config"])
:check(XLifeBar.bEnabled or false)
:check(function(bChecked)
XLifeBar.bUseGlobalConfig = bChecked
Expand Down

0 comments on commit 0fa5298

Please sign in to comment.