OptionBox.st
changeset 372 2ee5887b00f0
parent 371 ed0d15f84085
child 490 08e8adfb783c
equal deleted inserted replaced
371:ed0d15f84085 372:2ee5887b00f0
   278     ].
   278     ].
   279     formLabel form:WarnBitmap
   279     formLabel form:WarnBitmap
   280 !
   280 !
   281 
   281 
   282 initialize
   282 initialize
   283     |nButt|
   283     |nButt mm|
   284 
   284 
   285     super initialize.
   285     super initialize.
       
   286 
       
   287     mm := ViewSpacing.
   286 
   288 
   287     formLabel := Label in:self.
   289     formLabel := Label in:self.
   288     self initFormBitmap.
   290     self initFormBitmap.
   289     formLabel borderWidth:0.
   291     formLabel borderWidth:0.
   290     formLabel origin:(ViewSpacing @ ViewSpacing).
   292     formLabel origin:(mm @ mm).
   291 
   293 
   292     textLabel := Label label:'Select' in:self.
   294     textLabel := Label label:'Select' in:self.
   293     textLabel borderWidth:0.
   295     textLabel borderWidth:0.
   294     textLabel origin:((ViewSpacing + formLabel width + ViewSpacing) @ ViewSpacing).
   296     textLabel origin:((mm + formLabel width + mm) @ mm).
   295 
   297 
   296     buttonPanel := HorizontalPanelView origin:(0.0 @ 1.0) corner:(1.0 @ 1.0) in:self.
   298     buttonPanel := HorizontalPanelView origin:(0.0 @ 1.0) corner:(1.0 @ 1.0) in:self.
   297     buttonPanel 
   299     buttonPanel 
   298 	bottomInset:ViewSpacing;
   300         bottomInset:mm;
   299 	topInset:(font height + ViewSpacing * 2) negated.
   301         topInset:(font height + mm * 2) negated.
   300     buttonPanel 
   302     buttonPanel 
   301 	borderWidth:0; 
   303         borderWidth:0; 
   302 	horizontalLayout:#fitSpace.
   304         horizontalLayout:#fitSpace.
   303 
   305 
   304     nButt := buttons size.
   306     nButt := buttons size.
   305 
   307 
   306     1 to:nButt do:[:index |
   308     1 to:nButt do:[:index |
   307 	|button|
   309         |button|
   308 
   310 
   309 	button := Button label:'press'.
   311         button := Button label:'press'.
   310 	button action:[
   312         button action:[
   311 		       |action|
   313                        |action|
   312 
   314 
   313 		       (buttons at:index) turnOffWithoutRedraw.
   315                        (buttons at:index) turnOffWithoutRedraw.
   314 		       self hide.
   316                        self hide.
   315 		       action := actions at:index.
   317                        action := actions at:index.
   316 		       action notNil ifTrue:[
   318                        action notNil ifTrue:[
   317 			   action value
   319                            action value
   318 		       ]
   320                        ]
   319 		      ].
   321                       ].
   320 "/        index == nButt ifTrue:[
   322 "/        index == nButt ifTrue:[
   321 "/            button isReturnButton:true
   323 "/            button isReturnButton:true
   322 "/        ].
   324 "/        ].
   323 	buttonPanel addSubView:button.
   325         buttonPanel addSubView:button.
   324 	buttons at:index put:button.
   326         buttons at:index put:button.
   325     ].
   327     ].
   326 
   328 
   327     "
   329     "
   328      |box|
   330      |box|
   329 
   331 
   330      box := OptionBox title:'hello' numberOfOptions:4.
   332      box := OptionBox title:'hello' numberOfOptions:4.
   331      box open
   333      box open
   332     "
   334     "
       
   335 
       
   336     "Modified: 21.2.1996 / 01:03:19 / cg"
   333 ! !
   337 ! !
   334 
   338 
   335 !OptionBox methodsFor:'queries'!
   339 !OptionBox methodsFor:'queries'!
   336 
   340 
   337 positionOffset
   341 positionOffset
   377 ! !
   381 ! !
   378 
   382 
   379 !OptionBox class methodsFor:'documentation'!
   383 !OptionBox class methodsFor:'documentation'!
   380 
   384 
   381 version
   385 version
   382     ^ '$Header: /cvs/stx/stx/libwidg/OptionBox.st,v 1.26 1996-02-21 00:02:15 cg Exp $'
   386     ^ '$Header: /cvs/stx/stx/libwidg/OptionBox.st,v 1.27 1996-02-21 00:03:33 cg Exp $'
   383 ! !
   387 ! !