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::GetUseIconsInMenus(), KiBitmap(), and Pgm().

Referenced by CONTEXT_MENU::Add().

62 {
63  // Retrieve the global applicaton show icon option:
64  bool useImagesInMenus = Pgm().GetUseIconsInMenus();
65 
66  if( aIcon && useImagesInMenus )
67  {
68  aMenu->SetBitmap( KiBitmap( aIcon ) );
69  }
70 }
PGM_BASE & Pgm()
The global Program "get" accessor.
Definition: kicad.cpp:65
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Function KiBitmap constructs a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:36
bool GetUseIconsInMenus()
Definition: pgm_base.h:328