本文整理汇总了C++中VisualGraphics::matchDisplayResolutionShowStrWithPrefs方法的典型用法代码示例。如果您正苦于以下问题:C++ VisualGraphics::matchDisplayResolutionShowStrWithPrefs方法的具体用法?C++ VisualGraphics::matchDisplayResolutionShowStrWithPrefs怎么用?C++ VisualGraphics::matchDisplayResolutionShowStrWithPrefs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VisualGraphics
的用法示例。
在下文中一共展示了VisualGraphics::matchDisplayResolutionShowStrWithPrefs方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetDlgItem
void CDisplayResolutionPane::OnSelchangeCombo1() {
char str[32];
CComboBox* pCB = (CComboBox*) GetDlgItem(IDC_COMBO1);
pCB->GetLBText(pCB->GetCurSel(), str);
VisualGraphics* theVisualGraphics = VisualGraphics::getInstance();
UInt16 horizontalPixels;
UInt16 verticalPixels;
UInt16 bitsPerPixel;
UInt16 refreshRate;
theVisualGraphics->matchDisplayResolutionShowStrWithPrefs(str, horizontalPixels, verticalPixels, bitsPerPixel, refreshRate);
VisualDataStore::setPreferenceValueInt(VisualConfiguration::kFullscreenWidth, horizontalPixels);
VisualDataStore::setPreferenceValueInt(VisualConfiguration::kFullscreenHeight, verticalPixels);
VisualDataStore::setPreferenceValueInt(VisualConfiguration::kFullscreenBitsPerPixel, bitsPerPixel);
VisualDataStore::setPreferenceValueInt(VisualConfiguration::kFullscreenRefreshRate, refreshRate);
VisualDataStore::storePreferences();
UInt16 minBitsPerPixel = 24;
UInt16 maxBitsPerPixel = 32;
VisualDataStore::setPreferredDisplayResolution(minBitsPerPixel, maxBitsPerPixel, bitsPerPixel, horizontalPixels, verticalPixels);
}
示例2: handleEvent
void OptionsDialog::handleEvent(EventHandlerCallRef inRef, EventRef inEvent, void* userData) {
UInt32 eventClass;
UInt32 eventKind;
eventClass = GetEventClass(inEvent);
eventKind = GetEventKind(inEvent);
switch (eventClass) {
case kEventClassWindow:
// window event
if (eventKind == kEventWindowClose) {
HideWindow(theOptionsDialog->optionsDialogWindow);
}
break;
case kEventClassControl:
// control event
ControlID controlID;
ControlRef control = NULL;
GetEventParameter(inEvent, kEventParamDirectObject, typeControlRef, NULL, sizeof(ControlRef), NULL, &control);
GetControlID(control, &controlID);
UInt32 stringLength = 0;
CFStringRef selectedText = NULL;
switch(controlID.id) {
case displayResolutionMenuId:
{
SInt32 selectedMenuItemIdx;
selectedMenuItemIdx = GetControl32BitValue(control);
theOptionsDialog->displayResolutionMenuSelectedIdx = selectedMenuItemIdx;
char str[32];
CopyMenuItemTextAsCFString(theOptionsDialog->displayResolutionMenu, selectedMenuItemIdx, &selectedText);
stringLength = CFStringGetLength(selectedText);
stringLength += 1; // incl. terminating null-byte
CFStringGetCString(selectedText, str, stringLength, kCFStringEncodingASCII);
CFRelease(selectedText);
VisualGraphics* theVisualGraphics = VisualGraphics::getInstance();
UInt16 horizontalPixels;
UInt16 verticalPixels;
UInt16 bitsPerPixel;
UInt16 refreshRate;
theVisualGraphics->matchDisplayResolutionShowStrWithPrefs(str, horizontalPixels, verticalPixels, bitsPerPixel, refreshRate);
VisualDataStore::setPreferenceValueInt(VisualConfiguration::kFullscreenWidth, horizontalPixels);
VisualDataStore::setPreferenceValueInt(VisualConfiguration::kFullscreenHeight, verticalPixels);
VisualDataStore::setPreferenceValueInt(VisualConfiguration::kFullscreenBitsPerPixel, bitsPerPixel);
VisualDataStore::setPreferenceValueInt(VisualConfiguration::kFullscreenRefreshRate, refreshRate);
VisualDataStore::storePreferences();
UInt16 minBitsPerPixel = 24;
UInt16 maxBitsPerPixel = 32;
VisualDataStore::setPreferredDisplayResolution(minBitsPerPixel, maxBitsPerPixel, bitsPerPixel, horizontalPixels, verticalPixels);
}
break;
case tabControlId:
theOptionsDialog->showSelectedPaneOfTabControl();
break;
}
break;
}
}