FSaveBox.st
author Claus Gittinger <cg@exept.de>
Thu, 16 May 1996 12:24:32 +0200
changeset 648 fcf02d58882e
parent 637 2084bbe806dc
child 741 eee7cb39bafe
permissions -rw-r--r--
checkin from browser
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
37
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
     1
"
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
     2
 COPYRIGHT (c) 1994 by Claus Gittinger
59
450ce95a72a4 *** empty log message ***
claus
parents: 37
diff changeset
     3
	      All Rights Reserved
37
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
     4
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    11
"
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    12
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    13
FileSelectionBox subclass:#FileSaveBox
585
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    14
	instanceVariableNames:'appendButton appendAction'
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    15
	classVariableNames:''
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    16
	poolDictionaries:''
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    17
	category:'Views-DialogBoxes'
37
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    18
!
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    19
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    20
!FileSaveBox class methodsFor:'documentation'!
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    21
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    22
copyright
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    23
"
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    24
 COPYRIGHT (c) 1994 by Claus Gittinger
59
450ce95a72a4 *** empty log message ***
claus
parents: 37
diff changeset
    25
	      All Rights Reserved
37
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    26
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    27
 This software is furnished under a license and may be used
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    28
 only in accordance with the terms of that license and with the
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    29
 inclusion of the above copyright notice.   This software may not
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    30
 be provided or otherwise made available to, or used by, any
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    31
 other person.  No title to or ownership of the software is
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    32
 hereby transferred.
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    33
"
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    34
!
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    35
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    36
documentation
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    37
"
637
2084bbe806dc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
    38
    Instances of FileSaveBox add an 'append'-button, and an
2084bbe806dc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
    39
    associated append-action. 
2084bbe806dc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
    40
    The other behavior is that of a FileSelectionBox.
37
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    41
585
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    42
    [Instance variables:]
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    43
        appendAction            action to be performed when append is pressed
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    44
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    45
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    46
    [author:]
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    47
        Claus Gittinger
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    48
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    49
    [see also:]
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    50
        DialogBox
648
fcf02d58882e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 637
diff changeset
    51
        EnterBox2 FilenameEnterBox YesNoBox
585
8f395aba0173 documentation
Claus Gittinger <cg@exept.de>
parents: 243
diff changeset
    52
        ListSelectionBox FileSelectionBox 
37
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    53
"
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    54
! !
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    55
197
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    56
!FileSaveBox methodsFor:'accessing'!
37
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    57
197
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    58
appendAction:aBlock
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    59
    "set the action to be performed when append is pressed"
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    60
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    61
    appendAction := aBlock
37
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    62
! !
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    63
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    64
!FileSaveBox methodsFor:'initialization'!
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    65
77
565b052f5277 *** empty log message ***
claus
parents: 59
diff changeset
    66
focusSequence
637
2084bbe806dc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
    67
    "return the sequence for tabbing through my components"
2084bbe806dc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
    68
77
565b052f5277 *** empty log message ***
claus
parents: 59
diff changeset
    69
    |a|
565b052f5277 *** empty log message ***
claus
parents: 59
diff changeset
    70
565b052f5277 *** empty log message ***
claus
parents: 59
diff changeset
    71
    patternField shown ifTrue:[
637
2084bbe806dc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
    72
        a := Array new:6.
2084bbe806dc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
    73
        a at:1 put:enterField.
2084bbe806dc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
    74
        a at:2 put:patternField.
2084bbe806dc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
    75
        a at:3 put:selectionList.
2084bbe806dc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
    76
        a at:4 put:abortButton.
2084bbe806dc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
    77
        a at:5 put:appendButton.
2084bbe806dc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
    78
        a at:6 put:okButton.
2084bbe806dc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
    79
        ^ a
77
565b052f5277 *** empty log message ***
claus
parents: 59
diff changeset
    80
    ].
565b052f5277 *** empty log message ***
claus
parents: 59
diff changeset
    81
    ^ Array with:enterField 
637
2084bbe806dc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
    82
            with:selectionList
2084bbe806dc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
    83
            with:abortButton 
2084bbe806dc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
    84
            with:appendButton 
2084bbe806dc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
    85
            with:okButton
2084bbe806dc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
    86
2084bbe806dc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
    87
    "Modified: 12.5.1996 / 21:46:17 / cg"
197
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    88
!
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    89
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    90
initialize
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    91
    super initialize.
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    92
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    93
    label := resources string:'Save file dialog'.
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    94
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    95
    okButton label:(resources string:'save').
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    96
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    97
    "
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    98
     insert an append-button between abort- and save-buttons
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    99
    "
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   100
    appendButton := Button okButton.
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   101
    appendButton isReturnButton:false.
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   102
    appendButton label:(resources string:'append').
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   103
    appendButton action:[appendButton turnOffWithoutRedraw. self appendPressed].
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   104
    buttonPanel addSubView:appendButton after:abortButton
37
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
   105
! !
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
   106
197
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   107
!FileSaveBox methodsFor:'user interaction'!
37
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
   108
197
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   109
appendPressed
637
2084bbe806dc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   110
    "append was pressed - evaluate the append-action"
2084bbe806dc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   111
197
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   112
    self hideAndEvaluate:[:string |
637
2084bbe806dc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   113
        appendAction notNil ifTrue:[
2084bbe806dc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   114
            appendAction value:string 
2084bbe806dc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   115
        ]
197
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   116
    ]
637
2084bbe806dc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   117
2084bbe806dc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
   118
    "Modified: 12.5.1996 / 21:45:52 / cg"
197
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
   119
! !
59
450ce95a72a4 *** empty log message ***
claus
parents: 37
diff changeset
   120
243
5c411425097d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
   121
!FileSaveBox class methodsFor:'documentation'!
5c411425097d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
   122
5c411425097d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
   123
version
648
fcf02d58882e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 637
diff changeset
   124
    ^ '$Header: /cvs/stx/stx/libwidg/Attic/FSaveBox.st,v 1.11 1996-05-16 10:24:32 cg Exp $'
243
5c411425097d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
   125
! !