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


C++ UserInterface::setMapControl方法代码示例

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


在下文中一共展示了UserInterface::setMapControl方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: WndProc


//.........这里部分代码省略.........
			(HINSTANCE) GetWindowLong (hwnd, GWL_HINSTANCE), NULL);

		// Create child control radio buttons
		hwndFpers = CreateWindow(TEXT("button"), TEXT("f/s"), 
			WS_CHILD | WS_VISIBLE | BS_RADIOBUTTON, 10, 470, 60, 20, hwnd,
			(HMENU) FPERS, (HINSTANCE) GetWindowLong (hwnd, GWL_HINSTANCE), NULL);

		hwndFperm = CreateWindow(TEXT("button"), TEXT("f/m"), 
			WS_CHILD | WS_VISIBLE | BS_RADIOBUTTON, 10, 490, 60, 20, hwnd,
			(HMENU) FPERM, (HINSTANCE) GetWindowLong (hwnd, GWL_HINSTANCE), NULL);

		hwndMpers = CreateWindow(TEXT("button"), TEXT("m/s"), 
			WS_CHILD | WS_VISIBLE | BS_RADIOBUTTON, 10, 510, 60, 20, hwnd,
			(HMENU) MPERS, (HINSTANCE) GetWindowLong (hwnd, GWL_HINSTANCE), NULL);
			
		// Fill combo box with intervals
		SendMessage (hwndCombo, CB_ADDSTRING, 0, (LPARAM) "1 Point Interval");
		SendMessage (hwndCombo, CB_ADDSTRING, 1, (LPARAM) "3 Point Interval");
		SendMessage (hwndCombo, CB_ADDSTRING, 2, (LPARAM) "6 Point Interval");

		// Set default radio button
		SendMessage (hwndFpers, BM_SETCHECK, 1, 0);

		// Set userInterface private member _hwnd to WndProcs hwnd
		userInterface.setHwnd (hwnd);
		
		// Set mapControls private member _balloon to balloon
		mapControl.setData (&balloon);
		
		// Set windDataReaders private member _balloon to balloon
		windDataReader.setBalloon (&balloon);
		
		// Set userInterfaces private member _mapControl to mapControl
		userInterface.setMapControl (&mapControl);

		// Set up file initialize to common open dialog for .ptm files
		mapControl.mapFileInitialize (hwnd);
		
		// Start the Initialize dialog box
		userInterface.InitializeDialog (hwnd);

		// If the user chose to read in from serial
		if (userInterface.getIsSerial())
		{
			// Populate wind data reader
			if ( !userInterface.getWindFrom().empty() )
				windDataReader.GenerateWindData(userInterface.getWindFrom());
			else
				MessageBox (hwnd, "No wind data table.", "Critical Error.", 0);
			
			// Set abstract parser to a new SerialParser
			parser = new SerialParser (serial, hwnd);
			
			// Open the com port
			if ( !userInterface.getReadingFrom().empty() )
				parser->openCom( userInterface.getReadingFrom().c_str() );
			else
				MessageBox (hwnd, "No COM port selected.", "Critical Error.", 0);
			
			// Attach parser to the observer
			parser->attach (&controlState);
		}
		
		else
		{
			// If the user didn't select serial, then they had to select
开发者ID:kibitz503,项目名称:BalloonPredict,代码行数:67,代码来源:Main.cpp


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