[r5083]: tags / V3_12 / PWToolBar.h Maximize Restore History

Download this file

PWToolBar.h    77 lines (61 with data), 2.5 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*
* Copyright (c) 2003-2008 Rony Shapiro <ronys@users.sourceforge.net>.
* All rights reserved. Use of the code is allowed under the
* Artistic License 2.0 terms, as specified in the LICENSE file
* distributed with this code, or available from
* http://www.opensource.org/licenses/artistic-license-2.0.php
*/
#pragma once
// CPWToolBar
#include <map>
typedef std::map<UINT, UINT> ID2ImageMap;
typedef ID2ImageMap::iterator ID2ImageMapIter;
class CPWToolBar : public CToolBar
{
DECLARE_DYNAMIC(CPWToolBar)
public:
CPWToolBar();
virtual ~CPWToolBar();
void Init(const int NumBits, const bool bRefresh = false);
void LoadDefaultToolBar(const int toolbarMode);
void CustomizeButtons(CString csButtonNames);
void ChangeImages(const int toolbarMode);
void Reset();
CString GetButtonString();
int GetBrowseURLImageIndex() {return m_iBrowseURL_BM_offset;}
int GetSendEmailImageIndex() {return m_iSendEmail_BM_offset;}
void MapControlIDtoImage(ID2ImageMap &IDtoImages);
void SetupImageList(const UINT *pBM_IDs, const UINT *pDisBM_IDs,
const int numBMs, const int nImageList);
void SetBitmapBackground(CBitmap &bm, const COLORREF newbkgrndColour);
void RefreshImages();
protected:
//{{AFX_MSG(CPWToolBar)
afx_msg void OnToolBarGetButtonInfo(NMHDR *pNotifyStruct, LRESULT* pResult);
afx_msg void OnToolBarQueryInsert(NMHDR* pNotifyStruct, LRESULT* pResult);
afx_msg void OnToolBarQueryDelete(NMHDR* pNotifyStruct, LRESULT* pResult);
afx_msg void OnToolBarQueryInfo(NMHDR* pNotifyStruct, LRESULT* pResult);
afx_msg void OnToolBarReset(NMHDR* pNotifyStruct, LRESULT* pResult);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
static const CString m_csMainButtons[];
static const UINT m_MainToolBarIDs[];
static const UINT m_MainToolBarClassicBMs[];
static const UINT m_MainToolBarNewBMs[];
static const UINT m_MainToolBarNewDisBMs[];
static const UINT m_OtherIDs[];
static const UINT m_OtherClassicBMs[];
static const UINT m_OtherNewBMs[];
static const UINT m_OtherNewDisBMs[];
// 1st = Classic; 2nd = New 8; 3rd = New 32;
CImageList m_ImageLists[3];
// 1st = New 8; 2nd = New 32;
CImageList m_DisabledImageLists[2];
CString m_csDefaultButtonString;
TBBUTTON *m_pOriginalTBinfo;
int m_iMaxNumButtons, m_iNum_Bitmaps, m_iNumDefaultButtons, m_NumBits;
int m_toolbarMode, m_bitmode;
bool m_bIsDefault;
int m_iBrowseURL_BM_offset, m_iSendEmail_BM_offset;
};