I would like to have something like this:
class Foo {
private:
int bar;
public:
void setBar(int bar);
int getBar() const;
}
class MyDialog : public CDialogImpl<MyDialog> {
BEGIN_MODEL_MAPPING()
MAP_INT_EDITOR(m_editBar, m_model, getBar, setBar);
END_MODEL_MAPPING()
// other methods and message map
private:
Foo * m_model;
CEdit m_editBar;
}
Also it would be great if I could provide my custom validations:
MAP_VALIDATED_INT_EDITOR(m_editBar, m_model, getBar, setBar, validateBar)
...
bool validateBar (int value) {
// custom validation
}
Have anybody seen something like this?
P.S. I don't like DDX because it's old and it's not flexible, and I cannot use getters and setters.