Commit 84d82cf2 authored by charras's avatar charras
Browse files

pcbnew: Update Layer manager display when changing active layer (from hotkey or menus)

fixed minor problems and fixed Layer Alignment Target bug.
parent cd535636
Loading
Loading
Loading
Loading
+18 −0
Original line number Original line Diff line number Diff line
@@ -4,6 +4,24 @@ 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-Jan-23 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
++ Pcbnew:
    Update Layer manager display when changing active layer (from hotkey or menus)
    fixed minor problems and fixed Layer Alignment Target bug.

2010-Jan-22 UPDATE Wayne Stambaugh <stambaughw@verizon.net>
================================================================================
Minor fixes and code cleaning.

* Remove redundant background redrawing RedrawActiveWindow.
* Remove redundant managed cursor callback in RedrawActiveWindow.
* Use refresh to redraw instead of directly calling RedrawActiveWindow.
* Remove unused SetDrawBgColor for drawframe.cpp.
* Fix compiler warning in cvpcb/cvframe.cpp.
* Fix menu spelling and syntax errors in pcbnew.
* Rename Trace_Curseur to DrawCursor in common/drawpanel.cpp.

2010-Jan-21 UPDATE Dick Hollenbeck <dick@softplc.com>
2010-Jan-21 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
================================================================================
++pcbnew
++pcbnew
+2 −7
Original line number Original line Diff line number Diff line
@@ -20,13 +20,8 @@ option(wxUSE_UNICODE "enable/disable building unicode (default OFF)")
option(KICAD_GOST "enable/disable building using GOST notation for multiple gates per package (default OFF)")
option(KICAD_GOST "enable/disable building using GOST notation for multiple gates per package (default OFF)")




if(APPLE)
option(KICAD_AUIMANAGER "Enable use of wxAuiManager (default ON)" ON)
option(KICAD_AUIMANAGER "Enable use of wxAuiManager (default ON)" ON)
option(KICAD_AUITOOLBAR "Enable use of wxAuiToolBar (default ON)" ON)
option(KICAD_AUITOOLBAR "Enable use of wxAuiToolBar (default ON)" ON)
else(APPLE)
    option(KICAD_AUIMANAGER "Enable use of wxAuiManager (default OFF)" OFF)
    option(KICAD_AUITOOLBAR "Enable use of wxAuiToolBar (default OFF)" OFF)
endif(APPLE)




# Comment this out if you don't want to build with Python support.
# Comment this out if you don't want to build with Python support.
+0 −24
Original line number Original line Diff line number Diff line
@@ -22,17 +22,9 @@ Common
  Need to do this using DialogBlocks.
  Need to do this using DialogBlocks.
* Component and module search displays in which library the
* Component and module search displays in which library the
  module or component lives.
  module or component lives.
* Create a better and cleaner add component and footprint dialog.
* List auto up and down scrolling.
* List auto up and down scrolling.
* Toolbars and menus should be equal.
* (Main) dialog(s) title(s) should always be the same and not change over time
  when not needed. For example KiCad - <file loaded> or PCBNew - <file loaded>.
  We dont have to see which build in the titlebar. This makes documentation
  screenshots also easier. We already have the build information in the about
  dialog.
* Integer/long/double input boxes should handle comma and dot separated values,
* Integer/long/double input boxes should handle comma and dot separated values,
  not only comma.
  not only comma.
* Undo/Redo should have more steps (or could be setable).


CvPCB
CvPCB
-----
-----
@@ -41,9 +33,6 @@ CvPCB


EESchema
EESchema
--------
--------

*Improvements*
* Component add list browser with optional component preview.
* Use collector classes.
* Use collector classes.
* Drag and drop between two EESchema windows.
* Drag and drop between two EESchema windows.


@@ -70,37 +59,24 @@ from folks with less than that minimum.


PCBNew
PCBNew
------
------
*BUGS*
* Backspace hotkey for deleting track segment doesn't work.
* Delete hotkey for deleting a track doesn't work.
* Fix block copy/move preview to not view only a border, we should
* Fix block copy/move preview to not view only a border, we should
  see the moved/copied parts.
  see the moved/copied parts.


* Fix DIALOG_PAD_PROPERTIES_BASE class to use actual layer names in the BOARD.
* Fix DIALOG_PAD_PROPERTIES_BASE class to use actual layer names in the BOARD.


* Use BOARD_ITEM::MenuIcon() in the onrightclick.cpp
* Use BOARD_ITEM::MenuIcon() in the onrightclick.cpp
* Add unroute option in rightclick menu for components
* Document specctra round tripper, and fix the english translation of help.
* Document specctra round tripper, and fix the english translation of help.
* Expose layer name editing. Should dove tail with net class editor from
* Expose layer name editing. Should dove tail with net class editor from
  a UI perspective.
  a UI perspective.
* Add ARC support to gerber polygons.
* Add ARC support to gerber polygons.
* Need to add polygon aperture type.
* Need to add polygon aperture type.
  Then example 2 in RS274xrevd_e.pdf will draw properly.
  Then example 2 in RS274xrevd_e.pdf will draw properly.
* Look at mouse auto-scroll modes (bug?)
* Add the footprint name in the automatic placement file
* Footprint list should also have a footprint preview.




LAYER_WIDGET for PCBNEW
LAYER_WIDGET for PCBNEW
-----------------------
-----------------------
L1) Keyboard focus is getting stuck in layer widget and then hotkeys do not work.
    There is probably a solution to be found and it may involve asking on the
    wxWidgets mailing list.

L2) Hook in bool WinEDA_PcbFrame::LYRS::OnLayerSelect( int aLayer )
L2) Hook in bool WinEDA_PcbFrame::LYRS::OnLayerSelect( int aLayer )


L3) When a layer changes via a hotkey, then call WinEDA_PcbFrame->m_Layers->SelectLayer()

L4) Move popup menu code from class LAYER_WIDGET into WinEDA_PcbFrame::LYRS so as
L4) Move popup menu code from class LAYER_WIDGET into WinEDA_PcbFrame::LYRS so as
    to keep LAYER_WIDGET fully usage agnostic.  Remove #include "pcbstruct.h"      // IsValidCopperLayerIndex()
    to keep LAYER_WIDGET fully usage agnostic.  Remove #include "pcbstruct.h"      // IsValidCopperLayerIndex()
    from layer_widget.cpp.
    from layer_widget.cpp.
+38 −8
Original line number Original line Diff line number Diff line
@@ -29,6 +29,7 @@ public:
    ~WinEDA_SelColorFrame() {};
    ~WinEDA_SelColorFrame() {};


private:
private:
    void Init_Dialog( int aOldColor );
    void OnCancel( wxCommandEvent& event );
    void OnCancel( wxCommandEvent& event );
    void SelColor( wxCommandEvent& event );
    void SelColor( wxCommandEvent& event );


@@ -66,6 +67,42 @@ WinEDA_SelColorFrame::WinEDA_SelColorFrame( wxWindow* parent,
                                            int            OldColor ) :
                                            int            OldColor ) :
    wxDialog( parent, -1, _( "Colors" ), framepos, wxDefaultSize,
    wxDialog( parent, -1, _( "Colors" ), framepos, wxDefaultSize,
              wxDEFAULT_DIALOG_STYLE | MAYBE_RESIZE_BORDER )
              wxDEFAULT_DIALOG_STYLE | MAYBE_RESIZE_BORDER )
{

    Init_Dialog( OldColor );
    // Resize the dialog
    GetSizer()->SetSizeHints( this );

    // Ensure the whole frame is visible, whenever the asked position.
    // Give also a small margin.
    wxPoint endCornerPosition = GetPosition();
    int margin = 10;
    endCornerPosition.x += GetSize().x + margin;
    endCornerPosition.y += GetSize().y + margin;

    wxPoint windowPosition = GetPosition();
    wxRect freeScreenArea( wxGetClientDisplayRect( ) );
    if( freeScreenArea.GetRight() < endCornerPosition.x )
    {
        windowPosition.x += freeScreenArea.GetRight() - endCornerPosition.x;
        if( windowPosition.x < freeScreenArea.x )
            windowPosition.x = freeScreenArea.x;
        // Sligly modify the vertical position to avoid the mouse to be
        // exactly on the upper side of the window
        windowPosition.y +=5;
        endCornerPosition.y += 5;
    }
    if( freeScreenArea.GetBottom() < endCornerPosition.y )
    {
        windowPosition.y += freeScreenArea.GetBottom() - endCornerPosition.y;
        if( windowPosition.y < freeScreenArea.y )
            windowPosition.y = freeScreenArea.y;
    }

    SetPosition(windowPosition);
}

void WinEDA_SelColorFrame::Init_Dialog( int aOldColor )
{
{
    wxBoxSizer*             OuterBoxSizer = NULL;
    wxBoxSizer*             OuterBoxSizer = NULL;
    wxBoxSizer*             MainBoxSizer  = NULL;
    wxBoxSizer*             MainBoxSizer  = NULL;
@@ -135,7 +172,7 @@ WinEDA_SelColorFrame::WinEDA_SelColorFrame( wxWindow* parent,
        // Set focus to this button if its color matches the
        // Set focus to this button if its color matches the
        // color which had been selected previously (for
        // color which had been selected previously (for
        // whichever layer's color is currently being edited).
        // whichever layer's color is currently being edited).
        if( OldColor == buttcolor )
        if( aOldColor == buttcolor )
        {
        {
            ColorFound = true;
            ColorFound = true;
            BitmapButton->SetFocus();
            BitmapButton->SetFocus();
@@ -171,14 +208,7 @@ WinEDA_SelColorFrame::WinEDA_SelColorFrame( wxWindow* parent,
    // (That shouldn't ever happen in practice though.)
    // (That shouldn't ever happen in practice though.)
    if( !ColorFound )
    if( !ColorFound )
        Button->SetFocus();
        Button->SetFocus();

    // Resize the dialog
    if( GetSizer() )
    {
        GetSizer()->SetSizeHints( this );
}
}
}



void WinEDA_SelColorFrame::OnCancel( wxCommandEvent& WXUNUSED( event ) )
void WinEDA_SelColorFrame::OnCancel( wxCommandEvent& WXUNUSED( event ) )
{
{
+8 −0
Original line number Original line Diff line number Diff line
@@ -206,6 +206,14 @@ public:
     */
     */
    void             AuxiliaryToolBar_DesignRules_Update_UI();
    void             AuxiliaryToolBar_DesignRules_Update_UI();


    /** Function SynchronizeLayersManager( )
     * Must be called when info displayed in the layer manager Toolbar
     * as been changed in the main window ( by hotkey or a tool option.
     * Mainly when the active layer as changed.
     * @param aFlag = flag giving the type of data (layers, checkboxes...)
     */
    void             SynchronizeLayersManager( int aFlag );

    /* mouse functions events: */
    /* mouse functions events: */
    void             OnLeftClick( wxDC* DC, const wxPoint& MousePos );
    void             OnLeftClick( wxDC* DC, const wxPoint& MousePos );
    void             OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
    void             OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
Loading