UIBuilder.st
author Claus Gittinger <cg@exept.de>
Fri, 17 Jan 1997 21:36:49 +0100
changeset 373 66283cb455bf
parent 372 6d7718f3d298
child 474 c337e7ad2220
permissions -rw-r--r--
checkin from browser

"
 COPYRIGHT (c) 1995 by Claus Gittinger
	      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.
"

WindowBuilder subclass:#UIBuilder
	instanceVariableNames:'view currentMenuSelector menuAspect spec'
	classVariableNames:'Verbose'
	poolDictionaries:''
	category:'Interface-Support-UI'
!

!UIBuilder class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 1995 by Claus Gittinger
	      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.
"
!

documentation
"
    this class will (eventually) allow parsing windowSpecs as
    created by ST-80's UIPainter, and thereby allow to run applications
    built with this tool.
    It was created to allow execution of PD applications which were
    written using that tool (and more and more are appearing ...).

    The class is not completed yet and certainly not bug free.
    Also, it is not quaranteed that all winSpecs are understood.

    Notice: 
        this class was implemented using protocol information
        from alpha testers, literature and by read public domain code
        - it may not be complete or compatible to
        the corresponding ST-80 class. 
        If you encounter any incompatibilities, please forward a note 
        describing the incompatibility verbal (i.e. no code) to the ST/X team.

    [author:]
        Claus Gittinger
"
! !

!UIBuilder class methodsFor:'initialization'!

initialize
    Verbose := false    "/ debugging flag
! !

!UIBuilder methodsFor:'accessing'!

menuAspect
    ^ menuAspect
! !

!UIBuilder methodsFor:'building'!

add:aSpec
    view := aSpec buildViewFor:self.
    ^ view

    "Modified: 16.1.1997 / 00:45:07 / cg"
!

buildFromSpec:aSpecArray
    |m spec|

"/ old:
"/    self readSpec:aSpecArray.

    spec := UISpecification from:aSpecArray.
    window := view := spec buildViewFor:self.

"/    menuAspect notNil ifTrue:[
"/        m := self componentAt:menuAspect.
"/        m notNil ifTrue:[
"/            m := m value.
"/            m notNil ifTrue:[
"/                m receiver:application.
"/                window add:m.
"/                view topInset:(m heightIncludingBorder).
"/            ]
"/        ]
"/    ].

    ^ window

    "Modified: 5.9.1995 / 21:43:29 / claus"
    "Modified: 17.1.1997 / 19:33:05 / cg"
!

buildFromSpec:aSpecArray in:aView
    |m spec|

    spec := UISpecification from:aSpecArray.

    view := spec buildViewFor:self in:aView.

"/    menuAspect notNil ifTrue:[
"/        m := self componentAt:menuAspect.
"/        m notNil ifTrue:[
"/            m := m value.
"/            m notNil ifTrue:[
"/                m receiver:application.
"/                window add:m.
"/                view topInset:(m heightIncludingBorder).
"/            ]
"/        ]
"/    ].

    ^ view

    "Modified: 5.9.1995 / 21:48:09 / claus"
    "Modified: 17.1.1997 / 19:33:48 / cg"
!

doFinalHookup

    "Created: 14.2.1997 / 14:52:27 / cg"
! !

!UIBuilder class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libview2/UIBuilder.st,v 1.19 1997-01-17 20:36:49 cg Exp $'
! !
UIBuilder initialize!