7 DECLARE_WND_CLASS_EX(TEXT(
"{DC2917D5-1288-4434-A28C-F16CFCE13C4B}"),CS_VREDRAW | CS_HREDRAW,(-1));
9 void initialize_window(HWND parent) {WIN32_OP(Create(parent,0,0,0,WS_EX_STATICEDGE) != NULL);}
23 static const GUID guid_myelem = { 0xb46dc166, 0x88f3, 0x4b45, { 0x9f, 0x77, 0xab, 0x33, 0xf4, 0xc3, 0xf2, 0xe4 } };
51 CRect rc; WIN32_OP_D( GetClientRect(&rc) );
53 WIN32_OP_D( brush.CreateSolidBrush( m_callback->query_std_color(
ui_color_background) ) != NULL );
54 WIN32_OP_D( dc.FillRect(&rc, brush) );
59 dc.SetTextColor( m_callback->query_std_color(
ui_color_text) );
60 dc.SetBkMode(TRANSPARENT);
62 const UINT format = DT_NOPREFIX | DT_CENTER | DT_VCENTER | DT_SINGLELINE;
64 WIN32_OP_D( GetClientRect(&rc) );
65 WIN32_OP_D( dc.DrawText(_T(
"This is a sample element."), -1, &rc, format) > 0 );
void notify(const GUID &p_what, t_size p_param1, const void *p_param2, t_size p_param2size)
Used by host to notify the element about various events. See ui_element_notify_* GUIDs for possible p...
static const GUID ui_element_subclass_utility
Configuration of a UI element.
static const GUID ui_color_background
static const GUID ui_element_notify_colors_changed
Dispatched through ui_element_instance::notify() when host changes color settings. Other parameters are not used and should be set to zero.
static const GUID ui_font_default
BOOL OnEraseBkgnd(CDCHandle)
static ui_element_config::ptr g_get_default_configuration()
static service_factory_single_t< ui_element_myimpl > g_ui_element_myimpl_factory
typedef BOOL(WINAPI *pPowerSetRequest_t)(__in HANDLE PowerRequest
static const char * g_get_description()
ui_element_config::ptr m_config
LRESULT OnLButtonDown(UINT, WPARAM, LPARAM, BOOL &)
static const GUID ui_element_notify_font_changed
static const GUID ui_color_text
Instance of a UI element.
const ui_element_instance_callback_ptr m_callback
void set_configuration(ui_element_config::ptr config)
Alters element's current configuration. Specified ui_element_config's GUID must be the same as this e...
DECLARE_WND_CLASS_EX(TEXT("{DC2917D5-1288-4434-A28C-F16CFCE13C4B}"), CS_VREDRAW|CS_HREDRAW,(-1))
static void g_get_name(pfc::string_base &out)
ui_element_config::ptr get_configuration()
Retrieves element's current configuration. Returned object's GUID must be set to your element's GUID ...
static GUID g_get_subclass()
Autopointer class to be used with all services. Manages reference counter calls behind-the-scenes.
void initialize_window(HWND parent)
static service_ptr_t< ui_element_config > g_create_empty(const GUID &id=pfc::guid_null)
virtual HWND get_wnd()=0
Returns ui_element_instance's window handle. UI Element's window must be created when the ui_element_...
BEGIN_MSG_MAP(ui_element_dummy) MESSAGE_HANDLER(WM_LBUTTONDOWN