Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/Tools/3dsmaxExport/LEXIExporter/GDIMetaLib/Sources/GDIButton.cpp @ 6

Last change on this file since 6 was 6, checked in by anonymous, 17 years ago

=…

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