SECTION I :


1.1  Application

Application Class (derived from wxApp)

Files: application.h
application.cpp
Authors: Eva Bunodiere
Yasmin Kossak
Date: July 25th 2000
Technical
Advisor :
Carlos Moreno



virtual bool OnInit();

Receives: N/A
Return: N/A
Description: Creates and starts the application.




1.2  Splash

Splash Class (derived from wxFrame)


Files: Splash.h
Splash.cpp
Authors: Eva Bunodiere
Yasmin Kossak
Date: July 25th 2000
Technical
Advisor :
Carlos Moreno

 

Function Definitions

 

Splash

Receive: const wxPoint& pos, const wxSize& size
Return: N/A
Description: Constructor for the Splash class. Creates a new frame by calling wxFrame constructor, passing
the pos and size variables. Assigns a new wxTimer to the timer member variable and starts it,
also loading the Splash image.


on_timer()

Receive: void
Return: void
Description: Creates a new MainFrame object, centering it and showing it. Closes the Splash page after
showing the MainFrame.



1.3  Main Menu

MainFrame Class (derived from wxFrame)

 
Files: ZoomSettingsDialog.h ZoomSettingsDialog.cpp
Authors: Eva Bunodiere
Yasmin Kossak
Date: July 25th 2000
Technical
Advisor :
Carlos Moreno



Member

Purpose

 
wxToolBarBase * toolbar Pointer to the toolbar
wxMenu * popup_menu Pointer to the pop-up menu
wxString icon_map         Name of the file containing the file names
Canvas * canvas Pointer to the canvas
vector <wxString> image_listing stores a list of files including their paths in an array
vector <wxString> image_list: Vector of names of images selected
Slide_show * slide_show Pointer to the slide show
int file_index index of image currently displayed


Funtion Definitions

 

MainFrame

Receive: const wxString& title, const wxPoint & pos, const wxSize & size
Return: N/A
Description: Constructor for the MainFrame class. Takes as a wxString the title for the frame. Receives a
wxPoint for the position as well as a wxSize for the window size. Calls the wxFrame constructor
with those parameters. Also creates and sets the menubar, and calls the init_toolbar function to
create the toolbar. Sets all the image-dependent menu items to disabled.


on_properties

Receive: wxCommandEvent&
Return: void
Description:  


on_select_files_category

Receive: wxCommandEvent&
Return: void
Description: Catches the click event on the toolbar button, or on the menu item.

 

on_select_files_filename

Receive: wxCommandEvent
Return: void
Description: Creates a new DirDialog for the user to select files. When the dialog returns wxID_OK, get_image_files returns a vector of strings. The first selection is loaded on to the canvas.


on_exit

Receive: wxCommandEvent &
Return: void
Description: Catches the click event on the menu item. Exits the program.

 

on_set_interval

Receive: wxCommandEvent&
Return: void
Description: Creates a SetIntervalDialog and shows it. When the dialog returns ID_OK, the read_interval and
            write_config_file functions are called.

 

on_show_files

Receive: wxCommandEvent&
Return: void
Description: Creates a ShowFilesDialog and shows it.

 

on_run

Receive: wxCommandEvent&
Return: void
Description: Calls the Slide_show function start_slide_show.

 

on_rotate

Receive: wxCommandEvent&
Return: void
Description: Catches the click event on the toolbar button, or on the menu item. Calls the Canvas class function on_rotate().

 

on_horizontal_flip

Receive: wxCommandEvent&
Return: void
Description: Catches the click event on the toolbar button, or on the menu item. Calls the Canvas class function on_h_lip()

 

on_vertical_flip

Receive: wxCommandEvent&
Return: void
Description: Catches the click event on the toolbar button, or on the menu item. Calls the Canvas class function on_v_flip()

 

void on_zoom_in

Receive: wxCommandEvent&
Return: void
Description: Catches the click event on the toolbar button, or on the menu item. Calls the Canvas class function zoom_center().

 

on_zoom_out

Receive: wxCommandEvent&
Return: void
Description: Catches the click event on the toolbar button, or on the menu item. Calls the Canvas class function zoom_out().

 

on_increase_contrast

Receive: wxCommandEvent&
Return: void
Description: Catches the click event on the toolbar button, or on the menu item. Calls the Canvas class function on_plus_contrast().

 

on_decrease_contrast

Receive: wxCommandEvent&
Return: void
Description: Catches the click event on the toolbar button, or on the menu item. Calls the Canvas class function on_minus_contrast().

 

on_increase_brightness

Receive: wxCommandEvent&
Return: void
Description: Catches the click event on the toolbar button, or on the menu item. Calls the Canvas class function on_bright().

 

on_decrease_brightness

Receive: wxCommandEvent&
Return: void
Description: Catches the click event on the toolbar button, or on the menu item. Calls tha Canvas class function on_dim().

 

on_original_image

Receive: wxCommandEvent&
Return: void
Description: Catches the click event on the toolbar button, or on the menu item. Calls the Canvas class function original().

 

on_language

Receive: wxCommandEvent&
Return: void
Description: Catches the click event on the menu item. Creates a new LanguageDialog. When the dialog returns wxID_OK the language is returned and written to file.

 

on_toggle_toolbar

Receive: wxCommandEvent&
Return: void
Description: Catches the click event on the menu item. Calls the ToolBar function Show passing the result of the operation of calling GetMenuBar, then calling IsChecked() to determine whether or not the    toolbar was shown at that moment. Show() then receives the result of the IsChecked() to show or not the toolbar

 

on_contents

Receive: wxCommandEvent&
Return: void
Description: Catches the click event on the toolbar button, or on the menu item. Creates a new ContentsFrame object, shows it and finally calls show_help() passing the path to the text file appropriate to the language

 

on_about

Receive: wxCommandEvent&
Return: void
Description: Catches the click event on the menu item. Creates an AboutDialog object, and shows it. Also destroys it when the ShowModal() function returns

 

on_zoom_settings

Receive: wxCommandEvent&
Return: void
Description: Catches the click event on the toolbar button, or on the menu item. Creates a new ZoomSettingsDialog object. When the object returns with wxID_OK, gets the values which were entered by calling the Canvas class function ChangeZoomType and passing the  ZoomSettingsDialog function zoom_by_interpolation's result.  Destroys the Dialog after getting the information.

 

init_toolbar

Receive: void
Return: bool
Description: Creates the toolbar for the program. Initializes the toolbar bitmaps needed into a wxBitmap array. Then adds the tools needed calling AddTool(), and passing the ID, the appropriate bitmap and the tooltip translation. Also sets all the image-dependent tools to disabled by calling the EnableTool() function. Calls the Realize() function to activate the changes to the toolbar.

 

read_config_file

Receive: void
Return: void
Description: Function reads the configuration file, which is dependent on OS. Reads the information from the file into the settings structure. If the file is not found or cannot be opened, the function alerts the user with a message box, and initializes the structure with default values.

                                                                                                                                                                           

enable_image_items()

Receive: void
Return: void
Description: Simply enables all image-dependent menu items and toolbar items. Calls the function Enable() to      enable the image-dependent items.


 


ZoomSettingsDialog Class: (derived from wxFrame)

Files: ZoomSettingsDialog.h ZoomSettingsDialog.cpp
Authors: Eva Bunodiere
Yasmin Kossak
Date: July 25th 2000
Technical
Advisor :
Carlos Moreno

 

       

Member

Purpose

 
wxButton * ok    Points to a wxButton
wxButton * cancel Points to a wxButton
wxStaticText * zoom_factor_label   Pointer to a static text label
wxTextCtrl * zoom_factor_choice Pointer  to a text control for zoom factor
wxRadioBox * zoom_choices Pointer to zoom type radio box

 

ZoomSettingsDialog::ZoomSettingsDialog

Receive: N/A (constructor)
Return: N/A (constructor)
Description: Calls the wxDialog constructor to create a new zoom settings dialog for the application. Creates a new wxRadioBox for the zoom type choice, and a wxTextCtrl for the zoom factor. Resizes the Dialog after placing the controls to ensure correct positioning. Adds Cancel and OK buttons to dismiss the dialog.

 

ZoomSettingsDialog::zoom_factor()

Receive: N/A
Return: double
Description: Returns the input of the user from the text control and converts the result to a double.

 

ZoomSettingsDialog::zoom_by_interpollation

Receive: N/A
Return: bool
Description: Returns the zoom type selected by the user, true if interpolation selected, false if stretching selected.

 


1.4   Translation

 
Files: translator.h translator.cpp
Authors: Eva Bunodiere
Yasmin Kossak
Date: July 25th 2000
Technical
Advisor :
Carlos Moreno

 

       

Member

Purpose

 
map <string, string> translations  Contains translation to a given string
string current_language  The current language
       
   


Funtion Descriptions

lower_case

Receive: string
Return: string
Description: Converts all the characters in a string to lower case equivalent.

 

Translator::Translator

Receive: N/A (constructor)
Return: N/A (constructor)
Description: Creates only the new translation strings in the current language.

   
Example:
translation ("&Select Files", "english") = "&Select Files";
translation ("&Select Files", "french") = "&Selectionner fichiers";
translation ("&Select Files", "spanish") = "&Seleccionar archivos";
translation string for:
- File Menu Labels
- View Menu Labels
- Slide Show Menu Labels
- Options Menu Labels
- Help Menu Labels
- Tool bar Tool Tips
- Rodio Box choices for Zoom Settings
- OK, Cancel Button Labels, etc...
- Non Menu items
- for Canvas.cpp
- for opening of files or categories
- About Dialog Text
- Language choices
- Set Interval Dialog
-For file selection by category


     

Translator::translation

Receive: string, string
Return: string
Description: Reads and returns the equivalent translated string, returns an empty string if no equivalent is found (private function).

 

Translator::operator[]

Receive: const string
Return: const char *
Description: Returns the translation of the string litteral contained between the square brackets.

 

Translator::return_language

Receive: N/A
Return: string
Description: Returns the current language.

 

Translator::get_language

Receive: N/A
Return: N/A
Description: Sets the language to English by default if no language has been selected. Reads the current language from the configuration file for UNIX or DOS.

 


1.5  Help / About

About Dialog Class

 
Files: AboutDialog.h AboutDialog.cpp
Authors: Eva Bunodiere
Yasmin Kossak
Date: July 25th 2000
Technical
Advisor :
Carlos Moreno


Funtion Definitions


AboutDialog

Receive: wxWindow* parent, wxWindowID id, const wxString title, const wxString& message, const wxString & OK);
Return: N/A
Description: Constructor for the AboutDialog Class, taking the parent window, and the ID. Takes a wxString for the title, the message, and the OK variable, which is to be the label for the OK button. Calls the wxDialog Constructor, creating, setting the text and showing the about dialog.

 


ContentsFrame Class (derived from wxFrame)

Files: ContentsFrame.h ContentsFrame.cpp
Authors: Eva Bunodiere
Yasmin Kossak
Date: July 25th 2000
Technical
Advisor :
Carlos Moreno


      

Member

Purpose

 
wxTextCtrl * text  Displays  the help file.

Funtion Definitions

ContentsFrame

Receive: wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE, const wxString& name = "Contents"
Initialisation:  wxFrame (parent, id, title, pos, size, style, name)
Description: Constructor for the ContentsFrame class. Takes the parent and ID. Also takes as a wxString the title, and name of the Frame which will be created. Takes the position, style and size with standard wxDefaults. Calls the wxFrame constructor passing the parameters to create and show the frame.

 

void ShowHelp

Receive: wxString path
Return: N/A
Description: Function receives a wxString parameter, which is the path for the help file. The function then opens the file and displays it in the text control member text.


 



1.6   Languages

Files: languageDialog.h languageDialog.cpp
Authors: Eva Bunodiere
Yasmin Kossak
Date: July 25th 2000
Technical
Advisor :
Carlos Moreno

Function Definitions

Language_Dialog::Language_Dialog

Receive: N/A (constructor)
Return: N/A (constructor)
Description: Creates a new Language selection dialog box. Calls the wxDialog constructor to create a new dialog, and adds a new wxChoice to contains a list of languages for the user to select. Resizes the Dialog after placing the controls to ensure correct positioning.
Adds Cancel and OK buttons to dismiss the dialog.

 

Language_Dialog::language_selected

Receive: N/A
Return: wxString
Description: Gets the language selected from the wxChoice and returns it as a wxString.

 


Back