ReactOS  0.4.15-dev-2528-g5506091
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)
 
DWORD SetDrawTextFlags (DWORD useBits, DWORD bitState)
 
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 327 of file rosctrls.h.

328  {
329  return SendMessageW(TB_ADDBUTTONS, 1, reinterpret_cast<LPARAM>(btn));
330  }
#define TB_ADDBUTTONS
Definition: commctrl.h:1271
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 332 of file rosctrls.h.

333  {
334  return SendMessageW(TB_ADDBUTTONS, count, reinterpret_cast<LPARAM>(buttons));
335  }
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define TB_ADDBUTTONS
Definition: commctrl.h:1271
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 378 of file rosctrls.h.

379  {
380  return SendMessageW(TB_AUTOSIZE);
381  }
#define TB_AUTOSIZE
Definition: commctrl.h:1137
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by CSysPagerWnd::OnSize(), CApplicationView::OnSize(), and CApplicationView::ProcessWindowMessage().

◆ CheckButton()

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

Definition at line 362 of file rosctrls.h.

363  {
364  return SendMessageW(TB_CHECKBUTTON, cmdId, MAKELPARAM(bCheck, 0));
365  }
#define MAKELPARAM(l, h)
Definition: winuser.h:3983
#define TB_CHECKBUTTON
Definition: commctrl.h:1043
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 256 of file rosctrls.h.

257  {
258  if (!dwStyles)
259  {
260  dwStyles = WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN;
261  }
262 
263  if (!dwExStyles)
264  {
265  dwExStyles = WS_EX_TOOLWINDOW;
266  }
267 
268  m_hWnd = CreateWindowExW(dwExStyles,
270  NULL,
271  dwStyles,
272  0, 0, 0, 0, hWndParent,
273  NULL,
274  _AtlBaseModule.GetModuleInstance(),
275  NULL);
276 
277  if (!m_hWnd)
278  return NULL;
279 
280  /* Identify the version we're using */
282 
283  return m_hWnd;
284  }
#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:286
#define TOOLBARCLASSNAME
Definition: commctrl.h:946
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 NULL
Definition: types.h:112
#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 347 of file rosctrls.h.

348  {
349  return SendMessageW(TB_DELETEBUTTON, index, 0);
350  }
GLuint index
Definition: glext.h:6031
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define TB_DELETEBUTTON
Definition: commctrl.h:1108

Referenced by CTaskSwitchWnd::DeleteTaskItemButton().

◆ GetButton()

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

Definition at line 322 of file rosctrls.h.

323  {
324  return SendMessageW(TB_GETBUTTON, index, reinterpret_cast<LPARAM>(btn));
325  }
#define TB_GETBUTTON
Definition: commctrl.h:1109
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 317 of file rosctrls.h.

318  {
320  }
#define TB_BUTTONCOUNT
Definition: commctrl.h:1110
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 352 of file rosctrls.h.

353  {
354  return SendMessageW(TB_GETBUTTONINFO, cmdId, reinterpret_cast<LPARAM>(info));
355  }
#define TB_GETBUTTONINFO
Definition: commctrl.h:1262
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 368 of file rosctrls.h.

369  {
371  }
#define TB_GETBUTTONSIZE
Definition: commctrl.h:1160
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 301 of file rosctrls.h.

302  {
303  return SendMessageW(TB_GETHOTITEM);
304  }
#define TB_GETHOTITEM
Definition: commctrl.h:1170
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 388 of file rosctrls.h.

389  {
390  return SendMessageW(TB_GETIDEALSIZE, useHeight, reinterpret_cast<LPARAM>(size));
391  }
#define TB_GETIDEALSIZE
Definition: commctrl.h:1284
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 436 of file rosctrls.h.

437  {
438  TBBUTTON btn;
439  GetButton(index, &btn);
440  return (TItemData*) btn.dwData;
441  }
GLuint index
Definition: glext.h:6031
DWORD_PTR dwData
Definition: commctrl.h:958
DWORD GetButton(int index, TBBUTTON *btn)
Definition: rosctrls.h:322

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

404  {
405  return SendMessageW(TB_GETITEMRECT, index, reinterpret_cast<LPARAM>(prcItem));
406  }
#define TB_GETITEMRECT
Definition: commctrl.h:1133
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 383 of file rosctrls.h.

384  {
385  return SendMessageW(TB_GETMAXSIZE, 0, reinterpret_cast<LPARAM>(size));
386  }
#define TB_GETMAXSIZE
Definition: commctrl.h:1189
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 393 of file rosctrls.h.

394  {
395  return SendMessageW(TB_GETMETRICS, 0, reinterpret_cast<LPARAM>(tbm));
396  }
#define TB_GETMETRICS
Definition: commctrl.h:1302
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 413 of file rosctrls.h.

414  {
415  return SendMessageW(TB_GETPADDING);
416  }
#define TB_GETPADDING
Definition: commctrl.h:1192
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 291 of file rosctrls.h.

292  {
294  }
#define TB_GETTOOLTIPS
Definition: commctrl.h:1138
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 430 of file rosctrls.h.

431  {
432  return (INT) SendMessageW(TB_HITTEST, 0, reinterpret_cast<LPARAM>(ppt));
433  }
#define TB_HITTEST
Definition: commctrl.h:1268
int32_t INT
Definition: typedefs.h:58
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 337 of file rosctrls.h.

338  {
339  return SendMessageW(TB_INSERTBUTTON, insertAt, reinterpret_cast<LPARAM>(btn));
340  }
#define TB_INSERTBUTTON
Definition: commctrl.h:1270
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 342 of file rosctrls.h.

343  {
344  return SendMessageW(TB_MOVEBUTTON, oldIndex, newIndex);
345  }
#define TB_MOVEBUTTON
Definition: commctrl.h:1188
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 357 of file rosctrls.h.

358  {
359  return SendMessageW(TB_SETBUTTONINFO, cmdId, reinterpret_cast<LPARAM>(info));
360  }
#define TB_SETBUTTONINFO
Definition: commctrl.h:1263
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 373 of file rosctrls.h.

374  {
376  }
#define TB_SETBUTTONSIZE
Definition: commctrl.h:1135
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
#define MAKELPARAM(l, h)
Definition: winuser.h:3983
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 286 of file rosctrls.h.

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

Referenced by CToolbar<>::Create().

◆ SetDrawTextFlags()

template<typename TItemData = DWORD_PTR>
DWORD CToolbar< TItemData >::SetDrawTextFlags ( DWORD  useBits,
DWORD  bitState 
)
inline

Definition at line 311 of file rosctrls.h.

312  {
313  return SendMessageW(TB_SETDRAWTEXTFLAGS, useBits, bitState);
314  }
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define TB_SETDRAWTEXTFLAGS
Definition: commctrl.h:1273

◆ SetHotItem()

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

Definition at line 306 of file rosctrls.h.

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

◆ SetImageList()

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

Definition at line 424 of file rosctrls.h.

425  {
426  return (HIMAGELIST)SendMessageW(TB_SETIMAGELIST, 0, reinterpret_cast<LPARAM>(himl));
427  }
HIMAGELIST himl
#define TB_SETIMAGELIST
Definition: commctrl.h:1150
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 443 of file rosctrls.h.

444  {
445  TBBUTTONINFOW info = { 0 };
446  info.cbSize = sizeof(info);
447  info.dwMask = TBIF_BYINDEX | TBIF_LPARAM;
448  info.lParam = (DWORD_PTR) data;
449  return SetButtonInfo(index, &info);
450  }
#define TBIF_LPARAM
Definition: commctrl.h:1223
#define DWORD_PTR
Definition: treelist.c:76
#define TBIF_BYINDEX
Definition: commctrl.h:1226
GLuint index
Definition: glext.h:6031
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
struct _test_info info[]
Definition: SetCursorPos.c:19
DWORD SetButtonInfo(int cmdId, TBBUTTONINFO *info)
Definition: rosctrls.h:357

◆ SetMetrics()

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

Definition at line 398 of file rosctrls.h.

399  {
400  return SendMessageW(TB_SETMETRICS, 0, reinterpret_cast<LPARAM>(tbm));
401  }
#define TB_SETMETRICS
Definition: commctrl.h:1303
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 418 of file rosctrls.h.

419  {
420  return SendMessageW(TB_SETPADDING, 0, MAKELPARAM(x, y));
421  }
#define MAKELPARAM(l, h)
Definition: winuser.h:3983
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define TB_SETPADDING
Definition: commctrl.h:1193
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 408 of file rosctrls.h.

409  {
411  }
#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 296 of file rosctrls.h.

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

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