本文整理汇总了C++中TCommandEnabler::SetReceiver方法的典型用法代码示例。如果您正苦于以下问题:C++ TCommandEnabler::SetReceiver方法的具体用法?C++ TCommandEnabler::SetReceiver怎么用?C++ TCommandEnabler::SetReceiver使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TCommandEnabler
的用法示例。
在下文中一共展示了TCommandEnabler::SetReceiver方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: eventInfo
//
/// When the gadget window receives a WM_COMMAND_ENABLE message, it is likely from a
/// gadget or control within a TControlGadget. This reroutes it to the command
/// target.
//
void
TGadgetWindow::EvCommandEnable(TCommandEnabler& ce)
{
// If someone derived from TGadgetWindow and handles the command there,
// give these handlers the first crack.
//
TEventInfo eventInfo(WM_COMMAND_ENABLE, ce.GetId());
if (Find(eventInfo)) {
Dispatch(eventInfo, 0, TParam2(&ce));
return;
}
TWindow* target = GetParentO();
// Forward to command target if the enabler was really destined for us, and
// not a routing from the frame.
//
if (target && ce.IsReceiver(*this)) {
CHECK(target->IsWindow());
ce.SetReceiver(*target);
target->EvCommandEnable(ce);
if( ce.GetHandled() )
return;
}
// Default to TWindow's implementation if the above routing fails
//
TWindow::EvCommandEnable(ce);
}