update test file & add TestGrid widget for debug

pull/2/merge
Qingping Hou 12 years ago
parent 2e3e0d849a
commit e300881361

@ -1,5 +1,22 @@
require "ui"
TestGrid = Widget:new{}
function TestGrid:paintTo()
v_line = math.floor(G_width / 50)
h_line = math.floor(G_height / 50)
for i=1,h_line do
y_num = i*50
renderUtf8Text(fb.bb, 0, y_num+10, Font:getFace("ffont", 12), y_num, true)
fb.bb:paintRect(0, y_num, G_width, 1, 10)
end
for i=1,v_line do
x_num = i*50
renderUtf8Text(fb.bb, x_num, 10, Font:getFace("ffont", 12), x_num, true)
fb.bb:paintRect(x_num, 0, 1, G_height, 10)
end
end
-- we create a widget that paints a background:
Background = InputContainer:new{
is_always_active = true, -- receive events when other dialogs are active
@ -97,16 +114,25 @@ menu_items = {
{text = "item10"},
{text = "item11"},
{text = "item12"},
{text = "item13"},
{text = "item14"},
{text = "item15"},
{text = "item16"},
{text = "item17"},
}
M = Menu:new{
title = "Test Menu",
item_table = menu_items,
width = 500,
height = 400,
height = 600,
}
UIManager:show(Background:new())
UIManager:show(TestGrid)
UIManager:show(Clock:new())
UIManager:show(M)
UIManager:show(Quiz)
UIManager:run()

Loading…
Cancel
Save