Ejemplo n.º 1
0
void MyFrame::OnSize(wxSizeEvent& event)
{
    if ( m_treeCtrl
#if wxUSE_LOG
                    && m_textCtrl
#endif // wxUSE_LOG
                                  )
    {
        Resize();
    }

    event.Skip();
}
Ejemplo n.º 2
0
void PHDStatusBar::OnSize(wxSizeEvent& event)
{
    wxRect fldRect;
    GetFieldRect(0, fldRect);
    int fldWidth = fldRect.GetWidth();
    m_ctrlPanel->SetSize(fldWidth - 1, fldRect.GetHeight());
    m_Msg1->SetPosition(wxPoint(2, 3));
    m_StarIndicators->PositionControls();
    m_GuideIndicators->PositionControls();
    m_StateIndicators->PositionControls();

    event.Skip();
}
Ejemplo n.º 3
0
void DropDownBase::OnSize( wxSizeEvent& event )
{
    event.Skip();
/*
    if (!m_dropdownButton) return;

    wxSize size = GetClientSize();
    wxPrintf(wxT("DropDownBase %d %d\n"), size.x, size.y);

    wxSize dropSize = m_dropdownButton->GetSize();
    m_dropdownButton->SetSize(size.x-dropSize.x, 0, dropSize.x, size.y);
*/
}
Ejemplo n.º 4
0
//------------------------------------------------------------------------------
void wxOgreRenderWindow::onSize (wxSizeEvent &evt)
{
  if (render_window_)
  {
    // Setting new size;
    int width;
    int height;
    wxSize size = evt.GetSize ();
    width = size.GetWidth ();
    height = size.GetHeight ();

    render_window_->resize (width, height);
    // Letting Ogre know the window has been resized;
    render_window_->windowMovedOrResized ();

    setCameraAspectRatio();

    Refresh();
  }

  evt.Skip();
}
Ejemplo n.º 5
0
    void OnSize(wxSizeEvent& event)
    {
        // show current size in the status bar
#if wxUSE_STATUSBAR
        if ( m_frameStatusBar )
        {
            wxSize sz = GetClientSize();
            SetStatusText(wxString::Format(_T("%dx%d"), sz.x, sz.y), 1);
        }
#endif // wxUSE_STATUSBAR

        event.Skip();
    }
Ejemplo n.º 6
0
void wxSkinFrame::OnSize(wxSizeEvent& e)
{	
  if( CreateFrame(GetClientSize()))
  {	SetWindowShape(m_bmpSkin);
  }
  /*if(m_sizeMode == 0)
  {*/
    Refresh();
    Layout();
  //}
    
  e.Skip();
}
Ejemplo n.º 7
0
/**
 @brief Resize Event Handler
 */
void CPropertyWindow::OnSize(wxSizeEvent& event)
{
	if (GetParent() != (void*)GetFrame())
	{
		const wxRect r = GetParent()->GetSize();
		SetSize(r);
		RecalculatePositions(r.width-20, r.height-20);
	}
	else
	{
		event.Skip();
	}
}
Ejemplo n.º 8
0
void OBSBasic::OnResizePreview(wxSizeEvent &event)
{
	event.Skip();

	wxSize newSize = previewPanel->GetClientSize();

	graphics_t graphics = obs_graphics();
	if (graphics) {
		gs_entercontext(graphics);
		gs_resize(newSize.x, newSize.y);
		gs_leavecontext();
	}
}
Ejemplo n.º 9
0
void CWindowStateManager::OnSize(wxSizeEvent& event)
{
	if (!m_pWindow->IsIconized())
	{
		m_lastMaximized = m_pWindow->IsMaximized();
		if (!m_lastMaximized)
		{
			m_lastWindowPosition = m_pWindow->GetPosition();
			m_lastWindowSize = m_pWindow->GetClientSize();
		}
	}
	event.Skip();
}
Ejemplo n.º 10
0
/// Sizing
void InstanceCtrl::OnSize(wxSizeEvent& event)
{
	int old_rows = GetItemsPerRow();
	int new_rows = CalculateItemsPerRow();
	if (old_rows != new_rows)
	{
		SetItemsPerRow(new_rows);
		ReflowAll();
	}
	SetupScrollbars();
	RecreateBuffer();
	event.Skip();
}
Ejemplo n.º 11
0
void CTexturePreviewDialog::OnSize(wxSizeEvent& event)
{
    wxSizer* pSizer = GetSizer();
    pSizer->DeleteWindows();
    InitCtrls();
    InsertTextureToListCtrl();
    if (m_nCurrentIndex != INVALID_DATA)
    {
        m_pListCtrl->SetItemState(m_nCurrentIndex, 1, wxLIST_STATE_SELECTED);
        ShowTextureInfo(m_nCurrentIndex);
    }
    event.Skip();
}
Ejemplo n.º 12
0
void wxComboBox::OnSize( wxSizeEvent &event )
{
    // NB: In some situations (e.g. on non-first page of a wizard, if the
    //     size used is default size), GtkCombo widget is resized correctly,
    //     but it's look is not updated, it's rendered as if it was much wider.
    //     No other widgets are affected, so it looks like a bug in GTK+.
    //     Manually requesting resize calculation (as gtk_pizza_set_size does)
    //     fixes it.
    if (GTK_WIDGET_VISIBLE(m_widget))
        gtk_widget_queue_resize(m_widget);

    event.Skip();
}
Ejemplo n.º 13
0
void wxListbook::OnSize(wxSizeEvent& event)
{
    // arrange the icons before calling SetClientSize(), otherwise it wouldn't
    // account for the scrollbars the list control might need and, at least
    // under MSW, we'd finish with an ugly looking list control with both
    // vertical and horizontal scrollbar (with one of them being added because
    // the other one is not accounted for in client size computations)
    wxListView * const list = GetListView();
    if ( list )
        list->Arrange();

    event.Skip();
}
Ejemplo n.º 14
0
void wxGISMapView::OnSize(wxSizeEvent & event)
{
    if(m_PrevSize == event.GetSize())
        return;

    //event.Skip(false);
    DestroyDrawThread();

    wxRect rc = GetClientRect();

    if(IsShownOnScreen())
    {
	    if(m_nDrawingState == enumGISMapZooming)
	    {
		    wxClientDC CDC(this);
		    if(m_pGISDisplay)
			    m_pGISDisplay->ZoomingDraw(GetClientRect(), &CDC);
	    }
	    else
	    {
		    //start zooming action
		    m_nDrawingState = enumGISMapZooming;
            if(m_pGISDisplay)
                m_pGISDisplay->SetDeviceFrame(rc);
			m_timer.Start(TM_ZOOMING);
        }
    }
    else
    {
        if(m_pGISDisplay)
            m_pGISDisplay->SetDeviceFrame(rc);
    }

	UpdateFrameCenter();
	//wxWakeUpIdle();
    m_PrevSize = event.GetSize();

}
Ejemplo n.º 15
0
void wxGL_PMFCanvas::OnSize(wxSizeEvent& event)
{
	
	if (FreezeRender) // this is a no-no if we're froze
		return;

	
	this->SetCurrent();

	// Tell openGL
	glViewport(0, 0, (GLsizei)event.GetSize().GetWidth(), (GLsizei)event.GetSize().GetHeight());
  
	// Select & reset the Projection Matrix

	//the render function does all of this already
	/*
	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();
	// Calculate aspect ratio
	if(event.GetSize().GetHeight()){
		//more division by zero-Bobboau
		float asp = (float)event.GetSize().GetWidth()/(float)event.GetSize().GetHeight();

		if(proj_mode == PROJ_ORTHO){
			glOrtho(asp*position.z+position.x, -asp*position.z+position.x, 1.0f*position.z+position.y, -1.0f*position.z+position.y, 0.0, 50000.0);
		}else{
			gluPerspective( 75.0f, asp, 1.0f, 25000.0f );
		}
	}


	// Select & reset the Modelview Matrix
	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();
	*/

	Render();
}
Ejemplo n.º 16
0
void GLCanvas::OnSize(wxSizeEvent &event)
{
	// set GL viewport
	wxSize size = event.GetSize();
	if (_GLRC)
	{
		SetCurrent(*_GLRC);
		glViewport(0, 0, GLint(size.x), GLint(size.y));
	}
	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();
	gluPerspective(45.0, double(size.x) / double(size.y), 0.1, 100.0);
	glMatrixMode(GL_MODELVIEW);
}
Ejemplo n.º 17
0
void wxFrame::OnSize(wxSizeEvent& event)
{
#if wxUSE_MENUS
    PositionMenuBar();
#endif // wxUSE_MENUS
#if wxUSE_STATUSBAR
    PositionStatusBar();
#endif // wxUSE_STATUSBAR
#if wxUSE_TOOLBAR
    PositionToolBar();
#endif // wxUSE_TOOLBAR

    event.Skip();
}
void DIALOG_TEMPLATE_SELECTOR::onNotebookResize(wxSizeEvent& event)
{
    for ( size_t i=0; i < m_notebook->GetPageCount(); i++ )
    {
        m_panels[i]->SetSize( m_notebook->GetSize().GetWidth() - 6, 140 );
        m_panels[i]->m_SizerBase->FitInside( m_panels[i] );
        m_panels[i]->m_scrolledWindow1->SetSize( m_panels[i]->GetSize().GetWidth() - 6,
                                                 m_panels[i]->GetSize().GetHeight() - 6 );
        m_panels[i]->m_SizerChoice->FitInside( m_panels[i]->m_scrolledWindow1 );
    }
    m_notebook->Refresh();

    event.Skip();
}
void WIZARD_3DSHAPE_LIBS_DOWNLOADER::OnGridLibReviewSize( wxSizeEvent& event )
{
    // Adjust the width of the column 1 afo m_gridLibReview (library names) to the
    // max available width.
    int gridwidth = m_gridLibReview->GetClientSize().x;
    gridwidth -= m_gridLibReview->GetColSize( 0 ) + m_gridLibReview->GetColLabelSize();

    if( gridwidth < 200 )
        gridwidth = 200;

    m_gridLibReview->SetColSize( 1, gridwidth );

    event.Skip();
}
Ejemplo n.º 20
0
void CFCEditorGLWindow::OnSize(wxSizeEvent& event)
{
    if ( IsShownOnScreen() )
    {
        SetCurrent(*m_glRC);
    }
    kmVec2 kmVecSize;
    wxSize size = event.GetSize();
    kmVecSize.x = size.GetWidth();
    kmVecSize.y = size.GetHeight();
    CRenderManager::GetInstance()->SetWindowSize(kmVecSize.x, kmVecSize.y);
    m_pCamera->SetWidth(size.GetWidth());
    m_pCamera->SetHeight(size.GetHeight());
}
Ejemplo n.º 21
0
void WhereHavingPage::OnSize(wxSizeEvent &event)
{
    int width = GetClientRect().GetWidth();
    if( width > 0 )
    {
        int grid_width = width - m_scrollbarWidth;
        int col_width = ( grid_width - ( m_operatorSize + m_logicalSize ) ) / 2;
        m_grid->SetColSize( 0, col_width );
        m_grid->SetColSize( 2, col_width );
        int height = m_grid->GetRowSize( 0 ) * 4;
        m_grid->SetMaxSize( wxSize( -1, height ) );
    }
    event.Skip();
}
Ejemplo n.º 22
0
/* MainWindow::onSize
 * Called when the window is resized
 *******************************************************************/
void MainWindow::onSize(wxSizeEvent& e)
{
	// Update toolbar layout (if needed)
	toolbar->updateLayout();
#ifndef __WXMSW__
	m_mgr->GetPane(toolbar).MinSize(-1, toolbar->minHeight());
	m_mgr->Update();
#endif

	// Update maximized cvar
	mw_maximized = IsMaximized();

	e.Skip();
}
Ejemplo n.º 23
0
void SpectraDocumentFrame::OnResize(wxSizeEvent& event)
{
	try
	{
		HandleResize();
		Update();
		event.Skip();
	}
	catch(oglplus::MissingFunction& mfe) { parent_app.HandleError(mfe, this); }
	catch(oglplus::ProgramBuildError& pbe) { parent_app.HandleError(pbe, this); }
	catch(oglplus::LimitError& le) { parent_app.HandleError(le, this); }
	catch(oglplus::Error& err) { parent_app.HandleError(err, this); }
	catch(const std::exception& se) { parent_app.HandleError(se, this); }
}
Ejemplo n.º 24
0
void SubtitlesPreview::OnSize(wxSizeEvent &evt) {
	if (bmp.get() && evt.GetSize() == bmp->GetSize()) return;

	int w = evt.GetSize().GetWidth();
	int h = evt.GetSize().GetHeight();

	bmp.reset(new wxBitmap(w, h, -1));
	vid.reset(new DummyVideoProvider(0.0, 10, w, h, backColour, true));
	try {
		provider.reset(SubtitlesProviderFactory::GetProvider());
	}
	catch (...) {
		wxMessageBox(
			"Could not get any subtitles provider for the preview box. Make "
			"sure that you have a provider installed.",
			"No subtitles provider", wxICON_ERROR | wxOK);
	}

	subFile->SetScriptInfo("PlayResX", wxString::Format("%i", w));
	subFile->SetScriptInfo("PlayResY", wxString::Format("%i", h));

	UpdateBitmap();
}
Ejemplo n.º 25
0
void wxGISStatusBar::OnSize(wxSizeEvent &event)
{
	wxRect	r;
	if( m_pAni && GetFieldRect(m_AniPos, r) )
	{
		r.Deflate(2);
		m_pAni->SetSize(r);
	}

	//if( m_pProgressBar && GetFieldRect(STATUSBAR_PROGRESS, r) )
	//{
	//	m_pProgressBar->SetSize(r);
	//}
	event.Skip();
}
Ejemplo n.º 26
0
void SubtitlesPreview::OnSize(wxSizeEvent &evt) {
	if (bmp.get() && evt.GetSize() == bmp->GetSize()) return;

	int w = evt.GetSize().GetWidth();
	int h = evt.GetSize().GetHeight();

	bmp = agi::util::make_unique<wxBitmap>(w, h, -1);
	vid.reset(new DummyVideoProvider(0.0, 10, w, h, back_color, true));
	try {
		if (!provider)
			provider = SubtitlesProviderFactory::GetProvider();
	}
	catch (...) {
		wxMessageBox(
			"Could not get any subtitles provider for the preview box. Make "
			"sure that you have a provider installed.",
			"No subtitles provider", wxOK | wxICON_ERROR | wxCENTER);
	}

	sub_file->SetScriptInfo("PlayResX", std::to_string(w));
	sub_file->SetScriptInfo("PlayResY", std::to_string(h));

	UpdateBitmap();
}
Ejemplo n.º 27
0
void wxTimeSpinCtrl::OnSize(wxSizeEvent &event)
{
	if ( m_spn )
	{
		wxSize sz = GetClientSize();

		wxSize ss = m_spn->GetSize();
		int eh = m_txt->GetBestSize().y;

		m_txt->SetSize(TXTPOSX, TXTPOSY, sz.x - ss.x - TXTPOSX, sz.y > eh ? eh - TXTPOSY : sz.y - TXTPOSY);
		m_spn->SetSize(sz.x - ss.x, 0, ss.x, sz.y);
	}

	event.Skip();
}
Ejemplo n.º 28
0
void CGraphView::OnSize(wxSizeEvent &event)
{
//	Beep(256,200);

	event.Skip();

	int cw=event.GetSize().GetWidth();
	int ch=event.GetSize().GetHeight();
	
	double zoom=m_diag.GetZoomFactor();
	double minx,miny,maxx,maxy;
	m_diag.GetDiagramExtents(minx,miny,maxx,maxy);

	// Readjust diagram
	int gw=(int)((maxx-minx)*zoom);
	int gh=(int)((maxy-miny)*zoom);

	if(gw>cw) {
		m_diag.TranslateAllShapes(-minx,0);
	} else {
		m_diag.TranslateAllShapes(-(minx-(cw/2/zoom-((maxx-minx)/2))),0);
	}
	
	if(gh>ch) {
		m_diag.TranslateAllShapes(0,-miny);
	} else {
		m_diag.TranslateAllShapes(0,-(miny-(ch/2/zoom-((maxy-miny)/2))));
	}

	
	int sx,sy;
	GetViewStart(&sx,&sy);

	SetScrollbars(1,1,gw,gh,sx,sy,true);
	Refresh(true);
}
Ejemplo n.º 29
0
void StreamTable::onResize(wxSizeEvent& event) {
    int width, height;
    GetSize(&width, &height);

    // automatically set some widths here after resizing
    SetColumnWidth(0, 0.5 * width);
    SetColumnWidth(1, 0.5 * width);

    // re-layout the control, to make sure the column sizes are actually being done.
    Layout();

    // propagate this event up the chain. If we don't do this, the control
    // will not be automatically resized.
    event.Skip();
}
Ejemplo n.º 30
0
void OptionsDlg::onResize(wxSizeEvent& event)
{
    const int widthTotal = m_gridCustomCommand->GetGridWindow()->GetClientSize().GetWidth();

    if (widthTotal >= 0 && m_gridCustomCommand->GetNumberCols() == 2)
    {
        const int w0 = widthTotal * 2 / 5; //ratio 2 : 3
        const int w1 = widthTotal - w0;
        m_gridCustomCommand->SetColSize(0, w0);
        m_gridCustomCommand->SetColSize(1, w1);

        m_gridCustomCommand->Refresh(); //required on Ubuntu
    }

    event.Skip();
}