本文整理汇总了C++中ControlButton::SetLabel方法的典型用法代码示例。如果您正苦于以下问题:C++ ControlButton::SetLabel方法的具体用法?C++ ControlButton::SetLabel怎么用?C++ ControlButton::SetLabel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ControlButton
的用法示例。
在下文中一共展示了ControlButton::SetLabel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DetectControl
void GamepadPage::DetectControl(wxCommandEvent& event)
{
ControlButton* btn = (ControlButton*)event.GetEventObject();
// find device :/
ControllerInterface::Device* const dev = g_controller_interface.FindDevice(controller->default_device);
if (dev)
{
btn->SetLabel(_("[ waiting ]"));
// apparently, this makes the "waiting" text work on Linux
wxTheApp->Yield();
std::lock_guard<std::recursive_mutex> lk(m_plugin.controls_lock);
ControllerInterface::Device::Control* const ctrl = btn->control_reference->Detect(DETECT_WAIT_TIME, dev);
// if we got input, update expression and reference
if (ctrl)
{
btn->control_reference->expression = ctrl->GetName();
g_controller_interface.UpdateReference(btn->control_reference, controller->default_device);
}
btn->SetLabel(WXSTR_FROM_STR(btn->control_reference->expression));
}
}
示例2: DetectControl
void GamepadPage::DetectControl(wxCommandEvent& event)
{
ControlButton* btn = (ControlButton*)event.GetEventObject();
// find device :/
Device* const dev = g_controller_interface.FindDevice(controller->default_device);
if (dev)
{
btn->SetLabel(_("[ waiting ]"));
// This makes the "waiting" text work on Linux. true (only if needed) prevents crash on Windows
wxTheApp->Yield(true);
std::lock_guard<std::recursive_mutex> lk(m_plugin.controls_lock);
Device::Control* const ctrl = btn->control_reference->Detect(DETECT_WAIT_TIME, dev);
// if we got input, update expression and reference
if (ctrl)
{
wxString control_name = ctrl->GetName();
wxString expr;
GetExpressionForControl(expr, control_name);
btn->control_reference->expression = expr;
g_controller_interface.UpdateReference(btn->control_reference, controller->default_device);
}
}
UpdateGUI();
}