Class: Fox::FXRecentFiles

Inherits:
FXObject show all
Includes:
Responder2
Defined in:
rdoc-sources/FXRecentFiles.rb,
lib/fox16/responder2.rb

Overview

The recent files object manages a most recently used file list by means of the standard system registry. When connected to a widget, like a menu command, the recent files object updates the menu commands label to the associated recent file name; when the menu command is invoked, the recent file object sends its target a SEL_COMMAND message with the message data set to the associated file name (a String). When adding or removing file names, the recent files object automatically updates the system registry to record these changes.

Events

The following messages are sent by FXRecentFiles to its target:

SEL_COMMAND

sent when one of the recent files in this list is selected, usually as a result of being selected from a menu command. The message data is a String containing the name of the file.

Message identifiers

ID_CLEAR

Clear the list of files

ID_ANYFILES

x

ID_FILE_1

x

ID_FILE_2

x

ID_FILE_3

x

ID_FILE_4

x

ID_FILE_5

x

ID_FILE_6

x

ID_FILE_7

x

ID_FILE_8

x

ID_FILE_9

x

ID_FILE_10

x

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Responder2

#connect

Methods inherited from FXObject

#bind, #handle, #load, #save, subclasses

Constructor Details

#initialize(a, gp, target = nil, selector = 0) ⇒ FXRecentFiles

Make new recent files group with groupname gp



56
57
# File 'rdoc-sources/FXRecentFiles.rb', line 56

def initialize # :yields: theRecentFiles
end

Instance Attribute Details

#appObject (readonly)

Application associated with this recent files group Fox::FXApp



39
40
41
# File 'rdoc-sources/FXRecentFiles.rb', line 39

def app
  @app
end

#groupNameObject

Group name [String]



45
46
47
# File 'rdoc-sources/FXRecentFiles.rb', line 45

def groupName
  @groupName
end

#maxFilesObject

Maximum number of files to track [Integer]



42
43
44
# File 'rdoc-sources/FXRecentFiles.rb', line 42

def maxFiles
  @maxFiles
end

#selectorObject

Message identifier [Integer]



51
52
53
# File 'rdoc-sources/FXRecentFiles.rb', line 51

def selector
  @selector
end

#targetObject

Message target Fox::FXObject



48
49
50
# File 'rdoc-sources/FXRecentFiles.rb', line 48

def target
  @target
end

Instance Method Details

#appendFile(filename) ⇒ Object

Append a file to the end of the list.



68
# File 'rdoc-sources/FXRecentFiles.rb', line 68

def appendFile(filename); end

#clearObject

Clear the list of files.



74
# File 'rdoc-sources/FXRecentFiles.rb', line 74

def clear(); end

#removeFile(filename) ⇒ Object

Remove a file from the list.



71
# File 'rdoc-sources/FXRecentFiles.rb', line 71

def removeFile(filename); end