00001 /*======================================================================= 00002 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), *** 00003 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. *** 00004 *** *** 00005 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS *** 00006 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR *** 00007 *** WRITTEN AUTHORIZATION OF FEI S.A.S. *** 00008 *** *** 00009 *** RESTRICTED RIGHTS LEGEND *** 00010 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS *** 00011 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN *** 00012 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT *** 00013 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN *** 00014 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. *** 00015 *** *** 00016 *** COPYRIGHT (C) 1996-2014 BY FEI S.A.S, *** 00017 *** BORDEAUX, FRANCE *** 00018 *** ALL RIGHTS RESERVED *** 00019 **=======================================================================*/ 00020 /*======================================================================= 00021 ** Author : VSG (MMM YYYY) 00022 **=======================================================================*/ 00023 00024 00025 #ifndef _SO_PIXMAP_BUTTON_ 00026 #define _SO_PIXMAP_BUTTON_ 00027 00028 #include <Inventor/Win/SoWinBeginStrict.h> 00029 #include <windows.h> 00030 #include <Inventor/Win/SoWinDef.h> 00031 00032 #include <Inventor/SbBasic.h> 00033 00034 00035 { 00036 public: 00037 SoWinBitmapButton(SoWidget parent, SbBool selectable); 00038 00039 ~SoWinBitmapButton(); 00040 00041 // return the motif push button 00042 SoWidget getWidget() { return widget; } 00043 00044 // draw the button (called from button parent's wndProc) 00045 void draw( LPDRAWITEMSTRUCT ) ; 00046 00047 // specify bitmap id in resource file to use for button 00048 // (use this instead of the setIcon method) 00049 // Up and down states of button are simulated like Motif. 00050 void setBitmap( HMODULE hModule, ULONG idBitmap ); 00051 00052 // specify both up and down bitmaps for button 00053 void setBitmaps( HMODULE hModule, 00054 ULONG idUp, ULONG idDown ); 00055 00056 // specify if button will draw differently when it has "focus" 00057 void showFocus( SbBool ); 00058 00059 // Highlight the pixmap to show it it selected (must pass TRUE 00060 // to the constructor, in which case another pixmap with a highlight 00061 // color will be created for the button). 00062 void select(SbBool onOrOff); 00063 SbBool isSelected() { return selectFlag; } 00064 00065 private: 00066 SoWidget widget; 00067 SbBool selectFlag, selectable; 00068 Pixmap normalPixmap, selectPixmap; 00069 00070 // fetch the bitmap(s) from the resource file 00071 void loadBitmaps() ; 00072 00073 ULONG idUp,idDown ; 00074 HMODULE hMod ; 00075 HBITMAP hUpBits ; 00076 HBITMAP hDownBits ; 00077 00078 BITMAP cUpBits ; 00079 BITMAP cDownBits ; 00080 00081 SbBool showsFocus; 00082 00083 }; 00084 00085 #include <Inventor/Win/SoWinEndStrict.h> 00086 00087 #endif // _SO_PIXMAP_BUTTON_ 00088 00089 00090