Class: Fox::FXFileList
- Inherits:
-
FXIconList
- Object
- FXObject
- FXId
- FXDrawable
- FXWindow
- FXComposite
- FXScrollArea
- FXIconList
- Fox::FXFileList
- Defined in:
- rdoc-sources/FXFileList.rb,
lib/fox16/core.rb
Overview
A File List widget provides an icon rich view of the file system. It automatically updates itself periodically by re-scanning the file system for any changes. As it scans the displayed directory, it automatically determines the icons to be displayed by consulting the file associations registry settings. A number of messages can be sent to the File List to control the filter pattern, sort category, sorting order, case sensitivity, and hidden file display mode. The File list widget supports drags and drops of files.
File List options
FILELIST_SHOWHIDDEN
-
Show hidden files or directories
FILELIST_SHOWDIRS
-
Show only directories
FILELIST_SHOWFILES
-
Show only files
FILELIST_SHOWIMAGES
-
Show preview of images
FILELIST_NO_OWN_ASSOC
-
Do not create associations for files
FILELIST_NO_PARENT
-
Suppress display of ‘.’ and ‘..’
Message identifiers
ID_SORT_BY_NAME
-
Sort by name
ID_SORT_BY_TYPE
-
Sort by type
ID_SORT_BY_SIZE
-
Sort by size
ID_SORT_BY_TIME
-
Sort by access time
ID_SORT_BY_USER
-
Sort by user name
ID_SORT_BY_GROUP
-
Sort by group name
ID_SORT_REVERSE
-
Reverse sort order
ID_DIRECTORY_UP
-
Move up one directory
ID_SET_PATTERN
-
Set match pattern
ID_SET_DIRECTORY
-
Set directory
ID_SHOW_HIDDEN
-
Show hidden files
ID_HIDE_HIDDEN
-
Hide hidden files
ID_TOGGLE_HIDDEN
-
Toggle visibility of hidden files
ID_REFRESHTIMER
-
x
ID_OPENTIMER
-
x
ID_TOGGLE_IMAGES
-
Toggle display of images
ID_REFRESH
-
Refresh immediately
Instance Attribute Summary collapse
-
#associations ⇒ Object
File associations FXFileDict.
-
#currentFile ⇒ Object
Current file [String].
-
#directory ⇒ Object
Current directory [String].
-
#imageSize ⇒ Object
Image size for preview images [Integer].
-
#matchMode ⇒ Object
Wildcard matching mode [Integer].
-
#pattern ⇒ Object
Wildcard matching pattern [String].
Attributes inherited from FXIconList
#anchorItem, #currentItem, #cursorItem, #font, #header, #helpText, #itemHeight, #itemSpace, #itemWidth, #listStyle, #numCols, #numHeaders, #numItems, #numRows, #selBackColor, #selTextColor, #textColor
Attributes inherited from FXScrollArea
#contentHeight, #contentWidth, #horizontalScrollBar, #scrollStyle, #verticalScrollBar, #viewportHeight, #viewportWidth, #xPosition, #yPosition
Attributes inherited from FXWindow
#accelTable, #backColor, #defaultCursor, #dragCursor, #first, #focus, #key, #last, #layoutHints, #next, #numChildren, #owner, #parent, #prev, #root, #selector, #shell, #target, #x, #y
Attributes inherited from FXDrawable
Attributes inherited from FXId
Instance Method Summary collapse
-
#hiddenFilesShown=(shown) ⇒ Object
Show or hide hidden files.
-
#hiddenFilesShown? ⇒ Boolean
Return
true
if showing hidden files. -
#hideParentDirs ⇒ Object
Hide parent directories.
-
#imagesShown=(shown) ⇒ Object
If shown is
true
, the file list will show preview images; otherwise it won’t. -
#imagesShown? ⇒ Boolean
Return
true
if the file list is showing preview images. -
#initialize(p, target = nil, selector = 0, opts = 0, x = 0, y = 0, width = 0, height = 0) ⇒ FXFileList
constructor
Construct a file list.
-
#itemAssoc(index) ⇒ Object
Return file association of item at index.
-
#itemDirectory?(index) ⇒ Boolean
Return
true
if item is a directory. -
#itemExecutable?(index) ⇒ Boolean
Return
true
if item is executable. -
#itemFile?(index) ⇒ Boolean
Return
true
if item is a file. -
#itemFilename(index) ⇒ Object
Return name of item at index.
-
#itemPathname(index) ⇒ Object
Return full pathname of item at index.
-
#itemShare?(index) ⇒ Boolean
Return
true
if item is a share. -
#onlyDirectoriesShown=(shown) ⇒ Object
Show directories only.
-
#onlyDirectoriesShown? ⇒ Boolean
Return
true
if showing directories only. -
#onlyFilesShown=(shown) ⇒ Object
Show files only.
-
#onlyFilesShown? ⇒ Boolean
Return
true
if showing files only. -
#parentDirsShown=(shown) ⇒ Object
Set whether parent directories are shown to
true
orfalse
. -
#parentDirsShown? ⇒ Boolean
Return
true
if parent directories are shown. -
#scan(force = true) ⇒ Object
Scan the current directory and update the items if needed, or if force is
true
. -
#setCurrentFile(filename, notify = false) ⇒ Object
Set the current file to filename.
-
#showParentDirs ⇒ Object
Show parent directories.
Methods inherited from FXIconList
#appendHeader, #appendItem, #clearItems, #deselectItem, #disableItem, #each, #enableItem, #extendSelection, #extractItem, #fillItems, #findItem, #findItemByData, #getHeaderIcon, #getHeaderSize, #getHeaderText, #getItem, #getItemAt, #getItemBigIcon, #getItemData, #getItemMiniIcon, #getItemText, #hitItem, #insertItem, #itemCurrent?, #itemEnabled?, #itemSelected?, #itemVisible?, #killSelection, #makeItemVisible, #moveItem, #prependItem, #removeHeader, #removeItem, #selectInRectangle, #selectItem, #setCurrentItem, #setHeaderIcon, #setHeaderSize, #setHeaderText, #setHeaders, #setItem, #setItemBigIcon, #setItemData, #setItemMiniIcon, #setItemText, #sortItems, #toggleItem, #updateItem
Methods inherited from FXScrollArea
#horizontalScrollable?, #position, #scrollCorner, #setPosition, #verticalScrollable?
Methods inherited from FXComposite
#maxChildHeight, #maxChildWidth
Methods inherited from FXWindow
#acceptDrop, #acquireClipboard, #acquireSelection, #active?, #addHotKey, after?, #after?, before?, #before?, #beginDrag, #canFocus?, #changeFocus, #childAtIndex, #childOf?, #children, #clearDragRectangle, #clearShape, colorType, colorTypeName, commonAncestor, #composeContext, #composite?, #contains?, #containsChild?, #create, #createComposeContext, #cursorPosition, #default?, #defaultHeight, #defaultWidth, deleteType, deleteTypeName, #destroy, #destroyComposeContext, #detach, #didAccept, #disable, #doesSaveUnder?, #dragging?, #dropDisable, #dropEnable, #dropEnabled?, #dropFinished, #dropTarget?, #each_child, #each_child_recursive, #enable, #enabled?, #endDrag, #forceRefresh, #getChildAt, #getDNDData, #getHeightForWidth, #getWidthForHeight, #grab, #grabKeyboard, #grabbed?, #grabbedKeyboard?, #handleDrag, #hasClipboard?, #hasFocus?, #hasSelection?, #height, #height=, #hide, imageType, #inFocusChain?, #indexOfChild, #initial?, #inquireDNDAction, #inquireDNDTypes, #killFocus, #layout, #linkAfter, #linkBefore, #lower, #move, octetType, octetTypeName, #offeredDNDType?, #position, #raiseWindow, #recalc, #releaseClipboard, #releaseSelection, #remHotKey, #removeChild, #repaint, #reparent, #resize, #scroll, #setCursorPosition, #setDNDData, #setDefault, #setDragRectangle, #setFocus, #setInitial, #setShape, #shell?, #show, #shown?, stringType, textType, textTypeName, #tr, #translateCoordinatesFrom, #translateCoordinatesTo, #underCursor?, #ungrab, #ungrabKeyboard, #update, urilistType, urilistTypeName, utf16Type, utf16TypeName, utf8Type, utf8TypeName, #visible=, #width, #width=
Methods included from Responder2
Methods inherited from FXDrawable
Methods inherited from FXId
#create, #created?, #destroy, #detach, #runOnUiThread
Methods inherited from FXObject
#bind, #handle, #load, #save, subclasses
Constructor Details
#initialize(p, target = nil, selector = 0, opts = 0, x = 0, y = 0, width = 0, height = 0) ⇒ FXFileList
Construct a file list
108 109 |
# File 'rdoc-sources/FXFileList.rb', line 108 def initialize(p, target=nil, selector=0, opts=0, x=0, y=0, width=0, height=0) # :yields: theFileList end |
Instance Attribute Details
#associations ⇒ Object
File associations Fox::FXFileDict
102 103 104 |
# File 'rdoc-sources/FXFileList.rb', line 102 def associations @associations end |
#currentFile ⇒ Object
Current file [String]
90 91 92 |
# File 'rdoc-sources/FXFileList.rb', line 90 def currentFile @currentFile end |
#directory ⇒ Object
Current directory [String]
93 94 95 |
# File 'rdoc-sources/FXFileList.rb', line 93 def directory @directory end |
#imageSize ⇒ Object
Image size for preview images [Integer]
105 106 107 |
# File 'rdoc-sources/FXFileList.rb', line 105 def imageSize @imageSize end |
#matchMode ⇒ Object
Wildcard matching mode [Integer]
99 100 101 |
# File 'rdoc-sources/FXFileList.rb', line 99 def matchMode @matchMode end |
#pattern ⇒ Object
Wildcard matching pattern [String]
96 97 98 |
# File 'rdoc-sources/FXFileList.rb', line 96 def pattern @pattern end |
Instance Method Details
#hiddenFilesShown=(shown) ⇒ Object
Show or hide hidden files.
172 |
# File 'rdoc-sources/FXFileList.rb', line 172 def hiddenFilesShown=(shown); end |
#hiddenFilesShown? ⇒ Boolean
Return true
if showing hidden files.
169 |
# File 'rdoc-sources/FXFileList.rb', line 169 def hiddenFilesShown?; end |
#hideParentDirs ⇒ Object
Hide parent directories
131 132 133 |
# File 'lib/fox16/core.rb', line 131 def hideParentDirs self.parentDirsShown = false end |
#imagesShown=(shown) ⇒ Object
If shown is true
, the file list will show preview images; otherwise it won’t.
190 |
# File 'rdoc-sources/FXFileList.rb', line 190 def imagesShown=(shown); end |
#imagesShown? ⇒ Boolean
Return true
if the file list is showing preview images.
195 |
# File 'rdoc-sources/FXFileList.rb', line 195 def imagesShown? ; end |
#itemAssoc(index) ⇒ Object
Return file association of item at index. Raises IndexError if index is out of bounds.
166 |
# File 'rdoc-sources/FXFileList.rb', line 166 def itemAssoc(index); end |
#itemDirectory?(index) ⇒ Boolean
Return true
if item is a directory. Raises IndexError if index is out of bounds.
130 |
# File 'rdoc-sources/FXFileList.rb', line 130 def itemDirectory?(index); end |
#itemExecutable?(index) ⇒ Boolean
Return true
if item is executable. Raises IndexError if index is out of bounds.
148 |
# File 'rdoc-sources/FXFileList.rb', line 148 def itemExecutable?(index); end |
#itemFile?(index) ⇒ Boolean
Return true
if item is a file. Raises IndexError if index is out of bounds.
142 |
# File 'rdoc-sources/FXFileList.rb', line 142 def itemFile?(index); end |
#itemFilename(index) ⇒ Object
Return name of item at index. Raises IndexError if index is out of bounds.
154 |
# File 'rdoc-sources/FXFileList.rb', line 154 def itemFilename(index); end |
#itemPathname(index) ⇒ Object
Return full pathname of item at index. Raises IndexError if index is out of bounds.
160 |
# File 'rdoc-sources/FXFileList.rb', line 160 def itemPathname(index); end |
#itemShare?(index) ⇒ Boolean
Return true
if item is a share. Raises IndexError if index is out of bounds.
136 |
# File 'rdoc-sources/FXFileList.rb', line 136 def itemShare?(index); end |
#onlyDirectoriesShown=(shown) ⇒ Object
Show directories only.
178 |
# File 'rdoc-sources/FXFileList.rb', line 178 def onlyDirectoriesShown=(shown); end |
#onlyDirectoriesShown? ⇒ Boolean
Return true
if showing directories only.
175 |
# File 'rdoc-sources/FXFileList.rb', line 175 def onlyDirectoriesShown?; end |
#onlyFilesShown=(shown) ⇒ Object
Show files only.
184 |
# File 'rdoc-sources/FXFileList.rb', line 184 def onlyFilesShown=(shown); end |
#onlyFilesShown? ⇒ Boolean
Return true
if showing files only.
181 |
# File 'rdoc-sources/FXFileList.rb', line 181 def onlyFilesShown?; end |
#parentDirsShown=(shown) ⇒ Object
Set whether parent directories are shown to true
or false
.
205 |
# File 'rdoc-sources/FXFileList.rb', line 205 def parentDirsShown=(shown); end |
#parentDirsShown? ⇒ Boolean
Return true
if parent directories are shown.
200 |
# File 'rdoc-sources/FXFileList.rb', line 200 def parentDirsShown? ; end |
#scan(force = true) ⇒ Object
Scan the current directory and update the items if needed, or if force is true
.
124 |
# File 'rdoc-sources/FXFileList.rb', line 124 def scan(force=true); end |
#setCurrentFile(filename, notify = false) ⇒ Object
Set the current file to filename. If notify is true
, a SEL_CHANGED
message is sent to the file list’s message target after the current item has changed. If this change causes the selected item(s) to change (because the file list is operating in browse-select mode), SEL_SELECTED
and SEL_DESELECTED
may be sent to the message target as well.
119 |
# File 'rdoc-sources/FXFileList.rb', line 119 def setCurrentFile(filename, notify=false); end |
#showParentDirs ⇒ Object
Show parent directories.
124 125 126 |
# File 'lib/fox16/core.rb', line 124 def showParentDirs self.parentDirsShown = true end |