Commit 3b246ca4 authored by jean-pierre charras's avatar jean-pierre charras
Browse files

Pl_Editor: add undo/redo commands.

parent 1ef311cd
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -102,7 +102,7 @@ void PICKED_ITEMS_LIST::ClearListAndDeleteItems()
        {
        {
        case UR_UNSPECIFIED:
        case UR_UNSPECIFIED:
            if( show_error_message )
            if( show_error_message )
                wxMessageBox( wxT( "ClearUndoORRedoList() error: UR_UNSPECIFIED command type" ) );
                wxMessageBox( wxT( "ClearListAndDeleteItems() error: UR_UNSPECIFIED command type" ) );


            show_error_message = false;
            show_error_message = false;
            break;
            break;
+22 −0
Original line number Original line Diff line number Diff line
@@ -638,6 +638,28 @@ void WORKSHEET_LAYOUT::SetDefaultLayout()
    }
    }
}
}


/**
 * Populates the list from a S expr description stored in a string
 * @param aPageLayout = the S expr string
 */
void WORKSHEET_LAYOUT::SetPageLayout( const char* aPageLayout, bool Append )
{
    if( ! Append )
        ClearList();

    PAGE_LAYOUT_READER_PARSER lp_parser( aPageLayout, wxT( "Sexpr_string" ) );

    try
    {
        lp_parser.Parse( this );
        SetDefaultDescrFlag( true );
    }
    catch( IO_ERROR ioe )
    {
        wxLogMessage( ioe.errorText );
    }
}

#include <wx/file.h>
#include <wx/file.h>


// SetLayout() try to load a custom layout file,
// SetLayout() try to load a custom layout file,
+5 −0
Original line number Original line Diff line number Diff line
@@ -134,6 +134,11 @@ enum KICAD_T {
     */
     */
    TYPE_GERBER_DRAW_ITEM,
    TYPE_GERBER_DRAW_ITEM,


    /*
     * for Pl_Editor, in undo/redo commands
     */
    TYPE_PL_EDITOR_LAYOUT,

    // End value
    // End value
    MAX_STRUCT_TYPE_ID
    MAX_STRUCT_TYPE_ID
};
};
+13 −1
Original line number Original line Diff line number Diff line
@@ -531,11 +531,17 @@ public:
    void ClearList();
    void ClearList();


    /**
    /**
     * Function Save:
     * Save the description in a file
     * @param aFullFileName the filename of the file to created
     * @param aFullFileName the filename of the file to created
     */
     */
    void Save( const wxString& aFullFileName );
    void Save( const wxString& aFullFileName );


    /**
     * Save the description in a buffer
     * @param aOutputString = a wxString to store the S expr string
     */
    void SaveInString( wxString& aOutputString );

    /**
    /**
     * Add an item to the list of items
     * Add an item to the list of items
     */
     */
@@ -591,6 +597,12 @@ public:
    void SetPageLayout( const wxString& aFullFileName = wxEmptyString,
    void SetPageLayout( const wxString& aFullFileName = wxEmptyString,
                        bool Append = false );
                        bool Append = false );


    /**
     * Populates the list from a S expr description stored in a string
     * @param aPageLayout = the S expr string
     */
    void SetPageLayout( const char* aPageLayout, bool Append = false );

    /**
    /**
     * @return a short filename  from a full filename:
     * @return a short filename  from a full filename:
     * if the path is the current path, or if the path
     * if the path is the current path, or if the path
+1 −0
Original line number Original line Diff line number Diff line
@@ -33,6 +33,7 @@ set(PL_EDITOR_SRCS
    pl_editor.cpp
    pl_editor.cpp
    pl_editor_config.cpp
    pl_editor_config.cpp
    pl_editor_frame.cpp
    pl_editor_frame.cpp
    pl_editor_undo_redo.cpp
    properties_frame.cpp
    properties_frame.cpp
    hotkeys.cpp
    hotkeys.cpp
    menubar.cpp
    menubar.cpp
Loading