Hi!
I was wondering, why cMenuText::ProcessKey returns osContinue for every key (except kOk) that was not processed by the parent:
if (state == osUnknown) { switch (Key) { case kOk: return osBack; default: state = osContinue; } } return state;
Shouldn't it return osUnknown there, like the other cMenu* classes?
See e.g. cMenuEvent:
if (state == osUnknown) { switch (Key) { case kGreen: case kYellow: return osContinue; case kOk: return osBack; default: break; } } return state;
Or am I missing something?
Regards,
Tobias
Klaus Schmidinger wrote:
Ok. I thought a menu should only return osContinue for keys, it has processed and I never saw a reason for a parent to process the keys pressed from it's child menu. But if I understand you right, osContinue is returned for keys, that no other parent menu should process.
Is this a valid usage scenario for a plugin?:
Story: In an item list, items are selected by the cursor key and the color keys invoke actions on the items. Opening an item with kOk should display some details, but the color keys should do exactly the same as in the list.
Implemented like this: A class derived from cOsdMenu show's a list of items. Pressing a color key invokes an action for the selected item. Pressing ok shows item details in a cMenuText-submenu. The class that inherits from cMenuText overrides ProcessKey() and returns osUnknown for the color keys. This way the parent's key actions are invoked.
Tobias