Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ImageBox.h
Go to the documentation of this file.
1 /* Project nGenEx
2  Destroyer Studios LLC
3  Copyright © 1997-2004. All Rights Reserved.
4 
5  SUBSYSTEM: nGenEx.lib
6  FILE: ImageBox.h
7  AUTHOR: John DiCamillo
8 
9 
10  OVERVIEW
11  ========
12  ImageBox class
13 */
14 
15 #ifndef ImageBox_h
16 #define ImageBox_h
17 
18 #include "Types.h"
19 #include "ActiveWindow.h"
20 #include "Bitmap.h"
21 
22 // +--------------------------------------------------------------------+
23 
24 class ImageBox : public ActiveWindow
25 {
26 public:
27  ImageBox(ActiveWindow* p, int ax, int ay, int aw, int ah, DWORD id=0);
28  ImageBox(Screen* s, int ax, int ay, int aw, int ah, DWORD id=0);
29  virtual ~ImageBox();
30 
31  // Operations:
32  virtual void Draw();
33 
34  // Event Target Interface:
35  virtual int OnMouseMove(int x, int y);
36  virtual int OnLButtonDown(int x, int y);
37  virtual int OnLButtonUp(int x, int y);
38  virtual int OnClick();
39  virtual int OnMouseEnter(int x, int y);
40  virtual int OnMouseExit(int x, int y);
41 
42  // Property accessors:
43  int GetBlendMode() const { return blend_mode; }
44  void SetBlendMode(int blend) { blend_mode = blend; }
45  bool GetBorder() const { return border; }
46  void SetBorder(bool bNewValue) { border = bNewValue; }
47  Color GetBorderColor() const { return border_color; }
49  void GetPicture(Bitmap& img) const;
50  void SetPicture(const Bitmap& img);
51  int GetPictureLocation() const;
52  void SetPictureLocation(int nNewValue);
53  Rect GetTargetRect() const { return target_rect; }
54  void SetTargetRect(const Rect& r) { target_rect = r; }
55 
56 protected:
57  virtual void DrawTabbedText();
58 
59  Rect CalcLabelRect(int img_w, int img_h);
61 
62  bool border;
68 };
69 
70 #endif ImageBox_h
71