The Trunk: ToolBuilder-Morphic-topa.190.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: ToolBuilder-Morphic-topa.190.mcz

commits-2
Tobias Pape uploaded a new version of ToolBuilder-Morphic to project The Trunk:
http://source.squeak.org/trunk/ToolBuilder-Morphic-topa.190.mcz

==================== Summary ====================

Name: ToolBuilder-Morphic-topa.190
Author: topa
Time: 17 January 2017, 5:57:56.691276 pm
UUID: 9b5813db-ef4d-4ef5-ba76-aa5473e98231
Ancestors: ToolBuilder-Morphic-nice.189

re-use settings for multi- and single-selection lists in toolbuilder

=============== Diff against ToolBuilder-Morphic-nice.189 ===============

Item was changed:
  ----- Method: MorphicToolBuilder>>buildPluggableList: (in category 'widgets required') -----
  buildPluggableList: aSpec
  | widget listClass getIndex setIndex |
  aSpec getSelected ifNil:[
  listClass := self listClass.
  getIndex := aSpec getIndex.
  setIndex := aSpec setIndex.
  ] ifNotNil:[
  listClass := self listByItemClass.
  getIndex := aSpec getSelected.
  setIndex := aSpec setSelected.
  ].
  widget := listClass on: aSpec model
  list: aSpec list
  selected: getIndex
  changeSelected: setIndex
  menu: aSpec menu
  keystroke: aSpec keyPress.
  self register: widget id: aSpec name.
 
+ widget
+ dragItemSelector: aSpec dragItem;
+ dropItemSelector: aSpec dropItem;
+ wantsDropSelector: aSpec dropAccept;
+ dragStartedSelector: aSpec dragStarted.
+
+ self setListPropertiesFor: widget spec: aSpec.
- "Override default scroll bar policies if needed. Widget will use preference values otherwise."
- aSpec hScrollBarPolicy ifNotNil: [:policy |
- policy caseOf: {
- [#always] -> [widget alwaysShowHScrollBar].
- [#never] -> [widget hideHScrollBarIndefinitely].
- [#whenNeeded] -> [widget showHScrollBarOnlyWhenNeeded]. } ].
- aSpec vScrollBarPolicy ifNotNil: [:policy |
- policy caseOf: {
- [#always] -> [widget alwaysShowVScrollBar].
- [#never] -> [widget hideVScrollBarIndefinitely].
- [#whenNeeded] -> [widget showVScrollBarOnlyWhenNeeded]. } ].
-
- widget getListElementSelector: aSpec listItem.
- widget getListSizeSelector: aSpec listSize.
- widget getIconSelector: aSpec icon.
- widget getHelpSelector: aSpec helpItem.
- widget doubleClickSelector: aSpec doubleClick.
-
- widget dragItemSelector: aSpec dragItem.
- widget dropItemSelector: aSpec dropItem.
- widget wantsDropSelector: aSpec dropAccept.
- widget dragStartedSelector: aSpec dragStarted.
-
- widget autoDeselect: aSpec autoDeselect.
- widget keystrokePreviewSelector: aSpec keystrokePreview.
-
- aSpec filterableList ifNotNil: [:b | widget filterableList: b].
- aSpec clearFilterAutomatically ifNotNil: [:b | widget clearFilterAutomatically: b].
-
- aSpec color ifNotNil: [:c | widget color: c].
- self buildHelpFor: widget spec: aSpec.
-
- self setFrame: aSpec frame in: widget.
- self setLayoutHintsFor: widget spec: aSpec.
-
- parent ifNotNil:[self add: widget to: parent].
- panes ifNotNil:[
- aSpec list ifNotNil:[panes add: aSpec list].
- ].
  ^widget!

Item was changed:
  ----- Method: MorphicToolBuilder>>buildPluggableMultiSelectionList: (in category 'widgets optional') -----
  buildPluggableMultiSelectionList: aSpec
  | widget listClass |
  aSpec getSelected ifNotNil:[^self error:'There is no PluggableListMorphOfManyByItem'].
  listClass := self multiSelectListClass.
  widget := listClass on: aSpec model
  list: aSpec list
  primarySelection: aSpec getIndex
  changePrimarySelection: aSpec setIndex
  listSelection: aSpec getSelectionList
  changeListSelection: aSpec setSelectionList
  menu: aSpec menu.
- self register: widget id: aSpec name.
  widget keystrokeActionSelector: aSpec keyPress.
+ self register: widget id: aSpec name.
+ self setListPropertiesFor: widget spec: aSpec.
- widget getListElementSelector: aSpec listItem.
- widget getListSizeSelector: aSpec listSize.
- self buildHelpFor: widget spec: aSpec.
- self setFrame: aSpec frame in: widget.
- self setLayoutHintsFor: widget spec: aSpec.
- parent ifNotNil:[self add: widget to: parent].
- panes ifNotNil:[
- aSpec list ifNotNil:[panes add: aSpec list].
- ].
  ^widget!

Item was added:
+ ----- Method: MorphicToolBuilder>>setListPropertiesFor:spec: (in category 'private') -----
+ setListPropertiesFor: widget spec: aSpec
+
+ "Override default scroll bar policies if needed. Widget will use preference values otherwise."
+ aSpec hScrollBarPolicy ifNotNil: [:policy |
+ policy caseOf: {
+ [#always] -> [widget alwaysShowHScrollBar].
+ [#never] -> [widget hideHScrollBarIndefinitely].
+ [#whenNeeded] -> [widget showHScrollBarOnlyWhenNeeded]. } ].
+ aSpec vScrollBarPolicy ifNotNil: [:policy |
+ policy caseOf: {
+ [#always] -> [widget alwaysShowVScrollBar].
+ [#never] -> [widget hideVScrollBarIndefinitely].
+ [#whenNeeded] -> [widget showVScrollBarOnlyWhenNeeded]. } ].
+
+ widget
+ getListElementSelector: aSpec listItem;
+ getListSizeSelector: aSpec listSize;
+ getIconSelector: aSpec icon;
+ getHelpSelector: aSpec helpItem;
+ doubleClickSelector: aSpec doubleClick.
+
+ widget
+ autoDeselect: aSpec autoDeselect;
+ keystrokePreviewSelector: aSpec keystrokePreview.
+
+ aSpec filterableList ifNotNil: [:b | widget filterableList: b].
+ aSpec clearFilterAutomatically ifNotNil: [:b | widget clearFilterAutomatically: b].
+
+ aSpec color ifNotNil: [:c | widget color: c].
+ self buildHelpFor: widget spec: aSpec.
+
+ self setFrame: aSpec frame in: widget.
+ self setLayoutHintsFor: widget spec: aSpec.
+
+ parent ifNotNil:[self add: widget to: parent].
+ (panes notNil and: [aSpec list notNil]) ifTrue: [panes add: aSpec list].
+ !