ReactOS 0.4.15-dev-6055-g36cdd34
CMainToolbar Class Reference

#include <appview.h>

Inheritance diagram for CMainToolbar:
Collaboration diagram for CMainToolbar:

Public Member Functions

 CMainToolbar ()
 
VOID OnGetDispInfo (LPTOOLTIPTEXT lpttt)
 
HWND Create (HWND hwndParent)
 
VOID HideButtonCaption ()
 
VOID ShowButtonCaption ()
 
DWORD GetMaxButtonsWidth () const
 
- Public Member Functions inherited from CUiWindow< CToolbar<> >
virtual CUiBoxAsBox ()
 
HWND GetWindow ()
 
virtual VOID ComputeMinimalSize (SIZE *size)
 
virtual VOID ComputeContentBounds (RECT *rect)
 
virtual DWORD_PTR CountSizableChildren ()
 
virtual HDWP OnParentSize (RECT parentRect, HDWP hDwp)
 
virtual VOID AppendTabOrderWindow (int Direction, ATL::CSimpleArray< HWND > &TabOrderList)
 
virtual ~CUiWindow ()
 
VOID GetWindowTextW (CStringW &szText)
 
- Public Member Functions inherited from CUiPrimitive
virtual ~CUiPrimitive ()
 
virtual CUiBoxAsBox ()
 
virtual VOID ComputeMinimalSize (SIZE *size)
 
virtual VOID ComputeContentBounds (RECT *rect)
 
virtual DWORD_PTR CountSizableChildren ()
 
virtual HDWP OnParentSize (RECT parentRect, HDWP hDwp)
 
- Public Member Functions inherited from CToolbar< TItemData >
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)
 

Private Member Functions

VOID AddImageToImageList (HIMAGELIST hImageList, UINT ImageIndex)
 
HIMAGELIST InitImageList ()
 

Private Attributes

const INT m_iToolbarHeight
 
DWORD m_dButtonsWidthMax
 
WCHAR szInstallBtn [MAX_STR_LEN]
 
WCHAR szUninstallBtn [MAX_STR_LEN]
 
WCHAR szModifyBtn [MAX_STR_LEN]
 
WCHAR szSelectAll [MAX_STR_LEN]
 
WCHAR szRefreshBtn [MAX_STR_LEN]
 
WCHAR szUpdateDbBtn [MAX_STR_LEN]
 

Additional Inherited Members

- Public Attributes inherited from CUiBox
CUiMargin m_Margin
 
CUiAlignment m_HorizontalAlignment
 
CUiAlignment m_VerticalAlignment
 
- Protected Member Functions inherited from CUiBox
 CUiBox ()
 
virtual VOID ComputeRect (RECT parentRect, RECT currentRect, RECT *newRect)
 
- Protected Attributes inherited from CUiPrimitive
CUiPrimitivem_Parent
 

Detailed Description

Definition at line 273 of file appview.h.

Constructor & Destructor Documentation

◆ CMainToolbar()

CMainToolbar::CMainToolbar ( )

Definition at line 57 of file appview.cpp.

58{
59 memset(szInstallBtn, 0, sizeof(szInstallBtn));
61 memset(szModifyBtn, 0, sizeof(szModifyBtn));
62 memset(szSelectAll, 0, sizeof(szSelectAll));
63 memset(szRefreshBtn, 0, sizeof(szRefreshBtn));
65}
WCHAR szSelectAll[MAX_STR_LEN]
Definition: appview.h:281
DWORD m_dButtonsWidthMax
Definition: appview.h:276
WCHAR szUpdateDbBtn[MAX_STR_LEN]
Definition: appview.h:283
const INT m_iToolbarHeight
Definition: appview.h:275
WCHAR szInstallBtn[MAX_STR_LEN]
Definition: appview.h:278
WCHAR szRefreshBtn[MAX_STR_LEN]
Definition: appview.h:282
WCHAR szModifyBtn[MAX_STR_LEN]
Definition: appview.h:280
WCHAR szUninstallBtn[MAX_STR_LEN]
Definition: appview.h:279
#define memset(x, y, z)
Definition: compat.h:39

Member Function Documentation

◆ AddImageToImageList()

VOID CMainToolbar::AddImageToImageList ( HIMAGELIST  hImageList,
UINT  ImageIndex 
)
private

Definition at line 19 of file appview.cpp.

20{
21 HICON hImage;
22
23 if (!(hImage =
25 {
26 return;
27 }
28
29 ImageList_AddIcon(hImageList, hImage);
30 DeleteObject(hImage);
31}
HINSTANCE hInst
Definition: dxdiag.c:13
pKey DeleteObject()
static HICON
Definition: imagelist.c:84
#define ImageList_AddIcon(himl, hicon)
Definition: commctrl.h:415
#define IMAGE_ICON
Definition: winuser.h:212
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
Definition: cursoricon.c:2172
#define MAKEINTRESOURCE
Definition: winuser.h:591

Referenced by InitImageList().

◆ Create()

HWND CMainToolbar::Create ( HWND  hwndParent)

Definition at line 105 of file appview.cpp.

106{
107 /* Create buttons */
108 TBBUTTON Buttons[] = {
109 /* iBitmap, idCommand, fsState, fsStyle, bReserved[2], dwData, iString */
114 {-1, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0},
117
124
125 m_hWnd = CreateWindowExW(
127 hwndParent, 0, hInst, NULL);
128
129 if (!m_hWnd)
130 {
131 return FALSE;
132 }
133
136
137 /* Set image list */
138 HIMAGELIST hImageList = InitImageList();
139
140 if (hImageList)
141 {
142 ImageList_Destroy(SetImageList(hImageList));
143 }
144
146
147 /* Remember ideal width to use as a max width of buttons */
148 SIZE size;
151
152 return m_hWnd;
153}
#define IDS_INSTALL
Definition: resource.h:9
#define IDS_TOOLTIP_REFRESH
Definition: resource.h:48
#define ID_REFRESH
Definition: resource.h:16
#define IDS_TOOLTIP_UPDATE_DB
Definition: resource.h:137
#define ID_UNINSTALL
Definition: resource.h:75
#define IDS_UNINSTALL
Definition: resource.h:95
#define IDS_SELECT_ALL
Definition: resource.h:118
#define IDS_MODIFY
Definition: resource.h:96
#define ID_CHECK_ALL
Definition: resource.h:85
#define ID_MODIFY
Definition: resource.h:78
#define ID_RESETDB
Definition: resource.h:84
#define ID_INSTALL
Definition: resource.h:74
HIMAGELIST InitImageList()
Definition: appview.cpp:34
DWORD AddButtons(int count, TBBUTTON *buttons)
Definition: rosctrls.h:332
DWORD SetButtonStructSize()
Definition: rosctrls.h:286
HIMAGELIST SetImageList(HIMAGELIST himl)
Definition: rosctrls.h:424
DWORD GetIdealSize(BOOL useHeight, LPSIZE size)
Definition: rosctrls.h:388
static HWND hwndParent
Definition: cryptui.c:300
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
GLsizeiptr size
Definition: glext.h:5919
static const TBBUTTON Buttons[]
Definition: mplay32.c:41
#define WS_CHILD
Definition: pedump.c:617
#define WS_VISIBLE
Definition: pedump.c:620
#define BTNS_BUTTON
Definition: commctrl.h:998
#define TB_SETEXTENDEDSTYLE
Definition: commctrl.h:1190
#define BTNS_AUTOSIZE
Definition: commctrl.h:1004
#define TBSTYLE_TOOLTIPS
Definition: commctrl.h:989
#define BTNS_SEP
Definition: commctrl.h:999
#define TBSTYLE_LIST
Definition: commctrl.h:993
#define TBSTYLE_EX_HIDECLIPPEDBUTTONS
Definition: commctrl.h:1013
#define TOOLBARCLASSNAMEW
Definition: commctrl.h:943
#define TBSTATE_ENABLED
Definition: commctrl.h:974
#define TBSTYLE_FLAT
Definition: commctrl.h:992
#define _countof(array)
Definition: sndvol32.h:68
int32_t INT_PTR
Definition: typedefs.h:64
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
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)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by CApplicationView::CreateToolbar().

◆ GetMaxButtonsWidth()

DWORD CMainToolbar::GetMaxButtonsWidth ( ) const

Definition at line 170 of file appview.cpp.

171{
172 return m_dButtonsWidthMax;
173}

Referenced by CApplicationView::OnSize().

◆ HideButtonCaption()

VOID CMainToolbar::HideButtonCaption ( )

Definition at line 156 of file appview.cpp.

157{
158 DWORD dCurrentExStyle = (DWORD)SendMessageW(TB_GETEXTENDEDSTYLE, 0, 0);
160}
unsigned long DWORD
Definition: ntddk_ex.h:95
#define DWORD
Definition: nt_native.h:44
#define TBSTYLE_EX_MIXEDBUTTONS
Definition: commctrl.h:1012
#define TB_GETEXTENDEDSTYLE
Definition: commctrl.h:1191

Referenced by CApplicationView::OnSize().

◆ InitImageList()

HIMAGELIST CMainToolbar::InitImageList ( )
private

Definition at line 34 of file appview.cpp.

35{
36 HIMAGELIST hImageList;
37
38 /* Create the toolbar icon image list */
40 if (!hImageList)
41 {
42 return NULL;
43 }
44
52 AddImageToImageList(hImageList, IDI_EXIT);
53
54 return hImageList;
55}
INT GetSystemColorDepth()
Definition: misc.cpp:321
#define IDI_UPDATE_DB
Definition: resource.h:14
#define IDI_EXIT
Definition: resource.h:5
#define IDI_MODIFY
Definition: resource.h:9
#define IDI_CHECK_ALL
Definition: resource.h:15
#define IDI_INSTALL
Definition: resource.h:6
#define IDI_SETTINGS
Definition: resource.h:8
#define IDI_UNINSTALL
Definition: resource.h:7
#define IDI_REFRESH
Definition: resource.h:10
VOID AddImageToImageList(HIMAGELIST hImageList, UINT ImageIndex)
Definition: appview.cpp:19
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:804
#define ILC_MASK
Definition: commctrl.h:351

Referenced by Create().

◆ OnGetDispInfo()

VOID CMainToolbar::OnGetDispInfo ( LPTOOLTIPTEXT  lpttt)

Definition at line 68 of file appview.cpp.

69{
70 UINT idButton = (UINT)lpttt->hdr.idFrom;
71
72 switch (idButton)
73 {
74 case ID_EXIT:
75 lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_EXIT);
76 break;
77
78 case ID_INSTALL:
79 lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_INSTALL);
80 break;
81
82 case ID_UNINSTALL:
83 lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_UNINSTALL);
84 break;
85
86 case ID_MODIFY:
87 lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_MODIFY);
88 break;
89
90 case ID_SETTINGS:
91 lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_SETTINGS);
92 break;
93
94 case ID_REFRESH:
95 lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_REFRESH);
96 break;
97
98 case ID_RESETDB:
99 lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_UPDATE_DB);
100 break;
101 }
102}
#define ID_EXIT
Definition: resource.h:10
#define IDS_TOOLTIP_INSTALL
Definition: resource.h:131
#define IDS_TOOLTIP_SETTINGS
Definition: resource.h:134
#define IDS_TOOLTIP_MODIFY
Definition: resource.h:133
#define IDS_TOOLTIP_UNINSTALL
Definition: resource.h:132
#define IDS_TOOLTIP_EXIT
Definition: resource.h:136
#define ID_SETTINGS
Definition: resource.h:81
switch(r->id)
Definition: btrfs.c:3046
unsigned int UINT
Definition: ndis.h:50
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

Referenced by CApplicationView::ProcessWindowMessage().

◆ ShowButtonCaption()

VOID CMainToolbar::ShowButtonCaption ( )

Definition at line 163 of file appview.cpp.

164{
165 DWORD dCurrentExStyle = (DWORD)SendMessageW(TB_GETEXTENDEDSTYLE, 0, 0);
167}

Referenced by CApplicationView::OnSize().

Member Data Documentation

◆ m_dButtonsWidthMax

DWORD CMainToolbar::m_dButtonsWidthMax
private

Definition at line 276 of file appview.h.

Referenced by Create(), and GetMaxButtonsWidth().

◆ m_iToolbarHeight

const INT CMainToolbar::m_iToolbarHeight
private

Definition at line 275 of file appview.h.

Referenced by AddImageToImageList(), and InitImageList().

◆ szInstallBtn

WCHAR CMainToolbar::szInstallBtn[MAX_STR_LEN]
private

Definition at line 278 of file appview.h.

Referenced by CMainToolbar(), and Create().

◆ szModifyBtn

WCHAR CMainToolbar::szModifyBtn[MAX_STR_LEN]
private

Definition at line 280 of file appview.h.

Referenced by CMainToolbar(), and Create().

◆ szRefreshBtn

WCHAR CMainToolbar::szRefreshBtn[MAX_STR_LEN]
private

Definition at line 282 of file appview.h.

Referenced by CMainToolbar(), and Create().

◆ szSelectAll

WCHAR CMainToolbar::szSelectAll[MAX_STR_LEN]
private

Definition at line 281 of file appview.h.

Referenced by CMainToolbar(), and Create().

◆ szUninstallBtn

WCHAR CMainToolbar::szUninstallBtn[MAX_STR_LEN]
private

Definition at line 279 of file appview.h.

Referenced by CMainToolbar(), and Create().

◆ szUpdateDbBtn

WCHAR CMainToolbar::szUpdateDbBtn[MAX_STR_LEN]
private

Definition at line 283 of file appview.h.

Referenced by CMainToolbar(), and Create().


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