foobar2000 SDK  2015-01-14
Public Member Functions
ui_element_instanceabstract

#include <ui_element.h>

+ Inheritance diagram for ui_element_instance:

Public Member Functions

virtual void edit_mode_context_menu_build (const POINT &p_point, bool p_fromkeyboard, HMENU p_menu, unsigned p_id_base)
 
virtual void edit_mode_context_menu_command (const POINT &p_point, bool p_fromkeyboard, unsigned p_id, unsigned p_id_base)
 
virtual bool edit_mode_context_menu_get_description (unsigned p_id, unsigned p_id_base, pfc::string_base &p_out)
 
virtual bool edit_mode_context_menu_get_focus_point (POINT &p_point)
 
virtual bool edit_mode_context_menu_test (const POINT &p_point, bool p_fromkeyboard)
 
 FB2K_MAKE_SERVICE_INTERFACE (ui_element_instance, service_base)
 
virtual ui_element_config::ptr get_configuration ()=0
 
virtual double get_focus_priority ()
 
virtual bool get_focus_priority_subclass (double &p_out, const GUID &p_subclass)
 
virtual GUID get_guid ()=0
 
virtual ui_element_min_max_info get_min_max_info ()
 
virtual GUID get_subclass ()=0
 
virtual HWND get_wnd ()=0
 
virtual void notify (const GUID &p_what, t_size p_param1, const void *p_param2, t_size p_param2size)
 
virtual void set_configuration (ui_element_config::ptr data)=0
 
virtual void set_default_focus ()
 
void set_default_focus_fallback ()
 
virtual bool set_default_focus_subclass (const GUID &p_subclass)
 
- Public Member Functions inherited from service_base
template<typename outPtr_t >
bool cast (outPtr_t &outPtr)
 
virtual int service_add_ref ()=0 throw ()
 
virtual bool service_query (service_ptr_t< service_base > &p_out, const GUID &p_guid)
 
template<class T >
bool service_query_t (service_ptr_t< T > &p_out)
 
virtual int service_release ()=0 throw ()
 

Additional Inherited Members

- Public Types inherited from service_base
typedef service_base t_interface
 
- Protected Member Functions inherited from service_base
 service_base ()
 
 ~service_base ()
 

Detailed Description

Instance of a UI element.

Definition at line 270 of file ui_element.h.

Member Function Documentation

virtual void ui_element_instance::edit_mode_context_menu_build ( const POINT &  p_point,
bool  p_fromkeyboard,
HMENU  p_menu,
unsigned  p_id_base 
)
inlinevirtual

Definition at line 322 of file ui_element.h.

322 {}
virtual void ui_element_instance::edit_mode_context_menu_command ( const POINT &  p_point,
bool  p_fromkeyboard,
unsigned  p_id,
unsigned  p_id_base 
)
inlinevirtual

Definition at line 323 of file ui_element.h.

323 {}
virtual bool ui_element_instance::edit_mode_context_menu_get_description ( unsigned  p_id,
unsigned  p_id_base,
pfc::string_base p_out 
)
inlinevirtual

Definition at line 327 of file ui_element.h.

327 {return false;}
virtual bool ui_element_instance::edit_mode_context_menu_get_focus_point ( POINT &  p_point)
inlinevirtual
Parameters
p_pointReceives the point to spawn context menu over when user has pressed the context menu key; in screen coordinates.

Definition at line 325 of file ui_element.h.

325 {return false;}
virtual bool ui_element_instance::edit_mode_context_menu_test ( const POINT &  p_point,
bool  p_fromkeyboard 
)
inlinevirtual
Parameters
p_pointContext menu point in screen coordinates. Always within out window's rect.
Returns
True to request edit_mode_context_menu_build() call to add our own items to the menu, false if we can't supply a context menu for this point.

Definition at line 321 of file ui_element.h.

321 {return false;}
ui_element_instance::FB2K_MAKE_SERVICE_INTERFACE ( ui_element_instance  ,
service_base   
)
virtual ui_element_config::ptr ui_element_instance::get_configuration ( )
pure virtual

Retrieves element's current configuration. Returned object's GUID must be set to your element's GUID so your element can be re-instantiated with stored settings.

Implemented in CMyElemWindow.

virtual double ui_element_instance::get_focus_priority ( )
inlinevirtual

Returns element's focus priority.

Definition at line 287 of file ui_element.h.

287 {return 0;}
virtual bool ui_element_instance::get_focus_priority_subclass ( double &  p_out,
const GUID p_subclass 
)
inlinevirtual

Overridden by containers only.

Definition at line 292 of file ui_element.h.

292  {
293  if (p_subclass == get_subclass()) {p_out = get_focus_priority(); return true;}
294  else {return false;}
295  }
virtual double get_focus_priority()
Returns element's focus priority.
Definition: ui_element.h:287
virtual GUID get_subclass()=0
Returns subclass GUID of the element. The return value must be the same as your ui_element::get_guid(...
virtual GUID ui_element_instance::get_guid ( )
pure virtual

Returns GUID of the element. The return value must be the same as your ui_element::get_guid().

virtual ui_element_min_max_info ui_element_instance::get_min_max_info ( )
inlinevirtual

Retrieves element's minimum/maximum window size. Default implementation will fall back to WM_GETMINMAXINFO.

Definition at line 303 of file ui_element.h.

303  {
305  MINMAXINFO temp = {};
306  temp.ptMaxTrackSize.x = 1024*1024;//arbitrary huge number
307  temp.ptMaxTrackSize.y = 1024*1024;
308  SendMessage(get_wnd(),WM_GETMINMAXINFO,0,(LPARAM)&temp);
309  if (temp.ptMinTrackSize.x >= 0) ret.m_min_width = temp.ptMinTrackSize.x;
310  if (temp.ptMaxTrackSize.x > 0) ret.m_max_width = temp.ptMaxTrackSize.x;
311  if (temp.ptMinTrackSize.y >= 0) ret.m_min_height = temp.ptMinTrackSize.y;
312  if (temp.ptMaxTrackSize.y > 0) ret.m_max_height = temp.ptMaxTrackSize.y;
313  return ret;
314  }
virtual HWND get_wnd()=0
Returns ui_element_instance's window handle. UI Element's window must be created when the ui_element_...
virtual GUID ui_element_instance::get_subclass ( )
pure virtual

Returns subclass GUID of the element. The return value must be the same as your ui_element::get_guid().

virtual HWND ui_element_instance::get_wnd ( )
pure virtual

Returns ui_element_instance's window handle.
UI Element's window must be created when the ui_element_instance object is created. The window may or may not be destroyed by caller before the ui_element_instance itself is destroyed. If caller doesn't destroy the window before ui_element_instance destruction, ui_element_instance destructor should do it.

virtual void ui_element_instance::notify ( const GUID p_what,
t_size  p_param1,
const void *  p_param2,
t_size  p_param2size 
)
inlinevirtual

Used by host to notify the element about various events. See ui_element_notify_* GUIDs for possible p_what parameter; meaning of other parameters depends on p_what value. Container classes should dispatch all notifications to their children.

Reimplemented in CMyElemWindow.

Definition at line 317 of file ui_element.h.

317 {}
virtual void ui_element_instance::set_configuration ( ui_element_config::ptr  data)
pure virtual

Alters element's current configuration. Specified ui_element_config's GUID must be the same as this element's GUID.

Implemented in CMyElemWindow.

virtual void ui_element_instance::set_default_focus ( )
inlinevirtual

Elements that host other elements should pass the call to the child with the highest priority. Override for container elements.

Definition at line 289 of file ui_element.h.

void set_default_focus_fallback()
Helper.
Definition: ui_element.h:331
void ui_element_instance::set_default_focus_fallback ( )
inline

Helper.

Definition at line 331 of file ui_element.h.

331  {
332  const HWND thisWnd = this->get_wnd();
333  if (thisWnd != NULL) ::SetFocus(thisWnd);
334  }
virtual HWND get_wnd()=0
Returns ui_element_instance's window handle. UI Element's window must be created when the ui_element_...
virtual bool ui_element_instance::set_default_focus_subclass ( const GUID p_subclass)
inlinevirtual

Overridden by containers only.

Definition at line 297 of file ui_element.h.

297  {
298  if (p_subclass == get_subclass()) {set_default_focus(); return true;}
299  else {return false;}
300  }
virtual void set_default_focus()
Elements that host other elements should pass the call to the child with the highest priority...
Definition: ui_element.h:289
virtual GUID get_subclass()=0
Returns subclass GUID of the element. The return value must be the same as your ui_element::get_guid(...

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