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.49 date: 2021/01/20 15:43:52
user: cg
file: FilenameEditField.st directory: libwidg2
module: stx stc-classLibrary: libwidg2

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.

copyright

COPYRIGHT (c) 1994 by Claus Gittinger All Rights Reserved This software is furnished under a license and may be used only in accordance with the terms of that license and with the inclusion of the above copyright notice. This software may not be provided or otherwise made available to, or used by, any other person. No title to or ownership of the software is hereby transferred.

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.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Sat, 21 Dec 2024 16:16:29 GMT