Hugin trunk 0.1
Loading...
Searching...
No Matches
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
 
 ~SelectAspectRatioDialog ()
 destructor, save position and list of aspect ratios
 
double GetSelectedAspectRatio () const
 returns the selected aspect ratio
 

Protected Member Functions

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

Private Member Functions

void ListBoxSelectionChanged ()
 implementation of activation/deactivation of buttons if necessary
 
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
 
wxFileName GetAspectRatioFilename () const
 returns the file name for the list of aspect ratios
 
void LoadAspectRatios ()
 load aspect ratios from file
 
void SaveAspectRatios ()
 save the aspect ratios to the file
 

Private Attributes

wxArrayString m_aspectRatioStrings
 array with names of all aspect ratios
 
std::vector< doublem_aspectRatios
 vector with values of all aspect ratios, ratio=width/height
 
wxListBoxm_aspectList
 pointer to wxListBox of aspect ratios
 

Detailed Description

Definition at line 35 of file SelectCropAspectRatioDialog.h.

Constructor & Destructor Documentation

◆ SelectAspectRatioDialog()

SelectAspectRatioDialog::SelectAspectRatioDialog ( wxWindow *  parent)

◆ ~SelectAspectRatioDialog()

SelectAspectRatioDialog::~SelectAspectRatioDialog ( )

destructor, save position and list of aspect ratios

Definition at line 49 of file SelectCropAspectRatioDialog.cpp.

References SaveAspectRatios(), and hugin_utils::StoreFramePosition().

Member Function Documentation

◆ FillListBox()

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 196 of file SelectCropAspectRatioDialog.cpp.

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

Referenced by SelectAspectRatioDialog().

◆ GetAspectRatioFilename()

wxFileName SelectAspectRatioDialog::GetAspectRatioFilename ( ) const
private

returns the file name for the list of aspect ratios

Definition at line 219 of file SelectCropAspectRatioDialog.cpp.

References hugin_utils::GetUserAppDataDir(), and threshold().

Referenced by LoadAspectRatios(), and SaveAspectRatios().

◆ GetSelectedAspectRatio()

double SelectAspectRatioDialog::GetSelectedAspectRatio ( ) const

returns the selected aspect ratio

Definition at line 57 of file SelectCropAspectRatioDialog.cpp.

References m_aspectList, m_aspectRatios, and threshold().

◆ ListBoxSelectionChanged()

void SelectAspectRatioDialog::ListBoxSelectionChanged ( )
private

implementation of activation/deactivation of buttons if necessary

Definition at line 188 of file SelectCropAspectRatioDialog.cpp.

References m_aspectList, m_aspectRatioStrings, and threshold().

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

◆ LoadAspectRatios()

void SelectAspectRatioDialog::LoadAspectRatios ( )
private

load aspect ratios from file

Definition at line 224 of file SelectCropAspectRatioDialog.cpp.

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

Referenced by FillListBox().

◆ OnAddAspectRatio()

void SelectAspectRatioDialog::OnAddAspectRatio ( wxCommandEvent &  e)
protected

handler for adding new aspect ratio setting

Definition at line 136 of file SelectCropAspectRatioDialog.cpp.

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

Referenced by SelectAspectRatioDialog().

◆ OnListBoxSelect()

void SelectAspectRatioDialog::OnListBoxSelect ( wxCommandEvent &  e)
protected

event handler for activation/deactivation of buttons if necessary

Definition at line 183 of file SelectCropAspectRatioDialog.cpp.

References ListBoxSelectionChanged().

Referenced by SelectAspectRatioDialog().

◆ OnOk()

void SelectAspectRatioDialog::OnOk ( wxCommandEvent &  e)
protected

handler for Ok, check for valid inputs

Definition at line 67 of file SelectCropAspectRatioDialog.cpp.

References m_aspectList, and threshold().

Referenced by SelectAspectRatioDialog().

◆ OnRemoveAspectRatio()

void SelectAspectRatioDialog::OnRemoveAspectRatio ( wxCommandEvent &  e)
protected

handler for removing selected aspect ratio

Definition at line 165 of file SelectCropAspectRatioDialog.cpp.

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

Referenced by SelectAspectRatioDialog().

◆ SaveAspectRatios()

void SelectAspectRatioDialog::SaveAspectRatios ( )
private

save the aspect ratios to the file

Definition at line 256 of file SelectCropAspectRatioDialog.cpp.

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

Referenced by ~SelectAspectRatioDialog().

Member Data Documentation

◆ m_aspectList

wxListBox* SelectAspectRatioDialog::m_aspectList
private

◆ m_aspectRatios

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().

◆ m_aspectRatioStrings

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: