1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 import unittest
20
21 from timelinelib.test.cases.wxapp import WxAppTestCase
22
23
24 TEXT_HEIGHT = 20
25 TEXT_WIDTH = 40
41
44
46 self._set_pen_call_count = 0
47 self._set_draw_line_call_count = 0
48 self._set_draw_text_call_count = 0
49 self._font = None
50 self._text_foreground = None
51 self._text = None
52 self._text_x = None
53 self._text_y = None
54
55 @property
57 return self._set_pen_call_count
58
59 @property
61 return self._set_draw_line_call_count
62
63 @property
65 return self._set_draw_text_call_count
66
67 @property
70
71 @property
74
75 @property
78
79 @property
82
83 @property
86
87 @property
89 return self._text_foreground
90
91 @property
94
95 @property
98
99 @property
102
104 self._set_pen_call_count += 1
105
106 - def SetTextForeground(self, color):
107 self._text_foreground = color
108
110 self._x1 = x1
111 self._y1 = y1
112 self._x2 = x2
113 self._y2 = y2
114 self._set_draw_line_call_count += 1
115
116 - def DrawText(self, text, x, y):
117 self._text = text
118 self._text_x = x
119 self._text_y = y
120 self._set_draw_text_call_count += 1
121
122 - def GetTextExtent(self, text):
124
127
130
131 - def __init__(self, width, height, divider_y):
135
136 @property
139
140 @property
143
144 @property
146 return self._divider_y
147
150
153
160