give an icon to bitmapt2component frame

This commit is contained in:
jean-pierre charras 2010-06-20 16:47:30 +02:00
parent c22c0bada9
commit 9cf56261b6
6 changed files with 81 additions and 15 deletions

View File

@ -9,7 +9,17 @@ set(BITMAP2COMPONENT_SRCS
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

View File

@ -29,6 +29,8 @@
#include "potracelib.h"
#include "bitmap_io.h"
//#include "bitmap2component.xpm"
#define KEYWORD_FRAME_POSX wxT( "bmconverter_Pos_x" )
#define KEYWORD_FRAME_POSY wxT( "bmconverter_Pos_y" )
@ -72,7 +74,6 @@ private:
void ExportFile( FILE* aOutfile, int aFormat );
};
BM2CMP_FRAME::BM2CMP_FRAME() : BM2CMP_FRAME_BASE( NULL )
{
m_Config = new wxConfig();
@ -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_SIZEY, & m_FrameSize.y, -1 );
SetIcon( wxICON( bitmap2component_icon ) );
wxString msg( wxT( " 0000 " ) );
m_gridInfo->SetCellValue( 1, 0, msg );

View File

@ -32,10 +32,8 @@
#include <vector>
#include "potracelib.h"
//#include "bitmap_io.h"
#include "auxiliary.h"
#ifndef max
#define max( a, b ) ( ( (a) > (b) ) ? (a) : (b) )
#endif

View File

@ -0,0 +1,54 @@
/* 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.= ... ",
"........................ .. ",
"........................ .. ",
" ",
" .",
" . .."
};

View File

@ -798,7 +798,7 @@ int DIALOG_BUILD_BOM::PrintComponentsListByPart(
for( int jj = FOOTPRINT; jj < currCmp->GetFieldCount(); jj++ )
{
//Ensure fields exists in dummy component
if( dummyCmp.GetFieldCount() < currCmp->GetFieldCount() )
if( dummyCmp.GetFieldCount() <= jj )
dummyCmp.AddField( *currCmp->GetField( jj ) );
// store useful data
if( !currCmp->GetField( jj )->m_Text.IsEmpty() )
@ -849,23 +849,27 @@ int DIALOG_BUILD_BOM::PrintComponentsListByPart(
CONV_TO_UTF8( currCmp->GetField( DATASHEET) ->m_Text ) );
#endif
fprintf( f, "%c%s", s_ExportSeparatorSymbol,
CONV_TO_UTF8( RNames ) );
// 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 ) )
fprintf( f, "%c%4s", s_ExportSeparatorSymbol,
CONV_TO_UTF8( dummyCmp.GetField( jj )->m_Text ) );
}
fprintf( f, "%c%s\n", s_ExportSeparatorSymbol,
CONV_TO_UTF8( RNames ) );
fprintf( f, "\n" );
// Clear strings and values, to prepare next component
qty = 0;
RNames.Empty();
for( int jj = FOOTPRINT; jj < currCmp->GetFieldCount(); jj++ )
for( int jj = FOOTPRINT; jj < dummyCmp.GetFieldCount(); jj++ )
dummyCmp.GetField( jj )->m_Text.Empty();
}

View File

@ -105,12 +105,10 @@ EDA_Rect EDGE_MODULE::GetBoundingBox()
if( Module )
{
RotatePoint( &pt.x, &pt.y, Module->m_Orient );
pt.x += Module->m_Pos.x;
pt.y += Module->m_Pos.y;
pt += Module->m_Pos;
}
pt.x += m_Start0.x;
pt.y += m_Start0.y;
pt += m_Start0;
bbox.m_Pos.x = MIN( bbox.m_Pos.x, pt.x );
bbox.m_Pos.y = MIN( bbox.m_Pos.y, pt.y );
p_end.x = MAX( p_end.x, pt.x );