Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FXIcon.h
1 /********************************************************************************
2 * *
3 * I c o n - O b j e c t *
4 * *
5 *********************************************************************************
6 * Copyright (C) 1997,2024 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU Lesser General Public License as published by *
10 * the Free Software Foundation; either version 3 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public License *
19 * along with this program. If not, see <http://www.gnu.org/licenses/> *
20 ********************************************************************************/
21 #ifndef FXICON_H
22 #define FXICON_H
23 
24 #ifndef FXIMAGE_H
25 #include "FXImage.h"
26 #endif
27 
28 namespace FX {
29 
30 class FXDC;
31 class FXDCWindow;
32 class FXDrawable;
33 class FXTopWindow;
34 
35 
42 class FXAPI FXIcon : public FXImage {
43  FXDECLARE(FXIcon)
44  friend class FXDC;
45  friend class FXWindow;
46  friend class FXDCWindow;
47  friend class FXDrawable;
48  friend class FXTopWindow;
49 protected:
50  FXID shape; // Shape pixmap
51  FXID etch; // Etch pixmap
52  FXColor transp; // Transparency color
53  FXshort thresh; // Treshold for etch mask
54 protected:
55  FXIcon();
56  FXColor guesstransp() const;
57  FXshort guessthresh() const;
58 private:
59  FXIcon(const FXIcon&);
60  FXIcon &operator=(const FXIcon&);
61 public:
62 
76  FXIcon(FXApp* a,const FXColor *pix=nullptr,FXColor clr=0,FXuint opts=0,FXint w=1,FXint h=1);
77 
86  virtual void create();
87 
92  virtual void detach();
93 
98  virtual void destroy();
99 
104  virtual void render();
105 
111  virtual void resize(FXint w,FXint h);
112 
114  FXColor getTransparentColor() const { return transp; }
115 
117  void setTransparentColor(FXColor color){ transp=color; }
118 
120  FXshort getThresholdValue() const { return thresh; }
121 
123  void setThresholdValue(FXshort value){ thresh=value; }
124 
126  virtual ~FXIcon();
127  };
128 
129 }
130 
131 #endif
FXshort getThresholdValue() const
Get threshold value.
Definition: FXIcon.h:120
FXColor getTransparentColor() const
Get transparency color.
Definition: FXIcon.h:114
Window is the base class for all widgets in FOX.
Definition: FXWindow.h:130
The Application object is the central point of a FOX user-interface.
Definition: FXApp.h:134
Abstract Device Context.
Definition: FXDC.h:153
Definition: FX4Splitter.h:28
An Icon is an image with two additional server-side resources: a shape bitmap, which is used to mask ...
Definition: FXIcon.h:42
Abstract base class for all top-level windows.
Definition: FXTopWindow.h:97
Window Device Context.
Definition: FXDCWindow.h:48
An Image is a rectangular array of pixels.
Definition: FXImage.h:67
void setThresholdValue(FXshort value)
Change threshold value.
Definition: FXIcon.h:123
void setTransparentColor(FXColor color)
Change transparency color.
Definition: FXIcon.h:117
Drawable is an abstract base class for any surface that can be drawn upon, such as a FXWindow...
Definition: FXDrawable.h:38

Copyright © 1997-2022 Jeroen van der Zijp