当前位置: 首页>>代码示例>>C++>>正文


C++ VisualGraphics::evaluateFullscreenDisplayResolution方法代码示例

本文整理汇总了C++中VisualGraphics::evaluateFullscreenDisplayResolution方法的典型用法代码示例。如果您正苦于以下问题:C++ VisualGraphics::evaluateFullscreenDisplayResolution方法的具体用法?C++ VisualGraphics::evaluateFullscreenDisplayResolution怎么用?C++ VisualGraphics::evaluateFullscreenDisplayResolution使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在VisualGraphics的用法示例。


在下文中一共展示了VisualGraphics::evaluateFullscreenDisplayResolution方法的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
}
开发者ID:Room1337,项目名称:projectM-update,代码行数:32,代码来源:DisplayResolutionPane.cpp

示例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);

}
开发者ID:alexpaulzor,项目名称:projectm,代码行数:87,代码来源:OptionsDialog.cpp


注:本文中的VisualGraphics::evaluateFullscreenDisplayResolution方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。