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

#include <misc.h>

+ Inheritance diagram for CMenuSelectionReceiver:

Public Types

typedef CWindowImpl< CMenuSelectionReceiver_baseClass
 

Public Member Functions

 CMenuSelectionReceiver (HWND p_parent)
 
 ~CMenuSelectionReceiver ()
 
 BEGIN_MSG_MAP (CMenuSelectionReceiver) MESSAGE_HANDLER(WM_MENUSELECT
 
 DECLARE_WND_CLASS_EX (TEXT("{DF0087DB-E765-4283-BBAB-6AB2E8AB64A1}"), 0, 0)
 
OnMenuSelect END_MSG_MAP () protected
 

Private Member Functions

LRESULT OnMenuSelect (UINT, WPARAM p_wp, LPARAM p_lp, BOOL &)
 
 PFC_CLASS_NOT_COPYABLE (CMenuSelectionReceiver, CMenuSelectionReceiver)
 

Private Attributes

service_ptr_t< ui_status_text_overridem_status
 

Detailed Description

Definition at line 1 of file misc.h.

Member Typedef Documentation

Definition at line 9 of file misc.h.

Constructor & Destructor Documentation

CMenuSelectionReceiver::CMenuSelectionReceiver ( HWND  p_parent)
inline

Definition at line 3 of file misc.h.

3  {
4  WIN32_OP( Create(p_parent) != NULL );
5  }
CMenuSelectionReceiver::~CMenuSelectionReceiver ( )
inline

Definition at line 6 of file misc.h.

6  {
7  if (m_hWnd != NULL) DestroyWindow();
8  }

Member Function Documentation

CMenuSelectionReceiver::BEGIN_MSG_MAP ( CMenuSelectionReceiver  )
CMenuSelectionReceiver::DECLARE_WND_CLASS_EX ( TEXT("{DF0087DB-E765-4283-BBAB-6AB2E8AB64A1}")  ,
,
 
)
OnMenuSelect CMenuSelectionReceiver::END_MSG_MAP ( )
inline

Definition at line 14 of file misc.h.

15  :
16  virtual bool QueryHint(unsigned p_id,pfc::string_base & p_out) {
17  return false;
18  }
LRESULT CMenuSelectionReceiver::OnMenuSelect ( UINT  ,
WPARAM  p_wp,
LPARAM  p_lp,
BOOL  
)
inlineprivate

Definition at line 20 of file misc.h.

20  {
21  if (p_lp != 0) {
22  if (HIWORD(p_wp) & MF_POPUP) {
23  m_status.release();
24  } else {
25  pfc::string8 msg;
26  if (!QueryHint(LOWORD(p_wp),msg)) {
27  m_status.release();
28  } else {
29  if (m_status.is_empty()) {
30  if (!static_api_ptr_t<ui_control>()->override_status_text_create(m_status)) m_status.release();
31  }
32  if (m_status.is_valid()) {
33  m_status->override_text(msg);
34  }
35  }
36  }
37  } else {
38  m_status.release();
39  }
40  return 0;
41  }
bool is_empty() const
Definition: service.h:120
bool is_valid() const
Definition: service.h:119
void release()
Definition: service.h:109
service_ptr_t< ui_status_text_override > m_status
Definition: misc.h:43
Helper template used to easily access core services. Usage: static_api_ptr_t<myclass> api; api->doso...
Definition: service.h:533
CMenuSelectionReceiver::PFC_CLASS_NOT_COPYABLE ( CMenuSelectionReceiver  ,
CMenuSelectionReceiver   
)
private

Field Documentation

service_ptr_t<ui_status_text_override> CMenuSelectionReceiver::m_status
private

Definition at line 43 of file misc.h.


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