I used mdlLevelList_getLevelNamesWithAttributes to get the level listmodel,and passed it to my Combobox.
The problem is when i use mdlDialog_comboBoxSetPopupState to make my ComboBox dropdown listbox stay opening,I found it'll cause a fault.
I chick the second col to display my level like the system do. .
Here I use mdlDialog_comboBoxSetPopupState to make the dorpdown stay opening in hook with the message DITEM_MESSAGE_STATECHANGED.
Then I chick the system level combobox.
It actually shows my ComboBox dropdown.
I tracked the hook message,and found that there is no focusout in Toolbox.This maybe why the fault caused.
Here is my Rscs:
DialogBoxRsc DIALOGID_Operate = { DIALOGATTR_DEFAULT | DIALOGATTR_GROWABLE | DIALOGATTR_DOCKABLE, 0,0, NOHELP,MHELP, NOHOOK, NOPARENTID, "", { {{0,0,0,0},ToolBox,TOOLBOXID_PC,ON,0,"",""}, }};DItem_ToolBoxRsc TOOLBOXID_PC ={ NOHELP, MHELPTOPIC, NOHOOK, NOARG, 0, "", { {{10,0.5*YC,12*XC,1.5*YC}, ComboBox, COMBOBOXID_DataLevel, ON, 0, "", ""}, }};//DItem_ComboBoxRsc COMBOBOXID_DataLevel = { NOCMD, LCMD, NOSYNONYM, NOHELP, MHELP, HOOKITEMID_DataLevel_ComboBox, NOARG, 128, "", "", "", "", NOMASK, 0, 12, 0, 28*XC, 0, COMBOATTR_DRAWPREFIXICON | COMBOATTR_READONLY, "", "", { {12*XC, 128, ALIGN_LEFT, ""}, {4*XC, 128, ALIGN_LEFT, ""}, {4*XC, 128, ALIGN_LEFT, ""}, {4*XC, 128, ALIGN_LEFT, ""}, }};
If someone have done something like this befor?
Why do you need to call mdlDialog_comboBoxSetPopupState from your hook function? Doesn't the drop-down list display correctly?
Regards, Jon Summers LA Solutions
Because the ComboBox drop-down list will close when i chick on it.
I need to keep the list opening.Like what the Attributes->Active Level ComboBox do.
The only examples I can find that use that function call it from the FOCUS IN event ...
case DITEM_MESSAGE_FOCUSIN: { if (riP && dimP->u.focusIn.focusOutType == FOCUSOUT_KEYSWITCH) mdlDialog_comboBoxSetPopupState (riP, TRUE); break; }See example projects cstexmpl and newitems.
I have tried example projects cstexmpl and newitems.But it didn't conform to my scene.
My combobox hook could not receive DITEM_MESSAGE_FOCUSIN message in my scene.
Sounds like an interesting topic to me, making me think about a UI combobox control I'd read about before. The combobox dropdown property might be helpful in this situation, however, they doesn't seems to use the identical programming language.