eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'FilenameEditField':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: FilenameEditField


Inheritance:

   Object
   |
   +--GraphicsMedium
      |
      +--DisplaySurface
         |
         +--SimpleView
            |
            +--View
               |
               +--ListView
                  |
                  +--TextView
                     |
                     +--EditTextView
                        |
                        +--EditField
                           |
                           +--FilenameEditField

Package:
stx:libwidg2
Category:
Views-Text
Version:
rev: 1.47 date: 2018/12/17 11:55:04
user: cg
file: FilenameEditField.st directory: libwidg2
module: stx stc-classLibrary: libwidg2
Author:
Claus Gittinger

Description:


like a normal editField, but does filename-completion on the last word of
the contents, when TAB is pressed.
Filename completion ignores regular files if directoriesOnly is true,
and ignores directories, if filesOnly is true. Both default to false.


Instance protocol:

accessing
o  acceptOnExpand
return the autoAccept on filename expansion (pressing tab key) flag.
The default is true, which means that an expand accepts

o  acceptOnExpand: aBoolean
set/clear autoAccept on filename expansion (pressing tab key).
The default is true, which means that an expand accepts

o  contents: someText
redefined to add a trailing file-separator if the displayed
filename is a directory

o  contents: someText addSeparatorToDirectories: doAddSeparator
optionally add a trailing file-separator if the displayed
filename is a directory.

o  directoriesOnly
set to expand names for directories only

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  directoriesOnly: aBoolean
control if only directories can be choosen

o  directory

o  directory: aFilename

o  filesOnly
set to expand names for files only

** This is an obsolete interface - do not use it (it may vanish in future versions) **

o  filesOnly: aBoolean
control if only files can be choosen

o  initialText: aString selected: aBoolean
redefined to move the cursor to the end
- that's the most interesting part of a filename

o  showsDirectoriesOnly
return if expanding names for directories only

o  showsFilesOnly
return if expanding names for files only

actions
o  doFilenameCompletionFor: aString
dir asFilename isDirectory ifTrue:[

event handling
o  keyPress: key x: x y: y
handle tab for filename completion.
Bug: it completes the last word; it should complete the
word before the cursor.

initialization
o  initialize

o  mapped
redefined to move the cursor to the end
- that's the most interesting part of a filename


Examples:


|t f b v| v := ValueHolder with:'c:\'. t := StandardSystemView new. f := FilenameEditField in:t. f origin:10@10 corner:1.0@30. f model:v. b := Button in:t. b label:'Check'. b action:[ Transcript show:'field: '; showCR: f contents. Transcript show:'model: '; showCR: v value. ]. b origin:10@40. t open.

ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Tue, 11 Aug 2020 01:50:15 GMT