+ tw,th = self.DC.GetTextExtent(val)
+ if self.num_align_horz == wxALIGN_CENTRE:
+ adj_h = (self.dl_w - tw)/2
+ elif self.num_align_horz == wxALIGN_RIGHT:
+ adj_h = self.dl_w - tw
+ else:
+ adj_h = 0 # left alignment
+
+ adj_h = adj_h + self.num_indent_horz
+
+ if self.num_align_vert == wxALIGN_CENTRE:
+ adj_v = (self.dl_h - th)/2
+ elif self.num_align_horz == wxALIGN_RIGHT:
+ adj_v = self.dl_h - th
+ else:
+ adj_v = 0 # left alignment
+
+ adj_v = adj_v + self.num_indent_vert
+
+ self.DC.DrawText(val, x+adj_h, y+adj_v)