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

Dialog for browsing pto files. More...

#include <BrowseDialog.h>

Inheritance diagram for BrowsePTOFilesDialog:
Inheritance graph

Public Member Functions

 BrowsePTOFilesDialog (wxWindow *parent, const wxString startDirectory)
 Constructor, read from xrc ressource; restore last uses settings and position. More...
 
 ~BrowsePTOFilesDialog ()
 destructor, saves position More...
 
wxString GetSelectedProject ()
 return full path of selected project More...
 
wxString GetSelectedPath ()
 return last selected path More...
 

Protected Member Functions

void OnOk (wxCommandEvent &e)
 Saves current expression when closing dialog with Ok. More...
 
void OnDirectoryChanged (wxTreeEvent &e)
 directory changed, load files from new directory More...
 
void OnFileChanged (wxListEvent &e)
 new file selected, generate preview for new file More...
 
void OnDblClickListCtrl (wxMouseEvent &e)
 double click does open file More...
 
void OnListColClick (wxListEvent &e)
 click on header to sort by column More...
 
void OnThumbnailUpdate (wxCommandEvent &e)
 for notifing from ThumbnailThread about new generated thumbnail generated thumbnail is transfered in event.GetEventObject() More...
 
void OnListTypeChanged (wxCommandEvent &e)
 Change display of wxListCtrl. More...
 
void OnShowOnMap (wxCommandEvent &e)
 show current pano on Openstreetmap More...
 

Private Member Functions

long TranslateIndex (const long index)
 translate the index to the index of m_ptoInfo More...
 
void SortItems ()
 sort the items according to selected column More...
 
void EndThumbnailThread ()
 end background thumbnail creating thread More...
 
PanoInfo ParsePTOFile (const wxFileName file)
 read the given pto file and add all information to wxListCtrl More...
 
void FillPanoInfo (const PanoInfo &info, long index)
 add a new item to wxListCtrl and populate all columns More...
 
void UpdateItemTexts (long newStyle)
 update all item texts More...
 
void UpdateImagesIndex ()
 update the image indexes More...
 
void GeneratePreview (int index)
 generate preview for pto file with index More...
 

Private Attributes

wxGenericDirCtrl * m_dirCtrl = nullptr
 
wxListCtrl * m_listCtrl = nullptr
 
wxChoice * m_listType = nullptr
 
wxButton * m_showMap = nullptr
 
long m_sortCol = -1
 
bool m_sortAscending = true
 
wxStaticBitmap * m_previewCtrl = nullptr
 
wxStaticText * m_labelControl = nullptr
 
wxSplitterWindow * m_splitter1
 
wxSplitterWindow * m_splitter2
 
std::vector< PanoInfom_ptoInfo
 info about the pto file More...
 
wxImageList m_thumbnails
 image list with all thumbnails More...
 
ThumbnailThreadm_thumbnailThread = nullptr
 background thumbnail creater thread More...
 
wxCriticalSection m_ThreadCS
 critical section to synchronize with ThumbnailThread More...
 

Friends

class ThumbnailThread
 

Detailed Description

Dialog for browsing pto files.

Definition at line 72 of file BrowseDialog.h.

Constructor & Destructor Documentation

BrowsePTOFilesDialog::BrowsePTOFilesDialog ( wxWindow *  parent,
const wxString  startDirectory 
)

Constructor, read from xrc ressource; restore last uses settings and position.

Definition at line 174 of file BrowseDialog.cpp.

References huginApp::Get(), celeste::max(), OnDblClickListCtrl(), RestoreFramePosition(), SetMyColumnImage(), and THUMBNAIL_SIZE.

BrowsePTOFilesDialog::~BrowsePTOFilesDialog ( )

destructor, saves position

Definition at line 290 of file BrowseDialog.cpp.

References EndThumbnailThread(), m_listCtrl, m_listType, m_sortAscending, m_sortCol, m_splitter1, m_splitter2, and StoreFramePosition().

Member Function Documentation

void BrowsePTOFilesDialog::EndThumbnailThread ( )
private

end background thumbnail creating thread

Definition at line 961 of file BrowseDialog.cpp.

References m_ThreadCS, and m_thumbnailThread.

Referenced by OnDirectoryChanged(), and ~BrowsePTOFilesDialog().

void BrowsePTOFilesDialog::FillPanoInfo ( const PanoInfo info,
long  index 
)
private
void BrowsePTOFilesDialog::GeneratePreview ( int  index)
private
wxString BrowsePTOFilesDialog::GetSelectedPath ( )

return last selected path

Definition at line 327 of file BrowseDialog.cpp.

References m_dirCtrl.

wxString BrowsePTOFilesDialog::GetSelectedProject ( )

return full path of selected project

Definition at line 310 of file BrowseDialog.cpp.

References m_listCtrl, m_ptoInfo, and TranslateIndex().

void BrowsePTOFilesDialog::OnDblClickListCtrl ( wxMouseEvent &  e)
protected

double click does open file

Definition at line 559 of file BrowseDialog.cpp.

References m_listCtrl.

Referenced by BrowsePTOFilesDialog().

void BrowsePTOFilesDialog::OnDirectoryChanged ( wxTreeEvent &  e)
protected
void BrowsePTOFilesDialog::OnFileChanged ( wxListEvent &  e)
protected

new file selected, generate preview for new file

Definition at line 551 of file BrowseDialog.cpp.

References GeneratePreview(), and TranslateIndex().

void BrowsePTOFilesDialog::OnListColClick ( wxListEvent &  e)
protected

click on header to sort by column

Definition at line 567 of file BrowseDialog.cpp.

References m_listCtrl, m_sortAscending, m_sortCol, SetMyColumnImage(), and SortItems().

void BrowsePTOFilesDialog::OnListTypeChanged ( wxCommandEvent &  e)
protected

Change display of wxListCtrl.

Definition at line 629 of file BrowseDialog.cpp.

References m_listCtrl, m_thumbnailThread, UpdateImagesIndex(), and UpdateItemTexts().

void BrowsePTOFilesDialog::OnOk ( wxCommandEvent &  e)
protected

Saves current expression when closing dialog with Ok.

Definition at line 332 of file BrowseDialog.cpp.

References m_listCtrl.

void BrowsePTOFilesDialog::OnShowOnMap ( wxCommandEvent &  e)
protected

show current pano on Openstreetmap

Definition at line 655 of file BrowseDialog.cpp.

References m_listCtrl, and m_ptoInfo.

void BrowsePTOFilesDialog::OnThumbnailUpdate ( wxCommandEvent &  e)
protected

for notifing from ThumbnailThread about new generated thumbnail generated thumbnail is transfered in event.GetEventObject()

Definition at line 602 of file BrowseDialog.cpp.

References ThreadImage::GetwxImage(), m_listCtrl, m_ptoInfo, m_thumbnails, and UpdateImagesIndex().

PanoInfo BrowsePTOFilesDialog::ParsePTOFile ( const wxFileName  file)
private
void BrowsePTOFilesDialog::SortItems ( )
private
long BrowsePTOFilesDialog::TranslateIndex ( const long  index)
private

translate the index to the index of m_ptoInfo

Definition at line 672 of file BrowseDialog.cpp.

References m_listCtrl.

Referenced by GetSelectedProject(), OnFileChanged(), and UpdateImagesIndex().

void BrowsePTOFilesDialog::UpdateImagesIndex ( )
private

update the image indexes

Definition at line 488 of file BrowseDialog.cpp.

References m_listCtrl, m_ptoInfo, and TranslateIndex().

Referenced by OnListTypeChanged(), and OnThumbnailUpdate().

void BrowsePTOFilesDialog::UpdateItemTexts ( long  newStyle)
private

update all item texts

Definition at line 468 of file BrowseDialog.cpp.

References FillPanoInfo(), m_listCtrl, m_ptoInfo, and SortItems().

Referenced by OnListTypeChanged().

Friends And Related Function Documentation

friend class ThumbnailThread
friend

Definition at line 142 of file BrowseDialog.h.

Referenced by OnDirectoryChanged().

Member Data Documentation

wxGenericDirCtrl* BrowsePTOFilesDialog::m_dirCtrl = nullptr
private

Definition at line 123 of file BrowseDialog.h.

Referenced by GetSelectedPath(), and OnDirectoryChanged().

wxStaticText* BrowsePTOFilesDialog::m_labelControl = nullptr
private

Definition at line 131 of file BrowseDialog.h.

Referenced by GeneratePreview(), and OnDirectoryChanged().

wxListCtrl* BrowsePTOFilesDialog::m_listCtrl = nullptr
private
wxChoice* BrowsePTOFilesDialog::m_listType = nullptr
private

Definition at line 125 of file BrowseDialog.h.

Referenced by ~BrowsePTOFilesDialog().

wxStaticBitmap* BrowsePTOFilesDialog::m_previewCtrl = nullptr
private

Definition at line 130 of file BrowseDialog.h.

Referenced by GeneratePreview(), and OnDirectoryChanged().

std::vector<PanoInfo> BrowsePTOFilesDialog::m_ptoInfo
private
wxButton* BrowsePTOFilesDialog::m_showMap = nullptr
private

Definition at line 126 of file BrowseDialog.h.

Referenced by GeneratePreview(), and OnDirectoryChanged().

bool BrowsePTOFilesDialog::m_sortAscending = true
private

Definition at line 129 of file BrowseDialog.h.

Referenced by OnListColClick(), SortItems(), and ~BrowsePTOFilesDialog().

long BrowsePTOFilesDialog::m_sortCol = -1
private

Definition at line 128 of file BrowseDialog.h.

Referenced by OnListColClick(), SortItems(), and ~BrowsePTOFilesDialog().

wxSplitterWindow* BrowsePTOFilesDialog::m_splitter1
private

Definition at line 132 of file BrowseDialog.h.

Referenced by ~BrowsePTOFilesDialog().

wxSplitterWindow* BrowsePTOFilesDialog::m_splitter2
private

Definition at line 133 of file BrowseDialog.h.

Referenced by ~BrowsePTOFilesDialog().

wxCriticalSection BrowsePTOFilesDialog::m_ThreadCS
private

critical section to synchronize with ThumbnailThread

Definition at line 141 of file BrowseDialog.h.

Referenced by EndThumbnailThread(), and ThumbnailThread::~ThumbnailThread().

wxImageList BrowsePTOFilesDialog::m_thumbnails
private

image list with all thumbnails

Definition at line 137 of file BrowseDialog.h.

Referenced by OnDirectoryChanged(), and OnThumbnailUpdate().

ThumbnailThread* BrowsePTOFilesDialog::m_thumbnailThread = nullptr
private

background thumbnail creater thread

Definition at line 139 of file BrowseDialog.h.

Referenced by EndThumbnailThread(), OnDirectoryChanged(), OnListTypeChanged(), and ThumbnailThread::~ThumbnailThread().


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