The recent development of a software encountered the problem of property editing, would like to use a list control to replace, but found that the list control has a lot of flaws, not too useful. The property control does not support editing and Drop-down list functionality, which has built-in these two features and provides Customdraw, but is not yet complete. Program running screen as shown in figure I:
Figure I
Here's a description of the main methods:
You define a macro to frame the list sequence:
begin_create_node
Begin_yjitem (0,yj_folder,yj_default,_t ("file"), yjedit,true,_t ("file")
Begin_ Yjitem (1,yj_folder,yj_default,_t ("new"), yjedit,true,_t ("document"))
Begin_yjitem (1,yj_item,yj_default,_t ("open"), yjlistbox,true,_t ("Document # program # text"))
Begin_yjitem (1,yj_item,yj_default,_t ("Exit"), yjlistbox,true,_t ("Document # program # text"))
Begin_yjitem (0,yj_folder,yj_default,_t ("edit"), yjedit,true,_t ("file")
Begin_yjitem (1,yj_item,yj_default,_t ("undo"), yjedit,true,_t ("file"))
Begin_yjitem (1,yj_item,yj_default,_t ("paste"), yjedit,true,_t ("file")
Begin_ Yjitem (1,yj_item,yj_default,_t ("copy"), yjedit,true,_t ("file"))
Begin_yjitem (0,yj_folder,yj_default,_t ("View"), yjedit,true,_t ("file"))
Begin_yjitem (1,yj_item,yj_default,_t ("undo"), yjedit,true,_t ("file"))
Begin_yjitem (1,YJ _item,yj_default,_t ("Paste"), yjedit,true,_t ("file"))
Begin_yjitem (1,yj_item,yj_default,_t ("copy"), yjedit,true,_t (" File)
End_create_node
Where the list string is separated by "#". The edit box is Yjedit, the list box is Yjlistbox, and then the macro is invoked inside the program,
CRATE_STRUCT(&m_propertyList)
m_propertyList.Invalidate();
Show Traversal Property list:
For(int i=0;i< m_propertyList.GetSize();i++)
M_propertyList.m_List[i]->GetString();
Each of these entries corresponds to a pointer to a Yjpropertyitem object. Please look at the code.
Development: Windows xp+vs2003 code See related attachments