Minor code cleaning: Remove unused file, remove obsolete or useless defines

This commit is contained in:
jean-pierre charras 2013-11-15 10:28:31 +01:00
parent 568a43b917
commit 9f9f2ed380
12 changed files with 36 additions and 1639 deletions

View File

@ -30,6 +30,7 @@
*/ */
#include <fctsys.h> #include <fctsys.h>
#include <macros.h>
#include <common.h> #include <common.h>
#include <base_struct.h> #include <base_struct.h>
#include <class_base_screen.h> #include <class_base_screen.h>

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,6 @@
*/ */
#include <fctsys.h> #include <fctsys.h>
#include <gr_basic.h>
#include <common.h> #include <common.h>
#include <colors.h> #include <colors.h>
@ -64,7 +63,7 @@ WinEDA_SelColorFrame::WinEDA_SelColorFrame( wxWindow* parent,
const wxPoint& framepos, const wxPoint& framepos,
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 | wxRESIZE_BORDER )
{ {
Init_Dialog( OldColor ); Init_Dialog( OldColor );

View File

@ -61,7 +61,7 @@ private:
const wxString& aCaption = _( "EESchema Colors" ), const wxString& aCaption = _( "EESchema Colors" ),
const wxPoint& aPosition = wxDefaultPosition, const wxPoint& aPosition = wxDefaultPosition,
const wxSize& aSize = wxDefaultSize, const wxSize& aSize = wxDefaultSize,
long aStyle = wxDEFAULT_DIALOG_STYLE | MAYBE_RESIZE_BORDER ); long aStyle = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER );
// Initializes member variables // Initializes member variables
void Init(); void Init();

View File

@ -138,7 +138,8 @@ void SCH_EDIT_FRAME::InstallHierarchyFrame( wxDC* DC, wxPoint& pos )
HIERARCHY_NAVIG_DLG::HIERARCHY_NAVIG_DLG( SCH_EDIT_FRAME* parent, wxDC* DC, const wxPoint& pos ) : HIERARCHY_NAVIG_DLG::HIERARCHY_NAVIG_DLG( SCH_EDIT_FRAME* parent, wxDC* DC, const wxPoint& pos ) :
wxDialog( parent, -1, _( "Navigator" ), pos, wxSize( 110, 50 ), DIALOG_STYLE ) wxDialog( parent, -1, _( "Navigator" ), pos, wxSize( 110, 50 ),
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER )
{ {
wxTreeItemId cellule; wxTreeItemId cellule;

View File

@ -86,7 +86,7 @@ SELECT_LAYER_DIALOG::SELECT_LAYER_DIALOG( GERBVIEW_FRAME* parent,
bool aShowDeselectOption ) : bool aShowDeselectOption ) :
wxDialog( parent, -1, _( "Select Layer:" ), wxPoint( -1, -1 ), wxDialog( parent, -1, _( "Select Layer:" ), wxPoint( -1, -1 ),
wxSize( 470, 250 ), wxSize( 470, 250 ),
DIALOG_STYLE ) wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER )
{ {
wxButton* Button; wxButton* Button;
LAYER_NUM ii; LAYER_NUM ii;

View File

@ -26,32 +26,6 @@
#define DBG(x) // nothing #define DBG(x) // nothing
#endif #endif
/**
* Function Clamp
* limits @a value within the range @a lower <= @a value <= @a upper. It will work
* on temporary expressions, since they are evaluated only once, and it should work
* on most if not all numeric types, string types, or any type for which "operator < ()"
* is present. The arguments are accepted in this order so you can remember the
* expression as a memory aid:
* <p>
* result is: lower <= value <= upper
*/
template <typename T> inline const T& Clamp( const T& lower, const T& value, const T& upper )
{
wxASSERT( lower <= upper );
if( value < lower )
return lower;
else if( upper < value )
return upper;
return value;
}
#define USE_RESIZE_BORDER
#if defined(__UNIX__) || defined(USE_RESIZE_BORDER)
#define MAYBE_RESIZE_BORDER wxRESIZE_BORDER // Linux users like resizeable borders
#else
#define MAYBE_RESIZE_BORDER 0 // no resizeable border
#endif
// wxNullPtr is not defined prior to wxWidgets 2.9.0. // wxNullPtr is not defined prior to wxWidgets 2.9.0.
#if !wxCHECK_VERSION( 2, 9, 0 ) #if !wxCHECK_VERSION( 2, 9, 0 )

View File

@ -77,4 +77,25 @@ template <class T, class T2> inline void EXCHG( T& a, T2& b )
b = temp; b = temp;
} }
/**
* Function Clamp
* limits @a value within the range @a lower <= @a value <= @a upper. It will work
* on temporary expressions, since they are evaluated only once, and it should work
* on most if not all numeric types, string types, or any type for which "operator < ()"
* is present. The arguments are accepted in this order so you can remember the
* expression as a memory aid:
* <p>
* result is: lower <= value <= upper
*/
template <typename T> inline const T& Clamp( const T& lower, const T& value, const T& upper )
{
wxASSERT( lower <= upper );
if( value < lower )
return lower;
else if( upper < value )
return upper;
return value;
}
#endif /* ifdef MACRO_H */ #endif /* ifdef MACRO_H */

View File

@ -51,9 +51,7 @@
#include <wx/overlay.h> #include <wx/overlay.h>
#endif #endif
// Option for dialog boxes // Option for main frames
#define DIALOG_STYLE wxDEFAULT_DIALOG_STYLE | wxFRAME_FLOAT_ON_PARENT | MAYBE_RESIZE_BORDER
#define KICAD_DEFAULT_DRAWFRAME_STYLE wxDEFAULT_FRAME_STYLE | wxWANTS_CHARS #define KICAD_DEFAULT_DRAWFRAME_STYLE wxDEFAULT_FRAME_STYLE | wxWANTS_CHARS
@ -973,15 +971,15 @@ public:
/** /**
* Function UseGalCanvas * Function UseGalCanvas
* used to switch between standard and GAL-based canvas. * used to switch between standard and GAL-based canvas.
* *
* @param aEnable True for GAL-based canvas, false for standard canvas. * @param aEnable True for GAL-based canvas, false for standard canvas.
*/ */
virtual void UseGalCanvas( bool aEnable ); virtual void UseGalCanvas( bool aEnable );
/** /**
* Function IsNewCanvasActive * Function IsNewCanvasActive
* is used to check which canvas (GAL-based or standard) is currently in use. * is used to check which canvas (GAL-based or standard) is currently in use.
* *
* @return True for GAL-based canvas, false for standard canvas. * @return True for GAL-based canvas, false for standard canvas.
*/ */
bool IsGalCanvasActive() { return m_galCanvasActive; } bool IsGalCanvasActive() { return m_galCanvasActive; }

View File

@ -65,6 +65,7 @@ Load() TODO's
#include <macros.h> #include <macros.h>
#include <fctsys.h> #include <fctsys.h>
#include <trigo.h> #include <trigo.h>
#include <macros.h>
#include <wx/filename.h> #include <wx/filename.h>
#include <class_board.h> #include <class_board.h>

View File

@ -791,7 +791,8 @@ END_EVENT_TABLE()
WinEDA_SetParamShapeFrame::WinEDA_SetParamShapeFrame( PCB_EDIT_FRAME* parent, WinEDA_SetParamShapeFrame::WinEDA_SetParamShapeFrame( PCB_EDIT_FRAME* parent,
const wxPoint& framepos ) : const wxPoint& framepos ) :
wxDialog( parent, -1, _( "Complex shape" ), framepos, wxSize( 350, 280 ), DIALOG_STYLE ) wxDialog( parent, -1, _( "Complex shape" ), framepos, wxSize( 350, 280 ),
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER )
{ {
m_Parent = parent; m_Parent = parent;

View File

@ -68,7 +68,7 @@ END_EVENT_TABLE()
SWAP_LAYERS_DIALOG::SWAP_LAYERS_DIALOG( PCB_BASE_FRAME* parent ) : SWAP_LAYERS_DIALOG::SWAP_LAYERS_DIALOG( PCB_BASE_FRAME* parent ) :
DIALOG_SHIM( parent, -1, _( "Swap Layers:" ), wxPoint( -1, -1 ), DIALOG_SHIM( parent, -1, _( "Swap Layers:" ), wxPoint( -1, -1 ),
wxDefaultSize, wxDEFAULT_DIALOG_STYLE | MAYBE_RESIZE_BORDER ) wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER )
{ {
BOARD* board = parent->GetBoard(); BOARD* board = parent->GetBoard();