YesNoBox.st
changeset 79 6d917a89f7b7
parent 63 f4eaf04d1eaf
child 95 7535cfca9509
equal deleted inserted replaced
78:1122ab450f80 79:6d917a89f7b7
    19 
    19 
    20 YesNoBox comment:'
    20 YesNoBox comment:'
    21 COPYRIGHT (c) 1989 by Claus Gittinger
    21 COPYRIGHT (c) 1989 by Claus Gittinger
    22 	      All Rights Reserved
    22 	      All Rights Reserved
    23 
    23 
    24 $Header: /cvs/stx/stx/libwidg/YesNoBox.st,v 1.8 1994-11-17 14:38:51 claus Exp $
    24 $Header: /cvs/stx/stx/libwidg/YesNoBox.st,v 1.9 1995-02-06 00:55:04 claus Exp $
    25 '!
    25 '!
    26 
    26 
    27 !YesNoBox class methodsFor:'documentation'!
    27 !YesNoBox class methodsFor:'documentation'!
    28 
    28 
    29 copyright
    29 copyright
    40 "
    40 "
    41 !
    41 !
    42 
    42 
    43 version
    43 version
    44 "
    44 "
    45 $Header: /cvs/stx/stx/libwidg/YesNoBox.st,v 1.8 1994-11-17 14:38:51 claus Exp $
    45 $Header: /cvs/stx/stx/libwidg/YesNoBox.st,v 1.9 1995-02-06 00:55:04 claus Exp $
    46 "
    46 "
    47 !
    47 !
    48 
    48 
    49 documentation
    49 documentation
    50 "
    50 "
   131 
   131 
   132 updateStyleCache
   132 updateStyleCache
   133     |img|
   133     |img|
   134 
   134 
   135     img := StyleSheet at:'requestBoxIcon'.
   135     img := StyleSheet at:'requestBoxIcon'.
   136     img notNil ifTrue:[RequestBitmap := img asFormOn:Display].
   136     img notNil ifTrue:[RequestBitmap := img on:Display].
   137 ! !
   137 ! !
   138 
   138 
   139 !YesNoBox class methodsFor:'icon bitmap'!
   139 !YesNoBox class methodsFor:'icon bitmap'!
   140 
   140 
   141 iconBitmap
   141 iconBitmap
   142     "return the bitmap shown as icon in my instances"
   142     "return the bitmap shown as icon in my instances"
   143 
   143 
   144     RequestBitmap isNil ifTrue:[
   144     RequestBitmap isNil ifTrue:[
   145 	RequestBitmap := (Image fromFile:'bitmaps/Request.xbm') asFormOn:Display 
   145 	RequestBitmap := (Image fromFile:'bitmaps/Request.xbm') on:Display 
   146     ].
   146     ].
   147     ^ RequestBitmap
   147     ^ RequestBitmap
   148 ! !
   148 ! !
   149 
   149 
   150 !YesNoBox class methodsFor:'easy startup '!
       
   151 
       
   152 XXconfirm:aTitle
       
   153     ^ self new confirm:aTitle
       
   154 ! !
       
   155 
       
   156 !YesNoBox class methodsFor:'instance creation'!
   150 !YesNoBox class methodsFor:'instance creation'!
   157 
   151 
   158 title:t yesText:yesString noText:noString
   152 title:t yesText:yesString noText:noString
   159     ^ (self new) title:t yesText:yesString noText:noString
   153     ^ (self new) title:t yesText:yesString noText:noString
   160 ! !
   154 ! !
   162 !YesNoBox methodsFor:'initialization'!
   156 !YesNoBox methodsFor:'initialization'!
   163 
   157 
   164 initialize
   158 initialize
   165     super initialize.
   159     super initialize.
   166 
   160 
   167     buttonPanel layout:#fit.  "/ looks better; should it come from the StyleSheet ?
   161     label := 'Choose'.
       
   162 
       
   163     buttonPanel layout:#fitSpace.  "/ looks better; should it come from the StyleSheet ?
   168 
   164 
   169     textLabel label:'please Confirm'.
   165     textLabel label:'please Confirm'.
   170     okButton label:(resources at:'yes').
   166     okButton label:(resources at:'yes').
   171 
   167 
   172     noButton := Button new.
   168     noButton := Button new.
   176     noButton action:[
   172     noButton action:[
   177 		       noButton turnOffWithoutRedraw.
   173 		       noButton turnOffWithoutRedraw.
   178 		       self noPressed
   174 		       self noPressed
   179 		    ].
   175 		    ].
   180     self resize.
   176     self resize.
       
   177 !
       
   178 
       
   179 focusSequence
       
   180     ^ Array with:noButton with:okButton 
   181 ! !
   181 ! !
   182 
   182 
   183 !YesNoBox methodsFor:'startup'!
   183 !YesNoBox methodsFor:'startup'!
   184 
   184 
   185 confirm
   185 confirm