eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'TextBox':

Home

everywhere
www.exept.de
for:
[back]

Class: TextBox


Inheritance:

   Object
   |
   +--GraphicsContext
      |
      +--DeviceGraphicsContext
         |
         +--GraphicsMedium
            |
            +--DisplaySurface
               |
               +--SimpleView
                  |
                  +--View
                     |
                     +--TopView
                        |
                        +--StandardSystemView
                           |
                           +--ModalBox
                              |
                              +--DialogBox
                                 |
                                 +--EnterBox
                                    |
                                    +--TextBox

Package:
stx:libwidg2
Category:
Views-DialogBoxes
Version:
rev: 1.20 date: 2008/10/26 20:10:23
user: stefan
file: TextBox.st directory: libwidg2
module: stx stc-classLibrary: libwidg2

Description:


this class implements a pop-up box to enter some text with 2 buttons,
one to cancel, another to start some action.
It is basically an enterBox, but allows entering of more than one line
of text.


Class protocol:

common dialogs
o  openOn: someText
open a textBox on some text,
return (the possibly modified) text if accepted; nil otherwise.

o  openOn: someText title: titleString
open a textBox on some text,
return (the possibly modified) text if accepted; nil otherwise.

defaults
o  defaultExtent


Instance protocol:

accessing
o  contents
return my contents

o  initialText: aString
define the initial text in the enterfield

o  readOnly: aBoolean
make my text readOnly or readWrite

o  textView

initialization
o  initialize

queries
o  preferredExtent
return the extent needed to make everything visible


Examples:


Example (using ok-action callBack):


  |textBox|

  textBox := TextBox new.
  textBox title:'enter some text'.
  textBox action:[:text | Transcript showCR:('the entered text was:\' , text) withCRs].
  textBox showAtPointer.
Example (asking afterwards):


  |textBox|

  textBox := TextBox new.
  textBox title:'enter some text'.
  textBox showAtPointer.
  textBox accepted ifTrue:[
      Transcript showCR:'accepted text is:'.
      Transcript showCR:textBox contents
  ].
Example - readonly text (useful for status display):


  |textBox|

  textBox := TextBox new.
  textBox initialText:('Makefile' asFilename contents).
  textBox title:'Makefile:'.
  textBox readOnly:true.
  textBox noCancel.
  textBox label:'Makefile'.
  textBox extent:(600@250); sizeFixed:true.
  textBox showAtPointer.


ST/X 6.1.1; WebServer 1.620 at exept:8081; Wed, 23 May 2012 21:28:16 GMT