1 | /* |
---|
2 | ----------------------------------------------------------------------------- |
---|
3 | This source file is part of LEXIExporter |
---|
4 | |
---|
5 | Copyright 2006 NDS Limited |
---|
6 | |
---|
7 | Author(s): |
---|
8 | Bo Krohn |
---|
9 | |
---|
10 | This program is free software; you can redistribute it and/or modify it under |
---|
11 | the terms of the GNU Lesser General Public License as published by the Free Software |
---|
12 | Foundation; either version 2 of the License, or (at your option) any later |
---|
13 | version. |
---|
14 | |
---|
15 | This program is distributed in the hope that it will be useful, but WITHOUT |
---|
16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
---|
17 | FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. |
---|
18 | |
---|
19 | You should have received a copy of the GNU Lesser General Public License along with |
---|
20 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple |
---|
21 | Place - Suite 330, Boston, MA 02111-1307, USA, or go to |
---|
22 | http://www.gnu.org/copyleft/lesser.txt. |
---|
23 | ----------------------------------------------------------------------------- |
---|
24 | */ |
---|
25 | |
---|
26 | ///////////////////////////////////////////////// |
---|
27 | // |
---|
28 | // Max Exporter - GDI ComboBox |
---|
29 | // |
---|
30 | ///////////////////////////////////////////////// |
---|
31 | |
---|
32 | #include "stdafx.h" |
---|
33 | |
---|
34 | // |
---|
35 | |
---|
36 | namespace GDI { |
---|
37 | |
---|
38 | // |
---|
39 | |
---|
40 | Button::Button() |
---|
41 | { |
---|
42 | } |
---|
43 | |
---|
44 | Button::~Button() |
---|
45 | { |
---|
46 | } |
---|
47 | |
---|
48 | // |
---|
49 | |
---|
50 | HBITMAP Button::GetBitmap() const |
---|
51 | { |
---|
52 | return (HBITMAP)SendMessage(BM_GETIMAGE, IMAGE_BITMAP, 0); |
---|
53 | } |
---|
54 | |
---|
55 | // |
---|
56 | |
---|
57 | unsigned int Button::GetButtonStyle() const |
---|
58 | { |
---|
59 | return (unsigned int)::GetWindowLong(m_hWnd, GWL_STYLE) & 0xff; |
---|
60 | } |
---|
61 | |
---|
62 | // |
---|
63 | |
---|
64 | unsigned int Button::GetCheck() const |
---|
65 | { |
---|
66 | return (unsigned int)SendMessage(BM_GETCHECK, 0, 0); |
---|
67 | } |
---|
68 | |
---|
69 | // |
---|
70 | |
---|
71 | HCURSOR Button::GetCursor() const |
---|
72 | { |
---|
73 | return (HCURSOR)SendMessage(BM_GETIMAGE, IMAGE_CURSOR, 0); |
---|
74 | } |
---|
75 | |
---|
76 | // |
---|
77 | |
---|
78 | HICON Button::GetIcon() const |
---|
79 | { |
---|
80 | return (HICON)SendMessage(BM_GETIMAGE, IMAGE_ICON, 0); |
---|
81 | } |
---|
82 | |
---|
83 | // |
---|
84 | |
---|
85 | unsigned int Button::GetState() const |
---|
86 | { |
---|
87 | return (unsigned int)SendMessage(BM_GETSTATE, 0, 0); |
---|
88 | } |
---|
89 | |
---|
90 | // |
---|
91 | |
---|
92 | HBITMAP Button::SetBitmap(HBITMAP hBitmap) |
---|
93 | { |
---|
94 | return (HBITMAP)SendMessage(BM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hBitmap); |
---|
95 | } |
---|
96 | |
---|
97 | // |
---|
98 | |
---|
99 | void Button::SetButtonStyle(unsigned int nStyle, bool bRedraw) |
---|
100 | { |
---|
101 | SendMessage(BM_SETSTYLE, nStyle, bRedraw); |
---|
102 | } |
---|
103 | |
---|
104 | // |
---|
105 | |
---|
106 | void Button::SetCheck(unsigned int nCheck) |
---|
107 | { |
---|
108 | SendMessage(BM_SETCHECK, nCheck, 0); |
---|
109 | } |
---|
110 | |
---|
111 | // |
---|
112 | |
---|
113 | HCURSOR Button::SetCursor(HCURSOR hCursor) |
---|
114 | { |
---|
115 | return (HCURSOR)SendMessage(BM_SETIMAGE, IMAGE_CURSOR, (LPARAM)hCursor); |
---|
116 | } |
---|
117 | |
---|
118 | // |
---|
119 | |
---|
120 | HICON Button::SetIcon(HICON hIcon) |
---|
121 | { |
---|
122 | return (HICON)SendMessage(BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon); |
---|
123 | } |
---|
124 | |
---|
125 | // |
---|
126 | |
---|
127 | void Button::SetState(bool bHighlight) |
---|
128 | { |
---|
129 | SendMessage(BM_SETSTATE, bHighlight, 0); |
---|
130 | } |
---|
131 | |
---|
132 | // |
---|
133 | |
---|
134 | } // namespace GDI |
---|
135 | |
---|
136 | // |
---|
137 | |
---|