ReactOS 0.4.17-dev-1190-g4c812f4
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 HideButton (int cmdId, BOOL bHide)
 
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 254 of file rosctrls.h.

Member Function Documentation

◆ AddButton()

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

Definition at line 332 of file rosctrls.h.

333 {
334 return SendMessageW(TB_ADDBUTTONS, 1, reinterpret_cast<LPARAM>(btn));
335 }
LONG_PTR LPARAM
Definition: minwindef.h:175
#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 337 of file rosctrls.h.

338 {
339 return SendMessageW(TB_ADDBUTTONS, count, reinterpret_cast<LPARAM>(buttons));
340 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
HWND buttons[5]
Definition: sndrec32.cpp:40

Referenced by CMainToolbar::Create().

◆ AutoSize()

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

Definition at line 388 of file rosctrls.h.

389 {
391 }
#define TB_AUTOSIZE
Definition: commctrl.h:1137

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

◆ CheckButton()

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

Definition at line 367 of file rosctrls.h.

368 {
369 return SendMessageW(TB_CHECKBUTTON, cmdId, MAKELPARAM(bCheck, 0));
370 }
#define TB_CHECKBUTTON
Definition: commctrl.h:1043
#define MAKELPARAM(l, h)
Definition: winuser.h:4116

Referenced by CMainWnd::UpdateToolbuttons().

◆ Create()

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

Definition at line 261 of file rosctrls.h.

262 {
263 if (!dwStyles)
264 {
265 dwStyles = WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN;
266 }
267
268 if (!dwExStyles)
269 {
270 dwExStyles = WS_EX_TOOLWINDOW;
271 }
272
273 m_hWnd = CreateWindowExW(dwExStyles,
275 NULL,
276 dwStyles,
277 0, 0, 0, 0, hWndParent,
278 NULL,
279 _AtlBaseModule.GetModuleInstance(),
280 NULL);
281
282 if (!m_hWnd)
283 return NULL;
284
285 /* Identify the version we're using */
287
288 return m_hWnd;
289 }
DWORD SetButtonStructSize()
Definition: rosctrls.h:291
#define NULL
Definition: types.h:112
#define WS_CHILD
Definition: pedump.c:617
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_CLIPCHILDREN
Definition: pedump.c:619
#define TOOLBARCLASSNAME
Definition: commctrl.h:946
#define WS_EX_TOOLWINDOW
Definition: winuser.h:404
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)

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

◆ DeleteButton()

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

Definition at line 352 of file rosctrls.h.

353 {
355 }
GLuint index
Definition: glext.h:6031
#define TB_DELETEBUTTON
Definition: commctrl.h:1108

Referenced by CApplicationView::ProcessWindowMessage().

◆ GetButton()

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

Definition at line 327 of file rosctrls.h.

328 {
329 return SendMessageW(TB_GETBUTTON, index, reinterpret_cast<LPARAM>(btn));
330 }
#define TB_GETBUTTON
Definition: commctrl.h:1109

Referenced by CToolbar< TItemData >::GetItemData().

◆ GetButtonCount()

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

Definition at line 322 of file rosctrls.h.

323 {
325 }
#define TB_BUTTONCOUNT
Definition: commctrl.h:1110

◆ GetButtonInfo()

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

Definition at line 357 of file rosctrls.h.

358 {
359 return SendMessageW(TB_GETBUTTONINFO, cmdId, reinterpret_cast<LPARAM>(info));
360 }
#define TB_GETBUTTONINFO
Definition: commctrl.h:1262

Referenced by CApplicationView::ProcessWindowMessage().

◆ GetButtonSize()

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

Definition at line 378 of file rosctrls.h.

379 {
381 }
#define TB_GETBUTTONSIZE
Definition: commctrl.h:1160

◆ GetHotItem()

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

Definition at line 306 of file rosctrls.h.

307 {
309 }
#define TB_GETHOTITEM
Definition: commctrl.h:1170

◆ GetIdealSize()

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

Definition at line 398 of file rosctrls.h.

399 {
400 return SendMessageW(TB_GETIDEALSIZE, useHeight, reinterpret_cast<LPARAM>(size));
401 }
GLsizeiptr size
Definition: glext.h:5919
#define TB_GETIDEALSIZE
Definition: commctrl.h:1284

Referenced by CMainToolbar::UpdateMaxButtonsWidth().

◆ GetItemData()

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

Definition at line 446 of file rosctrls.h.

447 {
448 TBBUTTON btn;
449 GetButton(index, &btn);
450 return (TItemData*) btn.dwData;
451 }
DWORD GetButton(int index, TBBUTTON *btn)
Definition: rosctrls.h:327
DWORD_PTR dwData
Definition: commctrl.h:958

◆ GetItemRect()

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

Definition at line 413 of file rosctrls.h.

414 {
415 return SendMessageW(TB_GETITEMRECT, index, reinterpret_cast<LPARAM>(prcItem));
416 }
#define TB_GETITEMRECT
Definition: commctrl.h:1133

◆ GetMaxSize()

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

Definition at line 393 of file rosctrls.h.

394 {
395 return SendMessageW(TB_GETMAXSIZE, 0, reinterpret_cast<LPARAM>(size));
396 }
#define TB_GETMAXSIZE
Definition: commctrl.h:1189

◆ GetMetrics()

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

Definition at line 403 of file rosctrls.h.

404 {
405 return SendMessageW(TB_GETMETRICS, 0, reinterpret_cast<LPARAM>(tbm));
406 }
#define TB_GETMETRICS
Definition: commctrl.h:1302

◆ GetPadding()

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

Definition at line 423 of file rosctrls.h.

424 {
426 }
#define TB_GETPADDING
Definition: commctrl.h:1192

◆ GetTooltip()

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

Definition at line 296 of file rosctrls.h.

297 {
299 }
#define TB_GETTOOLTIPS
Definition: commctrl.h:1138

◆ HideButton()

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

Definition at line 372 of file rosctrls.h.

373 {
374 return SendMessageW(TB_HIDEBUTTON, cmdId, MAKELPARAM(bHide, 0));
375 }
#define TB_HIDEBUTTON
Definition: commctrl.h:1045

Referenced by CMainWnd::UpdateUpToolButton().

◆ HitTest()

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

Definition at line 440 of file rosctrls.h.

441 {
442 return (INT) SendMessageW(TB_HITTEST, 0, reinterpret_cast<LPARAM>(ppt));
443 }
#define TB_HITTEST
Definition: commctrl.h:1268
int32_t INT
Definition: typedefs.h:58

◆ InsertButton()

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

Definition at line 342 of file rosctrls.h.

343 {
344 return SendMessageW(TB_INSERTBUTTON, insertAt, reinterpret_cast<LPARAM>(btn));
345 }
#define TB_INSERTBUTTON
Definition: commctrl.h:1270

◆ MoveButton()

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

Definition at line 347 of file rosctrls.h.

348 {
349 return SendMessageW(TB_MOVEBUTTON, oldIndex, newIndex);
350 }
#define TB_MOVEBUTTON
Definition: commctrl.h:1188

◆ SetButtonInfo()

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

Definition at line 362 of file rosctrls.h.

363 {
364 return SendMessageW(TB_SETBUTTONINFO, cmdId, reinterpret_cast<LPARAM>(info));
365 }
#define TB_SETBUTTONINFO
Definition: commctrl.h:1263

Referenced by CToolbar< TItemData >::SetItemData().

◆ SetButtonSize()

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

Definition at line 383 of file rosctrls.h.

384 {
386 }
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
#define TB_SETBUTTONSIZE
Definition: commctrl.h:1135

◆ SetButtonStructSize()

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

Definition at line 291 of file rosctrls.h.

292 {
293 return SendMessageW(TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0);
294 }
#define TB_BUTTONSTRUCTSIZE
Definition: commctrl.h:1134

Referenced by CMainToolbar::Create(), and CToolbar< TItemData >::Create().

◆ SetDrawTextFlags()

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

Definition at line 316 of file rosctrls.h.

317 {
318 return SendMessageW(TB_SETDRAWTEXTFLAGS, useBits, bitState);
319 }
#define TB_SETDRAWTEXTFLAGS
Definition: commctrl.h:1273

◆ SetHotItem()

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

Definition at line 311 of file rosctrls.h.

312 {
314 }
#define TB_SETHOTITEM
Definition: commctrl.h:1171

◆ SetImageList()

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

Definition at line 434 of file rosctrls.h.

435 {
436 return (HIMAGELIST)SendMessageW(TB_SETIMAGELIST, 0, reinterpret_cast<LPARAM>(himl));
437 }
HIMAGELIST himl
#define TB_SETIMAGELIST
Definition: commctrl.h:1150

Referenced by CMainToolbar::Create(), and CMainWnd::OnCreate().

◆ SetItemData()

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

Definition at line 453 of file rosctrls.h.

454 {
455 TBBUTTONINFOW info = { 0 };
456 info.cbSize = sizeof(info);
457 info.dwMask = TBIF_BYINDEX | TBIF_LPARAM;
458 info.lParam = (DWORD_PTR) data;
459 return SetButtonInfo(index, &info);
460 }
DWORD SetButtonInfo(int cmdId, TBBUTTONINFO *info)
Definition: rosctrls.h:362
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define TBIF_LPARAM
Definition: commctrl.h:1223
#define TBIF_BYINDEX
Definition: commctrl.h:1226
#define DWORD_PTR
Definition: treelist.c:76

◆ SetMetrics()

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

Definition at line 408 of file rosctrls.h.

409 {
410 return SendMessageW(TB_SETMETRICS, 0, reinterpret_cast<LPARAM>(tbm));
411 }
#define TB_SETMETRICS
Definition: commctrl.h:1303

◆ SetPadding()

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

Definition at line 428 of file rosctrls.h.

429 {
431 }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define TB_SETPADDING
Definition: commctrl.h:1193

◆ SetRedraw()

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

Definition at line 418 of file rosctrls.h.

419 {
421 }
#define WM_SETREDRAW
Definition: winuser.h:1644
_In_ BOOL bEnable
Definition: winddi.h:3426

◆ SetTooltip()

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

Definition at line 301 of file rosctrls.h.

302 {
303 return SendMessageW(TB_SETTOOLTIPS, reinterpret_cast<WPARAM>(hWndTooltip), 0);
304 }
UINT_PTR WPARAM
Definition: minwindef.h:174
#define TB_SETTOOLTIPS
Definition: commctrl.h:1139

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