ClanLib  2.3.7
List of all members
CL_OpenFileDialog Class Reference

OpenFileDialog component. More...

#include <openfiledialog.h>

Public Member Functions

Construction
 CL_OpenFileDialog (CL_GUIComponent *owner)
 Constructs an open file dialog. More...
 
virtual ~CL_OpenFileDialog ()
 
Attributes
CL_String get_filename () const
 Get the full path of the file selected. More...
 
std::vector< CL_Stringget_filenames () const
 Gets an array that contains one file name for each selected file. More...
 
Operations
void set_multi_select (bool multiselect)
 Sets if multiple files can be selected or not. More...
 
void set_filename (const CL_String &filename)
 Sets a string containing the full path of the file selected. More...
 
void add_filter (const CL_String &filter_description, const CL_String &filter_extension, bool is_default=false)
 Add a filter that determines what types of files are displayed. More...
 
void clear_filters ()
 Clears all filters. More...
 
void set_filter_index (int filter_index)
 Sets a default filter, on a 0-based index. More...
 
void set_initial_directory (const CL_String &path)
 Sets the initial directory that is displayed. More...
 
void set_title (const CL_String &title)
 Sets the text that appears in the title bar. More...
 
bool show ()
 Shows the file dialog. More...
 

Detailed Description

OpenFileDialog component.

Constructor & Destructor Documentation

CL_OpenFileDialog::CL_OpenFileDialog ( CL_GUIComponent owner)

Constructs an open file dialog.

Parameters
owner= Owning GUIComponent
virtual CL_OpenFileDialog::~CL_OpenFileDialog ( )
virtual

Member Function Documentation

void CL_OpenFileDialog::add_filter ( const CL_String filter_description,
const CL_String filter_extension,
bool  is_default = false 
)

Add a filter that determines what types of files are displayed.

Parameters
filter_description= filter_description
filter_extension= filter_extension
is_default= is_default
void CL_OpenFileDialog::clear_filters ( )

Clears all filters.

CL_String CL_OpenFileDialog::get_filename ( ) const

Get the full path of the file selected.

If multiple files are selected, this returns the first file.

Returns
CL_String
std::vector<CL_String> CL_OpenFileDialog::get_filenames ( ) const

Gets an array that contains one file name for each selected file.

Returns
std::vector<CL_String>
void CL_OpenFileDialog::set_filename ( const CL_String filename)

Sets a string containing the full path of the file selected.

Parameters
filename= filename
void CL_OpenFileDialog::set_filter_index ( int  filter_index)

Sets a default filter, on a 0-based index.

Parameters
filter_index= filter_index
void CL_OpenFileDialog::set_initial_directory ( const CL_String path)

Sets the initial directory that is displayed.

Parameters
path= path
void CL_OpenFileDialog::set_multi_select ( bool  multiselect)

Sets if multiple files can be selected or not.

Parameters
multiselect= When true, multiple items can be selected.
void CL_OpenFileDialog::set_title ( const CL_String title)

Sets the text that appears in the title bar.

Parameters
title= title
bool CL_OpenFileDialog::show ( )

Shows the file dialog.

Returns
true if the user clicks the OK button of the dialog that is displayed, false otherwise.

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