本文整理汇总了C++中VisualGraphics::getNextAvailableDisplayResolution方法的典型用法代码示例。如果您正苦于以下问题:C++ VisualGraphics::getNextAvailableDisplayResolution方法的具体用法?C++ VisualGraphics::getNextAvailableDisplayResolution怎么用?C++ VisualGraphics::getNextAvailableDisplayResolution使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VisualGraphics
的用法示例。
在下文中一共展示了VisualGraphics::getNextAvailableDisplayResolution方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnInitDialog
BOOL CDisplayResolutionPane::OnInitDialog() {
CPropertyPage::OnInitDialog();
UInt8 isSelected;
CComboBox* pCB = (CComboBox*) GetDlgItem(IDC_COMBO1);
VisualGraphics* theVisualGraphics;
theVisualGraphics = VisualGraphics::getInstance();
theVisualGraphics->evaluateFullscreenDisplayResolution();
//theVisualGraphics->gatherAvailableDisplayResolutions();
//theVisualGraphics->resetDisplayResolutionIterIndex();
char showStr[32];
UInt16 count = 0;
UInt16 selIdx = 0;
while(theVisualGraphics->getNextAvailableDisplayResolution(showStr, &isSelected)) {
if (isSelected == 1) {
selIdx = count;
}
if (pCB->AddString(showStr) == CB_ERR) {
AfxMessageBox("AnError occurred while adding mon res item to combo list.");
}
count++;
}
pCB->SetCurSel(selIdx);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX-Eigenschaftenseiten sollten FALSE zurückgeben
}
示例2: show
void OptionsDialog::show() {
int aLastTabIndex;
OSStatus err;
VisualGraphics* theVisualGraphics = VisualGraphics::getInstance();
theVisualGraphics->evaluateFullscreenDisplayResolution();
aLastTabIndex = VisualDataStore::getPreferenceValueInt(VisualConfiguration::kPreferencePane);
if (aLastTabIndex == 0) {
aLastTabIndex = 1;
}
if (theOptionsDialog->optionsDialogWindow == NULL) {
// find the bundle to load the nib inside of it
IBNibRef nibRef;
CFStringRef pluginName;
pluginName = CFStringCreateWithCString(kCFAllocatorDefault, VisualConfiguration::kVisualPluginDomainIdentifier, kCFStringEncodingWindowsLatin1);
CFBundleRef thePlugin = CFBundleGetBundleWithIdentifier(pluginName);
err = CreateNibReferenceWithCFBundle(thePlugin, CFSTR("VisualOptions"), &nibRef);
if (err != noErr) {
writeLog("CreateNibReferenceWithCFBundle failed in OptionsDialog->show");
return;
}
CreateWindowFromNib(nibRef, CFSTR("OptionsDialog"), &(theOptionsDialog->optionsDialogWindow));
if (err != noErr) {
writeLog("CreateWindowFromNib failed in OptionsDialog->show");
return;
}
DisposeNibReference(nibRef);
CFRelease(pluginName);
// tab control
GetControlByID(theOptionsDialog->optionsDialogWindow, &theOptionsDialog->tabControlID, &theOptionsDialog->tabControl);
// display resolution menu pop up control
err = GetControlByID(theOptionsDialog->optionsDialogWindow, &theOptionsDialog->displayResolutionMenuControlID, &(theOptionsDialog->displayResolutionPopUpControl));
if (err != noErr) {
writeLog("GetControlByID failed in OptionsDialog->show");
return;
}
UInt32 count;
MenuAttributes displayResolutionMenuAttributes = (MenuAttributes)NULL;
err = CreateNewMenu(131, displayResolutionMenuAttributes, &(theOptionsDialog->displayResolutionMenu));
if (err != noErr) {
writeLog("CreateNewMenu failed in OptionsDialog->show");
return;
}
CFStringRef displayResolutionShowStr;
count = 0;
char str[32];
UInt8 isSelected = 0;
while(theVisualGraphics->getNextAvailableDisplayResolution(str, &isSelected)) {
displayResolutionShowStr = CFStringCreateWithFormat(kCFAllocatorDefault, NULL, CFSTR("%s"), str);
err = AppendMenuItemTextWithCFString(theOptionsDialog->displayResolutionMenu, displayResolutionShowStr, 0, 0, NULL);
if (err != noErr) {
writeLog("Error while appending menu item");
}
count++;
if (isSelected == 1) {
theOptionsDialog->displayResolutionMenuSelectedIdx = count;
}
CFRelease(displayResolutionShowStr);
}
SetControlPopupMenuHandle(theOptionsDialog->displayResolutionPopUpControl, theOptionsDialog->displayResolutionMenu);
SetControl32BitMaximum(theOptionsDialog->displayResolutionPopUpControl, count);
InstallWindowEventHandler(theOptionsDialog->optionsDialogWindow, NewEventHandlerUPP(optionsDialogWindowHandler), 1, &windowCloseEvent, NULL, NULL);
InstallWindowEventHandler(theOptionsDialog->optionsDialogWindow, NewEventHandlerUPP(optionsDialogControlHandler), 1, &controlHitEvent, NULL, NULL);
}
if (theOptionsDialog->displayResolutionMenuSelectedIdx == -1) {
theOptionsDialog->displayResolutionMenuSelectedIdx = 1; // first menuItem is default
}
SetControl32BitValue(theOptionsDialog->displayResolutionPopUpControl, theOptionsDialog->displayResolutionMenuSelectedIdx);
SetControl32BitValue(theOptionsDialog->tabControl, aLastTabIndex);
theOptionsDialog->showSelectedPaneOfTabControl();
ShowWindow(theOptionsDialog->optionsDialogWindow);
SelectWindow(theOptionsDialog->optionsDialogWindow);
}