Class: Wx::FileHistory

Inherits:
Object
  • Object
show all
Defined in:
lib/wx/doc/gen/file_history.rb

Overview

Note:

This class is untracked and should not be derived from nor instances extended!

The FileHistory encapsulates a user interface convenience, the list of most recently visited files as shown on a menu (usually the File menu).

FileHistory can manage one or more file menus. More than one menu may be required in an MDI application, where the file history should appear on each MDI child menu as well as the MDI parent frame.

Category: Document/View Framework

See Also:

  • Framework
  • DocManager

Requires:

  • USE_FILE_HISTORY

Instance Method Summary collapse

Methods inherited from Object

#clone, #dup, #is_same_as, #un_share

Constructor Details

#initialize(maxFiles = 9, idBase = wxID_FILE1) ⇒ Wx::FileHistory

Constructor.

Pass the maximum number of files that should be stored and displayed. idBase defaults to StandardID::ID_FILE1 and represents the id given to the first history menu item. Since menu items can't share the same ID you should change idBase (to one of your own defined IDs) when using more than one Wx::FileHistory in your application.

Parameters:

  • maxFiles (Integer) (defaults to: 9)
  • idBase (Integer) (defaults to: wxID_FILE1)


52
# File 'lib/wx/doc/gen/file_history.rb', line 52

def initialize(maxFiles=9, idBase=wxID_FILE1) end

Instance Method Details

#add_file_to_history(filename) ⇒ void

This method returns an undefined value.

Adds a file to the file history list, if the object has a pointer to an appropriate file menu.

Parameters:

  • filename (String)


57
# File 'lib/wx/doc/gen/file_history.rb', line 57

def add_file_to_history(filename) end

#add_files_to_menu ⇒ void #add_files_to_menu(menu) ⇒ void

Overloads:

  • #add_files_to_menu ⇒ void

    This method returns an undefined value.

    Appends the files in the history list, to all menus managed by the file history object.

  • #add_files_to_menu(menu) ⇒ void

    This method returns an undefined value.

    Appends the files in the history list, to the given menu only.

    Parameters:



66
# File 'lib/wx/doc/gen/file_history.rb', line 66

def add_files_to_menu(*args) end

#get_base_id ⇒ Integer Also known as: base_id

Returns the base identifier for the range used for appending items.

Returns:

  • (Integer)


70
# File 'lib/wx/doc/gen/file_history.rb', line 70

def get_base_id; end

#get_count ⇒ Integer Also known as: count

Returns the number of files currently stored in the file history.

Returns:

  • (Integer)


75
# File 'lib/wx/doc/gen/file_history.rb', line 75

def get_count; end

#get_history_file(index) ⇒ String Also known as: history_file

Returns the file at this index (zero-based).

Parameters:

  • index (Integer)

Returns:

  • (String)


81
# File 'lib/wx/doc/gen/file_history.rb', line 81

def get_history_file(index) end

#get_max_files ⇒ Integer Also known as: max_files

Returns the maximum number of files that can be stored.

Returns:

  • (Integer)


86
# File 'lib/wx/doc/gen/file_history.rb', line 86

def get_max_files; end

#get_menu_path_style ⇒ Wx::FileHistoryMenuPathStyle Also known as: menu_path_style

Get the current style of the menu item labels.

Initially returns Wx::FileHistoryMenuPathStyle::FH_PATH_SHOW_IF_DIFFERENT.



149
# File 'lib/wx/doc/gen/file_history.rb', line 149

def get_menu_path_style; end

#get_menus ⇒ Array<Wx::Menu> Also known as: menus

Returns the list of menus that are managed by this file history object.

Returns:

See Also:



94
# File 'lib/wx/doc/gen/file_history.rb', line 94

def get_menus; end

#load(config) ⇒ void

This method returns an undefined value.

Loads the file history from the given config object.

This function should be called explicitly by the application.

Parameters:

See Also:



103
# File 'lib/wx/doc/gen/file_history.rb', line 103

def load(config) end

#remove_file_from_history(i) ⇒ void

This method returns an undefined value.

Removes the specified file from the history.

Parameters:

  • i (Integer)


108
# File 'lib/wx/doc/gen/file_history.rb', line 108

def remove_file_from_history(i) end

#remove_menu(menu) ⇒ void

This method returns an undefined value.

Removes this menu from the list of those managed by this object.

Parameters:



113
# File 'lib/wx/doc/gen/file_history.rb', line 113

def remove_menu(menu) end

#save(config) ⇒ void

This method returns an undefined value.

Saves the file history into the given config object.

This must be called explicitly by the application.

Parameters:

See Also:



121
# File 'lib/wx/doc/gen/file_history.rb', line 121

def save(config) end

#set_base_id(baseId) ⇒ void Also known as: base_id=

This method returns an undefined value.

Sets the base identifier for the range used for appending items.

Parameters:

  • baseId (Integer)


126
# File 'lib/wx/doc/gen/file_history.rb', line 126

def set_base_id(baseId) end

#set_menu_path_style(style) ⇒ void Also known as: menu_path_style=

This method returns an undefined value.

Set the style of the menu item labels.

By default, the menu item label style is Wx::FileHistoryMenuPathStyle::FH_PATH_SHOW_IF_DIFFERENT.

Parameters:



141
# File 'lib/wx/doc/gen/file_history.rb', line 141

def set_menu_path_style(style) end

#use_menu(menu) ⇒ void

This method returns an undefined value.

Adds this menu to the list of those menus that are managed by this file history object.

Also see #add_files_to_menu for initializing the menu with filenames that are already in the history when this function is called, as this is not done automatically.

Parameters:



134
# File 'lib/wx/doc/gen/file_history.rb', line 134

def use_menu(menu) end