MenuEditor.st
changeset 3178 58100b56595d
parent 3165 c4e94501002c
child 3211 534bd836ae08
equal deleted inserted replaced
3177:0d5fbdb2e7fd 3178:58100b56595d
     8  be provided or otherwise made available to, or used by, any
     8  be provided or otherwise made available to, or used by, any
     9  other person.  No title to or ownership of the software is
     9  other person.  No title to or ownership of the software is
    10  hereby transferred.
    10  hereby transferred.
    11 "
    11 "
    12 "{ Package: 'stx:libtool2' }"
    12 "{ Package: 'stx:libtool2' }"
       
    13 
       
    14 "{ NameSpace: Smalltalk }"
    13 
    15 
    14 ResourceSpecEditor subclass:#MenuEditor
    16 ResourceSpecEditor subclass:#MenuEditor
    15 	instanceVariableNames:'selectionHolder tabHolder listOfItems listOfTabs
    17 	instanceVariableNames:'selectionHolder tabHolder listOfItems listOfTabs
    16 		selectedSuperItems notifyDisabledCounter wizards listOfItemsView
    18 		selectedSuperItems notifyDisabledCounter wizards listOfItemsView
    17 		dropOverLine savedSpec'
    19 		dropOverLine savedSpec'
  3925     "returns the label on default displayed on the screen
  3927     "returns the label on default displayed on the screen
  3926     "
  3928     "
  3927     ^ menuItem rawLabel
  3929     ^ menuItem rawLabel
  3928 !
  3930 !
  3929 
  3931 
  3930 displayOn:aGC x:x y:y h:h
  3932 displayOn:aGC x:x y:y h:h isHighlightedAsSelected:isHighlightedAsSelected
  3931     "display the item in the graphicsContext, aGC.
  3933     "display the item in the graphicsContext, aGC"
  3932     "
  3934 
  3933     |label|
  3935     |label|
  3934 
  3936 
  3935     label := self displayLabel.
  3937     label := self displayLabel.
  3936 
  3938 
  3937     label notNil ifTrue:[
  3939     label notNil ifTrue:[
  3938 	self displayLabel:label h:(self heightOn:aGC) on:aGC x:x y:y h:h
  3940         self displayLabel:label h:(self heightOn:aGC) on:aGC x:x y:y h:h isHighlightedAsSelected:isHighlightedAsSelected
  3939     ].
  3941     ].
  3940 !
  3942 !
  3941 
  3943 
  3942 heightOn:aGC
  3944 heightOn:aGC
  3943     "returns the height of the label on a GC
  3945     "returns the height of the label on a GC
  6391   ^ super  toAspects:aspects.
  6393   ^ super  toAspects:aspects.
  6392 ! !
  6394 ! !
  6393 
  6395 
  6394 !MenuEditor::SeparatorItem methodsFor:'displaying'!
  6396 !MenuEditor::SeparatorItem methodsFor:'displaying'!
  6395 
  6397 
  6396 displayOn:aGC x:x y:y h:h
  6398 displayOn:aGC x:x y:y h:h isHighlightedAsSelected:isHighlightedAsSelected
  6397     "draw the receiver in the graphicsContext, aGC.
  6399     "draw the receiver in the graphicsContext, aGC"
  6398     "
  6400 
  6399     |x1 y0 type|
  6401     |x1 y0 type|
  6400 
  6402 
  6401     type := self separatorType.
  6403     type := self separatorType.
  6402     type == #blank ifTrue:[ ^ self ].
  6404     type == #blank ifTrue:[ ^ self ].
  6403 
  6405 
  6404     x1 := x + (self widthOn:aGC).
  6406     x1 := x + (self widthOn:aGC).
  6405     y0 := y + (h // 2) - 1.
  6407     y0 := y + (h // 2) - 1.
  6406 
  6408 
  6407     type == #double ifTrue:[
  6409     type == #double ifTrue:[
  6408 	y0 := y0 + 1.
  6410         y0 := y0 + 1.
  6409 	aGC displayLineFromX:x y:y0 toX:x1 y:y0.
  6411         aGC displayLineFromX:x y:y0 toX:x1 y:y0.
  6410 	y0 := y0 - 2
  6412         y0 := y0 - 2
  6411     ].
  6413     ].
  6412     aGC displayLineFromX:x y:y0 toX:x1 y:y0
  6414     aGC displayLineFromX:x y:y0 toX:x1 y:y0
  6413 !
  6415 !
  6414 
  6416 
  6415 widthOn:aGC
  6417 widthOn:aGC