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.


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

Function Documentation

◆ set_wxMenuIcon()

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

Definition at line 61 of file context_menu.cpp.

62 {
63  if( !Pgm().CommonSettings() )
64  return;
66  // Retrieve the global applicaton show icon option:
67  bool useImagesInMenus;
68  Pgm().CommonSettings()->Read( USE_ICONS_IN_MENUS_KEY, &useImagesInMenus );
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:190
Definition: pgm_base.h:45

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

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