ALBA
albaGUIListBox.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaGUIListBox
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#ifndef __albaGUIListBox_H__
17#define __albaGUIListBox_H__
18//----------------------------------------------------------------------------
19// Include:
20//----------------------------------------------------------------------------
21#include <wx/laywin.h>
22#include <wx/listctrl.h>
23#include "albaEvent.h"
24#include "albaObserver.h"
25#include "albaGUIPanel.h"
26
27//----------------------------------------------------------------------------
28// albaGUIListBox :
33//----------------------------------------------------------------------------
34
36{
37public:
38 albaGUIListBox(wxWindow* parent,
39 wxWindowID id,
40 const wxPoint& pos = wxDefaultPosition,
41 const wxSize& size = wxDefaultSize,
42 long style = wxTAB_TRAVERSAL | wxCLIP_CHILDREN);
43
44 virtual ~albaGUIListBox();
45
46 void Clear();
47 void AddItem(wxString label, bool checked = false);
48 void RemoveItem(long id);
49 bool IsChecked();
50 void CheckItem(long id);
52 void SetItemLabel(long id, wxString label);
53 void SetItemLabel(wxString label);
54 wxString GetStringSelection() {return m_ListBox->GetStringSelection();};
55 int GetNumberOfItems() {return m_ListBox->GetCount();};
56 void SetListener(albaObserver *listener) {m_Listener = listener;};
57 void Select(int id);
58
59 wxListBox *m_ListBox;
60
61protected:
62 void OnSelect(wxCommandEvent &event);
63 void OnSize(wxSizeEvent& event);
64
68
69 DECLARE_EVENT_TABLE()
70};
71#endif
a ListBox that send albaEventNotification in the form albaEvent(this, widget_id, item_id,...
void CheckSelectedItem()
wxListBox * m_ListBox
virtual ~albaGUIListBox()
void SetItemLabel(long id, wxString label)
void OnSize(wxSizeEvent &event)
wxString GetStringSelection()
int GetNumberOfItems()
void OnSelect(wxCommandEvent &event)
void CheckItem(long id)
void SetListener(albaObserver *listener)
void AddItem(wxString label, bool checked=false)
void SetItemLabel(wxString label)
wxString m_ItemSelected
albaGUIListBox(wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxCLIP_CHILDREN)
void Select(int id)
void RemoveItem(long id)
albaObserver * m_Listener
class name: albaGUIPanel Inherits directly from wxPanel and adds the pointer to the next panel
Definition: albaGUIPanel.h:27
Interface implementing the Observer of the Subject/Observer design pattern.
Definition: albaObserver.h:36