/traderous

To get this branch, use:
bzr branch http://9ix.org/bzr/traderous

« back to all changes in this revision

Viewing changes to trade_view.lua

  • Committer: Josh C
  • Date: 2013-06-15 16:59:30 UTC
  • Revision ID: josh@9ix.org-20130615165930-iud659qdwcvjlnoh
beginnings of trading interface

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 
7
7
              local boxL = the.app.width / 2 - 200
8
8
              local boxT = the.app.height / 2 - 200
9
 
              local boxR = boxL + 400
10
 
 
11
 
              local lh = 17 -- line height
12
9
 
13
10
              self:add(Fill:new{
14
11
                          fill = {255,255,255},
30
27
                 local t = Text:new{
31
28
                    text = good[1],
32
29
                    x = boxL + 10,
33
 
                    y = boxT + 10 + (i-1) * lh,
34
30
                    width = 380
35
31
                 }
36
32
 
37
 
                 self:add(t)
38
 
 
39
 
                 t = Text:new{
40
 
                    text = good[2],
41
 
                    x = boxL + 10,
42
 
                    y = boxT + 10 + (i-1) * lh,
43
 
                    width = 300,
44
 
                    align = 'right'
45
 
                 }
46
 
                 self:add(t)
47
 
 
48
 
                 local b = Button:new{
49
 
                    x = boxR - 80,
50
 
                    y = boxT + 10 + (i-1) * lh - 1,
51
 
                    label = Text:new{ text = 'BUY', x = 1 },
52
 
                 }
53
 
                 local tw, th = b.label:getSize()
54
 
                 b.background = Fill:new{
55
 
                    fill = {100,100,100},
56
 
                    width = tw + 3,
57
 
                    height = th
58
 
                 }
59
 
                 self:add(b)
60
 
 
61
 
                 b = Button:new{
62
 
                    x = boxR - 40,
63
 
                    y = boxT + 10 + (i-1) * lh - 1,
64
 
                    label = Text:new{ text = 'SELL', x = 1 },
65
 
                 }
66
 
                 local tw, th = b.label:getSize()
67
 
                 b.background = Fill:new{
68
 
                    fill = {100,100,100},
69
 
                    width = tw + 3,
70
 
                    height = th
71
 
                 }
72
 
                 self:add(b)
73
 
 
 
33
                 local tw, th = t:getSize()
 
34
                 t.y = boxT + 10 + (i-1) * th -- (th + 2) -- for padding?
 
35
 
 
36
                 self:add(t)
74
37
              end
75
38
           end,
76
39
   activate = function (self)