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


C++ SetZoom函数代码示例

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


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

示例1: get_wh

void mxConfig::OnAlto (wxCommandEvent & evt) {
	if (ignore_events) return;
	ignore_events=true;
	evt.Skip();
	long h;
	if (tx_alto->GetValue().ToLong(&h)) {
		int w1,h1; get_wh(1,w1,h1);
		float z=100.f*(float(h)/float(h1));
		SetZoom(z,2);
	}
	ignore_events=false;
}
开发者ID:retrography,项目名称:git-import-test,代码行数:12,代码来源:mxConfig.cpp

示例2: SetZoom

	void CustomWebView::wheelEvent (QWheelEvent *e)
	{
		if (e->modifiers () & Qt::ControlModifier)
		{
			int degrees = e->delta () / 8;
			qreal delta = static_cast<qreal> (degrees) / 150;
			SetZoom (zoomFactor () + delta);
			e->accept ();
		}
		else
			QWebView::wheelEvent (e);
	}
开发者ID:DJm00n,项目名称:leechcraft,代码行数:12,代码来源:customwebview.cpp

示例3: SetPic

void Interface::BaseReset()
{
    if (origImageFilename.size() > 0) {
     SetPic(origImageFilename); 
     SetZoom( ratio );        
    } 
    
    sx1->setValue(0);
    sx2->setValue(0);
    Top_startX = 0;
    QApplication::restoreOverrideCursor();
}
开发者ID:martamius,项目名称:mushi,代码行数:12,代码来源:interface.cpp

示例4: SetZoom

bool BASE_SCREEN::SetPreviousZoom()
{
    for( unsigned i = m_ZoomList.size(); i != 0;  --i )
    {
        if( m_Zoom > m_ZoomList[i - 1] )
        {
            SetZoom( m_ZoomList[i - 1] );
            return true;
        }
    }

    return false;
}
开发者ID:james-sakalaukus,项目名称:kicad,代码行数:13,代码来源:base_screen.cpp

示例5: SetZoom

void GameBase::Loop(){
	SetZoom();
	Init();
	InitWorldPhysics();
	while(wnd->isOpen()){		
		wnd->clear(clearColor);
		DoEvents();
		CheckCollitions();
		UpdateWorldPhysics();
		DrawWorld();
		wnd->display();
	}
}
开发者ID:dexter1986,项目名称:unli,代码行数:13,代码来源:GameBase.cpp

示例6: SetZoom

bool WeaponMenuItem::IsMouseOver()
{
  if (!ActiveTeam().ReadNbAmmos(weapon->GetType())) {
    if (zoom)
      SetZoom(false);
    return false;
  }

  // Compute the size of the icon bounding box
  Point2i size(MAX_ICON_SIZE, MAX_ICON_SIZE);

  // The icon bounding box for this is centered around the transformed position
  Rectanglei r(transformed_position + 1 - size/2, size);
  if (r.Contains(Mouse::GetInstance()->GetPosition())) {
    if (!zoom)
      SetZoom(true);
    return true;
  }
  if (zoom)
    SetZoom(false);
  return false;
}
开发者ID:fluxer,项目名称:warmux,代码行数:22,代码来源:weapon_menu.cpp

示例7: conf

void ZoomText::OnSettingsChanged(wxCommandEvent& e)
{
    e.Skip();
    znConfigItem data;
    clConfig conf("zoom-navigator.conf");
    if(conf.ReadItem(&data)) {
        m_zoomFactor = data.GetZoomFactor();
        m_colour = data.GetHighlightColour();
        MarkerSetBackground(1, m_colour);
        SetZoom(m_zoomFactor);
        Colourise(0, wxSTC_INVALID_POSITION);
    }
}
开发者ID:eranif,项目名称:codelite,代码行数:13,代码来源:zoomtext.cpp

示例8: wxGLCanvas

VideoDisplay::VideoDisplay(
	wxToolBar *visualSubToolBar,
	bool freeSize,
	wxComboBox *zoomBox,
	wxWindow* parent,
	agi::Context *c)
: wxGLCanvas(parent, -1, attribList)
, autohideTools(OPT_GET("Tool/Visual/Autohide"))
, con(c)
, zoomValue(OPT_GET("Video/Default Zoom")->GetInt() * .125 + .125)
, toolBar(visualSubToolBar)
, zoomBox(zoomBox)
, freeSize(freeSize)
, retina_helper(agi::util::make_unique<RetinaHelper>(this))
, scale_factor(retina_helper->GetScaleFactor())
, scale_factor_connection(retina_helper->AddScaleFactorListener([=](int new_scale_factor) {
	double new_zoom = zoomValue * new_scale_factor / scale_factor;
	scale_factor = new_scale_factor;
	SetZoom(new_zoom);
}))
{
	zoomBox->SetValue(wxString::Format("%g%%", zoomValue * 100.));
	zoomBox->Bind(wxEVT_COMBOBOX, &VideoDisplay::SetZoomFromBox, this);
	zoomBox->Bind(wxEVT_TEXT_ENTER, &VideoDisplay::SetZoomFromBoxText, this);

	con->videoController->Bind(EVT_FRAME_READY, &VideoDisplay::UploadFrameData, this);
	slots.push_back(con->videoController->AddVideoOpenListener(&VideoDisplay::UpdateSize, this));
	slots.push_back(con->videoController->AddARChangeListener(&VideoDisplay::UpdateSize, this));

	slots.push_back(con->subsController->AddFileSaveListener(&VideoDisplay::OnSubtitlesSave, this));

	Bind(wxEVT_PAINT, std::bind(&VideoDisplay::Render, this));
	Bind(wxEVT_SIZE, &VideoDisplay::OnSizeEvent, this);
	Bind(wxEVT_CONTEXT_MENU, &VideoDisplay::OnContextMenu, this);
	Bind(wxEVT_ENTER_WINDOW, &VideoDisplay::OnMouseEvent, this);
	Bind(wxEVT_CHAR_HOOK, &VideoDisplay::OnKeyDown, this);
	Bind(wxEVT_LEAVE_WINDOW, &VideoDisplay::OnMouseLeave, this);
	Bind(wxEVT_LEFT_DCLICK, &VideoDisplay::OnMouseEvent, this);
	Bind(wxEVT_LEFT_DOWN, &VideoDisplay::OnMouseEvent, this);
	Bind(wxEVT_LEFT_UP, &VideoDisplay::OnMouseEvent, this);
	Bind(wxEVT_MOTION, &VideoDisplay::OnMouseEvent, this);
	Bind(wxEVT_MOUSEWHEEL, &VideoDisplay::OnMouseWheel, this);

	SetCursor(wxNullCursor);

	c->videoDisplay = this;

	if (con->videoController->IsLoaded())
		con->videoController->JumpToFrame(con->videoController->GetFrameN());
}
开发者ID:Leinad4Mind,项目名称:Aegisub,代码行数:50,代码来源:video_display.cpp

示例9: FTLTRACE

void CNCaptureView::OnCaptureImageChanged()
{
	FTLTRACE(TEXT("CNCaptureView::OnCaptureImageChanged\n"));

	CNCaptureDoc* pDoc = CNCaptureApplication::Instance()->GetDocument();
	if (pDoc)
	{
		CCapImageObj* pCaptureImage = pDoc->GetCurCaptureImage();
		//save zoom to imageobject
		if (m_pImage != NULL)
		{
			m_pImage->SetZoom(GetZoom());
		}
		m_pImage = pCaptureImage;
		m_bImageChanged = TRUE;
	}
	//m_iFixedZoomIndex = s_NormalZoomIndex;
	//ReleaseSelectRect();
	_CalcImageSize();
	//make scrollbar disappear and set statusbar text unvisible
	if (NULL == m_pImage)
	{
		CRect rcClient;
		GetClientRect(&rcClient);
		SetScrollSize(0, 0, FALSE, FALSE);
		STATUSBARINFO stStatusBarInfo;
		stStatusBarInfo.bEnable = FALSE;
		SetCurrentToolType(ttNone);
		CMainFrame* pMainFrame = CNCaptureApplication::Instance()->GetMainFrame();
		if (pMainFrame)
		{
			pMainFrame->SetStatusInfo(&stStatusBarInfo);
		}
	}
	else
	{	
		//first capture
		if (1 == pDoc->GetCaptureCount() )
		{
			SetCurrentToolType(CalcCurrentToolType());
		}
		SetZoom(m_pImage->GetZoom(), TRUE, TRUE);
		m_pImage->GetCurrentObjectInfo(m_allObjects, m_selection, TRUE);
	}
		
	Invalidate();


}
开发者ID:moon-sky,项目名称:fishjam-template-library,代码行数:49,代码来源:nCaptureView.cpp

示例10: SetZoom

void BASE_SCREEN::SetScalingFactor(double aScale )
{
    double zoom = aScale;

    // Limit zoom to max and min allowed values:
    if( zoom < m_ZoomList[0] )
        zoom = m_ZoomList[0];

    int idxmax = m_ZoomList.GetCount() - 1;

    if( zoom > m_ZoomList[idxmax] )
        zoom = m_ZoomList[idxmax];

    SetZoom( zoom );
}
开发者ID:hellamps,项目名称:kicad,代码行数:15,代码来源:base_screen.cpp

示例11: OnCommand

	virtual int OnCommand(int cmd, HWND hWnd)
	{
		switch ( cmd )
		{
			case IDM_VIEW_LINECURVE:
			case IDM_VIEW_AREAFILL:
			case IDM_VIEW_BITMAP:
			case IDM_VIEW_TEXT:
				if ( cmd==m_demo )
					return View_NoChange;
				else
				{
					m_demo = cmd;
					return View_Redraw;
				}
				break;

			case IDM_VIEW_ZOOM500  : return SetZoom(500);
			case IDM_VIEW_ZOOM400  : return SetZoom(400);
			case IDM_VIEW_ZOOM200  : return SetZoom(200); 
			case IDM_VIEW_ZOOM150  : return SetZoom(150); 
			case IDM_VIEW_ZOOM100  : return SetZoom(100);
			case IDM_VIEW_ZOOM75   : return SetZoom( 75);
			case IDM_VIEW_ZOOM50   : return SetZoom( 50);
			case IDM_VIEW_ZOOM25   : return SetZoom( 25);
			case IDM_VIEW_ZOOM10   : return SetZoom( 10);

			case IDM_FILE_PRINT    : UponFilePrint();	  GetDimension(); return View_Resize;
			case IDM_FILE_PAGESETUP: UponFilePageSetup(); GetDimension(); return View_Resize;

			case IDM_FILE_PROPERTY:  
			{
				int nControlID[] = { IDC_LIST, IDC_DEFAULT, IDC_PRINTERS, 
					IDC_PRINTERPROPERTIES, IDC_ADVANCEDDOCUMENTPROPERTIES, IDC_DOCUMENTPROPERTIES };
			
				ShowProperty(m_OutputSetup, m_hInst, nControlID, IDD_PROPERTY);
			}
		}

		return View_NoChange;
	}
开发者ID:b2kguga,项目名称:CodesAndNotes,代码行数:41,代码来源:Printer.cpp

示例12: QMainWindow

// TODO: Make this class thread-aware. Can't send events to a different thread. Currently only works on X11.
// Needs to use QueuedConnection for signals/slots.
MainWindow::MainWindow(QWidget *parent) :
	QMainWindow(parent),
	ui(new Ui::MainWindow),
	nextState(CORE_POWERDOWN),
	dialogDisasm(0),
	memoryWindow(0),
	memoryTexWindow(0),
	timer(this),
	displaylistWindow(0),
	lastUIState(UISTATE_MENU)
{
	ui->setupUi(this);

	controls = new Controls(this);
#if QT_HAS_SDL
	gamePadDlg = new GamePadDialog(&input_state, this);
#endif

	host = new QtHost(this);
	emugl = ui->widget;
	emugl->init(&input_state);
	emugl->resize(pixel_xres, pixel_yres);
	emugl->setMinimumSize(pixel_xres, pixel_yres);
	emugl->setMaximumSize(pixel_xres, pixel_yres);
	QObject::connect( emugl, SIGNAL(doubleClick()), this, SLOT(on_action_OptionsFullScreen_triggered()) );

	createLanguageMenu();
	UpdateMenus();

	int zoom = g_Config.iWindowZoom;
	if (zoom < 1) zoom = 1;
	if (zoom > 4) zoom = 4;
	SetZoom(zoom);

	SetGameTitle(fileToStart);

	connect(&timer, SIGNAL(timeout()), this, SLOT(Update()));
	timer.setInterval(0);
	timer.start();

//	if (!fileToStart.isNull())
//	{
//		UpdateMenus();

//		if (stateToLoad != NULL)
//			SaveState::Load(stateToLoad);
//	}
}
开发者ID:Darth1701,项目名称:ppsspp,代码行数:50,代码来源:mainwindow.cpp

示例13: SetZoom

bool BASE_SCREEN::SetPreviousZoom()
{
    // Step must be AT LEAST 1.2
    double target = m_Zoom / 1.2;

    for( unsigned i = m_ZoomList.size(); i != 0;  --i )
    {
        if( target > m_ZoomList[i - 1] )
        {
            SetZoom( m_ZoomList[i - 1] );
            return true;
        }
    }

    return false;
}
开发者ID:KiCad,项目名称:kicad-source-mirror,代码行数:16,代码来源:base_screen.cpp

示例14: QMainWindow

MainWindow::MainWindow(QWidget *parent) :
	QMainWindow(parent),
	ui(new Ui::MainWindow),
	nextState(CORE_POWERDOWN),
	dialogDisasm(0)
{
	ui->setupUi(this);
	qApp->installEventFilter(this);

	controls = new Controls(this);
#if QT_HAS_SDL
	gamePadDlg = new GamePadDialog(&input_state, this);
#endif

	host = new QtHost(this);
	w = ui->widget;
	w->init(&input_state);
	w->resize(pixel_xres, pixel_yres);
	w->setMinimumSize(pixel_xres, pixel_yres);
	w->setMaximumSize(pixel_xres, pixel_yres);

	/*
	DialogManager::AddDlg(memoryWindow[0] = new CMemoryDlg(_hInstance, hwndMain, currentDebugMIPS));
	DialogManager::AddDlg(vfpudlg = new CVFPUDlg(_hInstance, hwndMain, currentDebugMIPS));
	*/
	// Update();
	UpdateMenus();

	int zoom = g_Config.iWindowZoom;
	if (zoom < 1) zoom = 1;
	if (zoom > 4) zoom = 4;
	SetZoom(zoom);

	if (!fileToStart.isNull())
	{
		SetPlaying(fileToStart);
		//Update();
		UpdateMenus();

		EmuThread_Start(fileToStart, w);
	}
	else
		BrowseAndBoot();

	if (!fileToStart.isNull() && stateToLoad != NULL)
		SaveState::Load(stateToLoad);
}
开发者ID:cgtchy,项目名称:ppsspp,代码行数:47,代码来源:mainwindow.cpp

示例15: HandleCommand

//
// FUNCTION: HandleCommand()
//
// PURPOSE: Take action in response to user action at the dialog box's controls.
//
void HandleCommand(_In_ HWND hwndDlg, _In_ WORD wCtrlId)
{
    switch (wCtrlId)
    {
    case IDC_CLOSE:

        // Close the sample dialog box.
        EndDialog(hwndDlg, 0);

        break;

    case IDC_RADIO_100:
    case IDC_RADIO_200:
    case IDC_RADIO_300:
    case IDC_RADIO_400:

        // The user clicked one of the radio button to apply some fullscreen magnification. (We know the control ids are sequential here.)
        SetZoom(hwndDlg, (float)(wCtrlId - IDC_RADIO_100 + 1));

        break;

    case IDC_CHECK_SETGRAYSCALE:
    {
        // The user clicked the checkbox to apply grayscale to the colors on the screen.
        bool fGrayscaleOn = (BST_CHECKED == SendDlgItemMessage(hwndDlg, IDC_CHECK_SETGRAYSCALE, BM_GETCHECK, 0, 0));

        SetColorGrayscaleState(fGrayscaleOn);

        break;
    }
    case IDC_CHECK_SETINPUTTRANSFORM:
    {
        // The user clicked the checkbox to apply an input transform for touch and pen input.
        bool fInputTransformOn = (BST_CHECKED == SendDlgItemMessage(hwndDlg, IDC_CHECK_SETINPUTTRANSFORM, BM_GETCHECK, 0, 0));

        SetInputTransform(hwndDlg, fInputTransformOn);

        break;
    }
    case IDC_BUTTON_GETSETTINGS:

        // The user wants to retrieve the current magnification settings.
        GetSettings(hwndDlg);

        break;
    }
}
开发者ID:dhanzhang,项目名称:Windows-classic-samples,代码行数:52,代码来源:FullscreenMagnifierSample.cpp


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