void ModelPreview::render( wxPaintEvent& event ) { if (mIsInitialized) { event.ResumePropagation(1); event.Skip (); // continue the event } }
void tui::LayoutCanvas::OnpaintGL(wxPaintEvent& event) { wxPaintDC dc(this); #ifndef __WXMOTIF__ if (!GetContext()) return; #endif SetCurrent(); // invalid_window indicates zooming. // event.GetEventType() == event.GetId() should means that database is updated // In both cases - the entire window is redrawn if ((invalid_window) || (event.GetEventType() == event.GetId())) { glMatrixMode( GL_MODELVIEW ); glShadeModel( GL_FLAT ); // Single color update_viewport(); //@TODO !! Check somewhere that RGBA mode is available!? // CTM matrix stuff glLoadIdentity(); glOrtho(lp_BL.x(),lp_TR.x(),lp_TR.y(),lp_BL.y(),-1.0,1.0); glClear(GL_COLOR_BUFFER_BIT); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glClear(GL_ACCUM_BUFFER_BIT); DATC->openGL_draw(_LayCTM); // draw data glAccum(GL_LOAD, 1.0); invalid_window = false; if (rubber_band) rubber_paint(); } else { glAccum(GL_RETURN, 1.0); if (tmp_wnd) wnd_paint(); else if (rubber_band) rubber_paint(); } // deal with the long cursor if (reperX || reperY) { glColor4f(1, 1, 1, .5); glBegin(GL_LINES); if (reperX) { glVertex2i(lp_BL.x(), ScrMARK.y()) ; glVertex2i(lp_TR.x(), ScrMARK.y()); } if (reperY) { glVertex2i(ScrMARK.x() , lp_BL.y()) ; glVertex2i(ScrMARK.x() , lp_TR.y()); } glEnd(); } SwapBuffers(); }
void GLCanvas::OnPaint (wxPaintEvent &event) { //if (!inited) { // ((FrmMainFrame *)mParent)->init(); // inited = true; //} if (!m_pEngine) return; { PROFILE("Nau"); wxPaintDC dc(this); if (!isPaused) { this->Render(); if (APISupport->apiSupport(IAPISupport::BUFFER_ATOMICS)) DlgAtomics::Instance()->update(); } event.Skip(); } if (m_pEngine && m_pEngine->getProfileResetRequest()) Profile::Reset(); Refresh(false); }
void wxdlg3dViewer::OnPaintPanelTexture( wxPaintEvent& event ) { ////@begin wxEVT_PAINT event handler for ID_PanelTexture in wxdlg3dViewer. // Before editing this code, remove the block markers. wxPaintDC dc(wxDynamicCast(event.GetEventObject(), wxWindow)); ////@end wxEVT_PAINT event handler for ID_PanelTexture in wxdlg3dViewer. }
void DendrogramPanel::OnPaint( wxPaintEvent& event ) { wxSize sz = GetClientSize(); if (layer_bm && isLayerValid) { wxMemoryDC dc; dc.SelectObject(*layer_bm); wxPaintDC paint_dc(this); paint_dc.Blit(0, 0, sz.x, sz.y, &dc, 0, 0); if (split_line) { split_line->draw(paint_dc); } dc.SelectObject(wxNullBitmap); } else { wxAutoBufferedPaintDC dc(this); dc.Clear(); dc.SetPen(*wxTRANSPARENT_PEN); wxBrush Brush; Brush.SetColour(GdaConst::canvas_background_color); dc.SetBrush(Brush); dc.DrawRectangle(wxRect(0, 0, sz.x, sz.y)); } event.Skip(); }
void GLCanvas::OnPaint(wxPaintEvent &event) { wxPaintDC dc(this); if (!_GLRC) { return; } SetCurrent(*_GLRC); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity(); if (_style & SINGLE_SENSOR_MODE) { renderSingleSensor(); } else if (_style & SINGLE_JOINT_MODE) { renderSingleJoint(); } else { renderSkeleton(); } // _image.render(); // glFlush(); SwapBuffers(); if (_showUI && !(_style & SELECTION_MODE)) { drawUserInterface(dc); } event.Skip(); }
void WeatherFaxWizard::OnPaintPhasing( wxPaintEvent& event ) { wxWindow *window = dynamic_cast<wxWindow*>(event.GetEventObject()); if(!window) return; wxPaintDC dc( window ); if(!m_thDecoder) return; dc.SetBrush(wxBrush(*wxBLACK)); dc.SetPen(wxPen( *wxBLACK, 1 )); int blocksize = m_decoder.m_blocksize; int w, h; int s = 4; window->GetSize(&w, &h); for(int x = 0; x<w; x++) { int i = x * blocksize / w; int y = h*((m_decoder.m_imageline ? m_decoder.datadouble[i] : 0) +(s/2))/s; dc.DrawLine(x, h/2, x, y); } int p; dc.SetPen(wxPen( *wxRED, 1 )); p = h*(1+(s/2))/s; dc.DrawLine(0, p, w, p); p = h*(-1+(s/2))/s; dc.DrawLine(0, p, w, p); dc.SetPen(wxPen( wxColour(32,192,32), 1 )); p = h*(m_decoder.m_minus_saturation_threshold+(s/2))/s; dc.DrawLine(0, p, w, p); }
void FifoPlayerDlg::OnPaint(wxPaintEvent& event) { UpdatePlayGui(); UpdateRecorderGui(); event.Skip(); }
void ImageDialog::OnPaint(wxPaintEvent &event) { if (!image.IsOk()) { // || event.GetEventObject() != imagePanel) event.Skip(); return; } // imagePanel != NULL or we wouldn't get this event wxPaintDC dc(this); wxMemoryDC memDC; wxSize size = GetClientSize(); wxBitmap bitmap; bitmap = wxBitmap(image); if (bitmap.GetPalette()) { memDC.SetPalette(*bitmap.GetPalette()); dc.SetPalette(*bitmap.GetPalette()); } memDC.SelectObject(bitmap); dc.Blit(0, 0, bitmap.GetWidth(), bitmap.GetHeight(), &memDC, 0, 0, wxCOPY, FALSE); memDC.SelectObject(wxNullBitmap); }
/* * Draw (on m_panelShowPin) the pin currently edited * accroding to current settings in dialog */ void DIALOG_LIB_EDIT_PIN::OnPaintShowPanel( wxPaintEvent& event ) { wxPaintDC dc( m_panelShowPin ); wxSize dc_size = dc.GetSize(); dc.SetDeviceOrigin( dc_size.x / 2, dc_size.y / 2 ); // Give a parent to m_dummyPin only from draw purpose. // In fact m_dummyPin should not have a parent, but draw functions need a parent // to know some options, about pin texts LIB_EDIT_FRAME* libframe = (LIB_EDIT_FRAME*) GetParent(); m_dummyPin->SetParent( libframe->GetComponent() ); // Calculate a suitable scale to fit the available draw area EDA_RECT bBox = m_dummyPin->GetBoundingBox(); double xscale = (double) dc_size.x / bBox.GetWidth(); double yscale = (double) dc_size.y / bBox.GetHeight(); double scale = std::min( xscale, yscale ); // Give a 10% margin scale *= 0.9; dc.SetUserScale( scale, scale ); wxPoint offset = bBox.Centre(); NEGATE( offset.x ); NEGATE( offset.y ); GRResetPenAndBrush( &dc ); m_dummyPin->Draw( NULL, &dc, offset, UNSPECIFIED_COLOR, GR_COPY, NULL, DefaultTransform ); m_dummyPin->SetParent(NULL); event.Skip(); }
void DesignerWindow::HighlightPaintHandler::OnPaint(wxPaintEvent &event) { // wxPaintDC dc(this); /* wxSize size = GetSize(); dc.SetPen(*wxBLACK_PEN); for ( int i = 0; i < size.GetWidth(); i += m_x ) { for ( int j = 0; j < size.GetHeight(); j += m_y ) { dc.DrawPoint( i - 1, j - 1 ); } }*/ /*if ( m_actPanel == this) { HighlightSelection( dc ); }*/ wxWindow *aux = m_window; while (!aux->IsKindOf(CLASSINFO(DesignerWindow))) aux = aux->GetParent(); DesignerWindow *dsgnWin = (DesignerWindow*) aux; if (dsgnWin->GetActivePanel() == m_window) { wxPaintDC dc(m_window); dsgnWin->HighlightSelection(dc); } event.Skip(); }
void VCameraControl::OnPaint(wxPaintEvent &ev) { wxSize size; ///Выводим информационную надпись, если не удалось подключить камеру if (!isConnected) { ///Задаем размер окна по умолчанию size.SetWidth(400); size.SetHeight(200); this->SetMinSize(size); screen->SetMinSize(size); wxPaintDC dc(screen); dc.DrawText(L"Не удалось подключить камеру!",50,60); dc.DrawText(L"Проверьте настройки подключения.", 50, 80); } else { size = capture->GetVideoSize(); size.SetWidth(size.GetWidth()); size.SetHeight(size.GetHeight()); } Update(); Fit(); ev.Skip(); }
void App::OnPaint(wxPaintEvent& event) { switch(mPage) { case PAGE_OSZI: { // we need to request the DC here,otherwise windows makes trouble if( !mOsziPage->IsBeingDeleted() and mOsziPage->GetPanel() and !mOsziPage->GetPanel()->IsBeingDeleted()) { wxBufferedPaintDC dc(mOsziPage->GetPanel()); mOsziPage->Paint(dc); } break; } case PAGE_FFT: { if( !mFFTPage->IsBeingDeleted() and mFFTPage->GetPanel() and !mFFTPage->GetPanel()->IsBeingDeleted()) { wxBufferedPaintDC dc(mFFTPage->GetPanel()); mFFTPage->Paint(dc); } break; } } event.Skip(); }
void MyEvtHandler::OnPaint(wxPaintEvent & event) { event.Skip(); if (m_listCtrl) { m_listCtrl->PostDrawProgressBarEvent(); } }
void EDA_3D_CANVAS::OnPaint( wxPaintEvent& event ) { wxPaintDC dc( this ); Redraw(); event.Skip(); }
// // Handle Indicator paint events // // Really only needed for the Mac since SetBackgroundColour() // doesn't seem to work with shaped frames. // void ToolManager::OnIndicatorPaint( wxPaintEvent & event ) { wxWindow *w = (wxWindow *)event.GetEventObject(); wxPaintDC dc( w ); dc.SetBackground( *wxBLUE_BRUSH ); dc.Clear(); }
void wxsDrawingWindow::OnPaint(wxPaintEvent& event) { if ( !m_DuringFetch ) { wxPaintDC PaintDC(this); PrepareDC(PaintDC); if ( m_IsBlockFetch || NoNeedToRefetch() ) { if ( m_Bitmap ) { wxBitmap BmpCopy = m_Bitmap->GetSubBitmap(wxRect(0,0,m_Bitmap->GetWidth(),m_Bitmap->GetHeight())); wxBufferedDC DC(&PaintDC,BmpCopy); PaintExtra(&DC); } } else { StartFetchingSequence(); } } else { event.Skip(); } }
void OnPaint(wxPaintEvent& event) { event.Skip(); wxPaintDC dc(m_win); wxScopedPtr<wxGraphicsContext> context(wxGraphicsContext::Create(dc)); context->SetPen(wxPen(*wxLIGHT_GREY, 2)); context->StrokePath(m_path); }
void HMWindow::OnPaint(wxPaintEvent& event) { wxBufferedPaintDC pdc(this); if (hm_background_img.IsOk()) { pdc.DrawBitmap(hm_background_img, 0, 0, false); } event.Skip(); }
void MyEvtHandler::OnPaint(wxPaintEvent & event) { if (m_listCtrl) { (m_listCtrl->GetMainWin())->ProcessEvent(event); m_listCtrl->DrawProgressBars(); } else { event.Skip(); } }
// // This draws the background of a toolbar // void ToolBar::OnPaint( wxPaintEvent & event ) { wxPaintDC dc( (wxWindow *) event.GetEventObject() ); // Start with a clean background // // Under GTK, we specifically set the toolbar background to the background // colour in the system theme. #if defined( __WXGTK__ ) dc.SetBackground( wxBrush( wxSystemSettings::GetColour( wxSYS_COLOUR_BACKGROUND ) ) ); #endif dc.Clear(); // EXPERIMENTAL_THEMING is set to not apply the gradient // on wxMAC builds. on wxMAC we have the AQUA_THEME. #ifdef USE_AQUA_THEME Repaint( &dc ); #else #ifdef EXPERIMENTAL_THEMING wxImage * mpBackGradient = &theTheme.Image( bmpRecoloredUpLarge ); if( mpBackGradient != NULL ) { wxSize imSz( mpBackGradient->GetWidth(), mpBackGradient->GetHeight() ); wxSize sz = GetSize(); int y; for(y=0;y<sz.y;y++) { int yPix = ((float)y * imSz.y - 1.0f)/(sz.y-1); wxColour col( mpBackGradient->GetRed( 0, yPix), mpBackGradient->GetGreen( 0, yPix), mpBackGradient->GetBlue( 0, yPix)); // Set background colour so that controls placed on this // toolbar such as radio buttons will draw reasonably. // It's a little tacky setting the background colour // here, but we can't do it in the constructor as the gradient // may not be available yet. // Better than this would be to set the colour when the image // is loaded. // We use the colour at the half way point as a suitable 'average'. if( y==(sz.y/2) ) { SetBackgroundColour( col ); } wxPen Pen( col ); dc.SetPen(Pen ); AColor::Line(dc, 0, y, sz.x, y ); } } #endif #endif }
void MediaBrowser::_onExpose(wxPaintEvent& ev) { // Populate the tree view if it is not already populated if (!_isPopulated) { populate(); } ev.Skip(); }
void RenderCanvas::OnPaint( wxPaintEvent& event ) { // This is required even though dc is not used otherwise. // PrepareDC(dc); wxPaintDC dc(this); const wxSize size = GetClientSize(); if ( m_RenderManager ) m_RenderManager->ResizeViewport( size.GetWidth(), size.GetHeight() ); RenderFrame(); event.Skip(); }
void LatencyPanel::onPaint(wxPaintEvent &ev) { if (_justResized) { _justResized = false; } ev.Skip(); }
void QSPImgCanvas::OnPaint(wxPaintEvent& event) { if (m_isAnim || !m_image.Ok()) { event.Skip(); return; } wxPaintDC dc(this); if (m_cachedBitmap.Ok()) dc.DrawBitmap(m_cachedBitmap, m_posX, m_posY, true); }
void CslPanelAboutImage::OnPaint(wxPaintEvent& event) { static const wxBitmap bmp = BitmapFromData(wxBITMAP_TYPE_PNG,csl_256_png); wxPaintDC dc(this); PrepareDC(dc); dc.DrawBitmap(bmp,0,0,true); event.Skip(); }
void klsMiniMap::OnPaint(wxPaintEvent& evt) { //Josh Edit 4/9/07 see coment put in update //update(); wxPaintDC dc(this); //dc.FloodFill(0, 0, *wxWHITE); wxBitmap mapBitmap(mapImage); dc.DrawBitmap(mapBitmap, 0, 0, true); evt.Skip(); }
void MovieWindowQT::OnPaint(wxPaintEvent &inEvent) { wxLogTrace(TRACE_STAGE_DRAWING, wxT("Asked to repaint movie window.")); if (mMovie) { wxLogTrace(TRACE_STAGE_DRAWING, wxT("Passing repaint event to movie.")); mMovie->Redraw(); } // Let wxWindows handle this paint event properly. It won't paint // anything, but it will do a bunch of other magic with a PaintDC // and other stuff, none of which I wish to figure out right now. inEvent.Skip(); }
// Draw a shaped window border. void OnPaint(wxPaintEvent& event) { event.Skip(); wxPaintDC dc(m_win); #ifdef __WXGTK3__ wxGraphicsContext* context = dc.GetGraphicsContext(); #else wxScopedPtr<wxGraphicsContext> context(wxGraphicsContext::Create(dc)); #endif context->SetPen(wxPen(*wxLIGHT_GREY, 2)); context->StrokePath(m_path); }
void DesignerWindow::HighlightPaintHandler::OnPaint(wxPaintEvent &event) { wxWindow *aux = m_window; while (!aux->IsKindOf(CLASSINFO(DesignerWindow))) aux = aux->GetParent(); DesignerWindow *dsgnWin = (DesignerWindow*) aux; if (dsgnWin->GetActivePanel() == m_window) { wxPaintDC dc(m_window); dsgnWin->HighlightSelection(dc); } event.Skip(); }