Commit 4b61440e authored by charras's avatar charras
Browse files

fix some problems (not all) when using wxAUI.

others minor bugs fix.
parent 277b843a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -398,9 +398,9 @@ void WinEDA_DrawFrame::OnSize( wxSizeEvent& SizeEv )

    GetClientSize( &size.x, &size.y );
    m_FrameSize = size;
    size.y -= m_MsgFrameHeight;

#if !defined(KICAD_AUIMANAGER)
    size.y -= m_MsgFrameHeight;
    if( MsgPanel ) // Positionnement en bas d'ecran
    {
        MsgPanel->SetSize( 0, size.y, size.x, m_MsgFrameHeight );
+23 −13
Original line number Diff line number Diff line
@@ -136,6 +136,12 @@ WinEDA_CvpcbFrame::WinEDA_CvpcbFrame( const wxString& title,
    if( m_FrameSize.y < FRAME_MIN_SIZE_Y )
        m_FrameSize.y = FRAME_MIN_SIZE_Y;

    // Set minimal frame width and height
    SetSizeHints( FRAME_MIN_SIZE_X, FRAME_MIN_SIZE_Y, -1, -1, -1, -1 );

    // Framesize and position
    SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );

    // create the status bar
    static const int dims[3] = { -1, -1, 250 };

@@ -149,6 +155,7 @@ WinEDA_CvpcbFrame::WinEDA_CvpcbFrame( const wxString& title,
    BuildCmpListBox();
    BuildFOOTPRINTS_LISTBOX();

#if !defined(KICAD_AUIMANAGER)
    /* Create size constraints of the component list window display. */
    wxLayoutConstraints* linkpos = new wxLayoutConstraints;
    linkpos->top.SameAs( this, wxTop );
@@ -166,12 +173,7 @@ WinEDA_CvpcbFrame::WinEDA_CvpcbFrame( const wxString& title,
    linkpos->left.SameAs( m_ListCmp, wxRight );
    if( m_FootprintList )
        m_FootprintList->SetConstraints( linkpos );

    // Set minimal frame width and height
    SetSizeHints( FRAME_MIN_SIZE_X, FRAME_MIN_SIZE_Y, -1, -1, -1, -1 );

    // Framesize and position
    SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
#endif

#if defined(KICAD_AUIMANAGER)
    m_auimgr.SetManagedWindow( this );
@@ -184,20 +186,17 @@ WinEDA_CvpcbFrame::WinEDA_CvpcbFrame( const wxString& title,
    horiz.CloseButton( false );
    horiz.CaptionVisible( false );

    wxAuiPaneInfo vert( horiz );

    vert.TopDockable( false ).BottomDockable( false );
    horiz.LeftDockable( false ).RightDockable( false );

    m_auimgr.AddPane( m_HToolBar,
                      wxAuiPaneInfo( horiz ).Name( wxT( "m_HToolBar" ) ).Top() );

    m_auimgr.AddPane( m_ListCmp,
                      wxAuiPaneInfo(horiz).Name( wxT( "m_ListCmp" ) ).CentrePane() );

    m_auimgr.AddPane( m_FootprintList,
                      wxAuiPaneInfo( horiz ).Name( wxT( "m_FootprintList" ) ).
                      Left().BestSize( m_FrameSize.x * 0.3, m_FrameSize.y * 0.9 ) );

    m_auimgr.AddPane( m_ListCmp,
                      wxAuiPaneInfo().Name( wxT( "m_ListCmp" ) ).CentrePane() );
                      Right().BestSize( m_FrameSize.x * 0.36, m_FrameSize.y ) );

    m_auimgr.Update();
#endif
@@ -588,6 +587,17 @@ void WinEDA_CvpcbFrame::OnSelectComponent( wxListEvent& event )
 */
void WinEDA_CvpcbFrame::OnSelectFilteringFootprint( wxCommandEvent& event )
{
    switch (event.GetId() )
    {
        case ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST:
            m_HToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST, false );
            break;
        case ID_CVPCB_FOOTPRINT_DISPLAY_FULL_LIST:
            m_HToolBar->ToggleTool( ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST, false );
            break;
        default:
        break;
    }
    wxListEvent l_event;

    OnSelectComponent( l_event );
+38 −3
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@

BEGIN_EVENT_TABLE( WinEDA_DisplayFrame, WinEDA_BasePcbFrame )
    EVT_CLOSE( WinEDA_DisplayFrame::OnCloseWindow )
    EVT_SIZE( WinEDA_DrawFrame::OnSize )
    EVT_SIZE( WinEDA_DisplayFrame::OnSize )
    EVT_TOOL_RANGE( ID_ZOOM_IN, ID_ZOOM_PAGE, WinEDA_DisplayFrame::OnZoom )
    EVT_TOOL( ID_OPTIONS_SETUP, WinEDA_DisplayFrame::InstallOptionsDisplay )
    EVT_TOOL( ID_CVPCB_SHOW3D_FRAME, WinEDA_DisplayFrame::Show3D_Frame )
@@ -59,8 +59,9 @@ WinEDA_DisplayFrame::WinEDA_DisplayFrame( WinEDA_CvpcbFrame* father,
    LoadSettings();
    // Internalize grid id to a default value if not found in config or bad:
    if( (m_LastGridSizeId <= 0) ||
        (m_LastGridSizeId < (ID_POPUP_GRID_USER - ID_POPUP_GRID_LEVEL_1000)) )
        (m_LastGridSizeId > (ID_POPUP_GRID_USER - ID_POPUP_GRID_LEVEL_1000)) )
        m_LastGridSizeId = ID_POPUP_GRID_LEVEL_500 - ID_POPUP_GRID_LEVEL_1000;
    GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId );

    // Initialize some display options
    DisplayOpt.DisplayPadIsol = false;      // Pad clearance has no meaning here
@@ -71,6 +72,39 @@ WinEDA_DisplayFrame::WinEDA_DisplayFrame( WinEDA_CvpcbFrame* father,
    SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
    ReCreateHToolbar();
    ReCreateVToolbar();

#if defined(KICAD_AUIMANAGER)
    m_auimgr.SetManagedWindow( this );

    wxAuiPaneInfo horiz;
    horiz.Gripper( false );
    horiz.DockFixed( true );
    horiz.Movable( false );
    horiz.Floatable( false );
    horiz.CloseButton( false );
    horiz.CaptionVisible( false );

    wxAuiPaneInfo vert( horiz );

    vert.TopDockable( false ).BottomDockable( false );
    horiz.LeftDockable( false ).RightDockable( false );

    m_auimgr.AddPane( m_HToolBar,
                      wxAuiPaneInfo( horiz ).Name( wxT( "m_HToolBar" ) ).Top().
                     Row( 0 ) );

    if( m_VToolBar )    // Currently, no vertical right toolbar.
        m_auimgr.AddPane( m_VToolBar,
                      wxAuiPaneInfo( vert ).Name( wxT( "m_VToolBar" ) ).Right() );

    m_auimgr.AddPane( DrawPanel,
                      wxAuiPaneInfo().Name( wxT( "DrawFrame" ) ).CentrePane() );

    m_auimgr.AddPane( MsgPanel,
                      wxAuiPaneInfo( horiz ).Name( wxT( "MsgPanel" ) ).Bottom() );

    m_auimgr.Update();
#endif
    Show( TRUE );
}

@@ -85,7 +119,6 @@ WinEDA_DisplayFrame::~WinEDA_DisplayFrame()
    ( (WinEDA_CvpcbFrame*) wxGetApp().GetTopWindow() )->DrawFrame = NULL;
}


/* Called when the frame is closed
 *  Save current settings (frame position and size
 */
@@ -104,6 +137,8 @@ void WinEDA_DisplayFrame::OnCloseWindow( wxCloseEvent& event )

void WinEDA_DisplayFrame::ReCreateVToolbar()
{
    // Currently, no vertical right toolbar.
    // So do nothing
}


+10 −8
Original line number Diff line number Diff line
@@ -381,19 +381,21 @@ void WinEDA_BasePcbFrame::LoadSettings()
    wxConfig* cfg = wxGetApp().m_EDA_Config;

    WinEDA_DrawFrame::LoadSettings();
    // Ensure grid id is an existant grid id:
    if( (m_LastGridSizeId <= 0) ||
        (m_LastGridSizeId > (ID_POPUP_GRID_USER - ID_POPUP_GRID_LEVEL_1000)) )
        m_LastGridSizeId = ID_POPUP_GRID_LEVEL_500 - ID_POPUP_GRID_LEVEL_1000;

    cfg->Read( m_FrameName + UserGridSizeXEntry, &m_UserGridSize.x, 0.01 );
    cfg->Read( m_FrameName + UserGridSizeYEntry, &m_UserGridSize.y, 0.01 );
    cfg->Read( m_FrameName + UserGridUnitsEntry, &m_UserGridUnits,
               ( long )INCHES );
    cfg->Read( m_FrameName + UserGridUnitsEntry, &m_UserGridUnits, ( long )INCHES );
    cfg->Read( m_FrameName + DisplayPadFillEntry, &m_DisplayPadFill, true );
    cfg->Read( m_FrameName + DisplayViaFillEntry, &m_DisplayViaFill, true );  //TODO: Will adding this line break tha pcbnew file compatibility?
    cfg->Read( m_FrameName + DisplayViaFillEntry, &m_DisplayViaFill, true );
    cfg->Read( m_FrameName + DisplayPadNumberEntry, &m_DisplayPadNum, true );
    cfg->Read( m_FrameName + DisplayModuleEdgeEntry, &m_DisplayModEdge,
               ( long )FILLED );
    cfg->Read( m_FrameName + DisplayModuleEdgeEntry, &m_DisplayModEdge, ( long )FILLED );
    if( m_DisplayModEdge < FILAIRE || m_DisplayModEdge > SKETCH )
        m_DisplayModEdge = FILLED;
    cfg->Read( m_FrameName + DisplayModuleTextEntry, &m_DisplayModText,
               ( long )FILLED );
    cfg->Read( m_FrameName + DisplayModuleTextEntry, &m_DisplayModText, ( long )FILLED );
    if( m_DisplayModText < FILAIRE || m_DisplayModText > SKETCH )
        m_DisplayModText = FILLED;
}
@@ -416,7 +418,7 @@ void WinEDA_BasePcbFrame::SaveSettings()
    cfg->Write( m_FrameName + UserGridSizeYEntry, m_UserGridSize.y );
    cfg->Write( m_FrameName + UserGridUnitsEntry, ( long )m_UserGridUnits );
    cfg->Write( m_FrameName + DisplayPadFillEntry, m_DisplayPadFill );
    cfg->Write( m_FrameName + DisplayViaFillEntry, m_DisplayViaFill );  //TODO: Will adding this line break tha pcbnew file compatibility?
    cfg->Write( m_FrameName + DisplayViaFillEntry, m_DisplayViaFill );
    cfg->Write( m_FrameName + DisplayPadNumberEntry, m_DisplayPadNum );
    cfg->Write( m_FrameName + DisplayModuleEdgeEntry, ( long )m_DisplayModEdge );
    cfg->Write( m_FrameName + DisplayModuleTextEntry, ( long )m_DisplayModText );
+1 −8
Original line number Diff line number Diff line
@@ -175,10 +175,6 @@ WinEDA_ModuleEditFrame::WinEDA_ModuleEditFrame( wxWindow* father,
    ActiveScreen = GetScreen();
    GetScreen()->SetCurItem( NULL );
    LoadSettings();
    // Initilialize grid id to a default value if not found in config or bad:
    if( (m_LastGridSizeId <= 0) ||
        (m_LastGridSizeId < (ID_POPUP_GRID_USER - ID_POPUP_GRID_LEVEL_1000)) )
        m_LastGridSizeId = ID_POPUP_GRID_LEVEL_500 - ID_POPUP_GRID_LEVEL_1000;

    GetScreen()->AddGrid( m_UserGridSize, m_UserGridUnits, ID_POPUP_GRID_USER );
    GetScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId  );
@@ -400,10 +396,7 @@ void WinEDA_ModuleEditFrame::SetToolbars()
        }

        if( m_SelGridBox )
        {
            m_SelGridBox->SetSelection( ID_POPUP_GRID_LEVEL_1000 +
                                        m_LastGridSizeId );
        }
            m_SelGridBox->SetSelection( m_LastGridSizeId );
    }

    DisplayUnitsMsg();
Loading