Class: Fox::FXFileList

Inherits:
FXIconList show all
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

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

#height, #visual, #width

Attributes inherited from FXId

#app, #userData, #xid

Instance Method Summary collapse

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

#connect

Methods inherited from FXDrawable

#resize

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

#associationsObject

File associations Fox::FXFileDict



102
103
104
# File 'rdoc-sources/FXFileList.rb', line 102

def associations
  @associations
end

#currentFileObject

Current file [String]



90
91
92
# File 'rdoc-sources/FXFileList.rb', line 90

def currentFile
  @currentFile
end

#directoryObject

Current directory [String]



93
94
95
# File 'rdoc-sources/FXFileList.rb', line 93

def directory
  @directory
end

#imageSizeObject

Image size for preview images [Integer]



105
106
107
# File 'rdoc-sources/FXFileList.rb', line 105

def imageSize
  @imageSize
end

#matchModeObject

Wildcard matching mode [Integer]



99
100
101
# File 'rdoc-sources/FXFileList.rb', line 99

def matchMode
  @matchMode
end

#patternObject

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.

Returns:

  • (Boolean)


169
# File 'rdoc-sources/FXFileList.rb', line 169

def hiddenFilesShown?; end

#hideParentDirsObject

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.

Returns:

  • (Boolean)


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.

Returns:

  • (Boolean)


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.

Returns:

  • (Boolean)


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.

Returns:

  • (Boolean)


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.

Returns:

  • (Boolean)


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.

Returns:

  • (Boolean)


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.

Returns:

  • (Boolean)


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.

Returns:

  • (Boolean)


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

#showParentDirsObject

Show parent directories.



124
125
126
# File 'lib/fox16/core.rb', line 124

def showParentDirs
  self.parentDirsShown = true
end