当前位置: 首页>>代码示例>>C++>>正文


C++ OnModify函数代码示例

本文整理汇总了C++中OnModify函数的典型用法代码示例。如果您正苦于以下问题:C++ OnModify函数的具体用法?C++ OnModify怎么用?C++ OnModify使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了OnModify函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: wxCHECK_RET

void SCH_EDIT_FRAME::OnFindReplace( wxFindDialogEvent& aEvent )
{
    SCH_FIND_COLLECTOR_DATA data;

    bool warpCursor = !( aEvent.GetFlags() & FR_NO_WARP_CURSOR );
    SCH_ITEM* item = (SCH_ITEM*) m_foundItems.GetItem( data );

    wxCHECK_RET( item != NULL, wxT( "Invalid replace item in find collector list." ) );

    wxLogTrace( traceFindReplace, wxT( "Replacing %s with %s in item %s" ),
                GetChars( aEvent.GetFindString() ), GetChars( aEvent.GetReplaceString() ),
                GetChars( m_foundItems.GetText() ) );

    SCH_ITEM* undoItem = data.GetParent();

    if( undoItem == NULL )
        undoItem = item;

    SetUndoItem( undoItem );

    if( m_foundItems.ReplaceItem() )
    {
        OnModify();
        SaveUndoItemInUndoList( undoItem );
        RedrawScreen( data.GetPosition(), warpCursor );
    }

    OnFindSchematicItem( aEvent );

    if( aEvent.GetEventType() == wxEVT_COMMAND_FIND_REPLACE_ALL )
    {
        while( ( item = (SCH_ITEM*) m_foundItems.GetItem( data ) ) != NULL )
        {
            wxLogTrace( traceFindReplace, wxT( "Replacing %s with %s in item %s" ),
                        GetChars( aEvent.GetFindString() ), GetChars( aEvent.GetReplaceString() ),
                        GetChars( m_foundItems.GetText() ) );

            SCH_ITEM* undoItem = data.GetParent();

            // Don't save child items in undo list.
            if( undoItem == NULL )
                undoItem = item;

            SetUndoItem( undoItem );

            if( m_foundItems.ReplaceItem() )
            {
                OnModify();
                SaveUndoItemInUndoList( undoItem );
                RedrawScreen( data.GetPosition(), warpCursor );
            }

            OnFindSchematicItem( aEvent );
        }
    }
}
开发者ID:james-sakalaukus,项目名称:kicad,代码行数:56,代码来源:find.cpp

示例2: switch

BOOL CScriptDlg::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
	


	NMHDR *phDR;
	phDR = (NMHDR*)lParam;

	// Does notification come from scintilla window?
	if (phDR !=  NULL)
	{
		CScintillaWnd* m_wndScintilla = NULL;
		if(phDR->hwndFrom == m_Script.m_hWnd)
			m_wndScintilla = &m_Script;
		if(phDR->hwndFrom == m_Help.m_hWnd)
			m_wndScintilla = &m_Help;

		SCNotification *pMsg = (SCNotification*)lParam;
		switch(phDR->code)       
		{ 
			case SCN_SAVEPOINTLEFT:
				break;

			case SCN_UPDATEUI:
				m_wndScintilla->UpdateUI();
				OnModify();
				break; 

			case SCN_MARGINCLICK:
				 m_wndScintilla->DoDefaultFolding(pMsg->margin,pMsg->position);
				break;

			case SCN_DOUBLECLICK:
				HelpMe();
				break;

			case SCN_CHARADDED:
			{
				SCNotification *scn = (SCNotification*)phDR;
				OnChar(scn->ch);
				OnModify();
				break;
			}

			case SCN_MODIFIED:
				OnModify();
				break;

		}
		return TRUE; 
   }

   return CWnd::OnNotify(wParam, lParam, pResult);
}
开发者ID:aolko,项目名称:construct,代码行数:54,代码来源:Script+Dlg.cpp

示例3: rescuer

bool SCH_EDIT_FRAME::RescueProject( bool aRunningOnDemand )
{
    RESCUER rescuer( *this, Prj() );

    rescuer.FindCandidates();

    if( ! rescuer.GetCandidateCount() )
    {
        if( aRunningOnDemand )
        {
            wxMessageDialog dlg( this, _( "This project has nothing to rescue." ),
                    _( "Project Rescue Helper" ) );
            dlg.ShowModal();
        }
        return true;
    }

    rescuer.RemoveDuplicates();

    rescuer.InvokeDialog( !aRunningOnDemand );

    // If no components were rescued, let the user know what's going on. He might
    // have clicked cancel by mistake, and should have some indication of that.
    if( !rescuer.GetChosenCandidateCount() )
    {
        wxMessageDialog dlg( this, _( "No symbols were rescued." ),
                _( "Project Rescue Helper" ) );
        dlg.ShowModal();

        // Set the modified flag even on Cancel. Many users seem to instinctively want to Save at
        // this point, due to the reloading of the symbols, so we'll make the save button active.
        OnModify();
        return true;
    }

    RESCUE_CACHE_CANDIDATE::OpenRescueLibrary();

    if( !rescuer.DoRescues() )
    {
        rescuer.UndoRescues();
        return false;
    }

    RESCUE_CACHE_CANDIDATE::WriteRescueLibrary( this, &Prj() );

    Prj().SetElem( PROJECT::ELEM_SCH_PART_LIBS, NULL );

    // Clean up wire ends
    GetScreen()->SchematicCleanUp();
    m_canvas->Refresh( true );
    OnModify();

    return true;
}
开发者ID:reportingsjr,项目名称:kicad-source-mirror,代码行数:54,代码来源:project_rescue.cpp

示例4: SCH_SHEET_PIN

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;
}
开发者ID:Th0rN13,项目名称:kicad-source-mirror,代码行数:28,代码来源:sheetlab.cpp

示例5: _

void PCB_BASE_FRAME::DeletePad( D_PAD* aPad, bool aQuery )
{
    if( aPad == NULL )
        return;

    MODULE* module = (MODULE*) aPad->GetParent();
    module->SetLastEditTime();

    // aQuery = true to prompt for confirmation, false to delete silently
    if( aQuery )
    {
        wxString msg;
        msg.Printf( _( "Delete Pad (footprint %s %s) ?" ),
                    GetChars( module->GetReference() ),
                    GetChars( module->GetValue() ) );

        if( !IsOK( this, msg ) )
            return;
    }

    m_Pcb->m_Status_Pcb = 0;
    aPad->DeleteStructure();
    // Refresh the modified screen area, using the initial bounding box
    // which is perhaps larger than the new bounding box
    m_canvas->RefreshDrawingRect( module->GetBoundingBox() );
    // Update the bounding box
    module->CalculateBoundingBox();

    OnModify();
}
开发者ID:Elphel,项目名称:kicad-source-mirror,代码行数:30,代码来源:pad_edition_functions.cpp

示例6: _

void PCB_BASE_FRAME::DeletePad( D_PAD* aPad, bool aQuery )
{
    if( aPad == NULL )
        return;

    MODULE* module = aPad->GetParent();
    module->SetLastEditTime();

    // aQuery = true to prompt for confirmation, false to delete silently
    if( aQuery )
    {
        wxString msg = wxString::Format( _( "Delete pad (footprint %s %s)?" ),
                                         module->GetReference(),
                                         module->GetValue() );

        if( !IsOK( this, msg ) )
            return;
    }

    // Stores the initial bounding box to refresh the old area
    EDA_RECT bbox = module->GetBoundingBox();

    m_Pcb->m_Status_Pcb = 0;

    GetBoard()->PadDelete( aPad );

    // Update the bounding box
    module->CalculateBoundingBox();

    // Refresh the modified screen area, using the initial bounding box
    // which is perhaps larger than the new bounding box
    m_canvas->RefreshDrawingRect( bbox );

    OnModify();
}
开发者ID:johnbeard,项目名称:kicad,代码行数:35,代码来源:pad_edit_functions.cpp

示例7: OnModify

void PCB_EDIT_FRAME::End_Move_Zone_Corner_Or_Outlines( wxDC* DC, ZONE_CONTAINER* aZone )
{
    aZone->ClearFlags();
    m_canvas->SetMouseCapture( NULL, NULL );

    if( DC )
        aZone->Draw( m_canvas, DC, GR_OR );

    OnModify();
    s_AddCutoutToCurrentZone = false;
    s_CurrentZone = NULL;

    SetCurItem( NULL );       // This outline can be deleted when merging outlines

    // Combine zones if possible
    GetBoard()->OnAreaPolygonModified( &s_AuxiliaryList, aZone );
    m_canvas->Refresh();

    int ii = GetBoard()->GetAreaIndex( aZone );     // test if aZone exists

    if( ii < 0 )
        aZone = NULL;                          // was removed by combining zones

    UpdateCopyOfZonesList( s_PickedList, s_AuxiliaryList, GetBoard() );
    SaveCopyInUndoList(s_PickedList, UR_UNSPECIFIED);
    s_PickedList.ClearItemsList(); // s_ItemsListPicker is no more owner of picked items

    int error_count = GetBoard()->Test_Drc_Areas_Outlines_To_Areas_Outlines( aZone, true );

    if( error_count )
    {
        DisplayError( this, _( "Area: DRC outline error" ) );
    }
}
开发者ID:AlexanderBrevig,项目名称:kicad-source-mirror,代码行数:34,代码来源:zones_by_polygon.cpp

示例8: Delete_OldZone_Fill

void PCB_EDIT_FRAME::Delete_Zone_Contour( wxDC* DC, ZONE_CONTAINER* aZone )
{
    int      ncont = aZone->m_Poly->GetContour( aZone->m_CornerSelection );

    EDA_RECT dirty = aZone->GetBoundingBox();

    // For compatibility with old boards: remove old SEGZONE fill segments
    Delete_OldZone_Fill( NULL, aZone->GetTimeStamp() );

    // Remove current filling:
    aZone->UnFill();

    if( ncont == 0 )    // This is the main outline: remove all
    {
        SaveCopyInUndoList( aZone, UR_DELETED );
        GetBoard()->Remove( aZone );
    }

    else
    {
        SaveCopyInUndoList( aZone, UR_CHANGED );
        aZone->m_Poly->RemoveContour( ncont );
    }

    m_canvas->RefreshDrawingRect( dirty );

    OnModify();
}
开发者ID:james-sakalaukus,项目名称:kicad,代码行数:28,代码来源:zones_by_polygon.cpp

示例9: SaveCopyInUndoList

void PCB_BASE_FRAME::RotateTextModule( TEXTE_MODULE* Text, wxDC* DC )
{
    if( Text == NULL )
        return;

    MODULE* module = (MODULE*) Text->GetParent();

    if( module && module->GetFlags() == 0 && Text->GetFlags() == 0 ) // prepare undo command
    {
        if( IsType( FRAME_PCB ) )
            SaveCopyInUndoList( module, UR_CHANGED );
    }

    // we expect MoveVector to be (0,0) if there is no move in progress
    Text->Draw( m_canvas, DC, GR_XOR, MoveVector );

    Text->SetTextAngle( Text->GetTextAngle() + 900 );

    Text->Draw( m_canvas, DC, GR_XOR, MoveVector );
    SetMsgPanel( Text );

    if( module )
        module->SetLastEditTime();

    OnModify();
}
开发者ID:johnbeard,项目名称:kicad,代码行数:26,代码来源:edtxtmod.cpp

示例10: SetCurItem

void PCB_EDIT_FRAME::Delete_Segment_Edge( DRAWSEGMENT* Segment, wxDC* DC )
{
    EDA_ITEM* PtStruct;
    int       track_fill_copy = DisplayOpt.DisplayDrawItems;

    if( Segment == NULL )
        return;

    if( Segment->IsNew() )  // Trace in progress.
    {
        // Delete current segment.
        DisplayOpt.DisplayDrawItems = SKETCH;
        Segment->Draw( m_canvas, DC, GR_XOR );
        PtStruct = Segment->Back();
        Segment ->DeleteStructure();

        if( PtStruct && (PtStruct->Type() == PCB_LINE_T ) )
            Segment = (DRAWSEGMENT*) PtStruct;

        DisplayOpt.DisplayDrawItems = track_fill_copy;
        SetCurItem( NULL );
    }
    else if( Segment->GetFlags() == 0 )
    {
        Segment->Draw( m_canvas, DC, GR_XOR );
        Segment->ClearFlags();
        SaveCopyInUndoList(Segment, UR_DELETED);
        Segment->UnLink();
        SetCurItem( NULL );
        OnModify();
    }
}
开发者ID:michaellis,项目名称:kicad-source-mirror,代码行数:32,代码来源:editedge.cpp

示例11: GetScreen

void SCH_EDIT_FRAME::OrientComponent( COMPONENT_ORIENTATION_T aOrientation )
{
    SCH_SCREEN* screen = GetScreen();
    SCH_ITEM* item = screen->GetCurItem();

    wxCHECK_RET( item != NULL && item->Type() == SCH_COMPONENT_T,
                 wxT( "Cannot change orientation of invalid schematic item." ) );

    SCH_COMPONENT* component = (SCH_COMPONENT*) item;

    m_canvas->MoveCursorToCrossHair();

    if( item->GetFlags() == 0 )
        SetUndoItem( item );

    INSTALL_UNBUFFERED_DC( dc, m_canvas );

    component->SetOrientation( aOrientation );

    m_canvas->CrossHairOn( &dc );

    if( item->GetFlags() == 0 )
    {
        addCurrentItemToList();
        SchematicCleanUp( true );
    }

    if( GetScreen()->TestDanglingEnds() )
        m_canvas->Refresh();

    OnModify();
}
开发者ID:zhihuitech,项目名称:kicad-source-mirror,代码行数:32,代码来源:getpart.cpp

示例12: wxCHECK_RET

void SCH_EDIT_FRAME::MoveItem( SCH_ITEM* aItem, wxDC* aDC )
{
    wxCHECK_RET( aItem != NULL, wxT( "Cannot move invalid schematic item" ) );

    SetRepeatItem( NULL );

    if( !aItem->IsNew() )
    {
        if( (aItem->Type() == SCH_SHEET_PIN_T) || (aItem->Type() == SCH_FIELD_T) )
            SetUndoItem( (SCH_ITEM*) aItem->GetParent() );
        else
            SetUndoItem( aItem );
    }

    aItem->SetFlags( IS_MOVED );
#ifdef USE_WX_OVERLAY
    this->Refresh();
    this->Update();
#endif
    m_canvas->CrossHairOff( aDC );

    if( aItem->Type() != SCH_SHEET_PIN_T )
        SetCrossHairPosition( aItem->GetPosition() );

    m_canvas->MoveCursorToCrossHair();

    OnModify();
    m_canvas->SetMouseCapture( moveItem, abortMoveItem );
    GetScreen()->SetCurItem( aItem );
    moveItem( m_canvas, aDC, wxDefaultPosition, true );
    m_canvas->CrossHairOn( aDC );
}
开发者ID:p12tic,项目名称:kicad-source-mirror,代码行数:32,代码来源:schedit.cpp

示例13: SaveCopyInUndoList

void SCH_EDIT_FRAME::RotateHierarchicalSheet( SCH_SHEET* aSheet, bool aRotCCW )
{
    if( aSheet == NULL )
        return;

    // Save old sheet in undo list if not already in edit, or moving.
    if( aSheet->GetFlags() == 0 )
        SaveCopyInUndoList( aSheet, UR_CHANGED );

    // Rotate the sheet on itself. Sheets do not have a anchor point.
    // Rotation is made around it center
    wxPoint rotPoint = aSheet->GetBoundingBox().Centre();

    // rotate CCW, or CW. to rotate CW, rotate 3 times
    aSheet->Rotate( rotPoint );

    if( !aRotCCW )
    {
        aSheet->Rotate( rotPoint );
        aSheet->Rotate( rotPoint );
    }

    GetCanvas()->Refresh();
    OnModify();
}
开发者ID:bpkempke,项目名称:kicad-source-mirror,代码行数:25,代码来源:sheet.cpp

示例14: SetMsgPanel

void PCB_EDIT_FRAME::Rotate_Texte_Pcb( TEXTE_PCB* TextePcb, wxDC* DC )
{
    int angle    = 900;

    if( TextePcb == NULL )
        return;

    // Erase previous text:
    TextePcb->Draw( m_canvas, DC, GR_XOR );

    TextePcb->SetOrientation( TextePcb->GetOrientation() + angle );

    // Redraw text in new position:
    TextePcb->Draw( m_canvas, DC, GR_XOR );
    SetMsgPanel( TextePcb );

    if( TextePcb->GetFlags() == 0 )    // i.e. not edited, or moved
        SaveCopyInUndoList( TextePcb, UR_ROTATED, TextePcb->GetTextPosition() );
    else                 // set flag edit, to show it was a complex command
        TextePcb->SetFlags( IN_EDIT );

    OnModify();
#ifdef USE_WX_OVERLAY
    m_canvas->Refresh();
#endif
}
开发者ID:johnbeard,项目名称:kicad-source-mirror,代码行数:26,代码来源:edit_pcb_text.cpp

示例15: stamp

/**
 * Function Delete_OldZone_Fill (obsolete)
 * Used for compatibility with old boards
 * Remove the zone filling which include the segment aZone, or the zone which have the
 * given time stamp.
 * A zone is a group of segments which have the same TimeStamp
 * @param aZone = zone segment within the zone to delete. Can be NULL
 * @param aTimestamp = Timestamp for the zone to delete, used if aZone == NULL
 */
void PCB_EDIT_FRAME::Delete_OldZone_Fill( SEGZONE* aZone, time_t aTimestamp )
{
    bool          modify  = false;
    time_t        TimeStamp;

    if( aZone == NULL )
        TimeStamp = aTimestamp;
    else
        TimeStamp = aZone->GetTimeStamp(); // Save reference time stamp (aZone will be deleted)

    SEGZONE* next;

    for( SEGZONE* zone = GetBoard()->m_Zone; zone != NULL; zone = next )
    {
        next = zone->Next();

        if( zone->GetTimeStamp() == TimeStamp )
        {
            modify = true;
            // remove item from linked list and free memory
            zone->DeleteStructure();
        }
    }

    if( modify )
    {
        OnModify();
        m_canvas->Refresh();
    }
}
开发者ID:AlexanderBrevig,项目名称:kicad-source-mirror,代码行数:39,代码来源:zones_by_polygon_fill_functions.cpp


注:本文中的OnModify函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。