|
Class: FilenameEditField
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
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.
accessing
-
acceptOnExpand
-
return the autoAccept on filename expansion (pressing tab key) flag.
The default is true, which means that an expand accepts
-
acceptOnExpand: aBoolean
-
set/clear autoAccept on filename expansion (pressing tab key).
The default is true, which means that an expand accepts
-
contents: someText
-
redefined to add a trailing file-separator if the displayed
filename is a directory
-
contents: someText addSeparatorToDirectories: doAddSeparator
-
optionally add a trailing file-separator if the displayed
filename is a directory.
-
directoriesOnly
-
set to expand names for directories only
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
directoriesOnly: aBoolean
-
control if only directories can be choosen
-
directory
-
-
directory: aFilename
-
-
filesOnly
-
set to expand names for files only
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
filesOnly: aBoolean
-
control if only files can be choosen
-
initialText: aString selected: aBoolean
-
redefined to move the cursor to the end
- that's the most interesting part of a filename
-
showsDirectoriesOnly
-
return if expanding names for directories only
-
showsFilesOnly
-
return if expanding names for files only
actions
-
doFilenameCompletionFor: aString
-
dir asFilename isDirectory ifTrue:[
event handling
-
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
-
initialize
-
-
mapped
-
redefined to move the cursor to the end
- that's the most interesting part of a filename
|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.
|