summaryrefslogtreecommitdiff
path: root/win/Piecebar.h
blob: 3da370d239ae0daffdb7347d654137d511d1f95f (plain)
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
// piecebar.h : header file
//
/////////////////////////////////////////////////////////////////////////

#if !defined(PIECEBAR_H_INCLUDED)
#define PIECEBAR_H_INCLUDED

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

#include "PieceLst.h"
#include "ColorLst.h"
#include "PieceCmb.h"
#include "PiecePrv.h"
#include "TransBar.h"
#include "Splitter.h"

/////////////////////////////////////////////////////////////////////////
// CPiecesBar control bar

class CPiecesBar : public CControlBar
{
public:
    CPiecesBar();

// Attributes
public:
    CSize m_sizeHorz;
    CSize m_sizeVert;
    CSize m_sizeFloat;
    BOOL IsHorzDocked() const;
    BOOL IsVertDocked() const;

// Operations
public:

// Overrides
public:
    // ClassWizard generated virtual function overrides
    //{{AFX_VIRTUAL(CPiecesBar)
	public:
    virtual BOOL Create(LPCTSTR lpszWindowName, CWnd* pParentWnd, CSize sizeDefault, BOOL bHasGripper, UINT nID, DWORD dwStyle = WS_CHILD | WS_VISIBLE | CBRS_TOP);
    virtual CSize CalcFixedLayout(BOOL bStretch, BOOL bHorz);
    virtual CSize CalcDynamicLayout(int nLength, DWORD dwMode);
	//}}AFX_VIRTUAL

// Implementation
public:
    virtual ~CPiecesBar();
    
protected:
    // implementation helpers
    void StartTracking();
    void StopTracking(BOOL bAccept);
	void OnTrackUpdateSize(CPoint& point);
    void OnTrackInvertTracker();
	virtual CSize CalcMaxSize();
	virtual BOOL QueryDragFullWindows() const;

protected:
	// used for resizing
    CSize	m_sizeMin;
    CSize   m_sizeMax;
	CPoint	m_ptOld;
    CRect   m_rectBorder;
    BOOL    m_bTracking;
	BOOL	m_bDragShowContent;
	CSize	m_sizeOld;

    BOOL    m_bInRecalcNC;
    UINT    m_nDockBarID;
    int     m_cxEdge;
    BOOL    m_bHasGripper;
    int     m_cyGripper;
    CRect   m_rectGripper;

public:
	void CreateGroupsBar();
	BOOL m_bSubParts;
	BOOL m_bPreview;
	BOOL m_bGroups;
	BOOL m_bCombo;
	BOOL m_bNumbers;
	CPiecesList		m_wndPiecesList;
	CColorsList		m_wndColorsList;
	CPiecesCombo	m_wndPiecesCombo;
	CPiecePreview	m_wndPiecePreview;
	CTransToolBar	m_wndGroupsBar;
	CySplitterWnd	m_wndSplitter;

	char m_GroupNames[32][33];
	int m_nCurGroup;

// Generated message map functions
protected:
	BOOL m_bNoContext;
	CFont m_Font;
	int m_nPreviewHeight;
	void OnUpdateCmdUI(CFrameWnd* pTarget, BOOL bDisableIfNoHndler);
	void OnSelChangeColor();
    //{{AFX_MSG(CPiecesBar)
    afx_msg void OnPaint();
    afx_msg void OnNcPaint();
    afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos);
    afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp);
    afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
    afx_msg void OnMouseMove(UINT nFlags, CPoint point);
    afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point);
    afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
    afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
	afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
    afx_msg void OnCaptureChanged(CWnd *pWnd);
    afx_msg UINT OnNcHitTest(CPoint point);
    afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
	//}}AFX_MSG

	afx_msg BOOL OnToolTipText(UINT, NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg LONG OnSplitterMoved(UINT lParam, LONG wParam);
	void OnPieceGroupClicked(UINT nID);

    DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.

#endif // !defined(PIECEBAR_H_INCLUDED)