Commit 1c0f034b authored by Dick Hollenbeck's avatar Dick Hollenbeck

Make KiCad compile with minimal warnings against SVN HEAD of wxWidgets as of today.

parent fe919cd4
......@@ -36,8 +36,10 @@
#include <queue>
#include <vector>
#include "3d_struct.h"
#include "modelparsers.h"
#include <3d_struct.h>
#include <modelparsers.h>
#include <xnode.h>
X3D_MODEL_PARSER::X3D_MODEL_PARSER( S3D_MASTER* aMaster ) :
S3D_MODEL_PARSER( aMaster )
......@@ -54,13 +56,13 @@ void X3D_MODEL_PARSER::Load( const wxString aFilename )
if( !doc.Load( aFilename ) )
{
wxLogError( wxT( "Error while parsing file <%s>" ), GetChars( aFilename ) );
wxLogError( wxT( "Error while parsing file '%s'" ), GetChars( aFilename ) );
return;
}
if( doc.GetRoot()->GetName() != wxT( "X3D" ) )
{
wxLogError( wxT( "Filetype is not X3D <%s>" ), GetChars( aFilename ) );
wxLogError( wxT( "Filetype is not X3D '%s'" ), GetChars( aFilename ) );
return;
}
......@@ -85,24 +87,25 @@ wxString X3D_MODEL_PARSER::VRML_representation()
for( unsigned i = 0; i < vrml_points.size(); i++ )
{
output += wxT( "Shape {\n"
" appearance Appearance {\n"
" material Material {\n" ) +
vrml_materials[i] +
wxT( " }\n"
" }\n"
" geometry IndexedFaceSet {\n"
" solid TRUE\n"
" coord Coordinate {\n"
" point [\n") +
vrml_points[i] +
wxT( " ]\n"
" }\n"
" coordIndex [\n" ) +
vrml_coord_indexes[i] +
wxT( " ]\n"
" }\n"
"},\n" );
output +=
wxT( "Shape {\n"
" appearance Appearance {\n"
" material Material {\n" ) +
vrml_materials[i] +
wxT( " }\n"
" }\n"
" geometry IndexedFaceSet {\n"
" solid TRUE\n"
" coord Coordinate {\n"
" point [\n") +
vrml_points[i] +
wxT( " ]\n"
" }\n"
" coordIndex [\n" ) +
vrml_coord_indexes[i] +
wxT( " ]\n"
" }\n"
"},\n" );
}
return output;
......@@ -115,6 +118,7 @@ void X3D_MODEL_PARSER::GetChildsByName( wxXmlNode* aParent,
{
// Breadth-first search (BFS)
std::queue< wxXmlNode* > found;
found.push( aParent );
while( !found.empty() )
......@@ -140,7 +144,7 @@ void X3D_MODEL_PARSER::GetChildsByName( wxXmlNode* aParent,
void X3D_MODEL_PARSER::GetNodeProperties( wxXmlNode* aNode, PROPERTY_MAP& aProps )
{
wxXmlProperty *prop;
wxXmlAttribute* prop;
for( prop = aNode->GetAttributes();
prop != NULL;
......@@ -167,6 +171,7 @@ void X3D_MODEL_PARSER::readTransform( wxXmlNode* aTransformNode )
childnodes.clear();
PROPERTY_MAP properties;
GetNodeProperties( aTransformNode, properties );
GetChildsByName( aTransformNode, wxT("IndexedFaceSet"), childnodes );
......@@ -252,7 +257,7 @@ void X3D_MODEL_PARSER::readMaterial( wxXmlNode* aMatNode )
wxString vrml_material;
PROPERTY_MAP::const_iterator p = ++properties.begin(); // skip DEF
for(;p != properties.end();p++)
for( ; p != properties.end(); p++ )
{
vrml_material.Append( p->first + wxT( " " ) + p->second + wxT( "\n" ) );
}
......@@ -270,8 +275,8 @@ void X3D_MODEL_PARSER::readMaterial( wxXmlNode* aMatNode )
{
if( material->m_Name == mat_name )
{
wxString vrml_material;
vrml_material.Append( wxString::Format( wxT( "specularColor %f %f %f\n" ),
material->m_SpecularColor.x,
material->m_SpecularColor.y,
......@@ -457,6 +462,7 @@ void X3D_MODEL_PARSER::readIndexedFaceSet( wxXmlNode* aFaceNode,
while( index_tokens.HasMoreTokens() )
{
long index = 0;
index_tokens.GetNextToken().ToLong( &index );
// -1 marks the end of polygon
......
......@@ -480,7 +480,12 @@ static inline const char* KICAD_BUILD_OPTIONS_SIGNATURE()
" (release,"
#endif
__WX_BO_UNICODE __ABI_VERSION __BO_COMPILER __WX_BO_STL
__WX_BO_WXWIN_COMPAT_2_6 __WX_BO_WXWIN_COMPAT_2_8 ")"
#if !wxCHECK_VERSION( 3, 0, 0 )
__WX_BO_WXWIN_COMPAT_2_6
#endif
__WX_BO_WXWIN_COMPAT_2_8 ")"
;
}
......
......@@ -41,7 +41,12 @@ void LAYER_SELECTOR::SetBitmapLayer( wxBitmap& aLayerbmp, LAYER_NUM aLayer )
// Prepare Bitmap
bmpDC.SelectObject( aLayerbmp );
brush.SetColour( MakeColour( GetLayerColor( aLayer ) ) );
#if wxCHECK_VERSION( 3, 0, 0 )
brush.SetStyle( wxBRUSHSTYLE_SOLID );
#else
brush.SetStyle( wxSOLID );
#endif
bmpDC.SetBrush( brush );
bmpDC.DrawRectangle( 0, 0, aLayerbmp.GetWidth(), aLayerbmp.GetHeight() );
......
......@@ -396,15 +396,22 @@ void GRSetBrush( wxDC* DC, EDA_COLOR_T Color, bool fill )
|| s_DC_lastbrushfill != fill
|| s_DC_lastDC != DC )
{
wxBrush DrawBrush;
DrawBrush.SetColour( MakeColour( Color ) );
wxBrush brush;
brush.SetColour( MakeColour( Color ) );
if( fill )
DrawBrush.SetStyle( wxSOLID );
#if wxCHECK_VERSION( 3, 0, 0 )
brush.SetStyle( wxBRUSHSTYLE_SOLID );
else
brush.SetStyle( wxBRUSHSTYLE_TRANSPARENT );
#else
brush.SetStyle( wxSOLID );
else
DrawBrush.SetStyle( wxTRANSPARENT );
brush.SetStyle( wxTRANSPARENT );
#endif
DC->SetBrush( DrawBrush );
DC->SetBrush( brush );
s_DC_lastbrushcolor = Color;
s_DC_lastbrushfill = fill;
......
......@@ -239,7 +239,12 @@ void EDA_MSG_PANEL::erase( wxDC* aDC )
pen.SetColour( color );
brush.SetColour( color );
#if wxCHECK_VERSION( 3, 0, 0 )
brush.SetStyle( wxBRUSHSTYLE_SOLID );
#else
brush.SetStyle( wxSOLID );
#endif
aDC->SetPen( pen );
aDC->SetBrush( brush );
......
......@@ -160,14 +160,23 @@ void WinEDA_SelColorFrame::Init_Dialog( int aOldColor )
butt_ID = ID_COLOR_BLACK + ii;
wxMemoryDC iconDC;
wxBitmap ButtBitmap( w, h );
wxBrush Brush;
wxBrush brush;
iconDC.SelectObject( ButtBitmap );
EDA_COLOR_T buttcolor = g_ColorRefs[ii].m_Numcolor;
iconDC.SetPen( *wxBLACK_PEN );
ColorSetBrush( &Brush, buttcolor );
Brush.SetStyle( wxSOLID );
ColorSetBrush( &brush, buttcolor );
#if wxCHECK_VERSION( 3, 0, 0 )
brush.SetStyle( wxBRUSHSTYLE_SOLID );
#else
brush.SetStyle( wxSOLID );
#endif
iconDC.SetBrush( brush );
iconDC.SetBrush( Brush );
iconDC.SetBackground( *wxGREY_BRUSH );
iconDC.Clear();
iconDC.DrawRoundedRectangle( 0, 0, w, h, (double) h / 3 );
......
......@@ -26,7 +26,7 @@
#include <xnode.h>
#include <macros.h>
typedef wxXmlProperty XATTR;
typedef wxXmlAttribute XATTR;
void XNODE::Format( OUTPUTFORMATTER* out, int nestLevel ) throw( IO_ERROR )
......
This diff is collapsed.
#ifndef _DIALOG_COLOR_CONFIG_H_
#define _DIALOG_COLOR_CONFIG_H_
#ifndef DIALOG_COLOR_CONFIG_H_
#define DIALOG_COLOR_CONFIG_H_
#include <wx/statline.h>
......@@ -13,47 +13,24 @@ class wxStdDialogButtonSizer;
extern void SeedLayers();
// Specify the width and height of every (color-displaying / bitmap) button
const int BUTT_SIZE_X = 16;
const int BUTT_SIZE_Y = 16;
/********************/
/* Layer menu list. */
/********************/
struct ColorButton
{
wxString m_Name;
int m_Layer;
};
struct ButtonIndex
{
wxString m_Name;
ColorButton* m_Buttons;
};
/***********************************************/
/* Derived class for the frame color settings. */
/***********************************************/
class DIALOG_COLOR_CONFIG: public wxDialog
class DIALOG_COLOR_CONFIG : public wxDialog
{
private:
DECLARE_DYNAMIC_CLASS( DIALOG_COLOR_CONFIG )
EDA_DRAW_FRAME* m_Parent;
wxBoxSizer* OuterBoxSizer;
wxBoxSizer* MainBoxSizer;
wxBoxSizer* ColumnBoxSizer;
wxBoxSizer* RowBoxSizer;
wxBitmapButton* BitmapButton;
EDA_DRAW_FRAME* m_parent;
wxBoxSizer* m_outerBoxSizer;
wxBoxSizer* m_mainBoxSizer;
wxBoxSizer* m_columnBoxSizer;
wxBoxSizer* m_rowBoxSizer;
wxBitmapButton* m_bitmapButton;
wxRadioBox* m_SelBgColor;
wxStaticLine* Line;
wxStdDialogButtonSizer* StdDialogButtonSizer;
wxButton* Button;
wxStaticLine* m_line;
wxStdDialogButtonSizer* m_stdDialogButtonSizer;
// Creation
bool Create( wxWindow* aParent,
......@@ -70,7 +47,7 @@ private:
void CreateControls();
wxBitmap GetBitmapResource( const wxString& aName );
wxIcon GetIconResource( const wxString& aName );
wxIcon GetIconResource( const wxString& aName );
static bool ShowToolTips();
bool UpdateColorsSettings();
......@@ -86,4 +63,4 @@ public:
~DIALOG_COLOR_CONFIG();
};
#endif // _DIALOG_COLOR_CONFIG_H_
#endif // DIALOG_COLOR_CONFIG_H_
......@@ -137,7 +137,12 @@ void GBR_LAYOUT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, GR_DRAWMODE aDrawMode,
// artifacts can happen with negative items or negative images
wxColour bgColor = MakeColour( g_DrawBgColor );
#if wxCHECK_VERSION( 3, 0, 0 )
wxBrush bgBrush( bgColor, wxBRUSHSTYLE_SOLID );
#else
wxBrush bgBrush( bgColor, wxSOLID );
#endif
GERBVIEW_FRAME* gerbFrame = (GERBVIEW_FRAME*) aPanel->GetParent();
......
......@@ -34,8 +34,8 @@
#include <wx/xml/xml.h>
#if wxCHECK_VERSION( 2, 9, 0 )
#define wxXmlProperty wxXmlAttribute
#if !wxCHECK_VERSION( 2, 9, 0 )
#define wxXmlAttribute wxXmlProperty
#endif
/**
......@@ -58,7 +58,7 @@ public:
}
XNODE( XNODE* aParent, wxXmlNodeType aType, const wxString& aName,
const wxString& aContent = wxEmptyString, wxXmlProperty* aProperties = NULL ) :
const wxString& aContent = wxEmptyString, wxXmlAttribute* aProperties = NULL ) :
wxXmlNode( aParent, aType, aName, aContent, aProperties )
{
}
......@@ -120,7 +120,7 @@ public:
{
return DeleteProperty( attrName );
}
wxXmlProperty* GetAttributes() const
wxXmlAttribute* GetAttributes() const
{
return GetProperties();
}
......
......@@ -694,7 +694,13 @@ wxBitmap DIALOG_COPPER_ZONE::makeLayerBitmap( EDA_COLOR_T aColor )
iconDC.SelectObject( bitmap );
brush.SetColour( MakeColour( aColor ) );
#if wxCHECK_VERSION( 3, 0, 0 )
brush.SetStyle( wxBRUSHSTYLE_SOLID );
#else
brush.SetStyle( wxSOLID );
#endif
iconDC.SetBrush( brush );
iconDC.DrawRectangle( 0, 0, LAYER_BITMAP_SIZE_X, LAYER_BITMAP_SIZE_Y );
......
......@@ -260,7 +260,13 @@ wxBitmap DIALOG_KEEPOUT_AREA_PROPERTIES::makeLayerBitmap( EDA_COLOR_T aColor )
iconDC.SelectObject( bitmap );
brush.SetColour( MakeColour( aColor ) );
#if wxCHECK_VERSION( 3, 0, 0 )
brush.SetStyle( wxBRUSHSTYLE_SOLID );
#else
brush.SetStyle( wxSOLID );
#endif
iconDC.SetBrush( brush );
iconDC.DrawRectangle( 0, 0, LAYER_BITMAP_SIZE_X, LAYER_BITMAP_SIZE_Y );
......
......@@ -80,8 +80,16 @@ EVT_TOOL( ID_FOOTPRINT_WIZARD_SHOW_3D_VIEW,
// listbox events
EVT_LISTBOX( ID_FOOTPRINT_WIZARD_PAGE_LIST, FOOTPRINT_WIZARD_FRAME::ClickOnPageList )
#if wxCHECK_VERSION( 3, 0, 0 )
EVT_GRID_CMD_CELL_CHANGED( ID_FOOTPRINT_WIZARD_PARAMETER_LIST,
FOOTPRINT_WIZARD_FRAME::ParametersUpdated )
#else
EVT_GRID_CMD_CELL_CHANGE( ID_FOOTPRINT_WIZARD_PARAMETER_LIST,
FOOTPRINT_WIZARD_FRAME::ParametersUpdated )
#endif
EVT_GRID_CMD_EDITOR_HIDDEN( ID_FOOTPRINT_WIZARD_PARAMETER_LIST,
FOOTPRINT_WIZARD_FRAME::ParametersUpdated )
......
......@@ -192,7 +192,13 @@ wxBitmap LAYER_WIDGET::makeBitmap( EDA_COLOR_T aColor )
iconDC.SelectObject( bitmap );
brush.SetColour( MakeColour( aColor ) );
#if wxCHECK_VERSION( 3, 0, 0 )
brush.SetStyle( wxBRUSHSTYLE_SOLID );
#else
brush.SetStyle( wxSOLID );
#endif
iconDC.SetBrush( brush );
iconDC.DrawRectangle( 0, 0, BUTT_SIZE_X - 2 * BUTT_VOID, BUTT_SIZE_Y - 2 * BUTT_VOID );
......
......@@ -495,7 +495,7 @@ PARAM_CFG_ARRAY& PCB_EDIT_FRAME::GetConfigurationSettings()
void PCB_EDIT_FRAME::SaveMacros()
{
wxXmlDocument xml;
wxXmlProperty *macrosProp, *hkProp, *xProp, *yProp;
wxXmlAttribute *macrosProp, *hkProp, *xProp, *yProp;
wxString str, hkStr, xStr, yStr;
wxFileName fn = GetBoard()->GetFileName();
......@@ -513,7 +513,7 @@ void PCB_EDIT_FRAME::SaveMacros()
for( int number = 9; number >= 0; number-- )
{
str.Printf( wxT( "%d" ), number );
macrosProp = new wxXmlProperty( wxT( "number" ), str );
macrosProp = new wxXmlAttribute( wxT( "number" ), str );
XNODE * macrosNode = new XNODE( rootNode, wxXML_ELEMENT_NODE,
wxT( "macros" ), wxEmptyString,
......@@ -527,9 +527,9 @@ void PCB_EDIT_FRAME::SaveMacros()
xStr.Printf( wxT( "%d" ), i->m_Position.x );
yStr.Printf( wxT( "%d" ), i->m_Position.y );
yProp = new wxXmlProperty( wxT( "y" ), yStr );
xProp = new wxXmlProperty( wxT( "x" ), xStr, yProp );
hkProp = new wxXmlProperty( wxT( "hkcode" ), hkStr, xProp );
yProp = new wxXmlAttribute( wxT( "y" ), yStr );
xProp = new wxXmlAttribute( wxT( "x" ), xStr, yProp );
hkProp = new wxXmlAttribute( wxT( "hkcode" ), hkStr, xProp );
new XNODE( macrosNode, wxXML_ELEMENT_NODE, wxT( "hotkey" ),
wxEmptyString, hkProp );
......
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