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

give an icon to bitmapt2component frame

parent c22c0bad
...@@ -9,7 +9,17 @@ set(BITMAP2COMPONENT_SRCS ...@@ -9,7 +9,17 @@ set(BITMAP2COMPONENT_SRCS
bitmap2cmp_gui bitmap2cmp_gui
) )
add_executable(bitmap2component WIN32 MACOSX_BUNDLE ${BITMAP2COMPONENT_SRCS} ${BITMAP2COMPONENT_RESOURCES}) if(WIN32)
if(MINGW)
# BITMAP2COMPONENT_RESOURCES variable is set by the macro.
mingw_resource_compiler(bitmap2component)
else(MINGW)
set(BITMAP2COMPONENT_RESOURCES bitmap2component.rc)
endif(MINGW)
endif(WIN32)
add_executable(bitmap2component WIN32 MACOSX_BUNDLE
${BITMAP2COMPONENT_SRCS}
${BITMAP2COMPONENT_RESOURCES})
target_link_libraries( bitmap2component target_link_libraries( bitmap2component
......
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
#include "potracelib.h" #include "potracelib.h"
#include "bitmap_io.h" #include "bitmap_io.h"
//#include "bitmap2component.xpm"
#define KEYWORD_FRAME_POSX wxT( "bmconverter_Pos_x" ) #define KEYWORD_FRAME_POSX wxT( "bmconverter_Pos_x" )
#define KEYWORD_FRAME_POSY wxT( "bmconverter_Pos_y" ) #define KEYWORD_FRAME_POSY wxT( "bmconverter_Pos_y" )
...@@ -72,7 +74,6 @@ private: ...@@ -72,7 +74,6 @@ private:
void ExportFile( FILE* aOutfile, int aFormat ); void ExportFile( FILE* aOutfile, int aFormat );
}; };
BM2CMP_FRAME::BM2CMP_FRAME() : BM2CMP_FRAME_BASE( NULL ) BM2CMP_FRAME::BM2CMP_FRAME() : BM2CMP_FRAME_BASE( NULL )
{ {
m_Config = new wxConfig(); m_Config = new wxConfig();
...@@ -81,6 +82,7 @@ BM2CMP_FRAME::BM2CMP_FRAME() : BM2CMP_FRAME_BASE( NULL ) ...@@ -81,6 +82,7 @@ BM2CMP_FRAME::BM2CMP_FRAME() : BM2CMP_FRAME_BASE( NULL )
m_Config->Read( KEYWORD_FRAME_SIZEX, & m_FrameSize.x, -1 ); m_Config->Read( KEYWORD_FRAME_SIZEX, & m_FrameSize.x, -1 );
m_Config->Read( KEYWORD_FRAME_SIZEY, & m_FrameSize.y, -1 ); m_Config->Read( KEYWORD_FRAME_SIZEY, & m_FrameSize.y, -1 );
SetIcon( wxICON( bitmap2component_icon ) );
wxString msg( wxT( " 0000 " ) ); wxString msg( wxT( " 0000 " ) );
m_gridInfo->SetCellValue( 1, 0, msg ); m_gridInfo->SetCellValue( 1, 0, msg );
......
...@@ -32,10 +32,8 @@ ...@@ -32,10 +32,8 @@
#include <vector> #include <vector>
#include "potracelib.h" #include "potracelib.h"
//#include "bitmap_io.h"
#include "auxiliary.h" #include "auxiliary.h"
#ifndef max #ifndef max
#define max( a, b ) ( ( (a) > (b) ) ? (a) : (b) ) #define max( a, b ) ( ( (a) > (b) ) ? (a) : (b) )
#endif #endif
......
/* XPM */
static const char *bitmap2component_xpm[] = {
/* columns rows colors chars-per-pixel */
"32 32 16 1",
"@ c #592904",
"# c #974704",
"$ c #5455D0",
"o c #090915",
"- c #2E1604",
"+ c #4B4BB5",
"* c #222352",
"X c #0F1128",
": c #BE5904",
" c #0CFA0C",
"% c #FC7A04",
"= c #323378",
"; c #753704",
"O c #3C3B8F",
"& c #DF6904",
". c #050204",
/* pixels */
" . ..",
" .",
" ",
"........................ .. ",
"........................ .. ",
" X.oO ... ",
"+++X@#.X+ $ ... .",
"...o@%&@.*$$X.o= ... ..",
"....@%%%#-..-#;.... ........",
"....@%%&%&-.#%%-.... .......",
"....@%%%%;..;%&......====O+$ ",
"....@%%:-....o..............= ",
"....@&@.... +*O ......%%%%&#.X ",
"....-..... .....%%&%%%:...",
"OO O=+ . *.%%%%%&%@X ",
" ... =.%%%%%%%#..",
" . O.%%%%&%%;.=",
".......... .....%%%%%%%-..",
"....@@..... ......%%%%%%;...",
"....@%:-....X.........###;;-.= ",
"....@%%&#...-#@...........o*$ ",
"....@%%%%&-.#%%...... $ ",
"....@%%%%#..;%%..... .......",
"....@%%&-....-..... ........",
"XXXo@%;.X+ +*=$ ... ..",
" X-.oO ... .",
" X.= ... ",
"........................ .. ",
"........................ .. ",
" ",
" .",
" . .."
};
...@@ -798,7 +798,7 @@ int DIALOG_BUILD_BOM::PrintComponentsListByPart( ...@@ -798,7 +798,7 @@ int DIALOG_BUILD_BOM::PrintComponentsListByPart(
for( int jj = FOOTPRINT; jj < currCmp->GetFieldCount(); jj++ ) for( int jj = FOOTPRINT; jj < currCmp->GetFieldCount(); jj++ )
{ {
//Ensure fields exists in dummy component //Ensure fields exists in dummy component
if( dummyCmp.GetFieldCount() < currCmp->GetFieldCount() ) if( dummyCmp.GetFieldCount() <= jj )
dummyCmp.AddField( *currCmp->GetField( jj ) ); dummyCmp.AddField( *currCmp->GetField( jj ) );
// store useful data // store useful data
if( !currCmp->GetField( jj )->m_Text.IsEmpty() ) if( !currCmp->GetField( jj )->m_Text.IsEmpty() )
...@@ -849,23 +849,27 @@ int DIALOG_BUILD_BOM::PrintComponentsListByPart( ...@@ -849,23 +849,27 @@ int DIALOG_BUILD_BOM::PrintComponentsListByPart(
CONV_TO_UTF8( currCmp->GetField( DATASHEET) ->m_Text ) ); CONV_TO_UTF8( currCmp->GetField( DATASHEET) ->m_Text ) );
#endif #endif
fprintf( f, "%c%s", s_ExportSeparatorSymbol,
CONV_TO_UTF8( RNames ) );
// print fields, on demand // print fields, on demand
for( int jj = FIELD1; jj <= FIELD8 ; jj++ ) int last_nonempty_field_idx = 0;
for( int jj = FOOTPRINT; jj < dummyCmp.GetFieldCount(); jj++ )
if ( !dummyCmp.GetField( jj )->m_Text.IsEmpty() )
last_nonempty_field_idx = jj;
for( int jj = FIELD1; jj <= last_nonempty_field_idx ; jj++ )
{ {
if( dummyCmp.GetFieldCount() >= jj )
break;
if ( IsFieldChecked( jj ) ) if ( IsFieldChecked( jj ) )
fprintf( f, "%c%4s", s_ExportSeparatorSymbol, fprintf( f, "%c%4s", s_ExportSeparatorSymbol,
CONV_TO_UTF8( dummyCmp.GetField( jj )->m_Text ) ); CONV_TO_UTF8( dummyCmp.GetField( jj )->m_Text ) );
} }
fprintf( f, "%c%s\n", s_ExportSeparatorSymbol, fprintf( f, "\n" );
CONV_TO_UTF8( RNames ) );
// Clear strings and values, to prepare next component // Clear strings and values, to prepare next component
qty = 0; qty = 0;
RNames.Empty(); RNames.Empty();
for( int jj = FOOTPRINT; jj < currCmp->GetFieldCount(); jj++ ) for( int jj = FOOTPRINT; jj < dummyCmp.GetFieldCount(); jj++ )
dummyCmp.GetField( jj )->m_Text.Empty(); dummyCmp.GetField( jj )->m_Text.Empty();
} }
......
...@@ -105,12 +105,10 @@ EDA_Rect EDGE_MODULE::GetBoundingBox() ...@@ -105,12 +105,10 @@ EDA_Rect EDGE_MODULE::GetBoundingBox()
if( Module ) if( Module )
{ {
RotatePoint( &pt.x, &pt.y, Module->m_Orient ); RotatePoint( &pt.x, &pt.y, Module->m_Orient );
pt.x += Module->m_Pos.x; pt += Module->m_Pos;
pt.y += Module->m_Pos.y;
} }
pt.x += m_Start0.x; pt += m_Start0;
pt.y += m_Start0.y;
bbox.m_Pos.x = MIN( bbox.m_Pos.x, pt.x ); bbox.m_Pos.x = MIN( bbox.m_Pos.x, pt.x );
bbox.m_Pos.y = MIN( bbox.m_Pos.y, pt.y ); bbox.m_Pos.y = MIN( bbox.m_Pos.y, pt.y );
p_end.x = MAX( p_end.x, pt.x ); p_end.x = MAX( p_end.x, pt.x );
......
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