Commit c5c98f95 authored by Wayne Stambaugh's avatar Wayne Stambaugh
Browse files

Add CMake code to enable or disable using images in menu items.

* Add USE_IMAGES_IN_MENUS definition to override the default platform
  behavior for adding images to menu items.
* Update COMPILING.txt to document how to use USE_IMAGES_IN_MENUS.
* Fix Windows segfault when creating language selection submenu introduced
  by new bitmap code in r3087.
* Changed per email from JP from CVPcb to CvPcb because I'm getting old and
  blind and misread the email.
* Lot's of Doxygen comment and coding style policy fixes.
parent 45c5e594
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -107,6 +107,19 @@ if(USE_BOOST_POLYGON_LIBRARY)
    add_definitions(-DUSE_BOOST_POLYGON_LIBRARY)
endif(USE_BOOST_POLYGON_LIBRARY)

# Allow user to override the default settings for adding images to menu items.  By default
# images in menu items are enabled on all plaforms except OSX.  This can be over ridden by
# defining -DUSE_IMAGES_IN_MENUS=ON/OFF to force the preferred behavior.
if(NOT DEFINED USE_IMAGES_IN_MENUS)
    if(NOT APPLE)
        set(USE_IMAGES_IN_MENUS ON)
    endif(NOT APPLE)
else(NOT DEFINED USE_IMAGES_IN_MENUS)
    if(USE_IMAGES_IN_MENUS)
        set(USE_IMAGES_IN_MENUS ON)
    endif(USE_IMAGES_IN_MENUS)
endif(NOT DEFINED USE_IMAGES_IN_MENUS)

# Locations for install targets.
set(KICAD_BIN bin
    CACHE PATH "Location of KiCad binaries.")
+2 −0
Original line number Diff line number Diff line
@@ -50,4 +50,6 @@
/* Warning!!!  Using wxGraphicContext for rendering is experimental. */
#cmakedefine USE_WX_GRAPHICS_CONTEXT 1

#cmakedefine USE_IMAGES_IN_MENUS 1

#endif  /* __CONFIG_H__ */
+5 −0
Original line number Diff line number Diff line
@@ -223,5 +223,10 @@ One of these 2 option *must* be set to ON:
   It requires wxWidgets to be built with the --enable-graphics_ctx switch.
   See building wxWidgets above.

 USE_IMAGES_IN_MENUS ON/OFF (OPTIONAL)
   Force building Kicad with or without images in menu items.  If this is not defined on
   when CMake is used to create the build files, images will be included in menu items
   on all platforms except OSX.

Note: that it is easy to build only a specific binary such as pcbnew alone:
    make pcbnew
+80 −152

File changed.

Preview size limit exceeded, changes collapsed.

+5 −10
Original line number Diff line number Diff line
@@ -47,14 +47,6 @@ wxString GetQuotedText( wxString & text )
}


/*
 * Called by the automatic association button
 * Read *.equ files to try to find corresponding footprint
 * for each component that is not already linked to a footprint ( a "free"
 * component )
 * format of a line:
 * 'cmp_ref' 'footprint_name'
 */
void CVPCB_MAINFRAME::AssocieModule( wxCommandEvent& event )
{
    FOOTPRINT_ALIAS_LIST aliases;
@@ -72,6 +64,7 @@ void CVPCB_MAINFRAME::AssocieModule( wxCommandEvent& event )
    for( ii = 0; ii < m_AliasLibNames.GetCount(); ii++ )
    {
        fn = m_AliasLibNames[ii];

        if( !fn.HasExt() ) {
            fn.SetExt( FootprintAliasFileExtension );
            // above fails if filename have more than one point
@@ -142,10 +135,12 @@ found in the default search paths." ),
        BOOST_FOREACH( FOOTPRINT_ALIAS& alias, aliases )
        {
            bool found = false;

            if( alias.m_Name.CmpNoCase( component.m_Value ) != 0 )
                continue;

            /* filter alias so one can use multiple aliases (for polar and nonpolar caps for example) */
            /* filter alias so one can use multiple aliases (for polar and nonpolar caps for
             * example) */
            FOOTPRINT_INFO *module = m_footprints.GetModuleInfo( alias.m_FootprintName );

            if( module )
@@ -164,7 +159,7 @@ found in the default search paths." ),
any of the project footprint libraries." ),
                            GetChars( component.m_Reference ),
                            GetChars( alias.m_FootprintName ) );
                wxMessageBox( msg, _( "CVPcb Error" ), wxOK | wxICON_ERROR,
                wxMessageBox( msg, _( "CvPcb Error" ), wxOK | wxICON_ERROR,
                              this );
            }
            if( found )
Loading