Skip to content

New trait class - CGridColumnTraitNumericEdit #22

@GoogleCodeExporter

Description

@GoogleCodeExporter
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 [email protected] on 8 Dec 2011 at 2:38

Attachments:

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions