Commit 4a8bf70d authored by dickelbeck's avatar dickelbeck

tweaks

parent 9fba83b5
...@@ -11,12 +11,12 @@ ...@@ -11,12 +11,12 @@
#define CONV_FROM_UTF8(utf8string) (utf8string) #define CONV_FROM_UTF8(utf8string) (utf8string)
#endif #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 #ifndef min
#define MIN(x, y) ((x) > (y) ? (y) : (x)) #define min(x, y) ((x) > (y) ? (y) : (x))
#endif #endif
#ifndef max #ifndef max
#define MAX(x, y) ((x) > (y) ? (x) : (y)) #define max(x, y) ((x) > (y) ? (x) : (y))
#endif #endif
*/ */
......
...@@ -325,11 +325,19 @@ public: ...@@ -325,11 +325,19 @@ public:
public: public:
PCB_SCREEN( int idscreen ); PCB_SCREEN( int idscreen );
~PCB_SCREEN(); ~PCB_SCREEN();
PCB_SCREEN* Next() { return (PCB_SCREEN*) Pnext; } PCB_SCREEN* Next() { return (PCB_SCREEN*) Pnext; }
void Init(); void Init();
void SetNextZoom(); void SetNextZoom();
void SetPreviousZoom(); void SetPreviousZoom();
void SetLastZoom(); 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(); }
}; };
/***************************/ /***************************/
......
...@@ -210,8 +210,8 @@ public: ...@@ -210,8 +210,8 @@ public:
BASE_SCREEN* m_CurrentScreen; // SCREEN en cours BASE_SCREEN* m_CurrentScreen; // SCREEN en cours
int m_CurrentCursorShape; // shape for cursor (0 = default cursor) int m_CurrentCursorShape; // shape for cursor (0 = default cursor)
int m_ID_current_state; // Id du bouton actif du tool bar vertical int m_ID_current_state; ///< Id of active button on the vertical toolbar
int m_HTOOL_current_state; // Id du bouton actif du tool bar horizontal int m_HTOOL_current_state; ///< Id of active button on horizontal toolbar
int m_InternalUnits; // nombre d'unites internes pour 1 pouce int m_InternalUnits; // nombre d'unites internes pour 1 pouce
// = 1000 pour schema, = 10000 pour PCB // = 1000 pour schema, = 10000 pour PCB
...@@ -394,6 +394,7 @@ public: ...@@ -394,6 +394,7 @@ public:
bool Clear_Pcb( wxDC* DC, bool query ); bool Clear_Pcb( wxDC* DC, bool query );
BOARD_ITEM* PcbGeneralLocateAndDisplay(); BOARD_ITEM* PcbGeneralLocateAndDisplay();
BOARD_ITEM* Locate( int typeloc, int LayerSearch ); BOARD_ITEM* Locate( int typeloc, int LayerSearch );
#if defined(DEBUG) #if defined(DEBUG)
/** /**
...@@ -562,7 +563,16 @@ public: ...@@ -562,7 +563,16 @@ public:
void PrepareLayerIndicator(); void PrepareLayerIndicator();
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 );
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 OnSelectOptionToolbar( wxCommandEvent& event );
void ToolOnRightClick( wxCommandEvent& event ); void ToolOnRightClick( wxCommandEvent& event );
......
...@@ -47,6 +47,19 @@ const KICAD_T GENERAL_COLLECTOR::AllBoardItems[] = { ...@@ -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 * Function Inspect
* is the examining function within the INSPECTOR which is passed to the * is the examining function within the INSPECTOR which is passed to the
...@@ -223,42 +236,8 @@ exit: ...@@ -223,42 +236,8 @@ 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 // 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 ) const COLLECTORS_GUIDE* aGuide )
{ {
Empty(); // empty the collection, primary criteria list Empty(); // empty the collection, primary criteria list
...@@ -269,9 +248,9 @@ void GENERAL_COLLECTOR::Collect( BOARD_ITEM* aItem, const wxPoint& refPos, ...@@ -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 // remember where the snapshot was taken from and pass refPos to
// the Inspect() function. // 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 aItem->Visit( this, // INSPECTOR* inspector
NULL, // const void* testData, not used here NULL, // const void* testData, not used here
m_ScanTypes); m_ScanTypes);
......
...@@ -192,6 +192,13 @@ public: ...@@ -192,6 +192,13 @@ public:
static const KICAD_T AllBoardItems[]; 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 * Constructor GENERALCOLLECTOR
*/ */
......
...@@ -351,6 +351,10 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -351,6 +351,10 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
DrawPanel->CursorOff( &dc ); DrawPanel->CursorOff( &dc );
DrawPanel->PrepareGraphicContext( &dc ); DrawPanel->PrepareGraphicContext( &dc );
#if defined(DEBUG)
std::cout << "GetString=" << event.GetString().mb_str() << '\n';
#endif
wxGetMousePosition( &pos.x, &pos.y ); wxGetMousePosition( &pos.x, &pos.y );
......
This diff is collapsed.
...@@ -18,7 +18,8 @@ ...@@ -18,7 +18,8 @@
BEGIN_EVENT_TABLE( WinEDA_PcbFrame, wxFrame ) BEGIN_EVENT_TABLE( WinEDA_PcbFrame, wxFrame )
COMMON_EVENTS_DRAWFRAME EVT_SOCKET( ID_EDA_SOCKET_EVENT_SERV, WinEDA_PcbFrame::OnSockRequestServer ) COMMON_EVENTS_DRAWFRAME
EVT_SOCKET( ID_EDA_SOCKET_EVENT_SERV, WinEDA_PcbFrame::OnSockRequestServer )
EVT_SOCKET( ID_EDA_SOCKET_EVENT, WinEDA_PcbFrame::OnSockRequest ) EVT_SOCKET( ID_EDA_SOCKET_EVENT, WinEDA_PcbFrame::OnSockRequest )
EVT_KICAD_CHOICEBOX( ID_ON_ZOOM_SELECT, WinEDA_PcbFrame::OnSelectZoom ) EVT_KICAD_CHOICEBOX( ID_ON_ZOOM_SELECT, WinEDA_PcbFrame::OnSelectZoom )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment