FileSaveBox.st
author Claus Gittinger <cg@exept.de>
Sat, 06 Mar 1999 03:08:19 +0100
changeset 1762 848075aa087c
parent 741 eee7cb39bafe
child 1764 45ca6b617934
permissions -rw-r--r--
care for styleSheets right-to-left button order.
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
197
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    66
initialize
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    67
    super initialize.
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    68
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    69
    label := resources string:'Save file dialog'.
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    70
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    71
    okButton label:(resources string:'save').
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    72
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    73
    "
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    74
     insert an append-button between abort- and save-buttons
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    75
    "
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    76
    appendButton := Button okButton.
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    77
    appendButton isReturnButton:false.
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    78
    appendButton label:(resources string:'append').
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    79
    appendButton action:[appendButton turnOffWithoutRedraw. self appendPressed].
1762
848075aa087c care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
    80
    (styleSheet at:'dialogBox.okAtLeft') ifTrue:[
848075aa087c care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
    81
        self addButton:appendButton after:okButton.
848075aa087c care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
    82
    ] ifFalse:[
848075aa087c care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
    83
        self addButton:appendButton before:okButton.
848075aa087c care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
    84
    ].
37
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    85
! !
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    86
197
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    87
!FileSaveBox methodsFor:'user interaction'!
37
8dd71a2e79cd Initial revision
claus
parents:
diff changeset
    88
197
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    89
appendPressed
637
2084bbe806dc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
    90
    "append was pressed - evaluate the append-action"
2084bbe806dc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
    91
197
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    92
    self hideAndEvaluate:[:string |
637
2084bbe806dc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
    93
        appendAction notNil ifTrue:[
2084bbe806dc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
    94
            appendAction value:string 
2084bbe806dc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
    95
        ]
197
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    96
    ]
637
2084bbe806dc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
    97
2084bbe806dc checkin from browser
Claus Gittinger <cg@exept.de>
parents: 585
diff changeset
    98
    "Modified: 12.5.1996 / 21:45:52 / cg"
197
00927189c882 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 174
diff changeset
    99
! !
59
450ce95a72a4 *** empty log message ***
claus
parents: 37
diff changeset
   100
243
5c411425097d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
   101
!FileSaveBox class methodsFor:'documentation'!
5c411425097d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
   102
5c411425097d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
   103
version
1762
848075aa087c care for styleSheets right-to-left button order.
Claus Gittinger <cg@exept.de>
parents: 741
diff changeset
   104
    ^ '$Header: /cvs/stx/stx/libwidg/FileSaveBox.st,v 1.13 1999-03-06 02:08:19 cg Exp $'
243
5c411425097d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 197
diff changeset
   105
! !