ALBA
albaGUILutSwatch.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaGUILutSwatch
5 Authors: Silvano Imboden
6
7 Copyright (c) BIC
8 All rights reserved. See Copyright.txt or
9
10
11 This software is distributed WITHOUT ANY WARRANTY; without even
12 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13 PURPOSE. See the above copyright notice for more information.
14
15=========================================================================*/
16
17#ifndef __albaGUILutSwatch_H__
18#define __albaGUILutSwatch_H__
19
20#include "albaEvent.h"
21#include "albaDecl.h"
22#include "albaGUILutSwatch.h"
23#include "vtkLookupTable.h"
24//----------------------------------------------------------------------------
28class ALBA_EXPORT albaGUILutSwatch: public wxPanel
29{
30public:
31 albaGUILutSwatch(wxWindow* parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition,
32 const wxSize& size = wxSize(100,50), long style = wxTAB_TRAVERSAL );
33
34 void SetLut(vtkLookupTable *lut);
40 void SetEditable(bool b);
41
42 virtual bool Enable(bool enable = true);
43
44 virtual void SetListener(albaObserver *Listener) {m_Listener = Listener;};
45protected:
47
48 wxBitmap m_Bmp;
49 void OnEraseBackground(wxEraseEvent& event) {}; // overrided to prevent flickering
50 void OnPaint(wxPaintEvent &event);
51 void Update();
52
53
54 void OnLeftMouseButtonDown(wxMouseEvent &event);
55 void OnLeftMouseButtonUp(wxMouseEvent &event);
56 void OnMouseMotion(wxMouseEvent &event);
57
58 // widgets
59 vtkLookupTable *m_Lut;
61 wxString m_Tip;
63 unsigned long m_UpdateTime;
65 wxFont m_Font;
66 int m_oldW;
67 int m_oldH;
69 DECLARE_EVENT_TABLE()
70};
71#endif
albaGUILutSwatch : widget representing a LUT, usually used to call the LutEditor.
void OnEraseBackground(wxEraseEvent &event)
void SetLut(vtkLookupTable *lut)
void SetEditable(bool b)
-if b=true LeftMouseButtonDown will pop-up the LutEditor -the user is notified anyway -default = fals...
void OnPaint(wxPaintEvent &event)
void OnLeftMouseButtonDown(wxMouseEvent &event)
albaGUILutSwatch(wxWindow *parent, wxWindowID id=-1, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(100, 50), long style=wxTAB_TRAVERSAL)
albaObserver * m_Listener
virtual bool Enable(bool enable=true)
void OnMouseMotion(wxMouseEvent &event)
virtual void SetListener(albaObserver *Listener)
vtkLookupTable * m_Lut
void OnLeftMouseButtonUp(wxMouseEvent &event)
unsigned long m_UpdateTime
Interface implementing the Observer of the Subject/Observer design pattern.
Definition: albaObserver.h:36