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


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

本文整理汇总了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);

}
开发者ID:Room1337,项目名称:projectM-update,代码行数:25,代码来源:DisplayResolutionPane.cpp

示例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;
	}
}
开发者ID:alexpaulzor,项目名称:projectm,代码行数:67,代码来源:OptionsDialog.cpp


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