SCH_SHEET_PIN* SCH_EDIT_FRAME::CreateSheetPin( SCH_SHEET* aSheet, wxDC* aDC ) { wxString line; SCH_SHEET_PIN* sheetPin; sheetPin = new SCH_SHEET_PIN( aSheet, wxPoint( 0, 0 ), line ); sheetPin->SetFlags( IS_NEW ); sheetPin->SetSize( m_lastSheetPinTextSize ); sheetPin->SetShape( m_lastSheetPinType ); int response = EditSheetPin( sheetPin, NULL ); if( sheetPin->GetText().IsEmpty() || (response == wxID_CANCEL) ) { delete sheetPin; return NULL; } m_lastSheetPinType = sheetPin->GetShape(); m_lastSheetPinTextSize = sheetPin->GetSize(); sheetPin->SetPosition( GetCrossHairPosition() ); sheetPin->Draw( m_canvas, aDC, wxPoint( 0, 0 ), g_XorMode ); MoveItem( (SCH_ITEM*) sheetPin, aDC ); OnModify(); return sheetPin; }