7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-18 16:59:18 +00:00

Remove 2 global variables: g_DrawBgColor and g_ShowPageLimits.

They are now member of EDA_DRAW_FRAME.
This change could fix Bug  (Background color change in Eeschema affects background color in Pcbnew)
Show page limits has meaning only for the schematic editor,  the board editor and the page layout editor.
Draw background color selection exists only in eeschema and  page layout editor.
In pcbnew, only a black background is allowed.
A side effect is now the user should set the background color in schematic editor, and the library editor (2 different options).
The default is still the white color.
This commit is contained in:
jean-pierre charras 2014-06-20 13:13:04 +02:00
parent 94d78047e3
commit 7c99a242cf
33 changed files with 143 additions and 138 deletions

View File

@ -117,6 +117,9 @@ EDA_DRAW_FRAME::EDA_DRAW_FRAME( KIWAY* aKiway, wxWindow* aParent,
m_LastGridSizeId = 0;
m_DrawGrid = true; // hide/Show grid. default = show
m_GridColor = DARKGRAY; // Grid color
m_showPageLimits = false;
m_drawBgColor = BLACK; // the background color of the draw canvas:
// BLACK for Pcbnew, BLACK or WHITeEfor eeschema
m_snapToGrid = true;
m_MsgFrameHeight = EDA_MSG_PANEL::GetRequiredHeight();
m_movingCursorWithKeyboard = false;

View File

@ -103,7 +103,7 @@ EDA_DRAW_PANEL::EDA_DRAW_PANEL( EDA_DRAW_FRAME* parent, int id,
m_scrollIncrementX = std::min( size.x / 8, 10 );
m_scrollIncrementY = std::min( size.y / 8, 10 );
SetBackgroundColour( MakeColour( g_DrawBgColor ) );
SetBackgroundColour( MakeColour( parent->GetDrawBgColor() ) );
#if KICAD_USE_BUFFERED_DC || KICAD_USE_BUFFERED_PAINTDC
SetBackgroundStyle( wxBG_STYLE_CUSTOM );
@ -528,9 +528,11 @@ void EDA_DRAW_PANEL::EraseScreen( wxDC* DC )
{
GRSetDrawMode( DC, GR_COPY );
EDA_COLOR_T bgColor = GetParent()->GetDrawBgColor();
GRSFilledRect( NULL, DC, m_ClipBox.GetX(), m_ClipBox.GetY(),
m_ClipBox.GetRight(), m_ClipBox.GetBottom(),
0, g_DrawBgColor, g_DrawBgColor );
0, bgColor, bgColor );
// Set to one (1) to draw bounding box validate bounding box calculation.
#if DEBUG_SHOW_CLIP_RECT
@ -583,10 +585,12 @@ void EDA_DRAW_PANEL::ReDraw( wxDC* DC, bool erasebg )
if( Screen == NULL )
return;
if( ( g_DrawBgColor != WHITE ) && ( g_DrawBgColor != BLACK ) )
g_DrawBgColor = BLACK;
EDA_COLOR_T bgColor = GetParent()->GetDrawBgColor();
if( g_DrawBgColor == WHITE )
if( ( bgColor != WHITE ) && ( bgColor != BLACK ) )
bgColor = BLACK;
if( bgColor == WHITE )
{
g_XorMode = GR_NXOR;
g_GhostColor = BLACK;
@ -599,7 +603,7 @@ void EDA_DRAW_PANEL::ReDraw( wxDC* DC, bool erasebg )
GRResetPenAndBrush( DC );
DC->SetBackground( g_DrawBgColor == BLACK ? *wxBLACK_BRUSH : *wxWHITE_BRUSH );
DC->SetBackground( bgColor == BLACK ? *wxBLACK_BRUSH : *wxWHITE_BRUSH );
DC->SetBackgroundMode( wxSOLID );
if( erasebg )

View File

@ -31,12 +31,6 @@
#include <pgm_base.h>
#include <common.h>
#include <gr_basic.h>
static const wxChar showPageLimitsKey[] = wxT( "ShowPageLimits" );
static const wxChar backgroundColorKey[] = wxT( "BackgroundColor" );
/// Initialize aDst SEARCH_STACK with KIFACE (DSO) specific settings.
/// A non-member function so it an be moved easily, plus it's nobody's business.
@ -97,24 +91,7 @@ static void setSearchPaths( SEARCH_STACK* aDst, KIWAY::FACE_T aId )
bool KIFACE_I::start_common( int aCtlBits )
{
m_start_flags = aCtlBits;
m_bm.Init();
m_bm.m_config->Read( showPageLimitsKey, &g_ShowPageLimits );
// FIXME OSX Mountain Lion (10.8)
// Seems that Read doesn't found anything and ColorFromInt
// Asserts - I'm unable to reproduce on 10.7
int draw_bg_color = BLACK; // Default for all apps but Eeschema
if( m_id == KIWAY::FACE_SCH )
draw_bg_color = WHITE; // Default for Eeschema
m_bm.m_config->Read( backgroundColorKey, &draw_bg_color );
g_DrawBgColor = ColorFromInt( draw_bg_color );
setSearchPaths( &m_bm.m_search, m_id );
return true;
@ -123,14 +100,6 @@ bool KIFACE_I::start_common( int aCtlBits )
void KIFACE_I::end_common()
{
if( m_bm.m_config )
{
// Save common preferences; the background still uses the old legacy
// color numbers, not the new names
m_bm.m_config->Write( showPageLimitsKey, g_ShowPageLimits );
m_bm.m_config->Write( backgroundColorKey, int( g_DrawBgColor ) );
}
m_bm.End();
}

View File

@ -83,12 +83,12 @@ void EDA_DRAW_FRAME::DrawWorkSheet( wxDC* aDC, BASE_SCREEN* aScreen, int aLineWi
wxSize pageSize = pageInfo.GetSizeMils();
// if not printing, draw the page limits:
if( !aScreen->m_IsPrinting && g_ShowPageLimits )
if( !aScreen->m_IsPrinting && m_showPageLimits )
{
GRSetDrawMode( aDC, GR_COPY );
GRRect( m_canvas->GetClipBox(), aDC, 0, 0,
pageSize.x * aScalar, pageSize.y * aScalar, aLineWidth,
g_DrawBgColor == WHITE ? LIGHTGRAY : DARKDARKGRAY );
m_drawBgColor == WHITE ? LIGHTGRAY : DARKDARKGRAY );
}
TITLE_BLOCK t_block = GetTitleBlock();

View File

@ -294,8 +294,6 @@ bool IFACE::OnKifaceStart( PGM_BASE* aProgram, int aCtlBits )
// SetFootprintLibTablePath();
*/
g_DrawBgColor = BLACK;
try
{
// The global table is not related to a specific project. All projects

View File

@ -232,7 +232,7 @@ void DIALOG_COLOR_CONFIG::CreateControls()
m_SelBgColor = new wxRadioBox( this, wxID_ANY, _( "Background Color" ),
wxDefaultPosition, wxDefaultSize,
m_SelBgColorStrings, 1, wxRA_SPECIFY_COLS );
m_SelBgColor->SetSelection( ( g_DrawBgColor == BLACK ) ? 1 : 0 );
m_SelBgColor->SetSelection( ( m_parent->GetDrawBgColor() == BLACK ) ? 1 : 0 );
m_columnBoxSizer->Add( m_SelBgColor, 1, wxGROW | wxRIGHT | wxTOP | wxBOTTOM, 5 );
// Provide a line to separate all of the controls added so far from the
@ -318,9 +318,9 @@ bool DIALOG_COLOR_CONFIG::UpdateColorsSettings()
{
// Update color of background
if( m_SelBgColor->GetSelection() == 0 )
g_DrawBgColor = WHITE;
m_parent->SetDrawBgColor( WHITE );
else
g_DrawBgColor = BLACK;
m_parent->SetDrawBgColor( BLACK );
bool warning = false;
@ -328,13 +328,13 @@ bool DIALOG_COLOR_CONFIG::UpdateColorsSettings()
{
SetLayerColor( currentColors[ ii ], ii );
if( g_DrawBgColor == GetLayerColor( ii ) )
if( m_parent->GetDrawBgColor() == GetLayerColor( ii ) )
warning = true;
}
m_parent->SetGridColor( GetLayerColor( LAYER_GRID ) );
if( g_DrawBgColor == GetLayerColor( LAYER_GRID ) )
if( m_parent->GetDrawBgColor() == GetLayerColor( LAYER_GRID ) )
warning = true;
return warning;

View File

@ -9,7 +9,7 @@
#include <dialog_lib_edit_pin.h>
DIALOG_LIB_EDIT_PIN::DIALOG_LIB_EDIT_PIN( wxWindow* parent, LIB_PIN* aPin ) :
DIALOG_LIB_EDIT_PIN::DIALOG_LIB_EDIT_PIN( EDA_DRAW_FRAME* parent, LIB_PIN* aPin ) :
DIALOG_LIB_EDIT_PIN_BASE( parent )
{
// Creates a dummy pin to show on a panel, inside this dialog:
@ -20,7 +20,7 @@ DIALOG_LIB_EDIT_PIN::DIALOG_LIB_EDIT_PIN( wxWindow* parent, LIB_PIN* aPin ) :
m_dummyPin->SetParent( NULL );
m_dummyPin->ClearFlags();
m_panelShowPin->SetBackgroundColour( MakeColour( g_DrawBgColor ) );
m_panelShowPin->SetBackgroundColour( MakeColour( parent->GetDrawBgColor() ) );
// Set tab order
m_textPadName->MoveAfterInTabOrder(m_textPinName);

View File

@ -17,7 +17,7 @@ class DIALOG_LIB_EDIT_PIN : public DIALOG_LIB_EDIT_PIN_BASE
public:
/** Constructor */
DIALOG_LIB_EDIT_PIN( wxWindow* parent, LIB_PIN* aPin );
DIALOG_LIB_EDIT_PIN( EDA_DRAW_FRAME* parent, LIB_PIN* aPin );
~DIALOG_LIB_EDIT_PIN();
void OnCloseDialog( wxCloseEvent& event );

View File

@ -63,7 +63,7 @@ public:
m_Parent = aParent;
}
SCH_EDIT_FRAME* GetSchFrameParent() { return m_Parent->GetParent(); }
bool OnPrintPage( int page );
bool HasPage( int page );
bool OnBeginDocument( int startPage, int endPage );
@ -425,7 +425,7 @@ void SCH_PRINTOUT::DrawPage( SCH_SCREEN* aScreen )
aScreen->m_IsPrinting = true;
EDA_COLOR_T bg_color = g_DrawBgColor;
EDA_COLOR_T bg_color = GetSchFrameParent()->GetDrawBgColor();
aScreen->Draw( panel, dc, GR_DEFAULT_DRAWMODE );
@ -433,7 +433,7 @@ void SCH_PRINTOUT::DrawPage( SCH_SCREEN* aScreen )
parent->DrawWorkSheet( dc, aScreen, GetDefaultLineThickness(),
IU_PER_MILS, aScreen->GetFileName() );
g_DrawBgColor = bg_color;
GetSchFrameParent()->SetDrawBgColor( bg_color );
aScreen->m_IsPrinting = false;
panel->SetClipBox( oldClipBox );

View File

@ -76,14 +76,14 @@ void SetDefaultBusThickness( int aThickness)
/// Default size for text (not only labels)
static int s_defaultTextSize;
int GetDefaultTextSize()
{
int GetDefaultTextSize()
{
return s_defaultTextSize;
}
void SetDefaultTextSize( int aTextSize )
{
s_defaultTextSize = aTextSize;
void SetDefaultTextSize( int aTextSize )
{
s_defaultTextSize = aTextSize;
}
/*
@ -311,7 +311,7 @@ void SCH_EDIT_FRAME::OnSetOptions( wxCommandEvent& event )
dlg.SetMiddleButtonPanLimited( m_canvas->GetMiddleButtonPanLimited() );
dlg.SetEnableAutoPan( m_canvas->GetEnableAutoPan() );
dlg.SetEnableHVBusOrientation( GetForceHVLines() );
dlg.SetShowPageLimits( g_ShowPageLimits );
dlg.SetShowPageLimits( m_showPageLimits );
dlg.Layout();
dlg.Fit();
dlg.SetMinSize( dlg.GetSize() );
@ -357,7 +357,7 @@ void SCH_EDIT_FRAME::OnSetOptions( wxCommandEvent& event )
m_canvas->SetMiddleButtonPanLimited( dlg.GetMiddleButtonPanLimited() );
m_canvas->SetEnableAutoPan( dlg.GetEnableAutoPan() );
SetForceHVLines( dlg.GetEnableHVBusOrientation() );
g_ShowPageLimits = dlg.GetShowPageLimits();
m_showPageLimits = dlg.GetShowPageLimits();
wxString templateFieldName;
@ -534,8 +534,14 @@ PARAM_CFG_ARRAY& SCH_EDIT_FRAME::GetConfigurationSettings( void )
if( !m_configSettings.empty() )
return m_configSettings;
m_configSettings.push_back( new PARAM_CFG_BOOL( true, wxT( "ShowPageLimits" ),
&m_showPageLimits, true ) );
m_configSettings.push_back( new PARAM_CFG_INT( true, wxT( "Units" ),
(int*)&g_UserUnit, MILLIMETRES ) );
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "SchEditorBgColor" ),
&m_drawBgColor,
WHITE ) );
m_configSettings.push_back( new PARAM_CFG_SETCOLOR( true, wxT( "ColorWireEx" ),
&s_layerColor[LAYER_WIRE],
GREEN ) );

View File

@ -295,6 +295,7 @@ const wxChar* LIB_EDIT_FRAME::GetLibEditFrameName()
return LIB_EDIT_FRAME_NAME;
}
static const wxChar drawBgColorKey[] = wxT( "LibeditBgColor" );
void LIB_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg )
{
@ -312,6 +313,9 @@ void LIB_EDIT_FRAME::LoadSettings( wxConfigBase* aCfg )
wxConfigPathChanger cpc( aCfg, m_configPath );
EDA_COLOR_T itmp = ColorByName( aCfg->Read( drawBgColorKey, wxT("WHITE") ) );
SetDrawBgColor( itmp );
m_lastLibExportPath = aCfg->Read( lastLibExportPathEntry, ::wxGetCwd() );
m_lastLibImportPath = aCfg->Read( lastLibImportPathEntry, ::wxGetCwd() );
@ -335,6 +339,7 @@ void LIB_EDIT_FRAME::SaveSettings( wxConfigBase* aCfg )
wxConfigPathChanger cpc( aCfg, m_configPath );
aCfg->Write( drawBgColorKey, ColorGetName( GetDrawBgColor() ) );
aCfg->Write( lastLibExportPathEntry, m_lastLibExportPath );
aCfg->Write( lastLibImportPathEntry, m_lastLibImportPath );
}

View File

@ -28,7 +28,6 @@
#include <base_units.h>
#include <kiway.h>
SCH_BASE_FRAME::SCH_BASE_FRAME( KIWAY* aKiway, wxWindow* aParent,
FRAME_T aWindowType, const wxString& aTitle,
const wxPoint& aPosition, const wxSize& aSize, long aStyle,
@ -36,6 +35,7 @@ SCH_BASE_FRAME::SCH_BASE_FRAME( KIWAY* aKiway, wxWindow* aParent,
EDA_DRAW_FRAME( aKiway, aParent, aWindowType, aTitle, aPosition,
aSize, aStyle, aFrameName )
{
SetDrawBgColor( WHITE ); // the background color of the draw canvas, BLACK or WHITE
}

View File

@ -191,6 +191,7 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ):
m_previewSize = wxDefaultSize;
m_printMonochrome = true;
m_printSheetReference = true;
SetShowPageLimits( true );
m_HotkeysZoomAndGridList = s_Schematic_Hokeys_Descr;
m_dlgFindReplace = NULL;
m_findReplaceData = new wxFindReplaceData( wxFR_DOWN );

View File

@ -496,6 +496,11 @@ void LIB_VIEW_FRAME::ExportToSchematicLibraryPart( wxCommandEvent& event )
#define LIBLIST_WIDTH_KEY wxT( "ViewLiblistWidth" )
#define CMPLIST_WIDTH_KEY wxT( "ViewCmplistWidth" )
// Currently, the library viewer has no dialog to change the background color
// of the draw canvas. Therefore the background color is here just
// in case of this option is added to some library viewer config dialog
#define LIBVIEW_BGCOLOR wxT( "LibviewBgColor" )
void LIB_VIEW_FRAME::LoadSettings( wxConfigBase* aCfg )
{
@ -503,6 +508,9 @@ void LIB_VIEW_FRAME::LoadSettings( wxConfigBase* aCfg )
wxConfigPathChanger cpc( aCfg, m_configPath );
EDA_COLOR_T itmp = ColorByName( aCfg->Read( LIBVIEW_BGCOLOR, wxT( "WHITE" ) ) );
SetDrawBgColor( itmp );
aCfg->Read( LIBLIST_WIDTH_KEY, &m_libListWidth, 100 );
aCfg->Read( CMPLIST_WIDTH_KEY, &m_cmpListWidth, 100 );
@ -529,6 +537,7 @@ void LIB_VIEW_FRAME::SaveSettings( wxConfigBase* aCfg )
m_cmpListWidth = m_cmpList->GetSize().x;
aCfg->Write( CMPLIST_WIDTH_KEY, m_cmpListWidth );
aCfg->Write( LIBVIEW_BGCOLOR, ColorGetName( GetDrawBgColor() ) );
}

View File

@ -138,6 +138,8 @@ void GERBVIEW_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
void GBR_LAYOUT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, GR_DRAWMODE aDrawMode,
const wxPoint& aOffset, bool aPrintBlackAndWhite )
{
GERBVIEW_FRAME* gerbFrame = (GERBVIEW_FRAME*) aPanel->GetParent();
// Because Images can be negative (i.e with background filled in color) items are drawn
// graphic layer per graphic layer, after the background is filled
// to a temporary bitmap
@ -145,7 +147,7 @@ void GBR_LAYOUT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, GR_DRAWMODE aDrawMode,
// If aDrawMode = UNSPECIFIED_DRAWMODE, items are drawn to the main screen, and therefore
// artifacts can happen with negative items or negative images
wxColour bgColor = MakeColour( g_DrawBgColor );
wxColour bgColor = MakeColour( gerbFrame->GetDrawBgColor() );
#if wxCHECK_VERSION( 3, 0, 0 )
wxBrush bgBrush( bgColor, wxBRUSHSTYLE_SOLID );
@ -153,8 +155,6 @@ void GBR_LAYOUT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, GR_DRAWMODE aDrawMode,
wxBrush bgBrush( bgColor, wxSOLID );
#endif
GERBVIEW_FRAME* gerbFrame = (GERBVIEW_FRAME*) aPanel->GetParent();
int bitmapWidth, bitmapHeight;
wxDC* plotDC = aDC;
@ -236,7 +236,7 @@ void GBR_LAYOUT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, GR_DRAWMODE aDrawMode,
// Force black and white draw mode on request:
if( aPrintBlackAndWhite )
gerbFrame->SetLayerColor( layer, g_DrawBgColor == BLACK ? WHITE : BLACK );
gerbFrame->SetLayerColor( layer, gerbFrame->GetDrawBgColor() == BLACK ? WHITE : BLACK );
if( useBufferBitmap )
{

View File

@ -44,7 +44,6 @@
// Colors for layers and items
COLORS_DESIGN_SETTINGS g_ColorsSettings;
extern EDA_COLOR_T g_DrawBgColor;
int g_Default_GERBER_Format;
@ -146,8 +145,6 @@ bool IFACE::OnKifaceStart( PGM_BASE* aProgram, int aCtlBits )
// display the real hotkeys in menus or tool tips
ReadHotkeyConfig( wxT("GerberFrame"), s_Gerbview_Hokeys_Descr );
g_DrawBgColor = BLACK;
return true;
}

View File

@ -656,7 +656,7 @@ EDA_COLOR_T GERBVIEW_FRAME::GetNegativeItemsColor() const
if( IsElementVisible( NEGATIVE_OBJECTS_VISIBLE ) )
return GetVisibleElementColor( NEGATIVE_OBJECTS_VISIBLE );
else
return g_DrawBgColor;
return GetDrawBgColor();
}

View File

@ -385,8 +385,6 @@ private:
void setMargins();
};
extern bool g_ShowPageLimits; ///< true to display the page limits
extern EDA_UNITS_T g_UserUnit; ///< display units
/// Draw color for moving objects.

View File

@ -56,7 +56,10 @@ protected:
// 0 is for the grid corresponding to
// a wxCommand ID = ID_POPUP_GRID_LEVEL_1000.
bool m_DrawGrid; // hide/Show grid
bool m_showPageLimits; ///< true to display the page limits
EDA_COLOR_T m_GridColor; // Grid color
EDA_COLOR_T m_drawBgColor; ///< the background color of the draw canvas
///< BLACK for Pcbnew, BLACK or WHITE for eeschema
/// The area to draw on.
EDA_DRAW_PANEL* m_canvas;
@ -235,6 +238,10 @@ public:
virtual const TITLE_BLOCK& GetTitleBlock() const = 0;
virtual void SetTitleBlock( const TITLE_BLOCK& aTitleBlock ) = 0;
// the background color of the draw canvas:
EDA_COLOR_T GetDrawBgColor() const { return m_drawBgColor; }
void SetDrawBgColor( EDA_COLOR_T aColor) { m_drawBgColor= aColor ; }
int GetCursorShape() const { return m_cursorShape; }
void SetCursorShape( int aCursorShape ) { m_cursorShape = aCursorShape; }
@ -242,6 +249,8 @@ public:
bool GetShowBorderAndTitleBlock() const { return m_showBorderAndTitleBlock; }
void SetShowBorderAndTitleBlock( bool aShow ) { m_showBorderAndTitleBlock = aShow; }
bool ShowPageLimits() const { return m_showPageLimits; }
void SetShowPageLimits( bool aShow ) { m_showPageLimits = aShow; }
EDA_DRAW_PANEL* GetCanvas() { return m_canvas; }

View File

@ -88,7 +88,6 @@ typedef int wxPenStyle;
extern GR_DRAWMODE g_XorMode;
extern EDA_COLOR_T g_DrawBgColor;
typedef enum {
@ -260,7 +259,7 @@ void GRSFilledRect( EDA_RECT* ClipBox, wxDC* DC, int x1, int y1,
void GRLineArray( EDA_RECT* aClipBox, wxDC* aDC,std::vector<wxPoint>& aLines,
int aWidth, EDA_COLOR_T aColor );
void GRDrawAnchor( EDA_RECT* aClipBox, wxDC *aDC, int x, int y, int aSize,
void GRDrawAnchor( EDA_RECT* aClipBox, wxDC *aDC, int x, int y, int aSize,
EDA_COLOR_T aColor );
#endif /* define GR_BASIC */

View File

@ -486,10 +486,11 @@ public:
}
/**
* Function ScriptingToolbarPane
* Change *this to a scripting toolbar for KiCad.
* Function ScriptingConsolePane
* Change *this to a python scripting console pane for KiCad.
* Used in Pcbnew
*/
EDA_PANEINFO& ScriptingToolbarPane()
EDA_PANEINFO& ScriptingConsolePane()
{
CloseButton( false );
Floatable( true );

View File

@ -186,13 +186,13 @@ void PLEDITOR_PRINTOUT::DrawPage( int aPageNum )
GRForceBlackPen( true );
screen->m_IsPrinting = true;
EDA_COLOR_T bg_color = g_DrawBgColor;
g_DrawBgColor = WHITE;
EDA_COLOR_T bg_color = m_parent->GetDrawBgColor();
m_parent->SetDrawBgColor( WHITE );
screen->m_ScreenNumber = aPageNum;
m_parent->DrawWorkSheet( dc, screen, 0, IU_PER_MILS, wxEmptyString );
g_DrawBgColor = bg_color;
m_parent->SetDrawBgColor( bg_color );
screen->m_IsPrinting = false;
panel->SetClipBox( oldClipBox );

View File

@ -117,7 +117,7 @@ void PL_EDITOR_FRAME::ReCreateMenuBar()
AddMenuItem( preferencesMenu,
ID_MENU_SWITCH_BGCOLOR,
g_DrawBgColor == WHITE ?
GetDrawBgColor() == WHITE ?
_( "&BackGround Black" ) : _( "&BackGround White" ),
wxEmptyString, KiBitmap( palette_xpm ) );

View File

@ -28,7 +28,6 @@
*/
#include <fctsys.h>
//#include <pgm_base.h>
#include <kiface_i.h>
#include <confirm.h>
#include <gestfich.h>
@ -41,8 +40,6 @@
#include <wx/file.h>
#include <wx/snglinst.h>
extern EDA_COLOR_T g_DrawBgColor;
namespace PGE {
@ -128,8 +125,6 @@ bool IFACE::OnKifaceStart( PGM_BASE* aProgram, int aCtlBits )
ReadHotkeyConfig( wxT("PlEditorFrame"), s_PlEditor_Hokeys_Descr );
g_UserUnit = MILLIMETRES;
g_DrawBgColor = WHITE;
g_ShowPageLimits = true;
return true;
}
@ -156,8 +151,6 @@ bool MYFACE::OnKifaceStart( PGM_BASE* aProgram )
}
g_UserUnit = MILLIMETRES;
g_DrawBgColor = WHITE;
g_ShowPageLimits = true;
// read current setup and reopen last directory if no filename to open in
// command line

View File

@ -51,13 +51,13 @@ void PL_EDITOR_FRAME::Process_Config( wxCommandEvent& event )
switch( id )
{
case ID_MENU_SWITCH_BGCOLOR:
if( g_DrawBgColor == WHITE )
g_DrawBgColor = BLACK;
if( GetDrawBgColor() == WHITE )
SetDrawBgColor( BLACK );
else
g_DrawBgColor = WHITE;
SetDrawBgColor( WHITE );
GetMenuBar()->SetLabel( ID_MENU_SWITCH_BGCOLOR,
g_DrawBgColor == WHITE ?
GetDrawBgColor() == WHITE ?
_( "&BackGround Black" ) :
_( "&BackGround White" ) );
m_canvas->Refresh();

Some files were not shown because too many files have changed in this diff Show More