ALBA
albaGUIListCtrlBitmap.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaGUIListCtrlBitmap
5 Authors: Paolo Quadrani
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 __albaGUIListCtrlBitmap_H__
18#define __albaGUIListCtrlBitmap_H__
19
20//----------------------------------------------------------------------------
21// Include:
22//----------------------------------------------------------------------------
23#include <wx/laywin.h>
24#include <wx/image.h>
25#include <wx/imaglist.h>
26#include <wx/listctrl.h>
27#include <wx/hash.h>
28#include "albaEvent.h"
29#include "albaGUINamedPanel.h"
30
31//----------------------------------------------------------------------------
32// forward declarations :
33//----------------------------------------------------------------------------
34class albaObserver;
35
36//----------------------------------------------------------------------------
37// Constants :
38//----------------------------------------------------------------------------
41{
42 ITEM_ERROR = -1, //returned by GetItemIcon(id) if 'id' doesn't exist
47};
48//----------------------------------------------------------------------------
49// albaGUIListCtrlBitmap :
50//----------------------------------------------------------------------------
53{
54public:
55 albaGUIListCtrlBitmap (wxWindow* parent, wxWindowID id=-1, bool CloseButton = false, bool HideTitle = false);
57
58 void SetListener(albaObserver *listener) {m_Listener = listener;};
59
61 void Reset();
62
64 bool AddItem(long item_id, wxString label, wxBitmap *bmp = NULL);
65
67 bool DeleteItem(long item_id);
68
70 bool SetItemLabel(long item_id, wxString label);
71
73 wxString GetItemLabel (long item_id);
74
76 bool SetItemIcon(long item_id, wxBitmap *bmp);
77
79 ITEM_ICONS GetItemIcon(long item_id);
80
82 bool SelectItem(long item_id);
83
85 void SetColumnLabel(int col, wxString label);
86
87protected:
89 void OnSelectionChanged(wxListEvent& event);
90
92 wxListCtrl *m_List;
93 wxImageList *m_Images;
95
96DECLARE_EVENT_TABLE()
97}; // end of albaGUIListCtrlBitmap
98#endif
ITEM_ICONS
possible values for icon
@ ITEM_ERROR
@ ITEM_YELLOW
albaGUIListCtrlBitmap allows a simplified use of a wxWindows ListCtrl widget.
void Reset()
Clear the control list.
albaGUIListCtrlBitmap(wxWindow *parent, wxWindowID id=-1, bool CloseButton=false, bool HideTitle=false)
bool AddItem(long item_id, wxString label, wxBitmap *bmp=NULL)
Add one item to the list.
ITEM_ICONS GetItemIcon(long item_id)
Get the item's icon.
wxString GetItemLabel(long item_id)
Get the item's label.
bool DeleteItem(long item_id)
Remove the item from the list.
bool SetItemIcon(long item_id, wxBitmap *bmp)
Set the item's icon, return true on success.
bool SetItemLabel(long item_id, wxString label)
Set the item's label.
virtual ~albaGUIListCtrlBitmap()
void SetColumnLabel(int col, wxString label)
Set the label for the list's column.
void SetListener(albaObserver *listener)
void OnSelectionChanged(wxListEvent &event)
Notify the Listener of item selection and deselection.
bool SelectItem(long item_id)
Select the item 'id'.
Class Name: albaGUINamedPanel.
Interface implementing the Observer of the Subject/Observer design pattern.
Definition: albaObserver.h:36