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 | List of all members
SelectAspectRatioDialog Class Reference

#include <SelectCropAspectRatioDialog.h>

Inheritance diagram for SelectAspectRatioDialog:
Inheritance graph

Public Member Functions

 SelectAspectRatioDialog (wxWindow *parent)
 constructor, build dialog and load settings from file More...
 
 ~SelectAspectRatioDialog ()
 destructor, save position and list of aspect ratios More...
 
double GetSelectedAspectRatio () const
 returns the selected aspect ratio More...
 

Protected Member Functions

void OnOk (wxCommandEvent &e)
 handler for Ok, check for valid inputs More...
 
void OnAddAspectRatio (wxCommandEvent &e)
 handler for adding new aspect ratio setting More...
 
void OnRemoveAspectRatio (wxCommandEvent &e)
 handler for removing selected aspect ratio More...
 
void OnListBoxSelect (wxCommandEvent &e)
 event handler for activation/deactivation of buttons if necessary More...
 

Private Member Functions

void ListBoxSelectionChanged ()
 implementation of activation/deactivation of buttons if necessary More...
 
void FillListBox ()
 read the settings from the file and add them to the list box if the file does not exist, populate list with default settings More...
 
wxFileName GetAspectRatioFilename () const
 returns the file name for the list of aspect ratios More...
 
void LoadAspectRatios ()
 load aspect ratios from file More...
 
void SaveAspectRatios ()
 save the aspect ratios to the file More...
 

Private Attributes

wxArrayString m_aspectRatioStrings
 array with names of all aspect ratios More...
 
std::vector< double > m_aspectRatios
 vector with values of all aspect ratios, ratio=width/height More...
 
wxListBox * m_aspectList
 pointer to wxListBox of aspect ratios More...
 

Detailed Description

Definition at line 35 of file SelectCropAspectRatioDialog.h.

Constructor & Destructor Documentation

SelectAspectRatioDialog::SelectAspectRatioDialog ( wxWindow *  parent)
SelectAspectRatioDialog::~SelectAspectRatioDialog ( )

destructor, save position and list of aspect ratios

Definition at line 55 of file SelectCropAspectRatioDialog.cpp.

References SaveAspectRatios(), and StoreFramePosition().

Member Function Documentation

void SelectAspectRatioDialog::FillListBox ( )
private

read the settings from the file and add them to the list box if the file does not exist, populate list with default settings

Definition at line 201 of file SelectCropAspectRatioDialog.cpp.

References LoadAspectRatios(), m_aspectList, m_aspectRatios, and m_aspectRatioStrings.

Referenced by SelectAspectRatioDialog().

wxFileName SelectAspectRatioDialog::GetAspectRatioFilename ( ) const
private

returns the file name for the list of aspect ratios

Definition at line 224 of file SelectCropAspectRatioDialog.cpp.

References hugin_utils::GetUserAppDataDir().

Referenced by LoadAspectRatios(), and SaveAspectRatios().

double SelectAspectRatioDialog::GetSelectedAspectRatio ( ) const

returns the selected aspect ratio

Definition at line 63 of file SelectCropAspectRatioDialog.cpp.

References m_aspectList, and m_aspectRatios.

Referenced by GLPreviewFrame::OnSetCropAspect().

void SelectAspectRatioDialog::ListBoxSelectionChanged ( )
private

implementation of activation/deactivation of buttons if necessary

Definition at line 193 of file SelectCropAspectRatioDialog.cpp.

References m_aspectList, and m_aspectRatioStrings.

Referenced by OnAddAspectRatio(), OnListBoxSelect(), OnRemoveAspectRatio(), and SelectAspectRatioDialog().

void SelectAspectRatioDialog::LoadAspectRatios ( )
private

load aspect ratios from file

Definition at line 229 of file SelectCropAspectRatioDialog.cpp.

References GetAspectRatioFilename(), celeste::line, m_aspectRatios, m_aspectRatioStrings, and separator.

Referenced by FillListBox().

void SelectAspectRatioDialog::OnAddAspectRatio ( wxCommandEvent &  e)
protected

handler for adding new aspect ratio setting

Definition at line 141 of file SelectCropAspectRatioDialog.cpp.

References CheckInputs(), ListBoxSelectionChanged(), m_aspectList, m_aspectRatios, and m_aspectRatioStrings.

Referenced by SelectAspectRatioDialog().

void SelectAspectRatioDialog::OnListBoxSelect ( wxCommandEvent &  e)
protected

event handler for activation/deactivation of buttons if necessary

Definition at line 188 of file SelectCropAspectRatioDialog.cpp.

References ListBoxSelectionChanged().

Referenced by SelectAspectRatioDialog().

void SelectAspectRatioDialog::OnOk ( wxCommandEvent &  e)
protected

handler for Ok, check for valid inputs

Definition at line 73 of file SelectCropAspectRatioDialog.cpp.

References m_aspectList.

Referenced by SelectAspectRatioDialog().

void SelectAspectRatioDialog::OnRemoveAspectRatio ( wxCommandEvent &  e)
protected

handler for removing selected aspect ratio

Definition at line 170 of file SelectCropAspectRatioDialog.cpp.

References ListBoxSelectionChanged(), m_aspectList, m_aspectRatios, and m_aspectRatioStrings.

Referenced by SelectAspectRatioDialog().

void SelectAspectRatioDialog::SaveAspectRatios ( )
private

save the aspect ratios to the file

Definition at line 261 of file SelectCropAspectRatioDialog.cpp.

References GetAspectRatioFilename(), m_aspectRatios, m_aspectRatioStrings, and separator.

Referenced by ~SelectAspectRatioDialog().

Member Data Documentation

wxListBox* SelectAspectRatioDialog::m_aspectList
private
std::vector<double> SelectAspectRatioDialog::m_aspectRatios
private

vector with values of all aspect ratios, ratio=width/height

Definition at line 68 of file SelectCropAspectRatioDialog.h.

Referenced by FillListBox(), GetSelectedAspectRatio(), LoadAspectRatios(), OnAddAspectRatio(), OnRemoveAspectRatio(), and SaveAspectRatios().

wxArrayString SelectAspectRatioDialog::m_aspectRatioStrings
private

array with names of all aspect ratios

Definition at line 66 of file SelectCropAspectRatioDialog.h.

Referenced by FillListBox(), ListBoxSelectionChanged(), LoadAspectRatios(), OnAddAspectRatio(), OnRemoveAspectRatio(), and SaveAspectRatios().


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