Skip to content
Snippets Groups Projects
Commit db16e07e authored by dg's avatar dg
Browse files

fix

git-svn-id: http://svn.net-core.org/repos/t-engine4@1304 51575b47-30f0-44d4-a5cc-537603b46e54
parent 4d4db6e9
No related branches found
No related tags found
No related merge requests found
......@@ -26,32 +26,33 @@ local ButtonList = require "engine.ButtonList"
--- Handles dialog windows
module(..., package.seeall, class.make)
function _M:init(name, text, x, y, w, height, owner, font, fct)
function _M:init(name, text, x, y, w, height, owner, font, fct)
self.type = "Button"
self.owner = owner
self.name = name
self.name = name
self.fct = fct
self.font = font
self.font = font
self.x = x
self.y = y
self.btn = {
self.btn = {
susel = ButtonList:makeButton(text, self.font, w, height, false),
sel = ButtonList:makeButton(text, self.font, 50, height, true),
h = height,
mouse_over= function(button)
if self.owner.state ~= self.name then self.owner:focusControl(self.name) end
if button == "left" then
self:fct()
end
end
}
self.owner.mouse:registerZone(owner.display_x + self.x, owner.display_y + self.y + height, w, height, self.btn.mouse_over)
mouse_over= function(button)
if self.owner.state ~= self.name then self.owner:focusControl(self.name) end
if button == "left" then
self:fct()
end
self.owner.changed = true
end
}
self.owner.mouse:registerZone(owner.display_x + self.x, owner.display_y + self.y + height, w, height, self.btn.mouse_over)
end
function _M:drawControl(s)
function _M:drawControl(s)
if (self.owner.state == self.name) then
s:merge(self.btn.sel, self.x, self.y)
s:merge(self.btn.sel, self.x, self.y)
else
s:merge(self.btn.susel, self.x, self.y)
end
s:merge(self.btn.susel, self.x, self.y)
end
end
\ No newline at end of file
......@@ -46,13 +46,13 @@ function _M:init(dialogdef, owner, font, mask, fct)
self.btn = {
h = dialogdef.h,
mouse_over= function(button)
if self.owner.state ~= self.name then self.focused=true self.owner:focusControl(self.name) end
if button == "right" then
self.text=0
self.ownwer.changed=true
end
end
}
if self.owner.state ~= self.name then self.focused=true self.owner:focusControl(self.name) end
if button == "right" then
self.text=0
end
self.owner.changed=true
end
}
self.owner.mouse:registerZone(self.owner.display_x + self.x, self.owner.display_y + self.y + self.h, self.w, self.h, self.btn.mouse_over)
self:startCursor()
self:moveRight(1, true)
......
......@@ -42,16 +42,16 @@ function _M:init(dialogdef, owner, font, mask, fct)
self.private = dialogdef.private
self.text = ""
self.owner = owner
self.btn = {
self.btn = {
h = dialogdef.h,
mouse_over= function(button)
if self.owner.state ~= self.name then self.focused=true self.owner:focusControl(self.name) end
if button == "right" then
self.text=""
self.ownwer.changed=true
end
end
}
if self.owner.state ~= self.name then self.focused=true self.owner:focusControl(self.name) end
if button == "right" then
self.text=""
end
self.owner.changed=true
end
}
self.owner.mouse:registerZone(self.owner.display_x + self.x, self.owner.display_y + self.y + self.h, self.w, self.h, self.btn.mouse_over)
self:startCursor()
end
......
......@@ -86,7 +86,7 @@ function _M:init(title, prompt, default, act)
end
})
self:mouseZones{
{ x=0, y=0, w=game.w, h=game.h, mode={button=true}, norestrict=true, fct=function(button) if button == "left" then game:unregisterDialog(self) end end},
-- { x=0, y=0, w=game.w, h=game.h, mode={button=true}, norestrict=true, fct=function(button) if button == "left" then game:unregisterDialog(self) end end},
}
self:addControl(NumberBox.new({name="qty",title="",min=self.min, max=self.max, default=default, x=10, y=5, w=290, h=30}, self, self.font, "qty"))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment