CMFCPropertyGridProperty list of values?
Is there a standard way to hold a user editable list of values in a CMFCPropertyGridProperty?开发者_Python百科 I'm thinking a string with semi-colon delimiter (that seems to be the windows standard). If I want an edit interface for this how would I build that?
One option:
You can inherit CMFCPropertyGridProperty
and override HasButton
, returning TRUE
. This will cause an ellipsis ("...") button to appear in the right-hand side of the value field. Override OnClickButton
to provide your user interface for editing the list of values. You can pop up a dialog with a list control and a way to add/remove/edit items in the list. Override FormatProperty
to display the list of values in the value field, and override ResetOriginalValue
and implement code to restore the value you are constructed with.
Another option:
Inherit CMFCPropertyGridProperty
and override OnKillFocus
. If the user-entered value violates the formatting that you allow (semicolon-separated list of integers, for example), pop up a warning and return FALSE
to prevent the edit from being committed.
精彩评论