The Trunk: PackageInfo-UI-fbs.1.mcz

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

The Trunk: PackageInfo-UI-fbs.1.mcz

commits-2
Frank Shearar uploaded a new version of PackageInfo-UI to project The Trunk:
http://source.squeak.org/trunk/PackageInfo-UI-fbs.1.mcz

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

Name: PackageInfo-UI-fbs.1
Author: fbs
Time: 3 July 2013, 10:29:09.239 pm
UUID: 47ca3033-6938-2d4f-9ff6-02b2345a1fc5
Ancestors:

Split PackageInfo's UI into a separate package.

==================== Snapshot ====================

SystemOrganization addCategory: #'PackageInfo-UI'!

Object subclass: #PackageList
        instanceVariableNames: 'selectedPackage packages'
        classVariableNames: ''
        poolDictionaries: ''
        category: 'PackageInfo-UI'!

----- Method: PackageList class>>initialize (in category 'as yet unclassified') -----
initialize
        TheWorldMenu registerOpenCommand: {'Package List'. {self. #open}}!

----- Method: PackageList class>>open (in category 'as yet unclassified') -----
open
        ^ self new openInWorld!

----- Method: PackageList>>addPackage (in category 'actions') -----
addPackage
        | packageName |
        packageName := UIManager default request: 'Package name:'.
        packageName isEmpty ifFalse:
                [selectedPackage := self packageOrganizer registerPackageNamed: packageName.
                self changed: #packageSelection]!

----- Method: PackageList>>buildList (in category 'morphic') -----
buildList
        ^ PluggableListMorph
                on: self
                list: #packageList
                selected: #packageSelection
                changeSelected: #packageSelection:
                menu: #packageMenu:!

----- Method: PackageList>>buildWindow (in category 'morphic') -----
buildWindow
        | window |
        window := SystemWindow labelled: self label.
        window model: self.
        window addMorph: self buildList fullFrame: (LayoutFrame fractions: (0@0 corner: 1@1)).
        ^ window!

----- Method: PackageList>>defaultBackgroundColor (in category 'morphic') -----
defaultBackgroundColor
        ^ Color white!

----- Method: PackageList>>defaultExtent (in category 'morphic') -----
defaultExtent
        ^ 200@200!

----- Method: PackageList>>label (in category 'morphic') -----
label
        ^ 'Packages'!

----- Method: PackageList>>openInWorld (in category 'morphic') -----
openInWorld
        self packageOrganizer addDependent: self.
        self buildWindow openInWorldExtent: self defaultExtent!

----- Method: PackageList>>packageContextMenu: (in category 'morphic') -----
packageContextMenu: aMenu
        aMenu
                addLine;
                add: 'remove package' action: #removePackage;
                addServices: PackageServices allServices for: selectedPackage extraLines: #()!

----- Method: PackageList>>packageList (in category 'morphic') -----
packageList
        ^ self packages collect: [:ea | ea packageName]!

----- Method: PackageList>>packageMenu: (in category 'morphic') -----
packageMenu: aMenu
        aMenu
                defaultTarget: self;
                add: 'add package' action: #addPackage.
        selectedPackage ifNotNil: [self packageContextMenu: aMenu].
        ^ aMenu!

----- Method: PackageList>>packageOrganizer (in category 'actions') -----
packageOrganizer
        ^ PackageOrganizer default!

----- Method: PackageList>>packageSelection (in category 'morphic') -----
packageSelection
        ^ self packages indexOf: selectedPackage!

----- Method: PackageList>>packageSelection: (in category 'morphic') -----
packageSelection: aNumber
        selectedPackage := self packages at: aNumber ifAbsent: [].
        self changed: #packageSelection!

----- Method: PackageList>>packages (in category 'as yet unclassified') -----
packages
        ^ packages ifNil: [packages := self packageOrganizer packages asSortedCollection:
                                                                        [:a :b | a packageName <= b packageName]]!

----- Method: PackageList>>perform:orSendTo: (in category 'morphic') -----
perform: selector orSendTo: otherTarget
        "Selector was just chosen from a menu by a user.  If can respond, then
perform it on myself. If not, send it to otherTarget, presumably the
editPane from which the menu was invoked."

        (self respondsTo: selector)
                ifTrue: [^ self perform: selector]
                ifFalse: [^ otherTarget perform: selector]!

----- Method: PackageList>>removePackage (in category 'actions') -----
removePackage
        self packageOrganizer unregisterPackage: selectedPackage!

----- Method: PackageList>>update: (in category 'actions') -----
update: aSymbol
        aSymbol = #packages ifTrue:
                [packages := nil.
                self changed: #packageList; changed: #packageSelection]!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: PackageInfo-UI-fbs.1.mcz

Frank Shearar-3
On 3 July 2013 22:29,  <[hidden email]> wrote:

> Frank Shearar uploaded a new version of PackageInfo-UI to project The Trunk:
> http://source.squeak.org/trunk/PackageInfo-UI-fbs.1.mcz
>
> ==================== Summary ====================
>
> Name: PackageInfo-UI-fbs.1
> Author: fbs
> Time: 3 July 2013, 10:29:09.239 pm
> UUID: 47ca3033-6938-2d4f-9ff6-02b2345a1fc5
> Ancestors:
>
> Split PackageInfo's UI into a separate package.
>
> ==================== Snapshot ====================

PackageList needs to be rewritten to use ToolBuilder. It ought to be a
small project for someone looking to dip their toe into writing
graphical framework agnostic user interfaces...

frank

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: PackageInfo-UI-fbs.1.mcz

Frank Shearar-3
On 3 July 2013 22:38, Frank Shearar <[hidden email]> wrote:

> On 3 July 2013 22:29,  <[hidden email]> wrote:
>> Frank Shearar uploaded a new version of PackageInfo-UI to project The Trunk:
>> http://source.squeak.org/trunk/PackageInfo-UI-fbs.1.mcz
>>
>> ==================== Summary ====================
>>
>> Name: PackageInfo-UI-fbs.1
>> Author: fbs
>> Time: 3 July 2013, 10:29:09.239 pm
>> UUID: 47ca3033-6938-2d4f-9ff6-02b2345a1fc5
>> Ancestors:
>>
>> Split PackageInfo's UI into a separate package.
>>
>> ==================== Snapshot ====================
>
> PackageList needs to be rewritten to use ToolBuilder. It ought to be a
> small project for someone looking to dip their toe into writing
> graphical framework agnostic user interfaces...

Oh, too late! See PackageInfo-UI-fbs.2.

> frank

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: PackageInfo-UI-fbs.1.mcz

Frank Shearar-3
On 3 July 2013 23:32, Frank Shearar <[hidden email]> wrote:

> On 3 July 2013 22:38, Frank Shearar <[hidden email]> wrote:
>> On 3 July 2013 22:29,  <[hidden email]> wrote:
>>> Frank Shearar uploaded a new version of PackageInfo-UI to project The Trunk:
>>> http://source.squeak.org/trunk/PackageInfo-UI-fbs.1.mcz
>>>
>>> ==================== Summary ====================
>>>
>>> Name: PackageInfo-UI-fbs.1
>>> Author: fbs
>>> Time: 3 July 2013, 10:29:09.239 pm
>>> UUID: 47ca3033-6938-2d4f-9ff6-02b2345a1fc5
>>> Ancestors:
>>>
>>> Split PackageInfo's UI into a separate package.
>>>
>>> ==================== Snapshot ====================
>>
>> PackageList needs to be rewritten to use ToolBuilder. It ought to be a
>> small project for someone looking to dip their toe into writing
>> graphical framework agnostic user interfaces...
>
> Oh, too late! See PackageInfo-UI-fbs.2.

-fbs.3, but you got the gist.

frank