home *** CD-ROM | disk | FTP | other *** search
- " Implementation of graphics boxes (a la TeX) for Self"
-
- "
- *
- * aaviews.self,v 1.2 1993/07/13 21:46:56 richards Exp
- *
- * /home/2user2/richards/cvs/491/aa/aaviews.self,v 1.2 1993/07/13 21:46:56 richards Exp
- *
- * aaviews.self,v
- # Revision 1.2 1993/07/13 21:46:56 richards
- # July 13 checkin.
- #
- # Revision 1.1 1993/06/24 21:24:27 richards
- # Split drawing out of boites and into light weight views.
- #
- *
- *
- "
-
-
- aa _AddSlotsIfAbsent: (| views* = (). |)
- aa views _AddSlotsIfAbsent: (| traits = () |)
- aa views _AddSlotsIfAbsent: (| prototypes* = () |)
-
- aa views traits _AddSlotsIfAbsent: (|
- boiteView = ().
- |)
-
- aa views prototypes _AddSlotsIfAbsent: (|
- boiteView = ().
- |)
-
- aa views traits boiteView _Define: (|
- parent** = traits views lwView.
-
- copying* = (|
- copyForBoite: b At: pt = (| nv. |
- nv: copyUnrealised.
- nv model: b.
- nv area: ((pt x)@(pt y - b upY))#((pt x + b xSize)@(pt y + b downY)).
- nv boiteOriginPt: pt.
- nv isHighlighted: isHighlighted.
- nv
- ).
- |).
-
- drawing* = (|
- simpleRedraw = (
- model drawOn: self At: boiteOriginPt.
- ).
- highlight = (
- 'highliting: ' print. model printLine.
- isHighlighted: true.
- ).
- unHighlight = (
- isHighlighted: false.
- ).
- drawAt: p String: s = (
- heavySuperView drawAt: p String: s
- ).
- drawFrom: o To: c Width: w = (
- heavySuperView drawFrom: o To: c Width: w
- ).
- drawFrom: o To: c = (
- heavySuperVIew drawFrom: o To: c
- ).
- drawLine: r = (
- heavySuperView drawLine: r
- ).
- drawFrom: o For: c = (
- heavySuperView drawFrom: o For: c
- ).
- drawAt: p String: s InFontNamed: fname = (
- drawAt: p String: s InFont: (manager openFontNamed: fname).
- ).
- drawAt: p String: s InFont: fontStruct = ( | fg. bg. |
- isHighlighted ifTrue: [
- fg: manager gcWithCharacteristics: [ | :aGc |
- (aGc fontId = fontStruct fid) &&
- (aGc whitePixel = manager display screen blackPixel) &&
- (aGc blackPixel = manager display screen whitePixel)
- ] MakeIt: [ | :aGc |
- aGc fontId: fontStruct fid.
- aGc whitePixel: manager display screen blackPixel.
- aGc blackPixel: manager display screen whitePixel.
- ].
- bg: manager gc.
- ] False: [
- fg: manager gcWithCharacteristics: [ | :aGc |
- (aGc fontId = fontStruct fid) &&
- (aGc blackPixel = manager display screen blackPixel) &&
- (aGc whitePixel = manager display screen whitePixel)
- ] MakeIt: [ | :aGc |
- aGc fontId: fontStruct fid.
- aGc blackPixel: manager display screen blackPixel.
- aGc whitePixel: manager display screen whitePixel.
- aGc
- ].
- bg: manager gcb.
- ].
- window fillRectangle: area GC: bg.
- window drawString: s At: p GC: fg.
- ).
-
- |).
-
- viewEvents* = (|
- ^ selectDown: pt WithSelection: es = (
- (area includes: pt) ifTrue: [
- es isValidSelection ifFalse: [
- " new selection "
- es becomeSelectedWith: self.
- ] True: [
- " there was an old selection "
- (es selectedBoite contains: model) ifTrue: [
- " we selected the same object again "
- " -> expand if possible"
- es becomeEnclosingEqn.
- ] False: [
- es becomeSelectedWith: self.
- ].
- ].
- ].
- ).
- |).
- |)
-
- aa views prototypes boiteView _Define: prototypes views lwView
- aa views prototypes boiteView _AddSlots: (|
- parent* = aa views traits boiteView.
- boiteOriginPt.
- isHighlighted <- false.
- |)
-
-