From 2b45335749b2b65a8cfe483d3d35179fa2b30996 Mon Sep 17 00:00:00 2001 From: Andrey Fedorushkov Date: Tue, 16 Aug 2011 22:32:56 +0400 Subject: [PATCH] bitmap2component: fix localize GUI, fix *nix native string --- bitmap2component/CMakeLists.txt | 101 ++++++++++++++-------------- bitmap2component/bitmap2cmp_gui.cpp | 24 ++++--- 2 files changed, 67 insertions(+), 58 deletions(-) diff --git a/bitmap2component/CMakeLists.txt b/bitmap2component/CMakeLists.txt index 2898ff6c10..87f54de9d8 100644 --- a/bitmap2component/CMakeLists.txt +++ b/bitmap2component/CMakeLists.txt @@ -1,50 +1,51 @@ -include_directories(${CMAKE_CURRENT_SOURCE_DIR} - ../potrace - ../polygon/kbool/include - ) - -set(BITMAP2COMPONENT_SRCS - bitmap2component.cpp - bitmap2cmp_gui_base - bitmap2cmp_gui - ) - -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) - - -if(APPLE) - set(BITMAP2COMPONENT_RESOURCES bitmap2component.icns) - set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/bitmap2component.icns" - PROPERTIES MACOSX_PACKAGE_LOCATION Resources) - set(MACOSX_BUNDLE_ICON_FILE bitmap2component.icns) - set(MACOSX_BUNDLE_GUI_IDENTIFIER org.kicad-eda.bitmap2component) -endif(APPLE) - - - -add_executable(bitmap2component WIN32 MACOSX_BUNDLE - ${BITMAP2COMPONENT_SRCS} - ${BITMAP2COMPONENT_RESOURCES}) - - -if(APPLE) - set_target_properties(bitmap2component PROPERTIES MACOSX_BUNDLE_INFO_PLIST - ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist) -endif(APPLE) - -target_link_libraries( bitmap2component - ${wxWidgets_LIBRARIES} - potrace - kbool ) - -install(TARGETS bitmap2component - DESTINATION ${KICAD_BIN} - COMPONENT binary) - +include_directories(${CMAKE_CURRENT_SOURCE_DIR} + ../potrace + ../polygon/kbool/include + ${CMAKE_SOURCE_DIR}/common + ) + +set(BITMAP2COMPONENT_SRCS + bitmap2component.cpp + bitmap2cmp_gui_base + bitmap2cmp_gui + ) + +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) + + +if(APPLE) + set(BITMAP2COMPONENT_RESOURCES bitmap2component.icns) + set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/bitmap2component.icns" + PROPERTIES MACOSX_PACKAGE_LOCATION Resources) + set(MACOSX_BUNDLE_ICON_FILE bitmap2component.icns) + set(MACOSX_BUNDLE_GUI_IDENTIFIER org.kicad-eda.bitmap2component) +endif(APPLE) + + + +add_executable(bitmap2component WIN32 MACOSX_BUNDLE + ${BITMAP2COMPONENT_SRCS} + ${BITMAP2COMPONENT_RESOURCES}) + + +if(APPLE) + set_target_properties(bitmap2component PROPERTIES MACOSX_BUNDLE_INFO_PLIST + ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist) +endif(APPLE) + +target_link_libraries( bitmap2component common polygon bitmaps + ${wxWidgets_LIBRARIES} + potrace + kbool ) + +install(TARGETS bitmap2component + DESTINATION ${KICAD_BIN} + COMPONENT binary) + diff --git a/bitmap2component/bitmap2cmp_gui.cpp b/bitmap2component/bitmap2cmp_gui.cpp index bd2a66e931..62d58f6fff 100644 --- a/bitmap2component/bitmap2cmp_gui.cpp +++ b/bitmap2component/bitmap2cmp_gui.cpp @@ -21,6 +21,13 @@ * or you may write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "fctsys.h" +#include "appl_wxstruct.h" +#include "wxstruct.h" +#include "common.h" +#include "confirm.h" +#include "gestfich.h" + #include "wx/wx.h" #include "wx/config.h" #include "wx/filename.h" @@ -32,6 +39,9 @@ #include "bitmap2component.xpm" +#include "bitmaps.h" +#include "colors_selection.h" +#include "build_version.h" #define KEYWORD_FRAME_POSX wxT( "Bmconverter_Pos_x" ) #define KEYWORD_FRAME_POSY wxT( "Bmconverter_Pos_y" ) @@ -367,27 +377,25 @@ void BM2CMP_FRAME::ExportFile( FILE* aOutfile, int aFormat ) // BM_TO_CMP_APP -class BM_TO_CMP_APP : public wxApp +void WinEDA_App::MacOpenFile(const wxString &fileName) { -public: - virtual bool OnInit(); -}; +} - -IMPLEMENT_APP( BM_TO_CMP_APP ) +IMPLEMENT_APP( WinEDA_App ) ///----------------------------------------------------------------------------- // BM_TO_CMP_APP // main program //----------------------------------------------------------------------------- -bool BM_TO_CMP_APP::OnInit() +bool WinEDA_App::OnInit() { wxInitAllImageHandlers(); - SetVendorName( wxT( "kicad" ) ); + InitEDA_Appl( wxT( "BMP2CMP" ) ); wxFrame* frame = new BM2CMP_FRAME(); + SetTopWindow( frame ); frame->Show( true ); return true;