← Back to team overview

kicad-developers team mailing list archive

Re: KiCad new look - new icons and new buttons

 

> Dick,
>
> I ran into a problem on Windows this morning with a segfault when creating the
> language menu.  I added KiBitmap() where the images get added to the menu item
> and it seems to have fixed the problem on CvPcb.  It's still in the process of
> building so I'm not sure if there are other issues in any of the other apps.
> I'm working on it and I'll keep you posted.

I think the problem was the

    const BITMAP_REF&  m_Lang_Icon;


which I think should now be:


    BITMAP_DEF m_Lang_Icon;


This keeps from making those bitmaps on any platform except Windows and only if
your
USE_IMAGES_IN_MENUS toggle is on.


Also, we'd eventually have needed the attached tweak to SetBitmaps() in macros.h.

Please consider the attached patch, and try it on Windows please.

Feel free to commit it or say I can.


Thanks,

Dick



=== modified file 'common/edaappl.cpp'
--- common/edaappl.cpp	2011-08-29 19:50:05 +0000
+++ common/edaappl.cpp	2011-08-29 20:50:11 +0000
@@ -62,19 +62,19 @@
  */
 struct LANGUAGE_DESCR
 {
-    /* wxWidgets locale identifier (See wxWidgets doc) */
-    int m_WX_Lang_Identifier;
-
-    /* KiCad identifier used in menu selection (See id.h) */
-    int m_KI_Lang_Identifier;
-
-    /* The menu language icons */
-    const wxBitmap m_Lang_Icon;
-
-    /* Labels used in menus */
+    /// wxWidgets locale identifier (See wxWidgets doc)
+    int     m_WX_Lang_Identifier;
+
+    /// KiCad identifier used in menu selection (See id.h)
+    int     m_KI_Lang_Identifier;
+
+    /// The menu language icons
+    BITMAP_DEF m_Lang_Icon;
+
+    /// Labels used in menus
     const wxChar* m_Lang_Label;
 
-    /* Set to true if the m_Lang_Label must not be translated */
+    /// Set to true if the m_Lang_Label must not be translated
     bool m_DoNotTranslate;
 };
 
@@ -91,7 +91,7 @@
     {
         wxLANGUAGE_DEFAULT,
         ID_LANGUAGE_DEFAULT,
-        KiBitmap( lang_def_xpm ),
+        lang_def_xpm,
         _( "Default" )
     },
 
@@ -99,7 +99,7 @@
     {
         wxLANGUAGE_ENGLISH,
         ID_LANGUAGE_ENGLISH,
-        KiBitmap( lang_en_xpm ),
+        lang_en_xpm,
         wxT( "English" ),
         true
     },
@@ -108,7 +108,7 @@
     {
         wxLANGUAGE_FRENCH,
         ID_LANGUAGE_FRENCH,
-        KiBitmap( lang_fr_xpm ),
+        lang_fr_xpm,
         _( "French" )
     },
 
@@ -116,7 +116,7 @@
     {
         wxLANGUAGE_FINNISH,
         ID_LANGUAGE_FINNISH,
-        KiBitmap( lang_fi_xpm ),
+        lang_fi_xpm,
         _( "Finnish" )
     },
 
@@ -124,7 +124,7 @@
     {
         wxLANGUAGE_SPANISH,
         ID_LANGUAGE_SPANISH,
-        KiBitmap( lang_es_xpm ),
+        lang_es_xpm,
         _( "Spanish" )
     },
 
@@ -132,7 +132,7 @@
     {
         wxLANGUAGE_PORTUGUESE,
         ID_LANGUAGE_PORTUGUESE,
-        KiBitmap( lang_pt_xpm ),
+        lang_pt_xpm,
         _( "Portuguese" )
     },
 
@@ -140,7 +140,7 @@
     {
         wxLANGUAGE_ITALIAN,
         ID_LANGUAGE_ITALIAN,
-        KiBitmap( lang_it_xpm ),
+        lang_it_xpm,
         _( "Italian" )
     },
 
@@ -148,7 +148,7 @@
     {
         wxLANGUAGE_GERMAN,
         ID_LANGUAGE_GERMAN,
-        KiBitmap( lang_de_xpm ),
+        lang_de_xpm,
         _( "German" )
     },
 
@@ -156,7 +156,7 @@
     {
         wxLANGUAGE_GREEK,
         ID_LANGUAGE_GREEK,
-        KiBitmap( lang_gr_xpm ),
+        lang_gr_xpm,
         _( "Greek" )
     },
 
@@ -164,7 +164,7 @@
     {
         wxLANGUAGE_SLOVENIAN,
         ID_LANGUAGE_SLOVENIAN,
-        KiBitmap( lang_sl_xpm ),
+        lang_sl_xpm,
         _( "Slovenian" )
     },
 
@@ -172,7 +172,7 @@
     {
         wxLANGUAGE_HUNGARIAN,
         ID_LANGUAGE_HUNGARIAN,
-        KiBitmap( lang_hu_xpm ),
+        lang_hu_xpm,
         _( "Hungarian" )
     },
 
@@ -180,7 +180,7 @@
     {
         wxLANGUAGE_POLISH,
         ID_LANGUAGE_POLISH,
-        KiBitmap( lang_pl_xpm ),
+        lang_pl_xpm,
         _( "Polish" )
     },
 
@@ -188,7 +188,7 @@
     {
         wxLANGUAGE_CZECH,
         ID_LANGUAGE_CZECH,
-        KiBitmap( lang_cs_xpm ),
+        lang_cs_xpm,
         _( "Czech" )
     },
 
@@ -196,7 +196,7 @@
     {
         wxLANGUAGE_RUSSIAN,
         ID_LANGUAGE_RUSSIAN,
-        KiBitmap( lang_ru_xpm ),
+        lang_ru_xpm,
         _( "Russian" )
     },
 
@@ -204,7 +204,7 @@
     {
         wxLANGUAGE_KOREAN,
         ID_LANGUAGE_KOREAN,
-        KiBitmap( lang_ko_xpm ),
+        lang_ko_xpm,
         _( "Korean" )
     },
 
@@ -212,7 +212,7 @@
     {
         wxLANGUAGE_CHINESE_SIMPLIFIED,
         ID_LANGUAGE_CHINESE_SIMPLIFIED,
-        KiBitmap( lang_chinese_xpm ),
+        lang_chinese_xpm,
         _( "Chinese simplified" )
     },
 
@@ -220,7 +220,7 @@
     {
         wxLANGUAGE_CATALAN,
         ID_LANGUAGE_CATALAN,
-        KiBitmap( lang_catalan_xpm ),
+        lang_catalan_xpm,
         _( "Catalan" )
     },
 
@@ -228,7 +228,7 @@
     {
         wxLANGUAGE_DUTCH,
         ID_LANGUAGE_DUTCH,
-        KiBitmap( lang_nl_xpm ),
+        lang_nl_xpm,
         _( "Dutch" )
     },
 
@@ -236,7 +236,7 @@
     {
         wxLANGUAGE_JAPANESE,
         ID_LANGUAGE_JAPANESE,
-        KiBitmap( lang_jp_xpm ),
+        lang_jp_xpm,
         _( "Japanese" )
      }
 };

=== modified file 'include/bitmaps.h'
--- include/bitmaps.h	2011-08-29 03:04:59 +0000
+++ include/bitmaps.h	2011-08-29 03:06:56 +0000
@@ -29,8 +29,8 @@
 
 #endif
 
-/// a BITMAP_DEF is really a const pointer to an opaque structure.  So you
-/// should never need to use 'const' with it.
+/// a BITMAP_DEF is really a const pointer to an opaque
+/// structure.  So you should never need to use 'const' with it.
 typedef const BITMAP_OPAQUE *BITMAP_DEF;
 
 

=== modified file 'include/macros.h'
--- include/macros.h	2011-08-29 19:50:05 +0000
+++ include/macros.h	2011-08-29 20:48:19 +0000
@@ -216,7 +216,7 @@
 
 // macro to add a bitmap list to check menus (do not use with normal menus)
 #if defined( USE_IMAGES_IN_MENUS ) && defined(  __WINDOWS__ )
-#  define SETBITMAPS( icon ) item->SetBitmaps( KiBitmap( apply_xpm ), (icon) )
+#  define SETBITMAPS( icon ) item->SetBitmaps( KiBitmap( apply_xpm ), KiBitmap( icon ) )
 #else
 #  define SETBITMAPS( icon )
 #endif


Follow ups

References