OSDN Git Service

2012/01/19 23:44:44
[nlite/nlite.git] / nlite / nlite_commentWrite.h
1 #pragma once
2
3 namespace nlite{
4
5         template <typename T>
6         struct CommentInfo{
7                 LPCTSTR name;
8                 T userData;
9         };
10
11         typedef CommentInfo<COLORREF> CommentColorInfo;
12         typedef CommentInfo<LPCTSTR> CommentSizeInfo; 
13         typedef CommentInfo<LPCTSTR> CommentPosInfo;
14
15         class CNicoLiveStream;
16
17         ///
18         ///\88ê\94Ê\89ï\88õ\83R\83}\83\93\83h
19         ///
20         namespace generalUser{
21                 ///
22                 ///\88ê\94Ê\89ï\88õ\83R\83\81\83\93\83g\90F\83\8a\83X\83g
23                 ///
24                 extern const  CommentColorInfo COMMENT_COLORLIST[];
25
26                 ///
27                 ///\88ê\94Ê\89ï\88õ\83T\83C\83Y\83R\83}\83\93\83h\83\8a\83X\83g
28                 ///
29                 extern const CommentSizeInfo COMMENT_SIZELIST[];
30
31                 ///
32                 ///\88ê\94Ê\89ï\88õ\83R\83\81\83\93\83g\88Ê\92u\83\8a\83X\83g
33                 ///
34                 extern const CommentPosInfo COMMENT_POSLIST[];
35
36         }
37
38         ///
39         ///\83v\83\8c\83~\83A\83\80\89ï\88õ\83R\83}\83\93\83h
40         ///
41         namespace premiumUser{
42                 ///
43                 ///\83v\83\8c\83~\83A\83\80\89ï\88õ\83R\83\81\83\93\83g\90F\83\8a\83X\83g
44                 ///
45                 extern const CommentColorInfo COMMENT_COLORLIST[];
46
47
48                 ///
49                 ///\83v\83\8c\83~\83A\83\80\89ï\88õ\83T\83C\83Y\83R\83}\83\93\83h\83\8a\83X\83g
50                 ///
51                 extern const CommentSizeInfo COMMENT_SIZELIST[];
52
53                 ///
54                 ///\83v\83\8c\83~\83A\83\80\89ï\88õ\83R\83\81\83\93\83g\88Ê\92u\83\8a\83X\83g
55                 ///
56                 extern const CommentPosInfo COMMENT_POSLIST[];
57
58         }
59         
60
61
62         const static LPCTSTR COMMENTWRITEWINDOW = TEXT("commentWriteWindow");
63         
64         class CCommentWriteWindow:public CWindowImpl<CCommentWriteWindow>{
65
66         private:
67                 CComboBox commentPosBox;
68                 CComAutoCriticalSection commentPosBoxCS;
69                 CComboBox commentSizeBox;
70                 CComAutoCriticalSection commentSizeBoxCS;
71                 CComboBox commentColorBox;
72                 CButton anonymousButton;
73                 CEdit commentEdit;
74                 CButton commentWriteButton;
75                 UINT_PTR commentWriteMaxLength;
76                 UINT_PTR commentWriteInternalHeight;
77                 CNicoLiveStream &nicoLiveStream;
78
79                 enum CONTROLID{
80                         COMMENTPOS_BOX = 1,
81                         COMMENTSIZE_BOX = 2,
82                         COMMENTCOLOR_BOX = 3,
83                         ANONYMOUS_BUTTON = 4,
84                         COMMENT_EDIT = 5,
85                         COMMENTWRITE_BOTTON = 6,
86
87                 };
88
89         public:
90                 UINT_PTR commentWriteHeight;
91
92         public:
93                 CCommentWriteWindow(CNicoLiveStream &nicoLiveStream);
94
95         public:
96                 
97                 DECLARE_WND_CLASS(COMMENTWRITEWINDOW)
98                 //\83\81\83b\83Z\81[\83W\83}\83b\83v
99                 BEGIN_MSG_MAP(CCommentWriteWindow)
100                         MSG_WM_CREATE(OnCreate)
101                         MSG_WM_DESTROY(OnDestroy)
102                         MSG_WM_SIZING(OnSizing)
103                         MSG_WM_PAINT(OnPaint)
104                         MSG_WM_SIZE(OnSize)
105                         MSG_WM_ERASEBKGND(OnEraseBkGnd)
106                         MSG_WM_DRAWITEM(OnDrawItem)
107                         MSG_WM_MEASUREITEM(OnMeasureItem)
108                 END_MSG_MAP()
109
110
111                 CCommentWriteWindow();
112
113                 //
114                 //\83\81\83b\83Z\81[\83W\83n\83\93\83h\83\89
115                 //
116         private:
117                 LRESULT OnCreate(LPCREATESTRUCT lpReateStruct);
118                 
119
120                 VOID OnDestroy();
121                 
122                 VOID OnSizing(UINT wParam,LPRECT lParam);
123
124                 VOID OnPaint(HDC hdc);
125
126                 LRESULT OnSize(UINT wParam,SIZE lParam);
127
128                 VOID ChangeSize(SIZE &size);
129
130                 VOID OnDrawItem(UINT wParam,LPDRAWITEMSTRUCT lParam);
131
132                 VOID OnMeasureItem(UINT wParam,LPMEASUREITEMSTRUCT lParam);
133
134                 LRESULT OnEraseBkGnd(HDC wParam);
135         };
136
137 }