Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
SoWinBitmapButton.h
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2014 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : VSG (MMM YYYY)
22**=======================================================================*/
23
24
25#ifndef _SO_PIXMAP_BUTTON_
26#define _SO_PIXMAP_BUTTON_
27
28#include <Inventor/Win/SoWinBeginStrict.h>
29#include <windows.h>
30#include <Inventor/Win/SoWinDef.h>
31
32#include <Inventor/SbBasic.h>
33
34
35{
36 public:
37 SoWinBitmapButton(SoWidget parent, SbBool selectable);
38
39 ~SoWinBitmapButton();
40
41 // return the motif push button
42 SoWidget getWidget() { return widget; }
43
44 // draw the button (called from button parent's wndProc)
45 void draw( LPDRAWITEMSTRUCT ) ;
46
47 // specify bitmap id in resource file to use for button
48 // (use this instead of the setIcon method)
49 // Up and down states of button are simulated like Motif.
50 void setBitmap( HMODULE hModule, ULONG idBitmap );
51
52 // specify both up and down bitmaps for button
53 void setBitmaps( HMODULE hModule,
54 ULONG idUp, ULONG idDown );
55
56 // specify if button will draw differently when it has "focus"
57 void showFocus( SbBool );
58
59 // Highlight the pixmap to show it it selected (must pass TRUE
60 // to the constructor, in which case another pixmap with a highlight
61 // color will be created for the button).
62 void select(SbBool onOrOff);
63 SbBool isSelected() { return selectFlag; }
64
65 private:
66 SoWidget widget;
67 SbBool selectFlag, selectable;
68 Pixmap normalPixmap, selectPixmap;
69
70 // fetch the bitmap(s) from the resource file
71 void loadBitmaps() ;
72
73 ULONG idUp,idDown ;
74 HMODULE hMod ;
75 HBITMAP hUpBits ;
76 HBITMAP hDownBits ;
77
78 BITMAP cUpBits ;
79 BITMAP cDownBits ;
80
81 SbBool showsFocus;
82
83};
84
85#include <Inventor/Win/SoWinEndStrict.h>
86
87#endif // _SO_PIXMAP_BUTTON_
88
89
int SbBool
Boolean type.
Definition SbBase.h:87