Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CMFCPropertyGridProperty list of values?

Is there a standard way to hold a user editable list of values in a CMFCPropertyGridProperty? 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?

like image 778
User Avatar asked Oct 28 '25 16:10

User


1 Answers

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.

like image 187
Aidan Ryan Avatar answered Oct 31 '25 13:10

Aidan Ryan