FSaveBox.st
author claus
Mon, 06 Feb 1995 01:53:30 +0100
changeset 77 565b052f5277
parent 59 450ce95a72a4
child 118 3ee5ea99d0e2
permissions -rw-r--r--
*** empty log message ***

"
 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.
"

FileSelectionBox subclass:#FileSaveBox
	 instanceVariableNames:'appendButton appendAction'
	 classVariableNames:''
	 poolDictionaries:''
	 category:'Views-DialogBoxes'
!

FileSaveBox comment:'
COPYRIGHT (c) 1994 by Claus Gittinger
	      All Rights Reserved

$Header: /cvs/stx/stx/libwidg/Attic/FSaveBox.st,v 1.3 1995-02-06 00:52:16 claus Exp $
'!

!FileSaveBox class methodsFor:'documentation'!

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.
"
!

version
"
$Header: /cvs/stx/stx/libwidg/Attic/FSaveBox.st,v 1.3 1995-02-06 00:52:16 claus Exp $
"
!

documentation
"
    Instances of FileSaveBox add an 'append'-button. The other
    behavior is that of a FileSelectionBox.

    Instance variables:
	appendAction            action to be performed when append is pressed
"
! !

!FileSaveBox methodsFor:'user interaction'!

appendPressed
    self hideAndEvaluate:[:string |
	appendAction notNil ifTrue:[
	    appendAction value:string 
	]
    ]
! !

!FileSaveBox methodsFor:'initialization'!

initialize
    super initialize.

    label := 'Save file dialog'.

    okButton label:(resources string:'save').

    "
     insert an append-button between abort- and save-buttons
    "
    appendButton := Button okButtonIn:nil.
    appendButton isReturnButton:false.
    appendButton label:(resources string:'append').
    appendButton action:[appendButton turnOffWithoutRedraw. self appendPressed].
    buttonPanel addSubView:appendButton after:abortButton
!

focusSequence
    |a|

    patternField shown ifTrue:[
	a := Array new:6.
	a at:1 put:enterField.
	a at:2 put:patternField.
	a at:3 put:selectionList.
	a at:4 put:abortButton.
	a at:5 put:appendButton.
	a at:6 put:okButton.
	^ a
    ].
    ^ Array with:enterField 
	    with:selectionList
	    with:abortButton 
	    with:appendButton 
	    with:okButton 
! !

!FileSaveBox methodsFor:'accessing'!

appendAction:aBlock
    "set the action to be performed when append is pressed"

    appendAction := aBlock
! !