ReactOS  0.4.13-dev-687-g023794c
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 236 of file rosctrls.h.

Member Function Documentation

◆ AddButton()

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

Definition at line 307 of file rosctrls.h.

308  {
309  return SendMessageW(TB_ADDBUTTONS, 1, reinterpret_cast<LPARAM>(btn));
310  }
#define TB_ADDBUTTONS
Definition: commctrl.h:1243
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 312 of file rosctrls.h.

313  {
314  return SendMessageW(TB_ADDBUTTONS, count, reinterpret_cast<LPARAM>(buttons));
315  }
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define TB_ADDBUTTONS
Definition: commctrl.h:1243
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 358 of file rosctrls.h.

359  {
360  return SendMessageW(TB_AUTOSIZE);
361  }
#define TB_AUTOSIZE
Definition: commctrl.h:1109
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 342 of file rosctrls.h.

343  {
344  return SendMessageW(TB_CHECKBUTTON, cmdId, MAKELPARAM(bCheck, 0));
345  }
#define MAKELPARAM(l, h)
Definition: winuser.h:3947
#define TB_CHECKBUTTON
Definition: commctrl.h:1015
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 241 of file rosctrls.h.

242  {
243  if (!dwStyles)
244  {
245  dwStyles = WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN;
246  }
247 
248  if (!dwExStyles)
249  {
250  dwExStyles = WS_EX_TOOLWINDOW;
251  }
252 
253  m_hWnd = CreateWindowExW(dwExStyles,
255  NULL,
256  dwStyles,
257  0, 0, 0, 0, hWndParent,
258  NULL,
259  _AtlBaseModule.GetModuleInstance(),
260  NULL);
261 
262  if (!m_hWnd)
263  return NULL;
264 
265  /* Identify the version we're using */
267 
268  return m_hWnd;
269  }
#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:271
#define TOOLBARCLASSNAME
Definition: commctrl.h:918
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 327 of file rosctrls.h.

328  {
329  return SendMessageW(TB_DELETEBUTTON, index, 0);
330  }
GLuint index
Definition: glext.h:6031
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define TB_DELETEBUTTON
Definition: commctrl.h:1080

Referenced by CTaskSwitchWnd::DeleteTaskItemButton().

◆ GetButton()

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

Definition at line 302 of file rosctrls.h.

303  {
304  return SendMessageW(TB_GETBUTTON, index, reinterpret_cast<LPARAM>(btn));
305  }
#define TB_GETBUTTON
Definition: commctrl.h:1081
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 297 of file rosctrls.h.

298  {
300  }
#define TB_BUTTONCOUNT
Definition: commctrl.h:1082
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 332 of file rosctrls.h.

333  {
334  return SendMessageW(TB_GETBUTTONINFO, cmdId, reinterpret_cast<LPARAM>(info));
335  }
#define TB_GETBUTTONINFO
Definition: commctrl.h:1234
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 348 of file rosctrls.h.

349  {
351  }
#define TB_GETBUTTONSIZE
Definition: commctrl.h:1132
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 286 of file rosctrls.h.

287  {
288  return SendMessageW(TB_GETHOTITEM);
289  }
#define TB_GETHOTITEM
Definition: commctrl.h:1142
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 368 of file rosctrls.h.

369  {
370  return SendMessageW(TB_GETIDEALSIZE, useHeight, reinterpret_cast<LPARAM>(size));
371  }
#define TB_GETIDEALSIZE
Definition: commctrl.h:1256
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 416 of file rosctrls.h.

417  {
418  TBBUTTON btn;
419  GetButton(index, &btn);
420  return (TItemData*) btn.dwData;
421  }
GLuint index
Definition: glext.h:6031
DWORD_PTR dwData
Definition: commctrl.h:930
DWORD GetButton(int index, TBBUTTON *btn)
Definition: rosctrls.h:302

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 383 of file rosctrls.h.

384  {
385  return SendMessageW(TB_GETITEMRECT, index, reinterpret_cast<LPARAM>(prcItem));
386  }
#define TB_GETITEMRECT
Definition: commctrl.h:1105
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 363 of file rosctrls.h.

364  {
365  return SendMessageW(TB_GETMAXSIZE, 0, reinterpret_cast<LPARAM>(size));
366  }
#define TB_GETMAXSIZE
Definition: commctrl.h:1161
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 373 of file rosctrls.h.

374  {
375  return SendMessageW(TB_GETMETRICS, 0, reinterpret_cast<LPARAM>(tbm));
376  }
#define TB_GETMETRICS
Definition: commctrl.h:1274
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 393 of file rosctrls.h.

394  {
395  return SendMessageW(TB_GETPADDING);
396  }
#define TB_GETPADDING
Definition: commctrl.h:1164
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 276 of file rosctrls.h.

277  {
279  }
#define TB_GETTOOLTIPS
Definition: commctrl.h:1110
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 410 of file rosctrls.h.

411  {
412  return (INT) SendMessageW(TB_HITTEST, 0, reinterpret_cast<LPARAM>(ppt));
413  }
#define TB_HITTEST
Definition: commctrl.h:1240
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 317 of file rosctrls.h.

318  {
319  return SendMessageW(TB_INSERTBUTTON, insertAt, reinterpret_cast<LPARAM>(btn));
320  }
#define TB_INSERTBUTTON
Definition: commctrl.h:1242
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 322 of file rosctrls.h.

323  {
324  return SendMessageW(TB_MOVEBUTTON, oldIndex, newIndex);
325  }
#define TB_MOVEBUTTON
Definition: commctrl.h:1160
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 337 of file rosctrls.h.

338  {
339  return SendMessageW(TB_SETBUTTONINFO, cmdId, reinterpret_cast<LPARAM>(info));
340  }
#define TB_SETBUTTONINFO
Definition: commctrl.h:1235
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 353 of file rosctrls.h.

354  {
356  }
#define TB_SETBUTTONSIZE
Definition: commctrl.h:1107
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 271 of file rosctrls.h.

272  {
273  return SendMessageW(TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0);
274  }
#define TB_BUTTONSTRUCTSIZE
Definition: commctrl.h:1106
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 291 of file rosctrls.h.

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

◆ SetImageList()

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

Definition at line 404 of file rosctrls.h.

405  {
406  return (HIMAGELIST)SendMessageW(TB_SETIMAGELIST, 0, reinterpret_cast<LPARAM>(himl));
407  }
HIMAGELIST himl
#define TB_SETIMAGELIST
Definition: commctrl.h:1122
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 423 of file rosctrls.h.

424  {
425  TBBUTTONINFOW info = { 0 };
426  info.cbSize = sizeof(info);
427  info.dwMask = TBIF_BYINDEX | TBIF_LPARAM;
428  info.lParam = (DWORD_PTR) data;
429  return SetButtonInfo(index, &info);
430  }
#define TBIF_LPARAM
Definition: commctrl.h:1195
#define DWORD_PTR
Definition: treelist.c:76
#define TBIF_BYINDEX
Definition: commctrl.h:1198
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:337

◆ SetMetrics()

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

Definition at line 378 of file rosctrls.h.

379  {
380  return SendMessageW(TB_SETMETRICS, 0, reinterpret_cast<LPARAM>(tbm));
381  }
#define TB_SETMETRICS
Definition: commctrl.h:1275
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 398 of file rosctrls.h.

399  {
400  return SendMessageW(TB_SETPADDING, 0, MAKELPARAM(x, y));
401  }
#define MAKELPARAM(l, h)
Definition: winuser.h:3947
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define TB_SETPADDING
Definition: commctrl.h:1165
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 388 of file rosctrls.h.

389  {
391  }
#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 281 of file rosctrls.h.

282  {
283  return SendMessageW(TB_SETTOOLTIPS, reinterpret_cast<WPARAM>(hWndTooltip), 0);
284  }
#define TB_SETTOOLTIPS
Definition: commctrl.h:1111
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

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