Commit 4a8bf70d authored by dickelbeck's avatar dickelbeck
Browse files

tweaks

parent 9fba83b5
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -11,12 +11,12 @@
#define CONV_FROM_UTF8(utf8string) (utf8string)
#endif

/* violation of C++ standard, cannot use MIN() and MAX()
/* violation of C++ standard, cannot use min() and max(), i.e. in lowercase
#ifndef min
#define MIN(x, y)		((x) > (y) ? (y) : (x))
#define min(x, y)		((x) > (y) ? (y) : (x))
#endif
#ifndef max
#define MAX(x, y)		((x) > (y) ? (x) : (y))
#define max(x, y)		((x) > (y) ? (x) : (y))
#endif
*/

+12 −4
Original line number Diff line number Diff line
@@ -325,11 +325,19 @@ public:
public:
    PCB_SCREEN( int idscreen );
    ~PCB_SCREEN();
    
    PCB_SCREEN* Next() { return (PCB_SCREEN*) Pnext; }
    void        Init();
    void        SetNextZoom();
    void        SetPreviousZoom();
    void        SetLastZoom();
    
    /**
     * Function GetCurItem
     * returns the currently selected BOARD_ITEM, overriding BASE_SCREEN::GetCurItem().
     * @return BOARD_ITEM* - the one selected, or NULL.
     */
    BOARD_ITEM* GetCurItem() const {  return (BOARD_ITEM*) BASE_SCREEN::GetCurItem(); }
};

/***************************/
+13 −3
Original line number Diff line number Diff line
@@ -210,8 +210,8 @@ public:
    BASE_SCREEN*      m_CurrentScreen;      // SCREEN en cours

    int     m_CurrentCursorShape;           // shape for cursor (0 = default cursor)
    int     m_ID_current_state;             // Id du bouton actif du tool bar vertical
    int     m_HTOOL_current_state;          // Id du bouton actif du tool bar horizontal
    int     m_ID_current_state;             ///< Id of active button on the vertical toolbar
    int     m_HTOOL_current_state;          ///< Id of active button on horizontal toolbar

    int     m_InternalUnits;                // nombre d'unites internes pour 1 pouce
                                            // = 1000 pour schema, = 10000 pour PCB
@@ -395,6 +395,7 @@ public:
    BOARD_ITEM*     PcbGeneralLocateAndDisplay();
    BOARD_ITEM*     Locate( int typeloc, int LayerSearch );
    

#if defined(DEBUG)
    /**
     * Function GetCollectorsGuide
@@ -562,7 +563,16 @@ public:
    void                PrepareLayerIndicator();
    void                OnLeftClick( wxDC* DC, const wxPoint& MousePos );
    void                OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
    void                OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
    
    /**
     * Function OnRightClick
     * populates a popup menu with the choices appropriate for the current context.
     * The caller will add the ZOOM menu choices afterwards.
     * @param aMousePos The current mouse position
     * @param aPopMenu The menu to add to.
     */
    void                OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu );
    
    void                OnSelectOptionToolbar( wxCommandEvent& event );
    void                ToolOnRightClick( wxCommandEvent& event );

+16 −37
Original line number Diff line number Diff line
@@ -47,6 +47,19 @@ const KICAD_T GENERAL_COLLECTOR::AllBoardItems[] = {
};    


const KICAD_T GENERAL_COLLECTOR::PrimaryItems[] = {
    TYPETEXTE, 
    TYPEDRAWSEGMENT, 
    TYPECOTATION,
    TYPEVIA,
    TYPETRACK,
//    TYPEPAD,              TYPEPAD and TYPETEXTEMODULE are handled in a subsearch
//    TYPETEXTEMODULE,
    TYPEMODULE,
    EOT
};


/**
 * Function Inspect
 * is the examining function within the INSPECTOR which is passed to the 
@@ -224,41 +237,7 @@ exit:


// see collectors.h 
/*
void GENERAL_COLLECTOR::Collect( BOARD* board, const wxPoint& refPos, 
                          int aPreferredLayer, int aLayerMask )
{
    Empty();        // empty the collection, primary criteria list
    Empty2nd();     // empty the collection, secondary criteria list
    
    SetPreferredLayer( aPreferredLayer );
    SetLayerMask( aLayerMask );
    
    //  remember refPos, pass to Inspect()
    SetRefPos( refPos );

#if defined(DEBUG)
    std::cout << '\n';
#endif
    
    // visit the board with the INSPECTOR (me).
    board->Visit(   this,       // INSPECTOR* inspector
                    NULL,       // const void* testData, not used here 
                    m_ScanTypes);
    
    SetTimeNow();               // when snapshot was taken
    
    // append 2nd list onto end of the first "list" 
    for( unsigned i=0;  i<list2nd.size();  ++i )
        Append( list2nd[i] );
    
    Empty2nd();
}
*/


// see collectors.h 
void GENERAL_COLLECTOR::Collect( BOARD_ITEM* aItem, const wxPoint& refPos, 
void GENERAL_COLLECTOR::Collect( BOARD_ITEM* aItem, const wxPoint& aRefPos, 
                            const COLLECTORS_GUIDE* aGuide )
{
    Empty();        // empty the collection, primary criteria list
@@ -269,9 +248,9 @@ void GENERAL_COLLECTOR::Collect( BOARD_ITEM* aItem, const wxPoint& refPos,
    
    // remember where the snapshot was taken from and pass refPos to
    // the Inspect() function.
    SetRefPos( refPos );
    SetRefPos( aRefPos );

    // visit the board with the INSPECTOR (me).
    // visit the board or module with the INSPECTOR (me).
    aItem->Visit(   this,       // INSPECTOR* inspector
                    NULL,       // const void* testData, not used here 
                    m_ScanTypes);
+7 −0
Original line number Diff line number Diff line
@@ -192,6 +192,13 @@ public:
    static const KICAD_T AllBoardItems[];


    /** 
     * A scan list for all primary board items, omitting items which are subsidiary to
     * a MODULE, such as D_PAD and TEXTEMODULE.
     */
    static const KICAD_T PrimaryItems[];
    
    
    /**
     * Constructor GENERALCOLLECTOR
     */ 
Loading