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

Minor fixes. Board and footprint editors: Auto update 3D display after...

Minor fixes. Board and footprint editors: Auto update 3D display after footprint or board edition. Convert gendrill dialog from DialogBlocks to wxFormBuilder
parents facbe280 bbb126db
Loading
Loading
Loading
Loading
+6 −4
Original line number Original line Diff line number Diff line
@@ -57,6 +57,7 @@ WinEDA3D_DrawFrame::WinEDA3D_DrawFrame( WinEDA_BasePcbFrame* parent,
    m_HToolBar      = NULL;
    m_HToolBar      = NULL;
    m_VToolBar      = NULL;
    m_VToolBar      = NULL;
    m_InternalUnits = 10000;    // Internal units = 1/10000 inch
    m_InternalUnits = 10000;    // Internal units = 1/10000 inch
    m_reloadRequest = false;


    // Give it an icon
    // Give it an icon
    SetIcon( wxICON( icon_w3d ) );
    SetIcon( wxICON( icon_w3d ) );
@@ -343,6 +344,8 @@ error: unknown command" ) );


void WinEDA3D_DrawFrame::NewDisplay()
void WinEDA3D_DrawFrame::NewDisplay()
{
{
    m_reloadRequest = false;

    m_Canvas->ClearLists();
    m_Canvas->ClearLists();
    m_Canvas->CreateDrawGL_List();
    m_Canvas->CreateDrawGL_List();


@@ -356,10 +359,9 @@ void WinEDA3D_DrawFrame::OnActivate( wxActivateEvent& event )
{
{
    // Reload data if 3D frame shows a footprint,
    // Reload data if 3D frame shows a footprint,
    // because it can be changed since last frame activation
    // because it can be changed since last frame activation
    if( m_Parent->m_Ident == MODULE_EDITOR_FRAME )
    if( m_reloadRequest )
    {
        NewDisplay();
//        NewDisplay();

    }
    event.Skip();   // required under wxMAC
    event.Skip();   // required under wxMAC
}
}


+17 −6
Original line number Original line Diff line number Diff line
@@ -185,23 +185,25 @@ class WinEDA3D_DrawFrame : public wxFrame
{
{
public:
public:
    WinEDA_BasePcbFrame* m_Parent;
    WinEDA_BasePcbFrame* m_Parent;
private:
    wxString m_FrameName;       // name used for writing and reading setup
                                // It is "Frame3D"
    Pcb3D_GLCanvas*      m_Canvas;
    Pcb3D_GLCanvas*      m_Canvas;
    WinEDA_Toolbar*      m_HToolBar;
    WinEDA_Toolbar*      m_HToolBar;
    WinEDA_Toolbar*      m_VToolBar;
    WinEDA_Toolbar*      m_VToolBar;
    int          m_InternalUnits;
    int          m_InternalUnits;
    wxPoint      m_FramePos;
    wxPoint      m_FramePos;
    wxSize       m_FrameSize;
    wxSize       m_FrameSize;

    wxAuiManager m_auimgr;
    wxAuiManager m_auimgr;
    ~WinEDA3D_DrawFrame() { m_auimgr.UnInit(); };
    bool         m_reloadRequest;

private:
    wxString m_FrameName;       // name used for writing and reading setup
                                // It is "Frame3D"


public:
public:
    WinEDA3D_DrawFrame( WinEDA_BasePcbFrame* parent, const wxString& title,
    WinEDA3D_DrawFrame( WinEDA_BasePcbFrame* parent, const wxString& title,
                        long style = KICAD_DEFAULT_3D_DRAWFRAME_STYLE );
                        long style = KICAD_DEFAULT_3D_DRAWFRAME_STYLE );
    ~WinEDA3D_DrawFrame()
    {
        m_auimgr.UnInit();
    };


    void Exit3DFrame( wxCommandEvent& event );
    void Exit3DFrame( wxCommandEvent& event );
    void OnCloseWindow( wxCloseEvent& Event );
    void OnCloseWindow( wxCloseEvent& Event );
@@ -211,6 +213,15 @@ public:
    void SetToolbars();
    void SetToolbars();
    void GetSettings();
    void GetSettings();
    void SaveSettings();
    void SaveSettings();
    /** function ReloadRequest
     * must be called when reloading data from Pcbnew is needed
     * mainly after edition of the board or footprint beeing displayed.
     * mainly for the mudule editor.
     */
    void ReloadRequest( )
    {
        m_reloadRequest = true;
    }


    void OnLeftClick( wxDC* DC, const wxPoint& MousePos );
    void OnLeftClick( wxDC* DC, const wxPoint& MousePos );
    void OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
    void OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
+8 −0
Original line number Original line Diff line number Diff line
@@ -4,6 +4,14 @@ KiCad ChangeLog 2010
Please add newer entries at the top, list the date and your name with
Please add newer entries at the top, list the date and your name with
email address.
email address.


2010-may-01, UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
++Pcbnew:
    Board and footprint editors:
    Auto update 3D display after footprint or board edition.
    (board or footprint is reloaded only when the 3D frame is reactivated, so
    no extra time is needed during edition)

2010-apr-29, UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
2010-apr-29, UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
================================================================================
++Pcbnew:
++Pcbnew:
+3 −1
Original line number Original line Diff line number Diff line
@@ -218,9 +218,11 @@ public:


    /** Function OnModify()
    /** Function OnModify()
     * Virtual
     * Virtual
     * Must be called after a schematic change
     * Must be called after a change
     * in order to set the "modify" flag of the current screen
     * in order to set the "modify" flag of the current screen
     * and update the date in frame reference
     * and update the date in frame reference
     * do not forget to call this basic OnModify function to update info
     * in derived OnModify functions
     */
     */
    virtual void OnModify( );
    virtual void OnModify( );


+16 −0
Original line number Original line Diff line number Diff line
@@ -274,6 +274,14 @@ public:
    void             ReCreateMenuBar();
    void             ReCreateMenuBar();
    WinEDAChoiceBox* ReCreateLayerBox( WinEDA_Toolbar* parent );
    WinEDAChoiceBox* ReCreateLayerBox( WinEDA_Toolbar* parent );


    /** Virtual Function OnModify()
     * Must be called after a board change
     * in order to set the "modify" flag of the current screen
     * and prepare, if needed the refresh of the 3D frame showing the footprint
     * do not forget to call the basic OnModify function to update auxiliary info
     */
    virtual void OnModify( );

    /**
    /**
     * Function IsElementVisible
     * Function IsElementVisible
     * tests whether a given element category is visible. Keep this as an
     * tests whether a given element category is visible. Keep this as an
@@ -1069,6 +1077,14 @@ public:
    void         GeneralControle( wxDC* DC, wxPoint Mouse );
    void         GeneralControle( wxDC* DC, wxPoint Mouse );
    void         LoadModuleFromBoard( wxCommandEvent& event );
    void         LoadModuleFromBoard( wxCommandEvent& event );


    /** Virtual Function OnModify()
     * Must be called after a footprint change
     * in order to set the "modify" flag of the current screen
     * and prepare, if needed the refresh of the 3D frame showing the footprint
     * do not forget to call the basic OnModify function to update auxiliary info
     */
    virtual void OnModify( );

    /** function ToPrinter
    /** function ToPrinter
     * Install the print dialog
     * Install the print dialog
     */
     */
Loading