The Inbox: Tools-fbs.239.mcz

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

The Inbox: Tools-fbs.239.mcz

commits-2
A new version of Tools was added to project The Inbox:
http://source.squeak.org/inbox/Tools-fbs.239.mcz

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

Name: Tools-fbs.239
Author: fbs
Time: 2 May 2010, 8:57:39.846 pm
UUID: 91c6e4cd-a84f-2143-8296-37b896ddf093
Ancestors: Tools-bf.238

Mantis 7520: FileList now has constant-height buttons.

=============== Diff against Tools-bf.238 ===============

Item was changed:
  ----- Method: FileList>>buildWith: (in category 'toolbuilder') -----
  buildWith: builder
  "FileList open"
  | windowSpec window |
  windowSpec := self buildWindowWith: builder specs: {
  (0@0 corner: 1@0.06) -> [self buildPatternInputWith: builder].
+ (0.25@0.06 corner: 1@0.5) -> [self buildFileListWith: builder].
- (0.25@0.06 corner: 1@0.15) -> [self buildButtonPaneWith: builder].
  (0@0.06 corner: 0.25@1) -> [self buildDirectoryTreeWith: builder].
- (0.25@0.15 corner: 1@0.5) -> [self buildFileListWith: builder].
  (0.25@0.5 corner: 1@1) -> [self buildContentPaneWith: builder].
  }.
  window := builder build: windowSpec.
  self changed: #selectedPath.
  ^window!

Item was added:
+ ----- Method: FileList>>frameOffsetFromTop:fromLeft:width:bottomFraction: (in category 'toolbuilder') -----
+ frameOffsetFromTop: height fromLeft: leftFraction width: rightFraction bottomFraction: bottomFraction
+ ^LayoutFrame new
+ topFraction: 0 offset: height;
+ leftFraction: leftFraction offset: 0;
+ rightFraction: (leftFraction + rightFraction) offset: 0;
+ bottomFraction: bottomFraction offset: 0;
+ yourself.!

Item was added:
+ ----- Method: FileList>>buttonHeight (in category 'toolbuilder') -----
+ buttonHeight
+ ^Preferences standardButtonFont height + 12!

Item was added:
+ ----- Method: FileList>>topConstantHeightFrame:fromLeft:width: (in category 'toolbuilder') -----
+ topConstantHeightFrame: height fromLeft: leftFraction width: rightFraction
+ ^LayoutFrame new
+ topFraction: 0 offset: 0;
+ leftFraction: leftFraction offset: 0;
+ rightFraction: (leftFraction + rightFraction) offset: 0;
+ bottomFraction: 0 offset: height;
+ yourself.!

Item was changed:
  ----- Method: FileList>>buildFileListWith: (in category 'toolbuilder') -----
  buildFileListWith: builder
+ | buttons listSpec top |
+ top := builder pluggablePanelSpec new.
+ top children: OrderedCollection new.
+
+ buttons := self buildButtonPaneWith: builder.
+ buttons frame: (self topConstantHeightFrame: self buttonHeight fromLeft: 0 width: 1).
+ top children add: buttons.
+
- | listSpec |
  listSpec := builder pluggableListSpec new.
  listSpec
  model: self;
  list: #fileList;
  getIndex: #fileListIndex;
  setIndex: #fileListIndex:;
  menu: #fileListMenu:;
+ keyPress: nil;
+ frame: (self frameOffsetFromTop: self buttonHeight + 4 fromLeft: 0 width: 1 bottomFraction: 1);
+ color: Color white.
+ top children add: listSpec.
+ ^top.
- keyPress: nil.
- ^listSpec
  !


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Tools-fbs.239.mcz

Frank Shearar
On 2010/05/02 19:01, [hidden email] wrote:

> A new version of Tools was added to project The Inbox:
> http://source.squeak.org/inbox/Tools-fbs.239.mcz
>
> ==================== Summary ====================
>
> Name: Tools-fbs.239
> Author: fbs
> Time: 2 May 2010, 8:57:39.846 pm
> UUID: 91c6e4cd-a84f-2143-8296-37b896ddf093
> Ancestors: Tools-bf.238
>
> Mantis 7520: FileList now has constant-height buttons.

This commit copies #frameOffsetFromTop:fromLeft:width:bottomFraction:
#topConstantHeightFrame:fromLeft:width: from Browser.

I find them very useful methods, and possibly point towards a useful
idiom in UI building. I copied the methods because it made for a cleaner
commit. However, the duplicated implementations should almost certainly
be moved to some other, common, place.

frank