247{
248 wxGridCellRenderer::Draw(grid, attr, dc, rect, row, col, isSelected);
249
250 wxGridTableBase *table = grid.GetTable();
253 wxString tstr;
254
255 if (ne) {
256 double value;
257
258 table->
GetValue(row, col).ToDouble(&value);
259
263 value,
265 wxPoint(10000, 10000));
266 tstr = tt.GetString();
267
268 ne->DecRef();
269 }
270
271 dc.SetBackgroundMode(wxTRANSPARENT);
272
273 if (grid.IsEnabled())
274 {
275 if (isSelected)
276 {
277 dc.SetTextBackground(grid.GetSelectionBackground());
278 dc.SetTextForeground(grid.GetSelectionForeground());
279 }
280 else
281 {
282 dc.SetTextBackground(attr.GetBackgroundColour());
283 dc.SetTextForeground(attr.GetTextColour());
284 }
285 }
286 else
287 {
288 dc.SetTextBackground(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));
289 dc.SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT));
290 }
291
292 dc.SetFont(attr.GetFont());
293
294 int hAlign, vAlign;
295
296 attr.GetAlignment(&hAlign, &vAlign);
297
298 grid.DrawTextRectangle(dc, tstr, rect, hAlign, vAlign);
299}
wxGridCellEditor for the NumericTextCtrl.
wxString GetValue() const override
NumericFormatID GetFormat() const
Options & AutoPos(bool enable)