Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ImagesList Class Reference

multi use list. More...

#include <ImagesList.h>

Inheritance diagram for ImagesList:
Inheritance graph

Public Member Functions

 ImagesList ()
 
bool Create (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL, const wxString &name=wxT("panel"))
 
void Init (HuginBase::Panorama *pano)
 
virtual ~ImagesList (void)
 
virtual void panoramaImagesChanged (HuginBase::Panorama &pano, const HuginBase::UIntSet &imgNr)
 receive the update signal and update display accordingly More...
 
virtual void panoramaChanged (HuginBase::Panorama &pano)
 Notification about a Panorama change. More...
 
virtual void CreateItem (unsigned int imgNr)
 create an list item for imgNr More...
 
virtual void UpdateItem (unsigned int imgNr)
 update the information in an already existing list item More...
 
virtual void UpdatePartNumbersForItem (unsigned int imgNr)
 Update the part numbers (e.g. More...
 
virtual void RemoveItem (unsigned int imgNr)
 remove an existing list item More...
 
void SelectSingleImage (unsigned int imgNr)
 Select an image. More...
 
void SelectImageRange (unsigned int imgStart, unsigned int imgEnd)
 Select an image range. More...
 
void SelectImages (const HuginBase::UIntSet imgs)
 selects the given images More...
 
void SelectAll ()
 Select all images. More...
 
void DeselectAll ()
 Deselects all images. More...
 
const HuginBase::UIntSetGetSelected () const
 get the currently selected images More...
 
- Public Member Functions inherited from HuginBase::PanoramaObserver
virtual ~PanoramaObserver ()
 

Protected Member Functions

void OnItemSelected (wxListEvent &e)
 
void OnItemDeselected (wxListEvent &e)
 
void OnColumnWidthChange (wxListEvent &e)
 
void OnChar (wxKeyEvent &e)
 event handler to capture special key code More...
 

Protected Attributes

HuginBase::Panoramapano
 
HuginBase::StandardImageVariableGroupsvariable_groups
 
HuginBase::UIntSet selectedItems
 create icons for an image More...
 
wxImageList * m_smallIcons
 
int m_iconHeight
 
int m_degDigits
 
int m_distDigits
 
int m_pixelDigits
 
bool m_notifyParents
 
bool m_singleSelect
 
wxString m_configClassName
 

Detailed Description

multi use list.

This list shall contain the overall handling of datas in lists, moving selecting, drag'n drop

the special layouts are realized with subclasses and not implemented in the base class. Subclasses can override CreateItem(), UpdateItem() and RemoveItem() to customize the layout.

They can also handle the list events, for example if they want to veto a selection.

parent controls can use EVT_LIST_ITEM_SELECTED(id, func) EVT_LIST_ITEM_DESELECTED(id, func) to get notified when the selection changes. WARNING: Do not read the event in the parent control, just use GetSelected()!

Todo:
make the listcontents editable -> wxListCtrl->wxGrid?

Definition at line 60 of file ImagesList.h.

Constructor & Destructor Documentation

ImagesList::ImagesList ( )

Definition at line 53 of file ImagesList.cpp.

ImagesList::~ImagesList ( void  )
virtual

Member Function Documentation

bool ImagesList::Create ( wxWindow *  parent,
wxWindowID  id = wxID_ANY,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = wxTAB_TRAVERSAL,
const wxString &  name = wxT("panel") 
)
void ImagesList::CreateItem ( unsigned int  imgNr)
virtual

create an list item for imgNr

This creates the list item and calles UpdateItem(imgNr) to fill it with information usually, just UpdateItem needs to be overridden by base classes

Definition at line 238 of file ImagesList.cpp.

References DEBUG_DEBUG, and UpdateItem().

Referenced by panoramaImagesChanged().

void ImagesList::DeselectAll ( )

Deselects all images.

Definition at line 314 of file ImagesList.cpp.

const HuginBase::UIntSet & ImagesList::GetSelected ( ) const

get the currently selected images

Definition at line 181 of file ImagesList.cpp.

References selectedItems.

Referenced by MaskEditorPanel::OnImageSelect().

void ImagesList::Init ( HuginBase::Panorama pano)
Todo:
check new didn't return NULL in non-debug builds.

Definition at line 90 of file ImagesList.cpp.

References HuginBase::Panorama::addObserver(), DEBUG_ASSERT, pano, and variable_groups.

Referenced by ImagesListMask::Init().

void ImagesList::OnChar ( wxKeyEvent &  e)
protected

event handler to capture special key code

Definition at line 338 of file ImagesList.cpp.

References m_singleSelect, and SelectAll().

void ImagesList::OnColumnWidthChange ( wxListEvent &  e)
protected

Definition at line 401 of file ImagesList.cpp.

References m_configClassName.

void ImagesList::OnItemDeselected ( wxListEvent &  e)
protected

Definition at line 367 of file ImagesList.cpp.

References DEBUG_TRACE, m_notifyParents, and selectedItems.

void ImagesList::OnItemSelected ( wxListEvent &  e)
protected

Definition at line 325 of file ImagesList.cpp.

References DEBUG_TRACE, m_notifyParents, and selectedItems.

virtual void ImagesList::panoramaChanged ( HuginBase::Panorama pano)
inlinevirtual

Notification about a Panorama change.

This function will always be called, even when the change could be handled by panoramaImageAdded() or other notify functions.

This allows lazy observers to just listen to panoramaChanged().

Implements HuginBase::PanoramaObserver.

Definition at line 74 of file ImagesList.h.

void ImagesList::panoramaImagesChanged ( HuginBase::Panorama pano,
const HuginBase::UIntSet imgNr 
)
virtual
void ImagesList::RemoveItem ( unsigned int  imgNr)
virtual

remove an existing list item

just calles wxListCtrl::DeleteItem, but might be overriden to release ressources associated with the item

Definition at line 246 of file ImagesList.cpp.

Referenced by panoramaImagesChanged().

void ImagesList::SelectAll ( )

Select all images.

Definition at line 305 of file ImagesList.cpp.

Referenced by OnChar().

void ImagesList::SelectImageRange ( unsigned int  imgStart,
unsigned int  imgEnd 
)

Select an image range.

selects images between imgNs and imgNe, and deselects all other images

Definition at line 281 of file ImagesList.cpp.

void ImagesList::SelectImages ( const HuginBase::UIntSet  imgs)

selects the given images

Definition at line 264 of file ImagesList.cpp.

References selectedItems, and set_contains().

void ImagesList::SelectSingleImage ( unsigned int  imgNr)

Select an image.

selects image imgNr, and deselects all other images

Definition at line 252 of file ImagesList.cpp.

Referenced by MaskEditorPanel::OnModeChanged(), and MaskEditorPanel::setImage().

void ImagesList::UpdateItem ( unsigned int  imgNr)
virtual

update the information in an already existing list item

Reimplemented in ImagesListMask.

Definition at line 410 of file ImagesList.cpp.

Referenced by CreateItem(), and panoramaImagesChanged().

void ImagesList::UpdatePartNumbersForItem ( unsigned int  imgNr)
virtual

Update the part numbers (e.g.

Lens number) in an already existing list item.

Needed as the part numbers can change without the rest of the image

Definition at line 415 of file ImagesList.cpp.

Referenced by panoramaImagesChanged().

Member Data Documentation

wxString ImagesList::m_configClassName
protected

Definition at line 160 of file ImagesList.h.

Referenced by ImagesListMask::Create(), and OnColumnWidthChange().

int ImagesList::m_degDigits
protected

Definition at line 151 of file ImagesList.h.

Referenced by Create().

int ImagesList::m_distDigits
protected

Definition at line 152 of file ImagesList.h.

Referenced by Create().

int ImagesList::m_iconHeight
protected

Definition at line 150 of file ImagesList.h.

Referenced by Create(), and panoramaImagesChanged().

bool ImagesList::m_notifyParents
protected

Definition at line 156 of file ImagesList.h.

Referenced by Create(), OnItemDeselected(), OnItemSelected(), and panoramaImagesChanged().

int ImagesList::m_pixelDigits
protected

Definition at line 153 of file ImagesList.h.

Referenced by Create().

bool ImagesList::m_singleSelect
protected

Definition at line 157 of file ImagesList.h.

Referenced by Create(), OnChar(), and ImagesListMask::SetSingleSelect().

wxImageList* ImagesList::m_smallIcons
protected

Definition at line 149 of file ImagesList.h.

HuginBase::Panorama* ImagesList::pano
protected

Definition at line 129 of file ImagesList.h.

Referenced by Init(), ImagesListMask::UpdateItem(), and ~ImagesList().

HuginBase::UIntSet ImagesList::selectedItems
protected

create icons for an image

Definition at line 146 of file ImagesList.h.

Referenced by GetSelected(), OnItemDeselected(), OnItemSelected(), and SelectImages().

HuginBase::StandardImageVariableGroups* ImagesList::variable_groups
protected

Definition at line 132 of file ImagesList.h.

Referenced by Init(), panoramaImagesChanged(), and ~ImagesList().


The documentation for this class was generated from the following files: