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  if( !Pgm().CommonSettings() )
64  return;
65 
66  // Retrieve the global applicaton show icon option:
67  bool useImagesInMenus;
68  Pgm().CommonSettings()->Read( USE_ICONS_IN_MENUS_KEY, &useImagesInMenus );
69 
70  if( aIcon && useImagesInMenus )
71  aMenu->SetBitmap( KiBitmap( aIcon ) );
72 }
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:66
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:79
VTBL_ENTRY wxConfigBase * CommonSettings() const
Definition: pgm_base.h:187
#define USE_ICONS_IN_MENUS_KEY
Definition: pgm_base.h:44