The Trunk: ToolBuilder-Morphic-mt.134.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-mt.134.mcz

commits-2
Marcel Taeumel uploaded a new version of ToolBuilder-Morphic to project The Trunk:
http://source.squeak.org/trunk/ToolBuilder-Morphic-mt.134.mcz

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

Name: ToolBuilder-Morphic-mt.134
Author: mt
Time: 17 April 2015, 3:31:27.635 pm
UUID: 1c976ef0-4b8a-d040-b6e7-11a436783e0f
Ancestors: ToolBuilder-Morphic-mt.133

Removed code duplication when building code panes. Reuse code for building text panes.

=============== Diff against ToolBuilder-Morphic-mt.133 ===============

Item was removed:
- ----- Method: MorphicToolBuilder>>buildPluggableCodePane: (in category 'widgets optional') -----
- buildPluggableCodePane: aSpec
- "Install the default styler for code panes.
- Implementation note: We should just be doing something like, e.g.,
- ^(self buildPluggableText: aSpec) useDefaultStyler
- Unfortunately, this will retrieve and layout the initial text twice which
- can make for a noticable performance difference when looking at some
- larger piece of code. So instead we copy the implementation from
- buildPlugggableText: here and insert #useDefaultStyler at the right point"
- | widget |
- widget := self codePaneClass new.
- widget useDefaultStyler.
- widget on: aSpec model
- text: aSpec getText
- accept: aSpec setText
- readSelection: aSpec selection
- menu: aSpec menu.
- widget font: Preferences standardCodeFont.
- self register: widget id: aSpec name.
- widget getColorSelector: aSpec color.
- self setFrame: aSpec frame in: widget.
- parent ifNotNil:[self add: widget to: parent].
- widget borderColor: Color lightGray.
- widget color: Color white.
- ^widget!

Item was changed:
  ----- Method: MorphicToolBuilder>>buildPluggableText: (in category 'widgets required') -----
  buildPluggableText: aSpec
  | widget |
+ widget := self textPaneClass new.
+ aSpec stylerClass ifNotNil: [:c | widget styler: (c new view: widget)].
+ widget
+ on: aSpec model
+ text: aSpec getText
+ accept: aSpec setText
+ readSelection: aSpec selection
+ menu: aSpec menu.
+ aSpec font ifNotNil: [:f | widget font: f].
+
- widget := self textPaneClass on: aSpec model
- text: aSpec getText
- accept: aSpec setText
- readSelection: aSpec selection
- menu: aSpec menu.
  widget editTextSelector: aSpec editText.
  widget wantsFrameAdornments: aSpec indicateUnacceptedChanges.
  widget askBeforeDiscardingEdits: aSpec askBeforeDiscardingEdits.
  widget font: Preferences standardCodeFont.
+
+ widget textMorph isAutoFit ifTrue: [
+ widget hideHScrollBarIndefinitely: true.].
+
  self register: widget id: aSpec name.
  widget getColorSelector: aSpec color.
  self buildHelpFor: widget spec: aSpec.
  self setFrame: aSpec frame in: widget.
  parent ifNotNil:[self add: widget to: parent].
  widget borderColor: Color lightGray.
  widget color: Color white.
  ^widget!