New trait class - CGridColumnTraitNumericEdit
Opened this issue · 1 comments
GoogleCodeExporter commented
Hey Rolf
As promised I have a new trait class for you (see attachments).
It's a numeric based column trait, capable of handling percision based numbers,
which I hacked together from the slightly modified 'Numeric Edit Control' code
project (http://www.codeproject.com/KB/edit/NumEditCtl.aspx).
// Interger Example: NNNN
CGridColumnTraitNumericEdit* numericCol = new CGridColumnTraitNumericEdit();
numericCol->SetLimitText(4);
numericCol->SetAllowNegativeValues(false);
numericCol->SetDigitsAfterDecimal(0);
m_list_ctrl.InsertColumnTrait(idx, "Interger Example", LVCFMT_LEFT, 100, idx,
numericCol);
// Double Example: NNNN.NN
CGridColumnTraitNumericEdit* numericCol = new CGridColumnTraitNumericEdit();
numericCol->SetLimitText(6);
numericCol->SetAllowNegativeValues(false);
numericCol->SetDigitsBeforeDecimal(4);
numericCol->SetDigitsAfterDecimal(2);
m_list_ctrl.InsertColumnTrait(idx, "Double Example", LVCFMT_LEFT, 100, idx,
numericCol);
Feel free to tidy it up refine it a little more, like I said it was hacked
together, lol
Thanks for all your help thus far :)
Darren
Original issue reported on code.google.com by darren.g...@rms.co.uk
on 8 Dec 2011 at 2:38
Attachments:
GoogleCodeExporter commented
Original comment by sweaty1
on 12 Jan 2012 at 3:17
- Added labels: Type-Enhancement
- Removed labels: Type-Defect