这篇教程C++ GetControl函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetControl函数的典型用法代码示例。如果您正苦于以下问题:C++ GetControl函数的具体用法?C++ GetControl怎么用?C++ GetControl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetControl函数的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: GetControlvoidDeviceEditWidget::SetConfig(const DeviceConfig &_config){ config = _config; if (config.port_type == DeviceConfig::PortType::DISABLED) /* if the user configures a new device, forget the old "enabled" flag and re-enable the device */ config.enabled = true; WndProperty &port_control = GetControl(Port); DataFieldEnum &port_df = *(DataFieldEnum *)port_control.GetDataField(); SetPort(port_df, config); port_control.RefreshDisplay(); WndProperty &baud_control = GetControl(BaudRate); DataFieldEnum &baud_df = *(DataFieldEnum *)baud_control.GetDataField(); baud_df.Set(config.baud_rate); baud_control.RefreshDisplay(); WndProperty &bulk_baud_control = GetControl(BulkBaudRate); DataFieldEnum &bulk_baud_df = *(DataFieldEnum *) bulk_baud_control.GetDataField(); bulk_baud_df.Set(config.bulk_baud_rate); bulk_baud_control.RefreshDisplay(); WndProperty &ip_address_control = GetControl(IP_ADDRESS); DataFieldEnum &ip_address_df = *(DataFieldEnum *) ip_address_control.GetDataField(); ip_address_df.Set(config.ip_address); ip_address_control.RefreshDisplay(); WndProperty &tcp_port_control = GetControl(TCPPort); DataFieldEnum &tcp_port_df = *(DataFieldEnum *) tcp_port_control.GetDataField(); tcp_port_df.Set(config.tcp_port); tcp_port_control.RefreshDisplay(); WndProperty &i2c_bus_control = GetControl(I2CBus); DataFieldEnum &i2c_bus_df = *(DataFieldEnum *) i2c_bus_control.GetDataField(); i2c_bus_df.Set(config.i2c_bus); i2c_bus_control.RefreshDisplay(); WndProperty &i2c_addr_control = GetControl(I2CAddr); DataFieldEnum &i2c_addr_df = *(DataFieldEnum *) i2c_addr_control.GetDataField(); i2c_addr_df.Set(config.i2c_addr); i2c_addr_control.RefreshDisplay(); WndProperty &press_control = GetControl(PressureUsage); DataFieldEnum &press_df = *(DataFieldEnum *) press_control.GetDataField(); press_df.Set((unsigned)config.press_use); press_control.RefreshDisplay(); WndProperty &driver_control = GetControl(Driver); DataFieldEnum &driver_df = *(DataFieldEnum *)driver_control.GetDataField(); driver_df.Set(config.driver_name); driver_control.RefreshDisplay(); WndProperty &sync_from_control = GetControl(SyncFromDevice); DataFieldBoolean &sync_from_df = *(DataFieldBoolean *)sync_from_control.GetDataField(); sync_from_df.Set(config.sync_from_device); sync_from_control.RefreshDisplay(); WndProperty &sync_to_control = GetControl(SyncToDevice); DataFieldBoolean &sync_to_df = *(DataFieldBoolean *)sync_to_control.GetDataField(); sync_to_df.Set(config.sync_to_device); sync_to_control.RefreshDisplay(); WndProperty &k6bt_control = GetControl(K6Bt); DataFieldBoolean &k6bt_df = *(DataFieldBoolean *)k6bt_control.GetDataField(); k6bt_df.Set(config.k6bt); k6bt_control.RefreshDisplay(); UpdateVisibilities();}
开发者ID:Adrien81,项目名称:XCSoar,代码行数:81,
示例2: GetControlvoid* Interface_GUIWindow::get_control_spin(void* kodiBase, void* handle, int control_id){ return GetControl(kodiBase, handle, control_id, __FUNCTION__, CGUIControl::GUICONTROL_SPINEX, "spin");}
开发者ID:totesmuhgoats,项目名称:xbmc,代码行数:4,
示例3: switchbool CGUIDialogKeyboardGeneric::OnMessage(CGUIMessage& message){ switch ( message.GetMessage() ) { case GUI_MSG_CLICKED: { int iControl = message.GetSenderId(); switch (iControl) { case CTL_BUTTON_DONE: OnOK(); break; case CTL_BUTTON_CANCEL: Close(); break; case CTL_BUTTON_SHIFT: OnShift(); break; case CTL_BUTTON_CAPS: if (m_keyType == LOWER) m_keyType = CAPS; else if (m_keyType == CAPS) m_keyType = LOWER; UpdateButtons(); break; case CTL_BUTTON_LAYOUT: OnLayout(); break; case CTL_BUTTON_SYMBOLS: OnSymbols(); break; case CTL_BUTTON_LEFT: MoveCursor( -1); break; case CTL_BUTTON_RIGHT: MoveCursor(1); break; case CTL_BUTTON_IP_ADDRESS: OnIPAddress(); break; case CTL_BUTTON_CLEAR: SetEditText(""); break; case CTL_EDIT: { CGUIMessage msg(GUI_MSG_ITEM_SELECTED, GetID(), CTL_EDIT); OnMessage(msg); // update callback I guess? if (m_pCharCallback) { // we did _something_, so make sure our search message filter is reset m_pCharCallback(this, msg.GetLabel()); } m_text = msg.GetLabel(); return true; } default: OnClickButton(iControl); break; } } break; case GUI_MSG_SET_TEXT: case GUI_MSG_INPUT_TEXT_EDIT: { // the edit control only handles these messages if it is either focues // or its specific control ID is set in the message. As neither is the // case here (focus is on one of the keyboard buttons) we have to force // the control ID of the message to the control ID of the edit control // (unfortunately we have to create a whole copy of the message object for that) CGUIMessage messageCopy(message.GetMessage(), message.GetSenderId(), CTL_EDIT, message.GetParam1(), message.GetParam2(), message.GetItem()); messageCopy.SetLabel(message.GetLabel()); // ensure this goes to the edit control CGUIControl *edit = GetControl(CTL_EDIT); if (edit) edit->OnMessage(messageCopy); // close the dialog if requested if (message.GetMessage() == GUI_MSG_SET_TEXT && message.GetParam1() > 0) OnOK(); return true; } } return CGUIDialog::OnMessage(message);}
开发者ID:Distrotech,项目名称:xbmc,代码行数:88,
示例4: GetControlvoid CGUIWindowSettingsScreenCalibration::UpdateFromControl(int iControl){ std::string strStatus; RESOLUTION_INFO info = g_graphicsContext.GetResInfo(m_Res[m_iCurRes]); if (iControl == CONTROL_PIXEL_RATIO) { CGUIControl *pControl = GetControl(CONTROL_PIXEL_RATIO); if (pControl) { float fWidth = (float)pControl->GetWidth(); float fHeight = (float)pControl->GetHeight(); info.fPixelRatio = fHeight / fWidth; // recenter our control... pControl->SetPosition((info.iWidth - pControl->GetWidth()) / 2, (info.iHeight - pControl->GetHeight()) / 2); strStatus = StringUtils::Format("%s (%5.3f)", g_localizeStrings.Get(275).c_str(), info.fPixelRatio); SET_CONTROL_LABEL(CONTROL_LABEL_ROW2, 278); } } else { const CGUIMoverControl *pControl = dynamic_cast<const CGUIMoverControl*>(GetControl(iControl)); if (pControl) { switch (iControl) { case CONTROL_TOP_LEFT: { info.Overscan.left = pControl->GetXLocation(); info.Overscan.top = pControl->GetYLocation(); strStatus = StringUtils::Format("%s (%i,%i)", g_localizeStrings.Get(272).c_str(), pControl->GetXLocation(), pControl->GetYLocation()); SET_CONTROL_LABEL(CONTROL_LABEL_ROW2, 276); } break; case CONTROL_BOTTOM_RIGHT: { info.Overscan.right = pControl->GetXLocation(); info.Overscan.bottom = pControl->GetYLocation(); int iXOff1 = info.iWidth - pControl->GetXLocation(); int iYOff1 = info.iHeight - pControl->GetYLocation(); strStatus = StringUtils::Format("%s (%i,%i)", g_localizeStrings.Get(273).c_str(), iXOff1, iYOff1); SET_CONTROL_LABEL(CONTROL_LABEL_ROW2, 276); } break; case CONTROL_SUBTITLES: { info.iSubtitles = pControl->GetYLocation(); strStatus = StringUtils::Format("%s (%i)", g_localizeStrings.Get(274).c_str(), pControl->GetYLocation()); SET_CONTROL_LABEL(CONTROL_LABEL_ROW2, 277); } break; } } } g_graphicsContext.SetResInfo(m_Res[m_iCurRes], info); // set the label control correctly std::string strText; if (g_Windowing.IsFullScreen()) strText = StringUtils::Format("%ix%[email C++ GetController函数代码示例 C++ GetContextSuspended函数代码示例
|