1.10
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
FileSaveDialog Class Reference

A FileSaveDialog is a widget which inherits from FileDialog and that allows user to: More...

#include <filedialog.h>

Inheritance diagram for FileSaveDialog:
Inheritance graph
[legend]

Public Member Functions

 FileSaveDialog (const Rect &rect={}) noexcept
 Create a file save dialog window and list the contents of current directory.
 
 FileSaveDialog (const std::string &filepath, const Rect &rect={}) noexcept
 Create a file save dialog window.
 
 FileSaveDialog (Serializer::Properties &props) noexcept
 Create a file save dialog window.
 
EGT_NODISCARD std::string selected () const
 Selected a location for saving a file.
 
void show () override
 Show the Widget.
 
void show_centered () override
 Show the window centered.
 
- Public Member Functions inherited from FileDialog
 FileDialog (const Rect &rect={}) noexcept
 Create a file open dialog window and list the contents of current directory.
 
 FileDialog (const std::string &filepath, const Rect &rect={}) noexcept
 Create a file dialog window.
 
 FileDialog (Serializer::Properties &props) noexcept
 Create a file dialog window.
 
void serialize (Serializer &serializer) const override
 
void show () override
 Show the Widget.
 
- Public Member Functions inherited from Dialog
 Dialog (const Rect &rect={}) noexcept
 Create a dialog with two buttons to handle decision.
 
 Dialog (Serializer::Properties &props) noexcept
 
void button (ButtonId button, const std::string &text)
 Set Button details for this dialog.
 
void icon (const Image &icon)
 Set a icon in a title area of a dialog.
 
void layout () override
 Perform layout on dialog Widget.
 
Size min_size_hint () const override
 Get a minimum size hint of the Dialog Widget.
 
void resize (const Size &size) override
 Resize the Dialog Widget.
 
void title (const Image &icon, const std::string &title)
 Set the title info for this dialog.
 
void title (const std::string &title)
 Set a title text for this dialog.
 
void widget (const std::shared_ptr< Widget > &widget)
 Set a widget for this dialog.
 
- Public Member Functions inherited from PopupType< T >
 PopupType (const Size &size={}, const Point &point={}) noexcept
 
 PopupType (Serializer::Properties &props) noexcept
 
void hide () override
 Hide the Widget.
 
void show () override
 Show the Widget.
 
virtual void show_modal (bool center=false)
 Show the window in modal mode.
 

Protected Member Functions

 FileSaveDialog (Serializer::Properties &props, bool is_derived) noexcept
 
void initialize ()
 
void selected (const std::string &fselect) override
 File selected.
 
- Protected Member Functions inherited from FileDialog
 FileDialog (Serializer::Properties &props, bool is_derived) noexcept
 
bool list_files (const std::string &filepath)
 List the contents of file path directory.
 
void list_item_selected (int index)
 Get the List Item selected index.
 
- Protected Member Functions inherited from Dialog
 Dialog (Serializer::Properties &props, bool is_derived) noexcept
 
void initialize (bool init_inherited_properties=true)
 
- Protected Member Functions inherited from PopupType< T >
 PopupType (Serializer::Properties &props, bool is_derived) noexcept
 

Protected Attributes

std::string m_fsave
 File path of a file save location.
 
TextBox m_fsave_box
 Input a filename or file path.
 
- Protected Attributes inherited from FileDialog
std::string m_filepath
 File path of a directory.
 
std::shared_ptr< ListBoxm_flist
 List Box for file listing.
 
- Protected Attributes inherited from Dialog
Button m_button1
 Button for okay or cancel.
 
Button m_button2
 Button for okay or cancel.
 
VerticalBoxSizer m_content
 Content sizer.
 
std::shared_ptr< StaticGridm_grid
 Grid for organizing okay & cancel Buttons.
 
VerticalBoxSizer m_layout
 Layout sizer.
 
ImageLabel m_title
 Dialog title.
 

Additional Inherited Members

- Public Types inherited from Dialog
enum class  ButtonId { button1 , button2 }
 Used to identify the button on the dialog. More...
 
- Public Attributes inherited from FileDialog
Signal on_selected
 Event signal.
 
- Public Attributes inherited from Dialog
Signal on_button1_click
 Event signal.
 
Signal on_button2_click
 Signal when button2 is clicked.
 

Detailed Description

A FileSaveDialog is a widget which inherits from FileDialog and that allows user to:

  1. View the contents of file system directories.
  2. Select a location to save a file or select a file to override a existing file.

Constructor & Destructor Documentation

◆ FileSaveDialog() [1/4]

FileSaveDialog ( const Rect rect = {})
explicitnoexcept

Create a file save dialog window and list the contents of current directory.

Parameters
[in]rectInitial rectangle of the Widget.

◆ FileSaveDialog() [2/4]

FileSaveDialog ( const std::string &  filepath,
const Rect rect = {} 
)
explicitnoexcept

Create a file save dialog window.

Parameters
[in]rectInitial rectangle of the Widget.
[in]filepathis to list the contents of filepath directory.
Note
filepath should be a directory. If the file path is regular file, then content of its parent directory will be listed.

◆ FileSaveDialog() [3/4]

FileSaveDialog ( Serializer::Properties props)
inlineexplicitnoexcept

Create a file save dialog window.

Parameters
[in]propslist of widget argument and its properties.

◆ FileSaveDialog() [4/4]

FileSaveDialog ( Serializer::Properties props,
bool  is_derived 
)
explicitprotectednoexcept

Member Function Documentation

◆ initialize()

void initialize ( )
protected

◆ selected() [1/2]

EGT_NODISCARD std::string selected ( ) const

Selected a location for saving a file.

Returns
file path of the file save location.

◆ selected() [2/2]

void selected ( const std::string &  fselect)
overrideprotectedvirtual

File selected.

Parameters
[in]fselectSelected filename.

Implements FileDialog.

◆ show()

void show ( )
override

Show the Widget.

This changes the visible() state of the Widget.

◆ show_centered()

void show_centered ( )
overridevirtual

Show the window centered.

Position the window the center of its parent, or if it has no parent, the screen.

Reimplemented from FileDialog.

Member Data Documentation

◆ m_fsave

std::string m_fsave
protected

File path of a file save location.

◆ m_fsave_box

TextBox m_fsave_box
protected

Input a filename or file path.