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

Gerbview: remove flicker when refresh screen, and loadind files. Fix very minor bugs.

Minor cosmetic enhancements.
commint forgoten files in boost lib.
parent e5e21a24
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -79,6 +79,7 @@ WinEDA_DrawPanel::WinEDA_DrawPanel( WinEDA_DrawFrame* parent, int id,
    m_AbortEnable       = m_AbortRequest = false;
    m_AbortEnable       = m_AbortRequest = false;
    m_AutoPAN_Enable    = TRUE;
    m_AutoPAN_Enable    = TRUE;
    m_IgnoreMouseEvents = 0;
    m_IgnoreMouseEvents = 0;
    m_DisableEraseBG    = false;


    ManageCurseur = NULL;
    ManageCurseur = NULL;
    ForceCloseManageCurseur = NULL;
    ForceCloseManageCurseur = NULL;
@@ -673,7 +674,7 @@ void WinEDA_DrawPanel::OnPaint( wxPaintEvent& event )
    // call ~wxDCClipper() before ~wxPaintDC()
    // call ~wxDCClipper() before ~wxPaintDC()
    {
    {
        wxDCClipper dcclip( paintDC, PaintClipBox );
        wxDCClipper dcclip( paintDC, PaintClipBox );
        ReDraw( &paintDC, true );
        ReDraw( &paintDC, m_DisableEraseBG ? false : true );
    }
    }


    m_ClipBox = tmp;
    m_ClipBox = tmp;
+1 −1
Original line number Original line Diff line number Diff line
@@ -37,7 +37,7 @@ void WinEDA_DrawFrame::Recadre_Trace( bool ToMouse )
     * use Refresh() and update() do not change problems
     * use Refresh() and update() do not change problems
     */
     */
    INSTALL_DC( dc, DrawPanel );
    INSTALL_DC( dc, DrawPanel );
    DrawPanel->ReDraw( &dc );
    DrawPanel->ReDraw( &dc, DrawPanel->m_DisableEraseBG ? false : true );


    /* Move the mouse cursor to the on grid graphic cursor position */
    /* Move the mouse cursor to the on grid graphic cursor position */
    if( ToMouse == TRUE )
    if( ToMouse == TRUE )
+1 −1
Original line number Original line Diff line number Diff line
@@ -36,7 +36,7 @@ set(CVPCB_SRCS
    listboxes.cpp
    listboxes.cpp
    listlib.cpp
    listlib.cpp
    loadcmp.cpp
    loadcmp.cpp
    menucfg.cpp
    menubar.cpp
    readschematicnetlist.cpp
    readschematicnetlist.cpp
    savecmp.cpp
    savecmp.cpp
    setvisu.cpp
    setvisu.cpp
+18 −7
Original line number Original line Diff line number Diff line
/**
/**
 * @file ./menucfg.cpp
 * @file menucfg.cpp
 * (Re)Create the CvPCB main MenuBar
 * (Re)Create the CvPCB main MenuBar
 */
 */
#include "fctsys.h"
#include "fctsys.h"
@@ -18,10 +18,19 @@
void WinEDA_CvpcbFrame::ReCreateMenuBar()
void WinEDA_CvpcbFrame::ReCreateMenuBar()
{
{
    wxMenuItem* item;
    wxMenuItem* item;
    wxMenuBar*  menuBar;
    wxMenuBar*  menuBar = GetMenuBar();


    if( ! menuBar )
        menuBar = new wxMenuBar();
        menuBar = new wxMenuBar();


    // Delete all existing menus so they can be rebuilt.
    // This allows language changes of the menu text on the fly.
    menuBar->Freeze();
    while( menuBar->GetMenuCount() )
        delete menuBar->Remove(0);

    // Recreate all menus:

    wxMenu* filesMenu = new wxMenu;
    wxMenu* filesMenu = new wxMenu;
    item = new wxMenuItem( filesMenu, ID_LOAD_PROJECT,
    item = new wxMenuItem( filesMenu, ID_LOAD_PROJECT,
                           _( "&Open" ),
                           _( "&Open" ),
@@ -96,14 +105,16 @@ void WinEDA_CvpcbFrame::ReCreateMenuBar()


#endif /* !defined(__WXMAC__) */
#endif /* !defined(__WXMAC__) */


    /**
    // Create the menubar and append all submenus
     * Create the menubar and append all submenus
     */
    menuBar->Append( filesMenu, _( "&File" ) );
    menuBar->Append( filesMenu, _( "&File" ) );
    menuBar->Append( configmenu, _( "&Preferences" ) );
    menuBar->Append( configmenu, _( "&Preferences" ) );
    menuBar->Append( helpMenu, _( "&Help" ) );
    menuBar->Append( helpMenu, _( "&Help" ) );


    /* Calling SetMenuBar() will Destroy the existing menu bar so it can be
    menuBar->Thaw();
     * rebuilt.  This allows language changes of the menu text on the fly. */

    // Associate the menu bar with the frame, if no previous menubar
    if( GetMenuBar() == NULL )
        SetMenuBar( menuBar );
        SetMenuBar( menuBar );
    else
        menuBar->Refresh();
}
}
+38 −50
Original line number Original line Diff line number Diff line
@@ -28,34 +28,34 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
    wxMenuItem* item;
    wxMenuItem* item;
    wxMenuBar*  menuBar = GetMenuBar();
    wxMenuBar*  menuBar = GetMenuBar();


    /**
    if( ! menuBar )
     * Destroy the existing menu bar so it can be rebuilt.  This allows
     * language changes of the menu text on the fly.
     */
    if( menuBar )
        SetMenuBar( NULL );

        menuBar = new wxMenuBar();
        menuBar = new wxMenuBar();


    /**
    // Delete all existing menus so they can be rebuilt.
     * File menu
    // This allows language changes of the menu text on the fly.
     */
    menuBar->Freeze();
    while( menuBar->GetMenuCount() )
        delete menuBar->Remove(0);

    // Recreate all menus:

    // File menu
    wxMenu* filesMenu = new wxMenu;
    wxMenu* filesMenu = new wxMenu;


    /* New */
    // New
    item = new wxMenuItem( filesMenu, ID_NEW_PROJECT, _( "&New\tCtrl+N" ),
    item = new wxMenuItem( filesMenu, ID_NEW_PROJECT, _( "&New\tCtrl+N" ),
                           _( "New schematic project" ) );
                           _( "New schematic project" ) );


    item->SetBitmap( new_xpm );
    item->SetBitmap( new_xpm );
    filesMenu->Append( item );
    filesMenu->Append( item );


    /* Open */
    // Open
    item = new wxMenuItem( filesMenu, ID_LOAD_PROJECT, _( "&Open\tCtrl+O" ),
    item = new wxMenuItem( filesMenu, ID_LOAD_PROJECT, _( "&Open\tCtrl+O" ),
                           _( "Open an existing schematic project" ) );
                           _( "Open an existing schematic project" ) );
    item->SetBitmap( open_xpm );
    item->SetBitmap( open_xpm );
    filesMenu->Append( item );
    filesMenu->Append( item );


    /* Open Recent submenu */
    // Open Recent submenu
    wxMenu* openRecentMenu = new wxMenu();
    wxMenu* openRecentMenu = new wxMenu();
    wxGetApp().m_fileHistory.AddFilesToMenu( openRecentMenu );
    wxGetApp().m_fileHistory.AddFilesToMenu( openRecentMenu );
    ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, openRecentMenu,
    ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, openRecentMenu,
@@ -63,11 +63,9 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
                                        _( "Open a recent opened schematic project" ),
                                        _( "Open a recent opened schematic project" ),
                                        open_project_xpm );
                                        open_project_xpm );


    /* Separator */
    filesMenu->AppendSeparator();


    /* Save */
    // Save schematic
    /* Save Project */
    filesMenu->AppendSeparator();
    item = new wxMenuItem( filesMenu, ID_SAVE_PROJECT,
    item = new wxMenuItem( filesMenu, ID_SAVE_PROJECT,
                           _( "&Save Whole Schematic Project\tCtrl+S" ),
                           _( "&Save Whole Schematic Project\tCtrl+S" ),
                           _( "Save all sheets in the schematic project" ) );
                           _( "Save all sheets in the schematic project" ) );
@@ -79,22 +77,21 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
    item->SetBitmap( save_xpm );
    item->SetBitmap( save_xpm );
    filesMenu->Append( item );
    filesMenu->Append( item );


    /* Save as... */
    // Save as...
    item = new wxMenuItem( filesMenu, ID_SAVE_ONE_SHEET_AS,
    item = new wxMenuItem( filesMenu, ID_SAVE_ONE_SHEET_AS,
                           _( "Save Current Sheet &as" ),
                           _( "Save Current Sheet &as" ),
                           _( "Save current schematic sheet as..." ) );
                           _( "Save current schematic sheet as..." ) );
    item->SetBitmap( save_as_xpm );
    item->SetBitmap( save_as_xpm );
    filesMenu->Append( item );
    filesMenu->Append( item );


    /* Separator */
    filesMenu->AppendSeparator();


    /* Print */
    // Print
    filesMenu->AppendSeparator();
    item = new wxMenuItem( filesMenu, wxID_PRINT, _( "P&rint" ), _( "Print schematic" ) );
    item = new wxMenuItem( filesMenu, wxID_PRINT, _( "P&rint" ), _( "Print schematic" ) );
    item->SetBitmap( print_button );
    item->SetBitmap( print_button );
    filesMenu->Append( item );
    filesMenu->Append( item );


    /* Plot submenu */
    // Plot submenu
    wxMenu* choice_plot_fmt = new wxMenu;
    wxMenu* choice_plot_fmt = new wxMenu;
    item = new wxMenuItem( choice_plot_fmt, ID_GEN_PLOT_PS,
    item = new wxMenuItem( choice_plot_fmt, ID_GEN_PLOT_PS,
                           _( "Plot PostScript" ),
                           _( "Plot PostScript" ),
@@ -108,19 +105,19 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
    item->SetBitmap( plot_HPG_xpm );
    item->SetBitmap( plot_HPG_xpm );
    choice_plot_fmt->Append( item );
    choice_plot_fmt->Append( item );


    /* Plot SVG */
    // Plot SVG
    item = new wxMenuItem( choice_plot_fmt, ID_GEN_PLOT_SVG, _( "Plot SVG" ),
    item = new wxMenuItem( choice_plot_fmt, ID_GEN_PLOT_SVG, _( "Plot SVG" ),
                           _( "Plot schematic sheet in SVG format" ) );
                           _( "Plot schematic sheet in SVG format" ) );
    item->SetBitmap( plot_xpm );
    item->SetBitmap( plot_xpm );
    choice_plot_fmt->Append( item );
    choice_plot_fmt->Append( item );


    /* Plot DXF */
    // Plot DXF
    item = new wxMenuItem( choice_plot_fmt, ID_GEN_PLOT_DXF, _( "Plot DXF" ),
    item = new wxMenuItem( choice_plot_fmt, ID_GEN_PLOT_DXF, _( "Plot DXF" ),
                           _( "Plot schematic sheet in DXF format" ) );
                           _( "Plot schematic sheet in DXF format" ) );
    item->SetBitmap( plot_xpm );
    item->SetBitmap( plot_xpm );
    choice_plot_fmt->Append( item );
    choice_plot_fmt->Append( item );


    /* Under windows, one can draw to the clipboard */
    // Under windows, one can draw to the clipboard
#ifdef __WINDOWS__
#ifdef __WINDOWS__


    item = new wxMenuItem( choice_plot_fmt, ID_GEN_COPY_SHEET_TO_CLIPBOARD,
    item = new wxMenuItem( choice_plot_fmt, ID_GEN_COPY_SHEET_TO_CLIPBOARD,
@@ -128,7 +125,6 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
                           _( "Export drawings to clipboard" ) );
                           _( "Export drawings to clipboard" ) );
    item->SetBitmap( copy_button );
    item->SetBitmap( copy_button );
    choice_plot_fmt->Append( item );
    choice_plot_fmt->Append( item );

#endif
#endif


    ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, choice_plot_fmt,
    ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, choice_plot_fmt,
@@ -136,7 +132,7 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
                                        _( "Plot schematic sheet in HPGL, PostScript or SVG format" ),
                                        _( "Plot schematic sheet in HPGL, PostScript or SVG format" ),
                                        plot_xpm );
                                        plot_xpm );


    /* Quit on all platforms except WXMAC */
    // Quit on all platforms except WXMAC
#if !defined(__WXMAC__)
#if !defined(__WXMAC__)


    filesMenu->AppendSeparator();
    filesMenu->AppendSeparator();
@@ -144,15 +140,12 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
    item->SetBitmap( exit_xpm );
    item->SetBitmap( exit_xpm );
    filesMenu->Append( item );
    filesMenu->Append( item );


#endif /* !defined( __WXMAC__) */
#endif // !defined( __WXMAC__)



    /**
    // Edit menu
     * Edit menu
     */
    wxMenu* editMenu = new wxMenu;
    wxMenu* editMenu = new wxMenu;


    /* Undo */
    // Undo
    text = AddHotkeyName( _( "Undo" ), s_Schematic_Hokeys_Descr, HK_UNDO );
    text = AddHotkeyName( _( "Undo" ), s_Schematic_Hokeys_Descr, HK_UNDO );


    item = new wxMenuItem( editMenu, wxID_UNDO, text, HELP_UNDO, wxITEM_NORMAL );
    item = new wxMenuItem( editMenu, wxID_UNDO, text, HELP_UNDO, wxITEM_NORMAL );
@@ -166,10 +159,8 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
    item->SetBitmap( redo_xpm );
    item->SetBitmap( redo_xpm );
    editMenu->Append( item );
    editMenu->Append( item );


    /* Separator */
    editMenu->AppendSeparator();

    /* Delete */
    /* Delete */
    editMenu->AppendSeparator();
    item = new wxMenuItem( editMenu, ID_SCHEMATIC_DELETE_ITEM_BUTT,
    item = new wxMenuItem( editMenu, ID_SCHEMATIC_DELETE_ITEM_BUTT,
                           _( "Delete" ), HELP_DELETE_ITEMS, wxITEM_NORMAL );
                           _( "Delete" ), HELP_DELETE_ITEMS, wxITEM_NORMAL );
    item->SetBitmap( delete_body_xpm );
    item->SetBitmap( delete_body_xpm );
@@ -195,9 +186,7 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
    editMenu->Append( item );
    editMenu->Append( item );




    /**
    // View menu
     * View menu
     */
    wxMenu* viewMenu = new wxMenu;
    wxMenu* viewMenu = new wxMenu;


    /* Important Note for ZOOM IN and ZOOM OUT commands from menubar:
    /* Important Note for ZOOM IN and ZOOM OUT commands from menubar:
@@ -378,9 +367,7 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
    placeMenu->Append( item );
    placeMenu->Append( item );




    /**
    // Preferences Menu
     * Preferences Menu
     */
    wxMenu* configmenu = new wxMenu;
    wxMenu* configmenu = new wxMenu;


    /* Library */
    /* Library */
@@ -423,9 +410,7 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
    configmenu->Append( item );
    configmenu->Append( item );




    /**
    // Help Menu
     * Help Menu
     */
    wxMenu* helpMenu = new wxMenu;
    wxMenu* helpMenu = new wxMenu;


    AddHelpVersionInfoMenuEntry( helpMenu );
    AddHelpVersionInfoMenuEntry( helpMenu );
@@ -446,9 +431,7 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
#endif /* !defined(__WXMAC__) */
#endif /* !defined(__WXMAC__) */




    /**
    // Create the menubar and append all submenus
     * Create the menubar and append all submenus
     */
    menuBar->Append( filesMenu, _( "&File" ) );
    menuBar->Append( filesMenu, _( "&File" ) );
    menuBar->Append( editMenu, _( "&Edit" ) );
    menuBar->Append( editMenu, _( "&Edit" ) );
    menuBar->Append( viewMenu, _( "&View" ) );
    menuBar->Append( viewMenu, _( "&View" ) );
@@ -456,6 +439,11 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
    menuBar->Append( configmenu, _( "&Preferences" ) );
    menuBar->Append( configmenu, _( "&Preferences" ) );
    menuBar->Append( helpMenu, _( "&Help" ) );
    menuBar->Append( helpMenu, _( "&Help" ) );


    /* Associate the menu bar with the frame */
    menuBar->Thaw();

    // Associate the menu bar with the frame, if no previous menubar
    if( GetMenuBar() == NULL )
        SetMenuBar( menuBar );
        SetMenuBar( menuBar );
    else
        menuBar->Refresh();
}
}
Loading