foobar2000 SDK  2015-08-03
Public Member Functions | Private Member Functions | Private Attributes
win32_menu

#include <win-objects.h>

Public Member Functions

 win32_menu (HMENU p_initval)
 
 win32_menu ()
 
 ~win32_menu ()
 
void create_popup ()
 
HMENU detach ()
 
HMENU get () const
 
bool is_valid () const
 
void release ()
 
void set (HMENU p_menu)
 

Private Member Functions

 win32_menu (const win32_menu &)
 
const win32_menuoperator= (const win32_menu &)
 

Private Attributes

HMENU m_menu
 

Detailed Description

Definition at line 102 of file win-objects.h.

Constructor & Destructor Documentation

win32_menu::win32_menu ( HMENU  p_initval)
inline

Definition at line 104 of file win-objects.h.

104 : m_menu(p_initval) {}
HMENU m_menu
Definition: win-objects.h:118
win32_menu::win32_menu ( )
inline

Definition at line 105 of file win-objects.h.

105 : m_menu(NULL) {}
HMENU m_menu
Definition: win-objects.h:118
win32_menu::~win32_menu ( )
inline

Definition at line 106 of file win-objects.h.

106 {release();}
void release()
win32_menu::win32_menu ( const win32_menu )
private

Member Function Documentation

void win32_menu::create_popup ( )

Definition at line 190 of file win-objects.cpp.

190  {
191  release();
192  SetLastError(NO_ERROR);
193  m_menu = CreatePopupMenu();
194  if (m_menu == NULL) throw exception_win32(GetLastError());
195 }
HMENU m_menu
Definition: win-objects.h:118
void release()
HMENU win32_menu::detach ( )
inline

Definition at line 111 of file win-objects.h.

111 {return pfc::replace_t(m_menu,(HMENU)NULL);}
t_type replace_t(t_type &p_var, const t_newval &p_newval)
Definition: primitives.h:682
HMENU m_menu
Definition: win-objects.h:118
HMENU win32_menu::get ( ) const
inline

Definition at line 110 of file win-objects.h.

110 {return m_menu;}
HMENU m_menu
Definition: win-objects.h:118
bool win32_menu::is_valid ( ) const
inline

Definition at line 113 of file win-objects.h.

113 {return m_menu != NULL;}
HMENU m_menu
Definition: win-objects.h:118
const win32_menu& win32_menu::operator= ( const win32_menu )
private
void win32_menu::release ( )

Definition at line 183 of file win-objects.cpp.

183  {
184  if (m_menu != NULL) {
185  DestroyMenu(m_menu);
186  m_menu = NULL;
187  }
188 }
HMENU m_menu
Definition: win-objects.h:118
void win32_menu::set ( HMENU  p_menu)
inline

Definition at line 108 of file win-objects.h.

108 {release(); m_menu = p_menu;}
HMENU m_menu
Definition: win-objects.h:118
void release()

Field Documentation

HMENU win32_menu::m_menu
private

Definition at line 118 of file win-objects.h.


The documentation for this class was generated from the following files: