ReactOS  0.4.14-dev-337-gf981a68
CToolbar< TItemData > Class Template Reference

#include <rosctrls.h>

Inheritance diagram for CToolbar< TItemData >:
Collaboration diagram for CToolbar< TItemData >:

Public Member Functions

HWND Create (HWND hWndParent, DWORD dwStyles=0, DWORD dwExStyles=0)
 
DWORD SetButtonStructSize ()
 
HWND GetTooltip ()
 
DWORD SetTooltip (HWND hWndTooltip)
 
INT GetHotItem ()
 
DWORD SetHotItem (INT item)
 
int GetButtonCount ()
 
DWORD GetButton (int index, TBBUTTON *btn)
 
DWORD AddButton (TBBUTTON *btn)
 
DWORD AddButtons (int count, TBBUTTON *buttons)
 
DWORD InsertButton (int insertAt, TBBUTTON *btn)
 
DWORD MoveButton (int oldIndex, int newIndex)
 
DWORD DeleteButton (int index)
 
DWORD GetButtonInfo (int cmdId, TBBUTTONINFO *info)
 
DWORD SetButtonInfo (int cmdId, TBBUTTONINFO *info)
 
DWORD CheckButton (int cmdId, BOOL bCheck)
 
DWORD GetButtonSize ()
 
DWORD SetButtonSize (int w, int h)
 
DWORD AutoSize ()
 
DWORD GetMaxSize (LPSIZE size)
 
DWORD GetIdealSize (BOOL useHeight, LPSIZE size)
 
DWORD GetMetrics (TBMETRICS *tbm)
 
DWORD SetMetrics (TBMETRICS *tbm)
 
DWORD GetItemRect (int index, LPRECT prcItem)
 
DWORD SetRedraw (BOOL bEnable)
 
DWORD GetPadding ()
 
DWORD SetPadding (int x, int y)
 
HIMAGELIST SetImageList (HIMAGELIST himl)
 
INT HitTest (PPOINT ppt)
 
TItemData * GetItemData (int index)
 
DWORD SetItemData (int index, TItemData *data)
 

Detailed Description

template<typename TItemData = DWORD_PTR>
class CToolbar< TItemData >

Definition at line 249 of file rosctrls.h.

Member Function Documentation

◆ AddButton()

template<typename TItemData = DWORD_PTR>
DWORD CToolbar< TItemData >::AddButton ( TBBUTTON btn)
inline

Definition at line 320 of file rosctrls.h.

321  {
322  return SendMessageW(TB_ADDBUTTONS, 1, reinterpret_cast<LPARAM>(btn));
323  }
#define TB_ADDBUTTONS
Definition: commctrl.h:1267
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by CNotifyToolbar::AddButton().

◆ AddButtons()

template<typename TItemData = DWORD_PTR>
DWORD CToolbar< TItemData >::AddButtons ( int  count,
TBBUTTON buttons 
)
inline

Definition at line 325 of file rosctrls.h.

326  {
327  return SendMessageW(TB_ADDBUTTONS, count, reinterpret_cast<LPARAM>(buttons));
328  }
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define TB_ADDBUTTONS
Definition: commctrl.h:1267
HWND buttons[5]
Definition: sndrec32.cpp:40
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

◆ AutoSize()

template<typename TItemData = DWORD_PTR>
DWORD CToolbar< TItemData >::AutoSize ( )
inline

Definition at line 371 of file rosctrls.h.

372  {
373  return SendMessageW(TB_AUTOSIZE);
374  }
#define TB_AUTOSIZE
Definition: commctrl.h:1133
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by CMainWindow::CreateLayout(), CSysPagerWnd::OnSize(), and CMainWindow::OnSize().

◆ CheckButton()

template<typename TItemData = DWORD_PTR>
DWORD CToolbar< TItemData >::CheckButton ( int  cmdId,
BOOL  bCheck 
)
inline

Definition at line 355 of file rosctrls.h.

356  {
357  return SendMessageW(TB_CHECKBUTTON, cmdId, MAKELPARAM(bCheck, 0));
358  }
#define MAKELPARAM(l, h)
Definition: winuser.h:3947
#define TB_CHECKBUTTON
Definition: commctrl.h:1039
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

◆ Create()

template<typename TItemData = DWORD_PTR>
HWND CToolbar< TItemData >::Create ( HWND  hWndParent,
DWORD  dwStyles = 0,
DWORD  dwExStyles = 0 
)
inline

Definition at line 254 of file rosctrls.h.

255  {
256  if (!dwStyles)
257  {
258  dwStyles = WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN;
259  }
260 
261  if (!dwExStyles)
262  {
263  dwExStyles = WS_EX_TOOLWINDOW;
264  }
265 
266  m_hWnd = CreateWindowExW(dwExStyles,
268  NULL,
269  dwStyles,
270  0, 0, 0, 0, hWndParent,
271  NULL,
272  _AtlBaseModule.GetModuleInstance(),
273  NULL);
274 
275  if (!m_hWnd)
276  return NULL;
277 
278  /* Identify the version we're using */
280 
281  return m_hWnd;
282  }
#define WS_CHILD
Definition: pedump.c:617
#define WS_CLIPCHILDREN
Definition: pedump.c:619
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
DWORD SetButtonStructSize()
Definition: rosctrls.h:284
#define TOOLBARCLASSNAME
Definition: commctrl.h:942
smooth NULL
Definition: ftsmooth.c:416
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
#define WS_VISIBLE
Definition: pedump.c:620

Referenced by CMenuToolbarBase::CreateToolbar(), CNotifyToolbar::Initialize(), and CTaskToolbar::Initialize().

◆ DeleteButton()

template<typename TItemData = DWORD_PTR>
DWORD CToolbar< TItemData >::DeleteButton ( int  index)
inline

Definition at line 340 of file rosctrls.h.

341  {
342  return SendMessageW(TB_DELETEBUTTON, index, 0);
343  }
GLuint index
Definition: glext.h:6031
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define TB_DELETEBUTTON
Definition: commctrl.h:1104

Referenced by CTaskSwitchWnd::DeleteTaskItemButton().

◆ GetButton()

template<typename TItemData = DWORD_PTR>
DWORD CToolbar< TItemData >::GetButton ( int  index,
TBBUTTON btn 
)
inline

Definition at line 315 of file rosctrls.h.

316  {
317  return SendMessageW(TB_GETBUTTON, index, reinterpret_cast<LPARAM>(btn));
318  }
#define TB_GETBUTTON
Definition: commctrl.h:1105
GLuint index
Definition: glext.h:6031
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by CToolbar<>::GetItemData().

◆ GetButtonCount()

template<typename TItemData = DWORD_PTR>
int CToolbar< TItemData >::GetButtonCount ( )
inline

Definition at line 310 of file rosctrls.h.

311  {
313  }
#define TB_BUTTONCOUNT
Definition: commctrl.h:1106
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by CBalloonQueue::IndexOf().

◆ GetButtonInfo()

template<typename TItemData = DWORD_PTR>
DWORD CToolbar< TItemData >::GetButtonInfo ( int  cmdId,
TBBUTTONINFO info 
)
inline

Definition at line 345 of file rosctrls.h.

346  {
347  return SendMessageW(TB_GETBUTTONINFO, cmdId, reinterpret_cast<LPARAM>(info));
348  }
#define TB_GETBUTTONINFO
Definition: commctrl.h:1258
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

◆ GetButtonSize()

template<typename TItemData = DWORD_PTR>
DWORD CToolbar< TItemData >::GetButtonSize ( )
inline

Definition at line 361 of file rosctrls.h.

362  {
364  }
#define TB_GETBUTTONSIZE
Definition: commctrl.h:1156
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

◆ GetHotItem()

template<typename TItemData = DWORD_PTR>
INT CToolbar< TItemData >::GetHotItem ( )
inline

Definition at line 299 of file rosctrls.h.

300  {
301  return SendMessageW(TB_GETHOTITEM);
302  }
#define TB_GETHOTITEM
Definition: commctrl.h:1166
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

◆ GetIdealSize()

template<typename TItemData = DWORD_PTR>
DWORD CToolbar< TItemData >::GetIdealSize ( BOOL  useHeight,
LPSIZE  size 
)
inline

Definition at line 381 of file rosctrls.h.

382  {
383  return SendMessageW(TB_GETIDEALSIZE, useHeight, reinterpret_cast<LPARAM>(size));
384  }
#define TB_GETIDEALSIZE
Definition: commctrl.h:1280
GLsizeiptr size
Definition: glext.h:5919
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by CSysPagerWnd::GetSize().

◆ GetItemData()

template<typename TItemData = DWORD_PTR>
TItemData* CToolbar< TItemData >::GetItemData ( int  index)
inline

Definition at line 429 of file rosctrls.h.

430  {
431  TBBUTTON btn;
432  GetButton(index, &btn);
433  return (TItemData*) btn.dwData;
434  }
GLuint index
Definition: glext.h:6031
DWORD_PTR dwData
Definition: commctrl.h:954
DWORD GetButton(int index, TBBUTTON *btn)
Definition: rosctrls.h:315

Referenced by CBalloonQueue::IndexOf(), and CSysPagerWnd::OnCommand().

◆ GetItemRect()

template<typename TItemData = DWORD_PTR>
DWORD CToolbar< TItemData >::GetItemRect ( int  index,
LPRECT  prcItem 
)
inline

Definition at line 396 of file rosctrls.h.

397  {
398  return SendMessageW(TB_GETITEMRECT, index, reinterpret_cast<LPARAM>(prcItem));
399  }
#define TB_GETITEMRECT
Definition: commctrl.h:1129
GLuint index
Definition: glext.h:6031
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by CTaskSwitchWnd::OnKludgeItemRect(), and CBalloonQueue::Show().

◆ GetMaxSize()

template<typename TItemData = DWORD_PTR>
DWORD CToolbar< TItemData >::GetMaxSize ( LPSIZE  size)
inline

Definition at line 376 of file rosctrls.h.

377  {
378  return SendMessageW(TB_GETMAXSIZE, 0, reinterpret_cast<LPARAM>(size));
379  }
#define TB_GETMAXSIZE
Definition: commctrl.h:1185
GLsizeiptr size
Definition: glext.h:5919
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

◆ GetMetrics()

template<typename TItemData = DWORD_PTR>
DWORD CToolbar< TItemData >::GetMetrics ( TBMETRICS tbm)
inline

Definition at line 386 of file rosctrls.h.

387  {
388  return SendMessageW(TB_GETMETRICS, 0, reinterpret_cast<LPARAM>(tbm));
389  }
#define TB_GETMETRICS
Definition: commctrl.h:1298
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by CTaskSwitchWnd::UpdateButtonsSize().

◆ GetPadding()

template<typename TItemData = DWORD_PTR>
DWORD CToolbar< TItemData >::GetPadding ( )
inline

Definition at line 406 of file rosctrls.h.

407  {
408  return SendMessageW(TB_GETPADDING);
409  }
#define TB_GETPADDING
Definition: commctrl.h:1188
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

◆ GetTooltip()

template<typename TItemData = DWORD_PTR>
HWND CToolbar< TItemData >::GetTooltip ( )
inline

Definition at line 289 of file rosctrls.h.

290  {
292  }
#define TB_GETTOOLTIPS
Definition: commctrl.h:1134
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

◆ HitTest()

template<typename TItemData = DWORD_PTR>
INT CToolbar< TItemData >::HitTest ( PPOINT  ppt)
inline

Definition at line 423 of file rosctrls.h.

424  {
425  return (INT) SendMessageW(TB_HITTEST, 0, reinterpret_cast<LPARAM>(ppt));
426  }
#define TB_HITTEST
Definition: commctrl.h:1264
int32_t INT
Definition: typedefs.h:56
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by CTaskSwitchWnd::OnContextMenu().

◆ InsertButton()

template<typename TItemData = DWORD_PTR>
DWORD CToolbar< TItemData >::InsertButton ( int  insertAt,
TBBUTTON btn 
)
inline

Definition at line 330 of file rosctrls.h.

331  {
332  return SendMessageW(TB_INSERTBUTTON, insertAt, reinterpret_cast<LPARAM>(btn));
333  }
#define TB_INSERTBUTTON
Definition: commctrl.h:1266
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by CTaskSwitchWnd::AddTaskItemButton().

◆ MoveButton()

template<typename TItemData = DWORD_PTR>
DWORD CToolbar< TItemData >::MoveButton ( int  oldIndex,
int  newIndex 
)
inline

Definition at line 335 of file rosctrls.h.

336  {
337  return SendMessageW(TB_MOVEBUTTON, oldIndex, newIndex);
338  }
#define TB_MOVEBUTTON
Definition: commctrl.h:1184
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

◆ SetButtonInfo()

template<typename TItemData = DWORD_PTR>
DWORD CToolbar< TItemData >::SetButtonInfo ( int  cmdId,
TBBUTTONINFO info 
)
inline

Definition at line 350 of file rosctrls.h.

351  {
352  return SendMessageW(TB_SETBUTTONINFO, cmdId, reinterpret_cast<LPARAM>(info));
353  }
#define TB_SETBUTTONINFO
Definition: commctrl.h:1259
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by CTaskSwitchWnd::RemoveIcon(), CToolbar<>::SetItemData(), CTaskSwitchWnd::UpdateButtonsSize(), and CTaskSwitchWnd::UpdateTaskItemButton().

◆ SetButtonSize()

template<typename TItemData = DWORD_PTR>
DWORD CToolbar< TItemData >::SetButtonSize ( int  w,
int  h 
)
inline

Definition at line 366 of file rosctrls.h.

367  {
369  }
#define TB_SETBUTTONSIZE
Definition: commctrl.h:1131
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
#define MAKELPARAM(l, h)
Definition: winuser.h:3947
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

◆ SetButtonStructSize()

template<typename TItemData = DWORD_PTR>
DWORD CToolbar< TItemData >::SetButtonStructSize ( )
inline

Definition at line 284 of file rosctrls.h.

285  {
286  return SendMessageW(TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0);
287  }
#define TB_BUTTONSTRUCTSIZE
Definition: commctrl.h:1130
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by CToolbar<>::Create().

◆ SetHotItem()

template<typename TItemData = DWORD_PTR>
DWORD CToolbar< TItemData >::SetHotItem ( INT  item)
inline

Definition at line 304 of file rosctrls.h.

305  {
307  }
static ATOM item
Definition: dde.c:856
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define TB_SETHOTITEM
Definition: commctrl.h:1167

◆ SetImageList()

template<typename TItemData = DWORD_PTR>
HIMAGELIST CToolbar< TItemData >::SetImageList ( HIMAGELIST  himl)
inline

Definition at line 417 of file rosctrls.h.

418  {
419  return (HIMAGELIST)SendMessageW(TB_SETIMAGELIST, 0, reinterpret_cast<LPARAM>(himl));
420  }
HIMAGELIST himl
#define TB_SETIMAGELIST
Definition: commctrl.h:1146
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by CTaskSwitchWnd::OnCreate(), and CTaskSwitchWnd::UpdateButtonsSize().

◆ SetItemData()

template<typename TItemData = DWORD_PTR>
DWORD CToolbar< TItemData >::SetItemData ( int  index,
TItemData *  data 
)
inline

Definition at line 436 of file rosctrls.h.

437  {
438  TBBUTTONINFOW info = { 0 };
439  info.cbSize = sizeof(info);
440  info.dwMask = TBIF_BYINDEX | TBIF_LPARAM;
441  info.lParam = (DWORD_PTR) data;
442  return SetButtonInfo(index, &info);
443  }
#define TBIF_LPARAM
Definition: commctrl.h:1219
#define DWORD_PTR
Definition: treelist.c:76
#define TBIF_BYINDEX
Definition: commctrl.h:1222
struct _test_info info[]
Definition: SetCursorPos.c:19
GLuint index
Definition: glext.h:6031
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
DWORD SetButtonInfo(int cmdId, TBBUTTONINFO *info)
Definition: rosctrls.h:350

◆ SetMetrics()

template<typename TItemData = DWORD_PTR>
DWORD CToolbar< TItemData >::SetMetrics ( TBMETRICS tbm)
inline

Definition at line 391 of file rosctrls.h.

392  {
393  return SendMessageW(TB_SETMETRICS, 0, reinterpret_cast<LPARAM>(tbm));
394  }
#define TB_SETMETRICS
Definition: commctrl.h:1299
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

◆ SetPadding()

template<typename TItemData = DWORD_PTR>
DWORD CToolbar< TItemData >::SetPadding ( int  x,
int  y 
)
inline

Definition at line 411 of file rosctrls.h.

412  {
413  return SendMessageW(TB_SETPADDING, 0, MAKELPARAM(x, y));
414  }
#define MAKELPARAM(l, h)
Definition: winuser.h:3947
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define TB_SETPADDING
Definition: commctrl.h:1189
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

◆ SetRedraw()

template<typename TItemData = DWORD_PTR>
DWORD CToolbar< TItemData >::SetRedraw ( BOOL  bEnable)
inline

Definition at line 401 of file rosctrls.h.

402  {
404  }
#define WM_SETREDRAW
Definition: winuser.h:1598
_In_ BOOL bEnable
Definition: winddi.h:3426
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

◆ SetTooltip()

template<typename TItemData = DWORD_PTR>
DWORD CToolbar< TItemData >::SetTooltip ( HWND  hWndTooltip)
inline

Definition at line 294 of file rosctrls.h.

295  {
296  return SendMessageW(TB_SETTOOLTIPS, reinterpret_cast<WPARAM>(hWndTooltip), 0);
297  }
#define TB_SETTOOLTIPS
Definition: commctrl.h:1135
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

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