WindowBuilder.st
author Claus Gittinger <cg@exept.de>
Sun, 29 Oct 1995 20:36:22 +0100
changeset 109 9e1383121df4
parent 100 0300e64bb883
child 114 e577a2f332d0
permissions -rw-r--r--
*** empty log message ***

"
 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.
"

'From Smalltalk/X, Version:2.10.7 on 7-sep-1995 at 10:06:38 pm'                 !

Object subclass:#WindowBuilder
	 instanceVariableNames:'topView application bindings aspects focusSequence'
	 classVariableNames:''
	 poolDictionaries:''
	 category:'Interface-Support-UI'
!

!WindowBuilder 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.
"
!

version
"
$Header: /cvs/stx/stx/libview2/WindowBuilder.st,v 1.8 1995-09-09 02:30:16 claus Exp $
"
!

documentation
"
    a no-op class, for systems which do not use the UIBuilder.
    Concrete subclasses know how to create a view (with components) from
    some interface spec. Currently, an experimantal version of UIBuilder exists,
    and more may be added in the future (for example, to parse different UI
    specs - thinking of motifs UIL specs etc).
"
! !

!WindowBuilder methodsFor:'accessing'!

window
    ^ topView
!

application
    ^ application
!

focusSequence 
    ^ focusSequence
!

aspectAt:aSymbol
    aspects isNil ifTrue:[^ nil].
    ^ aspects at:aSymbol ifAbsent:nil
!

application:anApplicationModel
    application := anApplicationModel
!

window:aView
    topView := aView
!

bindings
    ^ bindings
!

bindings:aDictionary
    bindings := aDictionary
!

componentAt:name put:aComponent
    bindings isNil ifTrue:[
	bindings := IdentityDictionary new.
    ].
    bindings at:name put:aComponent
!

aspectAt:aSymbol put:aModel
    aspects isNil ifTrue:[
	aspects := IdentityDictionary new
    ].
    ^ aspects at:aSymbol put:aModel
!

namedComponents
    ^ bindings
!

componentAt:name
    bindings isNil ifTrue:[^ nil].
    ^ bindings at:name ifAbsent:nil
!

windowGroup
    ^ topView windowGroup
!

source:anApplicationModel
    application := anApplicationModel
! !

!WindowBuilder methodsFor:'operation'!

openWithExtent:aPoint
    "open my topView, as previously created, but override
     the extent."

    self openWithExtent:aPoint andType:#normal 
!

openWithExtent:ext andType:type
    "open my topView, as previously created. The type argument
     may be #dialog or #normal, and specifies if the view should
     be opened as a modal view, blocking interaction to the currently 
     active view, or as a normal view."

    ext notNil ifTrue:[
	topView extent:ext
    ].
    type == #dialog ifTrue:[
	topView openModal.
	^ self
    ].

    type == #normal ifTrue:[
	topView open.
	^ self
    ].
    "
     if ST-80 supports more types - these may be added later
    "
    self halt:'unimplemented'
!

buildFromSpec:aSpec
    self subclassResponsibility
!

open
    "open my topView, as previously created"

    self openWithExtent:nil andType:#normal 
!

openDialog
    "open my topView, as previously created as a modal view,
     blocking interaction to the currently active view."

    self openWithExtent:nil andType:#dialog
!

openDialogWithExtent:ext
    "open my topView, as previously created as a modal view,
     blocking interaction to the currently active view."

    self openWithExtent:ext andType:#dialog
!

closeRequest
    topView destroy
! !

!WindowBuilder methodsFor:'spec creation callbacks'!

createdComponent:aView forSpec:spec

    "Modified: 5.9.1995 / 21:42:54 / claus"
! !