Commit 9f9f2ed3 authored by jean-pierre charras's avatar jean-pierre charras

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

parent 568a43b9
...@@ -30,6 +30,7 @@ ...@@ -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>
......
This diff is collapsed.
...@@ -6,7 +6,6 @@ ...@@ -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, ...@@ -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 );
......
...@@ -61,7 +61,7 @@ private: ...@@ -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();
......
...@@ -138,7 +138,8 @@ void SCH_EDIT_FRAME::InstallHierarchyFrame( wxDC* DC, wxPoint& pos ) ...@@ -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;
......
...@@ -86,7 +86,7 @@ SELECT_LAYER_DIALOG::SELECT_LAYER_DIALOG( GERBVIEW_FRAME* parent, ...@@ -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;
......
...@@ -26,32 +26,6 @@ ...@@ -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 )
......
...@@ -77,4 +77,25 @@ template <class T, class T2> inline void EXCHG( T& a, T2& b ) ...@@ -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 */
...@@ -51,9 +51,7 @@ ...@@ -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: ...@@ -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; }
......
...@@ -65,6 +65,7 @@ Load() TODO's ...@@ -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>
......
...@@ -791,7 +791,8 @@ END_EVENT_TABLE() ...@@ -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;
......
...@@ -68,7 +68,7 @@ END_EVENT_TABLE() ...@@ -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();
......
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