FDOSTUI
FreeDOS Text User Interface
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Static Private Member Functions | List of all members
filedlg Class Reference

Allows a user to choose a file. More...

#include <filedlg.hpp>

Inheritance diagram for filedlg:
Inheritance graph
[legend]

Public Member Functions

 filedlg (int const i_pos_x, int const i_pos_y, unsigned int const i_len_x, unsigned int const i_len_y)
 constructor More...
 
virtual ~filedlg ()
 destructor More...
 
unsigned char * get_filename () const
 gets the filename the user choose More...
 
void set_filename (unsigned char const *i_filename)
 sets the default file name More...
 
void drive_changed_internal ()
 event handler when drive changes More...
 
void directory_changed_internal ()
 event handler when directory changed More...
 
void file_changed_internal ()
 event handler when file changed More...
 
void attribute_changed_internal ()
 event handler when attribute (hidden, system, readonly) changed More...
 
void refresh ()
 refreshes/reloads dialog box More...
 
- Public Member Functions inherited from window
 window (int const i_pos_x, int const i_pos_y, unsigned int const i_len_x, unsigned int const i_len_y)
 constructor More...
 
virtual ~window ()
 destructor More...
 
virtual void draw () const
 draws the widget More...
 
enum attributes get_attributes () const
 gets the window attributes More...
 
unsigned char const * get_title () const
 gets the windows title More...
 
void set_attributes (unsigned const i_attributes)
 set the window attributes More...
 
void set_title (unsigned char const *i_str)
 sets the windows title More...
 
- Public Member Functions inherited from group
 group (int const i_pos_x, int const i_pos_y, unsigned int const i_len_x, unsigned int const i_len_y)
 constructor More...
 
virtual ~group ()
 destructor More...
 
virtual void set_damage (unsigned int const i_damage=DAMAGE_NONE)
 sets damage mask More...
 
virtual int add (widget *const i_widget)
 add child widget More...
 
virtual enum event_response event_key_default (enum scancodes const i_scan)
 default scan code event handler More...
 
virtual enum event_response event_key (struct event_key const &i_event)
 handle key event More...
 
virtual enum event_response event_mouse (struct event_mouse const &i_event)
 handle mouse event More...
 
virtual void focus_enter ()
 handle entering focus More...
 
virtual void focus_leave ()
 handle leaving focus More...
 
void set_focus (widget &i_widget)
 set widget focus More...
 
- Public Member Functions inherited from widget
 widget (int const i_pos_x, int const i_pos_y, unsigned int const i_len_x, unsigned int const i_len_y)
 constructor More...
 
virtual ~widget ()
 destructor More...
 
virtual bool close (bool const i_shutting_down)
 called when widget is about to be destroyed More...
 
bool contains (int const i_pos_x, int const i_pos_y) const
 test if point is contained within the widget More...
 
bool contains (struct box const &i_box) const
 test if rectangular region is contained within the widget More...
 
void get_box (struct box &o_box) const
 gets the rectangular region this widget occupies More...
 
bool get_can_focus () const
 gets whether or not the widget can receive focus More...
 
bool get_enabled () const
 gets whether or not the widget is enabled More...
 
bool get_has_focus () const
 gets whether or not the widget has focus More...
 
group *const get_parent () const
 gets the parent widget More...
 
void * get_user_data () const
 gets user defined data pointer More...
 
bool get_visible () const
 gets whether or not the widget is visible More...
 
int get_pos_x () const
 gets the relative x position of the widget More...
 
int get_pos_y () const
 gets the relative y position of the widget More...
 
unsigned int get_len_x () const
 gets the horizontal length of the widget More...
 
unsigned int get_len_y () const
 gets the vertical length of the widget More...
 
virtual void move (int const i_pos_x, int const i_pos_y)
 move the widget to a new position More...
 
virtual void resize (unsigned int const i_len_x, unsigned int const i_len_y)
 resize the widget More...
 
void set_can_close (bool const i_can_close)
 set internal indicator if widget can be closed More...
 
void set_disabled ()
 disable the widget More...
 
void set_enabled ()
 enable the widget
 
void set_hidden ()
 hide the widget More...
 
virtual void set_parent (group *const i_parent)
 sets the parent group of the widget More...
 
void set_user_data (void *io_user_data)
 sets the user defined data pointer More...
 
void set_visible ()
 sets the widget as visible More...
 
void translate_screen (int *const o_pos_x, int *const o_pos_y) const
 translate a widgets relative coordinates to screen coordinates More...
 

Protected Member Functions

void configure_default ()
 startup configuration. Loads the dialog up with intial values. More...
 
void configure_listbox_file ()
 configure file listbox. Loads files from the current directory. More...
 
void configure_listbox_directories ()
 configure directories listbox. Loads directories from current directory. More...
 
void configure_listbox_drives ()
 configure drives listbox. Loads drives from the hardware module. More...
 

Protected Attributes

labelm_label_file
 
entrym_entry_file
 
labelm_label_filter
 
entrym_entry_filter
 
checkbuttonm_checkbutton_readonly
 
checkbuttonm_checkbutton_hidden
 
checkbuttonm_checkbutton_system
 
buttonm_button_refresh
 
buttonm_button_cancel
 
buttonm_button_ok
 
labelm_label_path
 
labelm_label_message
 
listboxm_listbox_file
 
comboboxm_combobox_directories
 
listboxm_listbox_drives
 
- Protected Attributes inherited from window
unsigned char * m_title
 
enum attributes m_attributes
 
- Protected Attributes inherited from group
widgetm_focused
 widget that has focus
 
size_t m_slot
 focused widget slot (index into array)
 
struct array m_array
 widget container
 
- Protected Attributes inherited from widget
unsigned int m_damage
 
unsigned int m_flags
 
struct box m_box
 
groupm_parent
 
void * m_user_data
 

Private Member Functions

 filedlg (const filedlg &)
 
filedlgoperator= (filedlg const &)
 

Static Private Member Functions

static void listbox_drive_cb (listbox const *i_listbox, void *io_user_data)
 listbox drives callback More...
 
static void combobox_directory_cb (entry const *i_entry, void *io_user_data)
 combobox directories callback More...
 
static void listbox_file_cb (listbox const *i_listbox, void *io_user_data)
 listbox file callback More...
 
static void checkbutton_attribute_cb (button const *i_button, void *io_user_data)
 attributes call back (system, readonly, hidden) More...
 
static void button_refresh_cb (button const *i_button, void *io_user_data)
 refresh button callback More...
 

Additional Inherited Members

- Public Types inherited from window
enum  attributes {
  EMPTY = (1 << 0), BORDER = (1 << 1), TITLE = (1 << 2), MINMAX = (1 << 3),
  RESIZE = (1 << 4), SYSTEM = (1 << 5)
}
 
- Public Types inherited from widget
enum  damage {
  DAMAGE_NONE = 0, DAMAGE_ALL = (1<<0), DAMAGE_LABEL = (1<<1), DAMAGE_VALUE = (1<<2),
  DAMAGE_SCROLL = (1<<3), DAMAGE_MOVED = (1<<4), DAMAGE_RESERVED1 = (1<<5), DAMAGE_RESERVED2 = (1<<6),
  DAMAGE_RESERVED3 = (1<<7)
}
 bit mask indicating what needs to be redrawn More...
 
- Protected Types inherited from widget
enum  flags {
  VISIBLE = (1 << 0), ENABLED = (1 << 1), CAN_FOCUS = (1 << 2), HAS_FOCUS = (1 << 3),
  CAN_CLOSE = (1 << 4)
}
 

Detailed Description

Allows a user to choose a file.

Constructor & Destructor Documentation

◆ filedlg()

filedlg::filedlg ( int const  i_pos_x,
int const  i_pos_y,
unsigned int const  i_len_x,
unsigned int const  i_len_y 
)

constructor

Parameters
[in]i_pos_xx position to place widget
[in]i_pos_yy position to place widget
[in]i_len_xx length of widget
[in]i_len_yy length of widget
Returns
none
See also
file_dialog_open

◆ ~filedlg()

filedlg::~filedlg ( )
virtual

destructor

Returns
none

Member Function Documentation

◆ attribute_changed_internal()

void filedlg::attribute_changed_internal ( )

event handler when attribute (hidden, system, readonly) changed

Returns
none

◆ button_refresh_cb()

void filedlg::button_refresh_cb ( button const *  i_button,
void *  io_user_data 
)
staticprivate

refresh button callback

Parameters
[in]i_buttonbutton widget
[in]io_user_datauser defined data
Returns
none

◆ checkbutton_attribute_cb()

void filedlg::checkbutton_attribute_cb ( button const *  i_button,
void *  io_user_data 
)
staticprivate

attributes call back (system, readonly, hidden)

Parameters
[in]i_buttonbutton widget
[in]io_user_datauser defined data
Returns
none

/*!

◆ combobox_directory_cb()

void filedlg::combobox_directory_cb ( entry const *  i_entry,
void *  io_user_data 
)
staticprivate

combobox directories callback

Parameters
[in]i_entryentry widget
[in]io_user_datauser defined data
Returns
none

◆ configure_default()

void filedlg::configure_default ( )
protected

startup configuration. Loads the dialog up with intial values.

Returns
none

◆ configure_listbox_directories()

void filedlg::configure_listbox_directories ( )
protected

configure directories listbox. Loads directories from current directory.

Returns
none

◆ configure_listbox_drives()

void filedlg::configure_listbox_drives ( )
protected

configure drives listbox. Loads drives from the hardware module.

Returns
none

◆ configure_listbox_file()

void filedlg::configure_listbox_file ( )
protected

configure file listbox. Loads files from the current directory.

Returns
none

◆ directory_changed_internal()

void filedlg::directory_changed_internal ( )

event handler when directory changed

Returns
none

◆ drive_changed_internal()

void filedlg::drive_changed_internal ( )

event handler when drive changes

Returns
none

◆ file_changed_internal()

void filedlg::file_changed_internal ( )

event handler when file changed

Returns
none

◆ get_filename()

unsigned char * filedlg::get_filename ( ) const

gets the filename the user choose

Returns
null terminated string of file choosen

Call takes ownership of the returned string. It will need to be released (free'd).

◆ listbox_drive_cb()

void filedlg::listbox_drive_cb ( listbox const *  i_listbox,
void *  io_user_data 
)
staticprivate

listbox drives callback

Parameters
[in]i_listboxlistbox widget
[in]io_user_datauser defined data
Returns
none

◆ listbox_file_cb()

void filedlg::listbox_file_cb ( listbox const *  i_listbox,
void *  io_user_data 
)
staticprivate

listbox file callback

Parameters
[in]i_listboxlistbox widget
[in]io_user_datauser defined data
Returns
none

◆ refresh()

void filedlg::refresh ( )

refreshes/reloads dialog box

Returns
none

◆ set_filename()

void filedlg::set_filename ( unsigned char const *  i_filename)

sets the default file name

Returns
none

Member Data Documentation

◆ m_button_cancel

filedlg::m_button_cancel
protected

cancel button

◆ m_button_ok

filedlg::m_button_ok
protected

ok button

◆ m_button_refresh

filedlg::m_button_refresh
protected

system button to refresh/reload dialog

◆ m_checkbutton_hidden

filedlg::m_checkbutton_hidden
protected

hidden attribute check button

◆ m_checkbutton_readonly

filedlg::m_checkbutton_readonly
protected

readonly attribute check button

◆ m_checkbutton_system

filedlg::m_checkbutton_system
protected

system attribute check button

◆ m_combobox_directories

filedlg::m_combobox_directories
protected

combobox for directories

◆ m_entry_file

filedlg::m_entry_file
protected

entry widget for filename

◆ m_entry_filter

filedlg::m_entry_filter
protected

entry widget for filter

◆ m_label_file

filedlg::m_label_file
protected

label for "File"

◆ m_label_filter

filedlg::m_label_filter
protected

label for "filter"

◆ m_label_message

filedlg::m_label_message
protected

label to display a message such as error messages

◆ m_label_path

filedlg::m_label_path
protected

label to display the path

◆ m_listbox_drives

filedlg::m_listbox_drives
protected

listbox for drives

◆ m_listbox_file

filedlg::m_listbox_file
protected

listbox for files


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