Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New trait class - CGridColumnTraitNumericEdit #22

Open
GoogleCodeExporter opened this issue Mar 16, 2015 · 1 comment
Open

New trait class - CGridColumnTraitNumericEdit #22

GoogleCodeExporter opened this issue Mar 16, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

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
Copy link
Author

Original comment by sweaty1 on 12 Jan 2012 at 3:17

  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants