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


C++ BASE_SCREEN::SetZoom方法代码示例

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


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

示例1: ReadGeneralDescrPcb

int WinEDA_BasePcbFrame::ReadGeneralDescrPcb(wxDC * DC, FILE * File, int * LineNum)
/**********************************************************************************/
{
char Line[1024], *data;
BASE_SCREEN * screen = m_CurrentScreen;

	while(  GetLine(File, Line, LineNum ) != NULL )
	{
		data = strtok(Line," =\n\r");
		if(strnicmp(data,"$EndGENERAL",10) == 0) break;

		if( strncmp(data, "Ly", 2) == 0 )	// Old format for Layer count
		{
			int Masque_Layer = 1, ii;
			data = strtok(NULL," =\n\r");
			sscanf(data,"%X",&Masque_Layer);
			// Setup layer count
			m_Pcb->m_BoardSettings->m_CopperLayerCount = 0;
			for ( ii = 0; ii < NB_COPPER_LAYERS; ii++ )
			{
				if ( Masque_Layer & 1 ) m_Pcb->m_BoardSettings->m_CopperLayerCount++;
				Masque_Layer >>= 1;
			}
			continue;
		}

		if(strnicmp(data, "Links", 5) == 0)
		{
			data = strtok(NULL," =\n\r");
			m_Pcb->m_NbLinks = atoi(data);
			continue;
		}

		if(strnicmp(data, "NoConn", 6) == 0)
		{
			data = strtok(NULL," =\n\r");
			m_Pcb->m_NbNoconnect = atoi(data);
			continue;
		}

		if(strnicmp(data, "Di", 2) == 0)
		{
			int ii, jj, bestzoom;
			wxSize pcbsize, screensize;
			data = strtok(NULL," =\n\r");
			m_Pcb->m_BoundaryBox.SetX(atoi(data));
			data = strtok(NULL," =\n\r");
			m_Pcb->m_BoundaryBox.SetY(atoi(data));
			data = strtok(NULL," =\n\r");
			m_Pcb->m_BoundaryBox.SetWidth(atoi(data) - m_Pcb->m_BoundaryBox.GetX());
			data = strtok(NULL," =\n\r");
			m_Pcb->m_BoundaryBox.SetHeight(atoi(data) - m_Pcb->m_BoundaryBox.GetY());

			/* calcul du zoom optimal */
			pcbsize = m_Pcb->m_BoundaryBox.GetSize();
			screensize = DrawPanel->GetClientSize();
			ii = pcbsize.x/screensize.x;
			jj = pcbsize.y/screensize.y;
			bestzoom = max(ii, jj);
			screen->m_Curseur = m_Pcb->m_BoundaryBox.Centre();

			screen->SetZoom(bestzoom);
			// la position des tracés a changé: mise a jour dans le DC courant
			wxPoint org;
			DrawPanel->GetViewStart(&org.x, &org.y);
			DrawPanel->GetScrollPixelsPerUnit(&ii, &jj);
			org.x *= ii; org.y *= jj;
#ifdef WX_ZOOM
			DC->SetUserScale(1.0/(double)screen->GetZoom(), 1.0/screen->GetZoom());
			org.x *= screen->GetZoom(); org.y *= screen->GetZoom();
			DC->SetDeviceOrigin(-org.x, -org.y);
#endif
			DrawPanel->SetBoundaryBox();
			Recadre_Trace(TRUE);
			continue;
		}

			/* Lecture du nombre de segments type DRAW , TRACT, ZONE */
		if(stricmp(data, "Ndraw") == 0)
		{
			data = strtok(NULL," =\n\r");
			NbDraw = atoi(data);;
			continue;
		}

		if(stricmp(data, "Ntrack") == 0)
		{
			data = strtok(NULL," =\n\r");
			NbTrack = atoi(data);
			continue;
		}

		if(stricmp(data, "Nzone") == 0)
		{
			data = strtok(NULL," =\n\r");
			NbZone = atoi(data);
			continue;
		}

		if(stricmp(data, "Nmodule") == 0)
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:kicad-svn,代码行数:101,代码来源:ioascii.cpp


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