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(); }
void mxDesktopTestGrid::OnResize(wxSizeEvent &evt) { if (created) { BeginBatch(); int w=evt.GetSize().GetWidth()-GetColSize(0)-GetColSize(1); double p = double(w)/old_size; int cols_num=GetNumberCols(); for (int i=PRECOLS;i<cols_num;i++) { cols_sizes[i-PRECOLS]*=p; SetColSize(i,int(cols_sizes[i-PRECOLS])); } old_size=w; EndBatch(); } evt.Skip(); }
// @@@ OnSize() is used for setting the font when it's called for the first // time because doing it in ::Create() doesn't work (for unknown reasons) void wxNotebook::OnSize(wxSizeEvent& event) { unsigned int nCount = m_pages.Count(); wxRect rect = GetPageRect() ; for ( unsigned int nPage = 0; nPage < nCount; nPage++ ) { wxNotebookPage *pPage = m_pages[nPage]; pPage->SetSize(rect); if ( pPage->GetAutoLayout() ) pPage->Layout(); } // Processing continues to next OnSize event.Skip(); }
void wxCoreGLCanvas::OnSize(wxSizeEvent& event) { # ifdef __WXGTK__ if(false == mPainted) { return; } # endif //this is also necessary to update the context on some platforms event.Skip(); ResizeGL(); SetDirty(); }
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(); list->EnsureVisible(m_selection); } event.Skip(); }
void CSourcesBox::OnSize( wxSizeEvent& event ) { if(m_pPictureBox && m_pPictureBox->IsShown()) { wxSize s =GetClientSize(); s.SetHeight(s.GetWidth()); m_pPictureBox->SetSizeHints(s,s); wxSashLayoutWindow::OnSize(event); m_pPictureBox->Refresh(); } else { //m_pPictureBox->SetSizeHints(0,0); event.Skip(); } }
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(m_ProgressPos, r) ) { //r.Deflate(2); m_pProgressBar->SetSize(r); } event.Skip(); }
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(); }
void cbAuiNotebook::OnResize(wxSizeEvent& event) { wxAuiTabCtrl* tabCtrl = (wxAuiTabCtrl*)event.GetEventObject(); if (tabCtrl) { cbAuiNotebook* nb = (cbAuiNotebook*)tabCtrl->GetParent(); if (nb) { if (nb->m_TabCtrlSize != event.GetSize()) { nb->m_TabCtrlSize = event.GetSize(); nb->MinimizeFreeSpace(); } } } event.Skip(); }
void wxChoicebook::OnSize(wxSizeEvent& event) { event.Skip(); if ( !m_choice ) { // we're not fully created yet return; } // resize the choice control and the page area to fit inside our new size const wxSize sizeClient = GetClientSize(), sizeChoice = GetChoiceSize(); wxPoint posChoice; switch ( GetWindowStyle() & wxCHB_ALIGN_MASK ) { default: wxFAIL_MSG( _T("unexpected wxChoicebook alignment") ); // fall through case wxCHB_TOP: case wxCHB_LEFT: // posChoice is already ok break; case wxCHB_BOTTOM: posChoice.y = sizeClient.y - sizeChoice.y; break; case wxCHB_RIGHT: posChoice.x = sizeClient.x - sizeChoice.x; break; } m_choice->Move(posChoice.x, posChoice.y); m_choice->SetSize(sizeChoice.x, sizeChoice.y); // resize the currently shown page if ( m_selection != wxNOT_FOUND ) { wxWindow *page = m_pages[m_selection]; wxCHECK_RET( page, _T("NULL page in wxChoicebook?") ); page->SetSize(GetPageRect()); } }
void MyFrame::OnSize(wxSizeEvent& event) { int w, h; GetClientSize(&w, &h); m_textWindow->SetSize(0, 0, 200, h); GetClientWindow()->SetSize(200, 0, w - 200, h); // FIXME: On wxX11, we need the MDI frame to process this // event, but on other platforms this should not // be done. #ifdef __WXUNIVERSAL__ event.Skip(); #else wxUnusedVar(event); #endif }
void wxSplitWindow::OnSize (wxSizeEvent& event) { // only process this message if we're not iconized - otherwise iconizing // and restoring a window containing the splitwindow has a funny side effect // of changing the splitwindow position! wxWindow *parent = wxGetTopLevelParent (this); bool iconized; wxTopLevelWindow *winTop = wxDynamicCast(parent, wxTopLevelWindow); if (winTop) { iconized = winTop->IsIconized(); }else{ wxFAIL_MSG(wxT("should have a top level parent!")); iconized = false; } if (iconized) { m_lastSize = wxSize(0,0); event.Skip(); return; } if (m_windowOne && m_windowTwo) { int w, h; GetClientSize (&w, &h); int size = m_splitMode == wxSPLIT_VERTICAL? w: h; int old_size = m_splitMode == wxSPLIT_VERTICAL ? m_lastSize.x : m_lastSize.y; if (old_size != 0) { int delta = (int)((size - old_size)*m_sashGravity); if (delta != 0) { int newPosition = m_sashPosition + delta; if (newPosition < m_minimumPaneSize) newPosition = m_minimumPaneSize; SetSashPositionAndNotify (newPosition); } } //? TODO use correct constants for the values if (m_sashPosition >= size - 5) SetSashPositionAndNotify (wxMax (10, size - 40)); m_lastSize = wxSize (w,h); } SizeWindows(); }
/* ArgsPanel::onSize * Rewrap the descriptions when the panel is resized *******************************************************************/ void ArgsPanel::onSize(wxSizeEvent& event) { event.Skip(); fg_sizer->Layout(); if (fg_sizer->GetColWidths().size() > 1) { int available_width = fg_sizer->GetColWidths()[1]; for (int a = 0; a < 5; a++) { // Wrap() puts hard newlines in the label, so we need to remove them wxString label = label_args_desc[a]->GetLabelText(); label.Replace("\n", " "); label_args_desc[a]->SetLabelText(label); label_args_desc[a]->Wrap(available_width); } } }
void wxFileListCtrl::OnSize( wxSizeEvent &event ) { event.Skip(); if ( InReportView() ) { // In report mode, set name column to use remaining width. int newNameWidth = GetClientSize().GetWidth(); for ( int i = 1; i < GetColumnCount(); i++ ) { newNameWidth -= GetColumnWidth(i); if ( newNameWidth <= 0 ) return; } SetColumnWidth(0, newNameWidth); } }
void wxChatWindow::OnSize(wxSizeEvent& event) { event.Skip(); wxSize size = event.GetSize(); wxInt32 w = size.GetWidth(); wxInt32 h = size.GetHeight(); wxInt32 th = 0; if(NULL != mpInputText) { th = mpInputText->GetSize().GetHeight(); mpInputText->SetSize(0, h - th, w, th); } mpHtmlWindow->SetSize(0, 0, w, h - th - 1); }
void PeakMeter::OnSize(wxSizeEvent& event) { // bool bIsRunning = IsStarted(); // // if ( bIsRunning ) // Stop(); /// do drawing // // Auto-restart // if ( bIsRunning ) // Start();// m_delay ); m_resized = true; Refresh(); event.Skip(); }
void wxTreeListCtrl::OnSize(wxSizeEvent& event) { event.Skip(); if ( m_view ) { // Resize the real control to cover our entire client area. const wxRect rect = GetClientRect(); m_view->SetSize(rect); #ifdef wxHAS_GENERIC_DATAVIEWCTRL // The generic implementation doesn't refresh itself immediately which // is annoying during "live resizing", so do it forcefully here to // ensure that the items are re-laid out and the focus rectangle is // redrawn correctly (instead of leaving traces) while our size is // being changed. wxWindow* const view = GetView(); view->Refresh(); view->Update(); #endif // wxHAS_GENERIC_DATAVIEWCTRL // Resize the first column to take the remaining available space. const unsigned numColumns = GetColumnCount(); if ( !numColumns ) return; // There is a bug in generic wxDataViewCtrl: if the column width sums // up to the total size, horizontal scrollbar (unnecessarily) appears, // so subtract a bit to ensure this doesn't happen. int remainingWidth = rect.width - 5; for ( unsigned n = 1; n < GetColumnCount(); n++ ) { remainingWidth -= GetColumnWidth(n); if ( remainingWidth <= 0 ) { // There is not enough space, as we're not going to give the // first column negative width anyhow, just don't do anything. return; } } SetColumnWidth(0, remainingWidth); } }
void ScrollableGamePanel::_onResize(wxSizeEvent& evt) { lua_State *L = m_pGamePanel->getLua(); if(!L) goto default_resize; // Get old world-coordinates of window center lua_Number fX, fY; lua_getglobal(L, "TheApp"); if(lua_isnil(L, -1)) { lua_pop(L, 1); goto default_resize; } lua_getfield(L, -1, "ui"); if(lua_isnil(L, -1)) { lua_pop(L, 2); goto default_resize; } lua_getfield(L, -1, "ScreenToWorld"); lua_pushvalue(L, -2); lua_pushinteger(L, m_pGamePanel->GetSize().GetWidth() / 2); lua_pushinteger(L, m_pGamePanel->GetSize().GetHeight() / 2); lua_call(L, 3, 2); fX = lua_tonumber(L, -2) - 1.0; fY = lua_tonumber(L, -1) - 1.0; lua_pop(L, 2); // Change window center Layout(); // Move window center to same world co-ordinates THMap::worldToScreen(fX, fY); lua_getfield(L, -1, "scrollMapTo"); lua_insert(L, -2); lua_pushnumber(L, fX); lua_pushnumber(L, fY); lua_call(L, 3, 0); lua_pop(L, 1); return; default_resize: evt.Skip(); }
/* MainWindow::onSize * Called when the window is resized *******************************************************************/ void MainWindow::onSize(wxSizeEvent& e) { // Update window size settings, but only if not maximized if (!IsMaximized()) { mw_width = GetSize().x; mw_height = GetSize().y; } // 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(); }
//--------------------------------------------------------- void CVIEW_Map::On_Size(wxSizeEvent &event) { int minSize = 2 * m_Ruler_Size + 10; wxSize Size(GetClientSize()), fSize(GetSize().x - Size.x, GetSize().y - Size.y); if( Size.x < minSize || Size.y < minSize ) { SetSize(wxSize( fSize.x + (Size.x < minSize ? minSize : Size.x), fSize.y + (Size.y < minSize ? minSize : Size.y) )); } else { _Set_Positions(); event.Skip(); } }
void MutRouteWnd::OnSize(wxSizeEvent& event) { FitInside(); Layout(); Refresh(); // we must repaint the entire window on resizing. //event.Skip(); // pass the event to enable the sizers to work #if 0 if (GetAutoLayout()) Layout(); #if wxUSE_CONSTRAINTS #if defined(__WXPM__) && 0 else { // Need to properly move child windows under OS/2 PSWP pWinSwp = GetSwp(); if (pWinSwp->cx == 0 && pWinSwp->cy == 0 && pWinSwp->fl == 0) { // Uninitialized ::WinQueryWindowPos(GetHWND(), pWinSwp); } else { SWP vSwp; int nYDiff; ::WinQueryWindowPos(GetHWND(), &vSwp); nYDiff = pWinSwp->cy - vSwp.cy; MoveChildren(nYDiff); pWinSwp->cx = vSwp.cx; pWinSwp->cy = vSwp.cy; } } #endif #endif // wxUSE_CONSTRAINTS event.Skip(); #endif }
void C3DWindowDialog::OnResize(wxSizeEvent& event) { #if MRPT_HAS_OPENGL_GLUT // Send the event: if (m_win3D) { try { m_win3D->publishEvent( mrptEventWindowResize( m_win3D, event.GetSize().GetWidth(), event.GetSize().GetHeight())); } catch (...) { } } event.Skip(); // so it's processed by the wx system! #endif }
/* Inactive */ void wxFoldPanelItem::OnSize(wxSizeEvent &event) { // deny access to pointers (yet) if(!m_controlCreated) { event.Skip(); return; } // calculate the size needed for this window, so // we get the parent size, and determine the size for the caption and the panel //wxRect rect = GetRect(); //wxSize size(0,wxDefaultCoord); //size.SetWidth(rect.GetWidth()); //m_captionBar->SetSize(size); }
void CFrame::OnResize(wxSizeEvent& event) { event.Skip(); if (!IsMaximized() && !(SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain && RendererIsFullscreen()) && !(Core::GetState() != Core::CORE_UNINITIALIZED && SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain && SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderWindowAutoSize)) { SConfig::GetInstance().m_LocalCoreStartupParameter.iWidth = GetSize().GetWidth(); SConfig::GetInstance().m_LocalCoreStartupParameter.iHeight = GetSize().GetHeight(); } // Make sure the logger pane is a sane size if (!g_pCodeWindow && m_LogWindow && m_Mgr->GetPane(_T("Pane 1")).IsShown() && !m_Mgr->GetPane(_T("Pane 1")).IsFloating() && (m_LogWindow->x > GetClientRect().GetWidth() || m_LogWindow->y > GetClientRect().GetHeight())) ShowResizePane(); }
// Set column widths of list control to fill out the available space on screen void EngagementTrigramsView::OnResize (wxSizeEvent & event) { if (_engagementObserver == NULL) return; // just forget it, if there is nothing to observe wxPanel * button = (wxPanel *) FindWindow (ID_ENGAGEMENT_RANK_F); // pick a widget off frame for width // TODO: Get this to work without need for - 35 int new_width = GetClientSize().GetWidth () - button->GetSize().GetWidth() - 35; int current_width = _engagementObserver->GetColumnWidth (0) + _engagementObserver->GetColumnWidth (1); if (new_width > 0 && current_width > 0) { double scale_factor = (double)new_width / (double)current_width; for (int i = 0; i < 2; ++i) { int newcolwidth = (int)(_engagementObserver->GetColumnWidth (i) * scale_factor); _engagementObserver->SetColumnWidth (i, newcolwidth); } } event.Skip (); // process resize event for superclasses }
//--------------------------------------------------------- void CVIEW_Layout::On_Size(wxSizeEvent &event) { int A, B, d, dX, dY; A = 1; B = 20; d = B - 4 * A; dX = GetClientSize().x - B; dY = GetClientSize().y - B; Freeze(); m_pRuler_Y->SetSize(wxRect(A, B, d , dY)); m_pRuler_X->SetSize(wxRect(B, A, dX, d )); m_pControl->SetSize(wxRect(B, B, dX, dY)); m_pControl->Fit_To_Size(dX, dY); Thaw(); event.Skip(); }
void wxStatusBarUniv::OnSize(wxSizeEvent& event) { // we don't need to refresh the fields whose width didn't change, so find // the first field whose width did change and refresh starting from it size_t field; if ( m_bSameWidthForAllPanes ) { // hence all fields widths have changed field = 0; } else { for ( field = 0; field < m_panes.GetCount(); field++ ) { if ( m_panes[field].GetWidth() < 0 ) { // var width field break; } } } if ( field < m_panes.GetCount() ) { // call this before invalidating the old widths as we want to use them, // not the new ones wxRect rect = DoGetFieldRect(field); // invalidate the widths, we'll have to recalc them m_widthsAbs.Empty(); // refresh everything after the first invalid field rect.y = 0; rect.SetRight(event.GetSize().x); rect.height = event.GetSize().y; RefreshRect(rect); } event.Skip(); }
// Set column widths of list control to fill out the available space on screen void ComparisonTableView::OnResize (wxSizeEvent & event) { if (_resemblanceObserver == NULL) return; // just forget it, if there is nothing to observe wxPanel * button = (wxPanel *) FindWindow (ID_RANK_1); // pick a widget off frame for width // TODO: Get this to work without need for - 55 int new_width = GetClientSize().GetWidth () - button->GetSize().GetWidth() - 55; int current_width = _resemblanceObserver->GetColumnWidth (0) + _resemblanceObserver->GetColumnWidth (1) + _resemblanceObserver->GetColumnWidth (2); if (new_width > 0 && current_width > 0) { double scale_factor = (double)new_width / (double)current_width; for (int i = 0; i < 3; ++i) { int newcolwidth = (int)(_resemblanceObserver->GetColumnWidth (i) * scale_factor); _resemblanceObserver->SetColumnWidth (i, newcolwidth); } } event.Skip (); // process resize event for superclasses }
void wxMonoScope::OnSize(wxSizeEvent & event) { wxSize size = event.GetSize(); m_scale.setMax(192, size.GetWidth() / m_analyzerBarWidth); m_rects.resize( m_scale.range() ); int i = 0, w = 0; for (; (unsigned) i < m_rects.size(); i++, w += m_analyzerBarWidth) m_rects[i]= wxRect(w, size.GetHeight() / 2, m_analyzerBarWidth - 1, 1); int os = m_mags.size(); m_mags.resize( m_scale.range() * 2 ); for (; (unsigned) os < m_mags.size(); os++) m_mags[os] = 0.0; m_scaleFactor = double( size.GetHeight() / 2 ) / log( 512.0 ); event.Skip(); }
//------------------------------------------------------------------------------ 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(); }