8 |
|
|
9 |
import gzz |
import gzz |
10 |
from gzz.impl import ModularSpace |
from gzz.impl import ModularSpace |
11 |
from gzz.view import CellVobFactory, TextCellContentView, ViewContext |
from gzz.view import CellVobFactory, TextCellContentView, ViewContext, MockViewContext |
12 |
from gzz.vob import * |
from gzz.vob import * |
13 |
from test.tools.gfx import * |
from test.tools.gfx import * |
14 |
from test.tools import tools |
from test.tools import tools |
20 |
tv = TextCellContentView(win.getGraphicsAPI().getTextStyle( |
tv = TextCellContentView(win.getGraphicsAPI().getTextStyle( |
21 |
"sans", 0, 20)) |
"sans", 0, 20)) |
22 |
|
|
|
class VC(ViewContext): |
|
|
def getAccursed(self): |
|
|
return cell |
|
|
|
|
|
def getCellContentView(self): |
|
|
return tv |
|
|
|
|
|
def getCursorColors(self, cell): |
|
|
return None |
|
|
|
|
|
def isMarked(self, cell): |
|
|
return 0 |
|
|
|
|
|
def getCursorOffset(self, *args): |
|
|
return 0 |
|
|
|
|
23 |
bgc = (0, 0, 255) |
bgc = (0, 0, 255) |
24 |
|
|
25 |
def checkbox(x, y, w, h, color): |
def checkbox(x, y, w, h, color): |
41 |
box = vs.orthoBoxCS(0, "A", 0, 100, 100, 1, 1, 200, 50) |
box = vs.orthoBoxCS(0, "A", 0, 100, 100, 1, 1, 200, 50) |
42 |
|
|
43 |
cvf = CellVobFactory() |
cvf = CellVobFactory() |
44 |
context = VC() |
context = MockViewContext() |
45 |
|
context.c, context.ccv = cell, tv |
46 |
cvf.place(cell, vs, box, context) |
cvf.place(cell, vs, box, context) |
47 |
|
|
48 |
render(vs) |
render(vs) |