ListEditor.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Mon, 17 Jun 2019 11:25:19 +0100
branchjv
changeset 6070 a0e88386e17c
parent 4770 6634b540fea2
permissions -rw-r--r--
UI: move all items in menu to the right as if there was an icon If there's no icon, just fraw empty space. This makes popup menus with no icons at all looks similar to popup menus with icons and also makes item labels more readable. In general, looks much better and fits better into modern desktops (GNOME & Windows behave the same).

"
 COPYRIGHT (c) 1998 by eXept Software AG
	      All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
"{ Package: 'stx:libwidg2' }"

"{ NameSpace: Smalltalk }"

ApplicationModel subclass:#ListEditor
	instanceVariableNames:'choiceList choiceSelection selectionList selectionSelection'
	classVariableNames:''
	poolDictionaries:''
	category:'Views-Lists'
!

!ListEditor class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 1998 by eXept Software AG
	      All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"


! !

!ListEditor class methodsFor:'interface specs'!

windowSpec
    "This resource specification was automatically generated
     by the UIPainter of ST/X."

    "Do not manually edit this!! If it is corrupted,
     the UIPainter may not be able to read the specification."

    "
     UIPainter new openOnClass:ListEditor andSelector:#windowSpec
     ListEditor new openInterface:#windowSpec
     ListEditor open
    "

    <resource: #canvas>

    ^

       #(#FullSpec
	  #window:
	   #(#WindowSpec
	      #name: 'NewApplication'
	      #layout: #(#LayoutFrame 216 0 173 0 515 0 472 0)
	      #level: 0
	      #label: 'NewApplication'
	      #min: #(#Point 10 10)
	      #max: #(#Point 800 553)
	      #bounds: #(#Rectangle 216 173 516 473)
	      #usePreferredExtent: false
	  )
	  #component:
	   #(#SpecCollection
	      #collection:
	       #(
		 #(#SequenceViewSpec
		    #name: 'choiceList'
		    #layout: #(#LayoutFrame 0 0.0 30 0.0 -12 0.5 0 1.0)
		    #model: #choiceSelection
		    #hasHorizontalScrollBar: true
		    #hasVerticalScrollBar: true
		    #miniScrollerHorizontal: true
		    #useIndex: true
		    #sequenceList: #choiceList
		)
		 #(#SequenceViewSpec
		    #name: 'selectionList'
		    #layout: #(#LayoutFrame 12 0.5 30 0.0 0 1.0 0 1.0)
		    #model: #selectionSelection
		    #hasHorizontalScrollBar: true
		    #hasVerticalScrollBar: true
		    #miniScrollerHorizontal: true
		    #useIndex: true
		    #sequenceList: #selectionList
		)
		 #(#LabelSpec
		    #name: 'choiceLabel'
		    #layout: #(#LayoutFrame 0 0.0 0 0 -20 0.5 30 0)
		    #label: 'Choices'
		    #translateLabel: true
		)
		 #(#LabelSpec
		    #name: 'selectionLabel'
		    #layout: #(#LayoutFrame 20 0.5 0 0 0 1.0 30 0)
		    #label: 'Selected'
		    #translateLabel: true
		)
		 #(#ArrowButtonSpec
		    #name: 'addButton'
		    #layout: #(#LayoutFrame -10 0.5 -25 0.5 10 0.5 -5 0.5)
		    #model: #addToSelection
		    #isTriggerOnDown: true
		    #direction: #right
		)
		 #(#ArrowButtonSpec
		    #name: 'removeButton'
		    #layout: #(#LayoutFrame -10 0.5 5 0.5 10 0.5 25 0.5)
		    #model: #removeFromSelection
		    #isTriggerOnDown: true
		    #direction: #left
		)
	      )
	  )
      )
! !

!ListEditor methodsFor:'actions'!

addToSelection
    "automatically generated by UIPainter ..."

    "*** the code below performs no action"
    "*** (except for some feedback on the Transcript)"
    "*** Please change as required and accept in the browser."

    "action to be added ..."

    Transcript showCR:self class name, ': action for addToSelection ...'.

    "Created: / 7.3.1999 / 00:44:23 / cg"
!

removeFromSelection
    "automatically generated by UIPainter ..."

    "*** the code below performs no action"
    "*** (except for some feedback on the Transcript)"
    "*** Please change as required and accept in the browser."

    "action to be added ..."

    Transcript showCR:self class name, ': action for removeFromSelection ...'.

    "Created: / 7.3.1999 / 00:44:24 / cg"
! !

!ListEditor methodsFor:'aspects'!

choiceList
    choiceList isNil ifTrue:[
	choiceList :=  ValueHolder new.
    ].
    ^ choiceList.

    "Created: / 7.3.1999 / 00:44:23 / cg"
    "Modified: / 7.3.1999 / 00:45:51 / cg"
!

choiceSelection
    choiceSelection isNil ifTrue:[
	choiceSelection := ValueHolder new.
    ].
    ^ choiceSelection.

    "Created: / 7.3.1999 / 00:44:23 / cg"
    "Modified: / 7.3.1999 / 00:46:29 / cg"
!

selectionList
    selectionList isNil ifTrue:[
	selectionList :=  ValueHolder new.
    ].
    ^ selectionList.

    "Created: / 7.3.1999 / 00:44:23 / cg"
    "Modified: / 7.3.1999 / 00:47:34 / cg"
!

selectionSelection
    selectionSelection isNil ifTrue:[
	selectionSelection :=  ValueHolder new.
    ].
    ^ selectionSelection.

    "Created: / 7.3.1999 / 00:44:23 / cg"
    "Modified: / 7.3.1999 / 00:48:27 / cg"
! !

!ListEditor class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libwidg2/ListEditor.st,v 1.5 2006-11-13 16:11:30 cg Exp $'
! !