本文整理汇总了C++中TCommandEnabler::GetId方法的典型用法代码示例。如果您正苦于以下问题:C++ TCommandEnabler::GetId方法的具体用法?C++ TCommandEnabler::GetId怎么用?C++ TCommandEnabler::GetId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TCommandEnabler
的用法示例。
在下文中一共展示了TCommandEnabler::GetId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetHintText
//
// !CQ Auto-hide all docking areas? Give them IDW_s
//
/// Handles checking and unchecking of menu items that are associated with
/// decorations.
//
void
TDecoratedFrame::EvCommandEnable(TCommandEnabler& commandEnabler)
{
// Provide default command text to TooltipEnablers
//
if (dynamic_cast<TTooltipEnabler*>(&commandEnabler))
{
tstring hint = GetHintText(commandEnabler.GetId(), htTooltip);
if (hint.length() > 0)
{
commandEnabler.SetText(hint);
return;
}
}
#if 0
TWindow* decoration;
if (DocAreaTop)
decoration = DocAreaTop->ChildWithId(commandEnabler.GetId());
else
decoration = ChildWithId(commandEnabler.GetId());
#else
TWindow* decoration = ChildWithId(commandEnabler.GetId());
#endif
if (!decoration)
TFrameWindow::EvCommandEnable(commandEnabler);
else {
commandEnabler.Enable();
commandEnabler.SetCheck(decoration->IsWindowVisible() ?
TCommandEnabler::Checked :
TCommandEnabler::Unchecked);
}
}
示例2: 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);
}