这篇教程C++ GetCanvas函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetCanvas函数的典型用法代码示例。如果您正苦于以下问题:C++ GetCanvas函数的具体用法?C++ GetCanvas怎么用?C++ GetCanvas使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetCanvas函数的22个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: GetParentvoid DISPLAY_FOOTPRINTS_FRAME::InitDisplay(){ wxString msg; CVPCB_MAINFRAME* parentframe = (CVPCB_MAINFRAME *) GetParent(); wxString footprintName = parentframe->m_footprintListBox->GetSelectedFootprint(); if( !footprintName.IsEmpty() ) { msg.Printf( _( "Footprint: %s" ), GetChars( footprintName ) ); SetTitle( msg ); const FOOTPRINT_INFO* module_info = parentframe->m_footprints.GetModuleInfo( footprintName ); const wxChar* libname; if( module_info ) libname = GetChars( module_info->GetNickname() ); else libname = GetChars( wxT( "???" ) ); msg.Printf( _( "Lib: %s" ), libname ); SetStatusText( msg, 0 ); if( GetBoard()->m_Modules.GetCount() ) { // there is only one module in the list GetBoard()->m_Modules.DeleteAll(); } MODULE* module = Get_Module( footprintName ); if( module ) GetBoard()->m_Modules.PushBack( module ); Zoom_Automatique( false ); } else // No footprint to display. Erase old footprint, if any { if( GetBoard()->m_Modules.GetCount() ) { GetBoard()->m_Modules.DeleteAll(); Zoom_Automatique( false ); SetStatusText( wxEmptyString, 0 ); } } // Display new cursor coordinates and zoom value: UpdateStatusBar(); GetCanvas()->Refresh(); if( m_Draw3DFrame ) m_Draw3DFrame->NewDisplay();}
开发者ID:antogg,项目名称:kicad-source-mirror,代码行数:57,
示例2: dlgvoid PCB_EDIT_FRAME::Swap_Layers( wxCommandEvent& event ){ PCB_LAYER_ID new_layer[PCB_LAYER_ID_COUNT]; DIALOG_SWAP_LAYERS dlg( this, new_layer ); if( dlg.ShowModal() != wxID_OK ) return; BOARD_COMMIT commit( this ); bool hasChanges = false; // Change tracks. for( TRACK* segm = GetBoard()->m_Track; segm; segm = segm->Next() ) { if( segm->Type() == PCB_VIA_T ) { VIA* via = (VIA*) segm; PCB_LAYER_ID top_layer, bottom_layer; if( via->GetViaType() == VIA_THROUGH ) continue; via->LayerPair( &top_layer, &bottom_layer ); if( new_layer[bottom_layer] != bottom_layer || new_layer[top_layer] != top_layer ) { commit.Modify( via ); via->SetLayerPair( new_layer[top_layer], new_layer[bottom_layer] ); GetGalCanvas()->GetView()->Update( via, KIGFX::GEOMETRY ); hasChanges = true; } } else { hasChanges |= processBoardItem( this, commit, segm, new_layer ); } } for( BOARD_ITEM* zone : GetBoard()->Zones() ) { hasChanges |= processBoardItem( this, commit, zone, new_layer ); } for( BOARD_ITEM* drawing : GetBoard()->Drawings() ) { hasChanges |= processBoardItem( this, commit, drawing, new_layer ); } if( hasChanges ) { OnModify(); commit.Push( "Layers moved" ); GetCanvas()->Refresh(); }}
开发者ID:KiCad,项目名称:kicad-source-mirror,代码行数:56,
示例3: WXUNUSEDvoid wxCompositeShape::OnDragLeft(bool WXUNUSED(draw), double x, double y, int WXUNUSED(keys), int WXUNUSED(attachment)){ double xx = x; double yy = y; m_canvas->Snap(&xx, &yy); double offsetX = xx - objectStartX; double offsetY = yy - objectStartY; wxClientDC dc(GetCanvas()); GetCanvas()->PrepareDC(dc); dc.SetLogicalFunction(OGLRBLF); wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT); dc.SetPen(dottedPen); dc.SetBrush((* wxTRANSPARENT_BRUSH)); GetEventHandler()->OnDrawOutline(dc, GetX() + offsetX, GetY() + offsetY, GetWidth(), GetHeight());// wxShape::OnDragLeft(draw, x, y, keys, attachment);}
开发者ID:kleopatra999,项目名称:pgadmin3,代码行数:19,
示例4: GetCanvasvoidTGUIStimulusView::Paint(){ if( bitmap == NULL ) return; // Draw the bitmap. if( visible ) GetCanvas()->Draw( bitmapTRect.Left, bitmapTRect.Top, bitmap );}
开发者ID:ACrazyer,项目名称:NeuralSystemsBCI2000,代码行数:10,
示例5: TraverseSpritesvoid StagePanel::OnPreview(){ int width, height; QueryWindowViewSizeSJ::Instance()->Query(width, height); std::vector<ee::SprPtr> sprs; TraverseSprites(ee::FetchAllRefVisitor<ee::Sprite>(sprs)); EnableObserve(false); GetCanvas()->EnableObserve(false); GetStageImpl()->EnableObserve(false); PreviewDialog dlg(const_cast<StagePanel*>(this), GetCanvas()->GetGLContext(), width, height, sprs); dlg.ShowModal(); EnableObserve(true); GetCanvas()->EnableObserve(true); GetStageImpl()->EnableObserve(true);}
开发者ID:xzrunner,项目名称:easyeditor,代码行数:19,
示例6: whilevoid wxDiagram::ReadLines(wxExprDatabase& database){ database.BeginFind(); wxExpr *clause = database.FindClauseByFunctor(_T("line")); while (clause) { wxString type; long parentId = -1; clause->GetAttributeValue(_T("type"), type); clause->GetAttributeValue(_T("parent"), parentId); wxClassInfo *classInfo = wxClassInfo::FindClass(type); if (classInfo) { wxLineShape *shape = (wxLineShape *)classInfo->CreateObject(); shape->Show(true); OnShapeLoad(database, *shape, *clause); shape->SetCanvas(GetCanvas()); long image_to = -1; long image_from = -1; clause->GetAttributeValue(_T("to"), image_to); clause->GetAttributeValue(_T("from"), image_from); wxExpr *image_to_expr = database.HashFind(_T("shape"), image_to); if (!image_to_expr) { // Error } wxExpr *image_from_expr = database.HashFind(_T("shape"), image_from); if (!image_from_expr) { // Error } if (image_to_expr && image_from_expr) { wxShape *image_to_object = (wxShape *)image_to_expr->GetClientData(); wxShape *image_from_object = (wxShape *)image_from_expr->GetClientData(); if (image_to_object && image_from_object) { image_from_object->AddLine(shape, image_to_object, shape->GetAttachmentFrom(), shape->GetAttachmentTo()); } } clause->SetClientData(shape); m_shapeList->Append(shape); } clause = database.FindClauseByFunctor(_T("line")); }}
开发者ID:crioux,项目名称:SpeedDemon-Profiler,代码行数:55,
示例7: SetSizebool wxDivisionShape::AdjustBottom(double bottom, bool test){ double y1 = (double)(GetY() - (GetHeight() / 2.0)); if (bottom <= y1) return FALSE; if (test) return TRUE; double newH = bottom - y1; double newY = (double)(y1 + newH / 2.0); SetSize(GetWidth(), newH); Move(GetX(), newY); if (GetCanvas()) GetCanvas()->Refresh(); return TRUE;}
开发者ID:kleopatra999,项目名称:pgadmin3,代码行数:20,
示例8: SetSize// Adjust a side, returning false if it's not physically possible.bool wxDivisionShape::AdjustLeft(double left, bool test){ double x2 = (double)(GetX() + (GetWidth()/2.0)); if (left >= x2) return false; if (test) return true; double newW = x2 - left; double newX = (double)(left + newW/2.0); SetSize(newW, GetHeight()); wxClientDC dc(GetCanvas()); GetCanvas()->PrepareDC(dc); Move(dc, newX, GetY()); return true;}
开发者ID:lixun910,项目名称:geoda,代码行数:21,
示例9: cmdvoid PCB_BASE_FRAME::SetPrevGrid(){ EDA_DRAW_FRAME::SetPrevGrid(); if( m_gridSelectBox ) { wxCommandEvent cmd( wxEVT_CHOICE ); cmd.SetEventObject( this ); OnSelectGrid( cmd ); } else GetCanvas()->Refresh();}
开发者ID:ejs-ejs,项目名称:kicad-source-mirror,代码行数:13,
示例10: GetCanvasvoid CGUIContext::Clear(){ Console = 0; TitleLabels = 0; VolumeControl = 0; TerrainControl = 0; GlyphControl = 0; SceneControl = 0; ControlPanel = 0; Manager->RemoveAllWidgets(); GetCanvas()->RemoveAllChildren();}
开发者ID:iondune,项目名称:Aqueous,代码行数:13,
示例11: GetCanvasvoid GTKWindow::PanelStateChanged(void){ Rect oRect; GdkBitmap *mask; GetCanvas()->SetNoScreenUpdate(true); Window::PanelStateChanged(); GetCanvas()->GetBackgroundRect(oRect); mask = ((GTKCanvas *)m_pCanvas)->GetMask(); gdk_threads_enter(); if (mask) gdk_window_shape_combine_mask(mainWindow->window, mask, 0, 0); gtk_widget_set_usize(mainWindow, oRect.Width(), oRect.Height()); gdk_threads_leave(); GetCanvas()->SetNoScreenUpdate(false); ((GTKCanvas *)GetCanvas())->Paint(oRect);}
开发者ID:pontocom,项目名称:opensdrm,代码行数:22,
示例12: SetAttachmentSizevoid wxCompositeShape::SetSize(double w, double h, bool recursive){ SetAttachmentSize(w, h); double xScale = (double)(w / (wxMax(1.0, GetWidth()))); double yScale = (double)(h / (wxMax(1.0, GetHeight()))); m_width = w; m_height = h; if (!recursive) return; wxNode *node = m_children.GetFirst(); wxClientDC dc(GetCanvas()); GetCanvas()->PrepareDC(dc); double xBound, yBound; while (node) { wxShape *object = (wxShape *)node->GetData(); // Scale the position first double newX = (double)(((object->GetX() - GetX()) * xScale) + GetX()); double newY = (double)(((object->GetY() - GetY()) * yScale) + GetY()); object->Show(FALSE); object->Move(newX, newY); object->Show(TRUE); // Now set the scaled size object->GetBoundingBoxMin(&xBound, &yBound); object->SetSize(object->GetFixedWidth() ? xBound : xScale * xBound, object->GetFixedHeight() ? yBound : yScale * yBound); node = node->GetNext(); } SetDefaultRegionSize();}
开发者ID:kleopatra999,项目名称:pgadmin3,代码行数:38,
示例13: Openvoid ComboBox::Open(){ if (!_menu) { return; } _menu->SetParent(GetCanvas()); _menu->SetHidden(false); _menu->BringToFront(); Gwen::Point point = LocalPositionToCanvas(Gwen::Point(0, 0)); _menu->SetBounds(Gwen::Rectangle(point._x, point._y + Height(), Width(), _menu->Height()));}
开发者ID:authenticate,项目名称:GWEN,代码行数:14,
示例14: GetCanvasvoidTGUIReinforcementView::Paint(){ if( animationCounter != lastAnimationCounter ) { if( animationCounter < numAnimationFrames ) animationBitmap = animFrames[ animationCounter ]; else animationBitmap = NULL; lastAnimationCounter = animationCounter; } if( animationBitmap != NULL ) GetCanvas()->Draw( animTRect.Left, animTRect.Top, animationBitmap );}
开发者ID:ACrazyer,项目名称:NeuralSystemsBCI2000,代码行数:14,
示例15: WXUNUSEDvoid MyFrame::OnSetFaceName(wxCommandEvent& WXUNUSED(event)){ wxString facename = GetCanvas()->GetTextFont().GetFaceName(); wxString newFaceName = wxGetTextFromUser( wxT("Here you can edit current font face name."), wxT("Input font facename"), facename, this); if (newFaceName.IsEmpty()) return; // user clicked "Cancel" - do nothing wxFont font(GetCanvas()->GetTextFont()); if (font.SetFaceName(newFaceName)) // change facename only { wxASSERT_MSG(font.IsOk(), wxT("The font should now be valid")); DoChangeFont(font); } else { wxASSERT_MSG(!font.IsOk(), wxT("The font should now be invalid")); wxMessageBox(wxT("There is no font with such face name..."), wxT("Invalid face name"), wxOK|wxICON_ERROR, this); }}
开发者ID:ruifig,项目名称:nutcracker,代码行数:23,
示例16: WXUNUSED// Control points ('handles') redirect control to the actual shape, to make it easier// to override sizing behaviour.void wxPolygonShape::OnSizingDragLeft(wxControlPoint *pt, bool WXUNUSED(draw), double x, double y, int WXUNUSED(keys), int WXUNUSED(attachment)){ wxPolygonControlPoint *ppt = (wxPolygonControlPoint *) pt; wxClientDC dc(GetCanvas()); GetCanvas()->PrepareDC(dc); dc.SetLogicalFunction(OGLRBLF); wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT); dc.SetPen(dottedPen); dc.SetBrush((* wxTRANSPARENT_BRUSH));#if 0 // keys & KEY_CTRL) { // TODO: mend this code. Currently we rely on altering the // actual points, but we should assume we're not, as per // the normal sizing case. m_canvas->Snap(&x, &y); // Move point ppt->m_polygonVertex->x = x - this->GetX(); ppt->m_polygonVertex->y = y - this->GetY(); ppt->SetX(x); ppt->SetY(y); ((wxPolygonShape *)this)->CalculateBoundingBox(); ((wxPolygonShape *)this)->CalculatePolygonCentre(); }#else { ppt->CalculateNewSize(x, y); }#endif this->GetEventHandler()->OnDrawOutline(dc, this->GetX(), this->GetY(), ppt->GetNewSize().x, ppt->GetNewSize().y);}
开发者ID:kleopatra999,项目名称:pgadmin3,代码行数:39,
示例17: gdk_threads_enterError GTKWindow::GetWindowPosition(Rect &oWindowRect) { if (!mainWindow->window) return kError_NoErr; gdk_threads_enter(); gdk_window_get_position(mainWindow->window, &oWindowRect.x1, &oWindowRect.y1); gdk_threads_leave(); Rect oRect; if (GetCanvas()) { GetCanvas()->GetBackgroundRect(oRect); oWindowRect.x2 = oWindowRect.x1 + oRect.Width(); oWindowRect.y2 = oWindowRect.y1 + oRect.Height(); } else { oWindowRect.x2 = oWindowRect.x1; oWindowRect.y2 = oWindowRect.y1; } return kError_NoErr;}
开发者ID:pontocom,项目名称:opensdrm,代码行数:24,
示例18: assertvoid Menu::Layout(Skin::Base* skin){ // Call the base class. ScrollControl::Layout(skin); int children_height = 0; for (auto i = _inner_panel->GetChildren().begin(); i != _inner_panel->GetChildren().end(); ++i) { Base* child = (*i); assert(child != nullptr); if (child != nullptr) { children_height += child->Height(); } } if (Y() + children_height > GetCanvas()->Height()) { children_height = GetCanvas()->Height() - Y(); } SetSize(Width(), children_height);}
开发者ID:authenticate,项目名称:GWEN,代码行数:24,
示例19: GetCanvasvoid SCH_EDIT_FRAME::DeleteAnnotation( bool aCurrentSheetOnly ){ if( aCurrentSheetOnly ) { m_CurrentSheet->Last()->ClearAnnotation(); } else { m_CurrentSheet->Last()->GetRootSheet()->ClearAnnotation( true ); } // Update the references for the sheet that is currently being displayed. m_CurrentSheet->Last()->UpdateAllScreenReferences(); GetCanvas()->Refresh(); OnModify();}
开发者ID:vasilenkomike,项目名称:kicad,代码行数:16,
示例20: GetCanvasvoid LIB_VIEW_FRAME::OnCloseWindow( wxCloseEvent& Event ){ GetCanvas()->StopDrawing(); if( !IsModal() ) { Destroy(); } else if( !IsDismissed() ) { // only dismiss modal frame if not already dismissed. DismissModal( false ); // Modal frame will be destroyed by the calling function. }}
开发者ID:johnbeard,项目名称:kicad,代码行数:16,
示例21: GetScreenvoid PCB_BASE_FRAME::SetFastGrid2(){ if( m_FastGrid2 >= (int)GetScreen()->GetGridCount() ) return; int cmdId = GetScreen()->GetGrids()[m_FastGrid2].m_CmdId; SetPresetGrid( cmdId - ID_POPUP_GRID_LEVEL_1000 ); if( m_gridSelectBox ) { wxCommandEvent cmd( wxEVT_CHOICE ); cmd.SetEventObject( this ); OnSelectGrid( cmd ); } else GetCanvas()->Refresh();}
开发者ID:ejs-ejs,项目名称:kicad-source-mirror,代码行数:17,
示例22: GetWorldvoid FieldStringEditor::do_xselection_paste(const Event& e) { XDisplay* disp = GetWorld()->display()->rep()->display_; unsigned int win = GetCanvas()->rep()->window_->rep()->xwindow_; Atom target_property = XInternAtom(disp, "PASTESTRING", false); Atom actual_atom; int actual_format; unsigned long ret_length, ret_remaining; unsigned char* data; int ret=XGetWindowProperty(disp, win, target_property, 0L, BUFSIZ, false, XA_STRING, &actual_atom, &actual_format, &ret_length, &ret_remaining, &data); if (ret == Success && data) { InsertText((char*) data, strlen((char*)data)); XFree(data); }}
开发者ID:jmzaleski,项目名称:ivtools-1.2,代码行数:17,
注:本文中的GetCanvas函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ GetCapsuleComponent函数代码示例 C++ GetCamera函数代码示例 |