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 @@
*/
#include <fctsys.h>
#include <macros.h>
#include <common.h>
#include <base_struct.h>
#include <class_base_screen.h>
......
This diff is collapsed.
......@@ -6,7 +6,6 @@
*/
#include <fctsys.h>
#include <gr_basic.h>
#include <common.h>
#include <colors.h>
......@@ -64,7 +63,7 @@ WinEDA_SelColorFrame::WinEDA_SelColorFrame( wxWindow* parent,
const wxPoint& framepos,
int OldColor ) :
wxDialog( parent, -1, _( "Colors" ), framepos, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | MAYBE_RESIZE_BORDER )
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER )
{
Init_Dialog( OldColor );
......
......@@ -61,7 +61,7 @@ private:
const wxString& aCaption = _( "EESchema Colors" ),
const wxPoint& aPosition = wxDefaultPosition,
const wxSize& aSize = wxDefaultSize,
long aStyle = wxDEFAULT_DIALOG_STYLE | MAYBE_RESIZE_BORDER );
long aStyle = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER );
// Initializes member variables
void Init();
......
......@@ -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 ) :
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;
......
......@@ -86,7 +86,7 @@ SELECT_LAYER_DIALOG::SELECT_LAYER_DIALOG( GERBVIEW_FRAME* parent,
bool aShowDeselectOption ) :
wxDialog( parent, -1, _( "Select Layer:" ), wxPoint( -1, -1 ),
wxSize( 470, 250 ),
DIALOG_STYLE )
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER )
{
wxButton* Button;
LAYER_NUM ii;
......
......@@ -26,32 +26,6 @@
#define DBG(x) // nothing
#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.
#if !wxCHECK_VERSION( 2, 9, 0 )
......
......@@ -77,4 +77,25 @@ template <class T, class T2> inline void EXCHG( T& a, T2& b )
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 */
......@@ -51,9 +51,7 @@
#include <wx/overlay.h>
#endif
// Option for dialog boxes
#define DIALOG_STYLE wxDEFAULT_DIALOG_STYLE | wxFRAME_FLOAT_ON_PARENT | MAYBE_RESIZE_BORDER
// Option for main frames
#define KICAD_DEFAULT_DRAWFRAME_STYLE wxDEFAULT_FRAME_STYLE | wxWANTS_CHARS
......
......@@ -65,6 +65,7 @@ Load() TODO's
#include <macros.h>
#include <fctsys.h>
#include <trigo.h>
#include <macros.h>
#include <wx/filename.h>
#include <class_board.h>
......
......@@ -791,7 +791,8 @@ END_EVENT_TABLE()
WinEDA_SetParamShapeFrame::WinEDA_SetParamShapeFrame( PCB_EDIT_FRAME* parent,
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;
......
......@@ -68,7 +68,7 @@ END_EVENT_TABLE()
SWAP_LAYERS_DIALOG::SWAP_LAYERS_DIALOG( PCB_BASE_FRAME* parent ) :
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();
......
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