KiCad PCB EDA Suite
context_menu.cpp File Reference
#include <tool/tool_event.h>
#include <tool/tool_manager.h>
#include <tool/tool_interactive.h>
#include <tool/context_menu.h>
#include <wx/log.h>
#include <pgm_base.h>
#include <functional>

Go to the source code of this file.

Functions

static void set_wxMenuIcon (wxMenuItem *aMenu, const BITMAP_OPAQUE *aIcon)
 

Function Documentation

static void set_wxMenuIcon ( wxMenuItem *  aMenu,
const BITMAP_OPAQUE aIcon 
)
static

Definition at line 61 of file context_menu.cpp.

References PGM_BASE::CommonSettings(), KiBitmap(), Pgm(), and USE_ICONS_IN_MENUS_KEY.

Referenced by CONTEXT_MENU::Add(), and CONTEXT_MENU::DisplayTitle().

62 {
63  // Retrieve the global applicaton show icon option:
64  bool useImagesInMenus;
65  Pgm().CommonSettings()->Read( USE_ICONS_IN_MENUS_KEY, &useImagesInMenus );
66 
67  if( aIcon && useImagesInMenus )
68  aMenu->SetBitmap( KiBitmap( aIcon ) );
69 }
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:66
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:78
VTBL_ENTRY wxConfigBase * CommonSettings() const
Definition: pgm_base.h:162
#define USE_ICONS_IN_MENUS_KEY
Definition: pgm_base.h:43