AbstractBackground.st
author Claus Gittinger <cg@exept.de>
Wed, 05 Feb 2014 14:29:03 +0100
changeset 6239 6566276ba3dc
parent 6238 d62bf03b097c
child 6955 fc29f17aeb4c
permissions -rw-r--r--
class: AbstractBackground added: #isViewBackground
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5459
7adaeea72491 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 5398
diff changeset
     1
"
7adaeea72491 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 5398
diff changeset
     2
 COPYRIGHT (c) 2009 by eXept Software AG
7adaeea72491 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 5398
diff changeset
     3
              All Rights Reserved
7adaeea72491 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 5398
diff changeset
     4
7adaeea72491 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 5398
diff changeset
     5
 This software is furnished under a license and may be used
7adaeea72491 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 5398
diff changeset
     6
 only in accordance with the terms of that license and with the
7adaeea72491 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 5398
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
7adaeea72491 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 5398
diff changeset
     8
 be provided or otherwise made available to, or used by, any
7adaeea72491 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 5398
diff changeset
     9
 other person.  No title to or ownership of the software is
7adaeea72491 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 5398
diff changeset
    10
 hereby transferred.
7adaeea72491 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 5398
diff changeset
    11
"
5398
9f94824ab735 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
"{ Package: 'stx:libview' }"
9f94824ab735 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
9f94824ab735 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
Object subclass:#AbstractBackground
9f94824ab735 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
	instanceVariableNames:''
9f94824ab735 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
	classVariableNames:''
9f94824ab735 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	poolDictionaries:''
9f94824ab735 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	category:'Graphics-Support'
9f94824ab735 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
!
9f94824ab735 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
9f94824ab735 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!AbstractBackground class methodsFor:'documentation'!
9f94824ab735 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
5459
7adaeea72491 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 5398
diff changeset
    23
copyright
7adaeea72491 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 5398
diff changeset
    24
"
7adaeea72491 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 5398
diff changeset
    25
 COPYRIGHT (c) 2009 by eXept Software AG
7adaeea72491 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 5398
diff changeset
    26
              All Rights Reserved
7adaeea72491 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 5398
diff changeset
    27
7adaeea72491 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 5398
diff changeset
    28
 This software is furnished under a license and may be used
7adaeea72491 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 5398
diff changeset
    29
 only in accordance with the terms of that license and with the
7adaeea72491 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 5398
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
7adaeea72491 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 5398
diff changeset
    31
 be provided or otherwise made available to, or used by, any
7adaeea72491 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 5398
diff changeset
    32
 other person.  No title to or ownership of the software is
7adaeea72491 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 5398
diff changeset
    33
 hereby transferred.
7adaeea72491 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 5398
diff changeset
    34
"
7adaeea72491 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 5398
diff changeset
    35
!
7adaeea72491 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 5398
diff changeset
    36
5398
9f94824ab735 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
documentation
9f94824ab735 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
"
9f94824ab735 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
    This will replace the viewBackground color.
6238
d62bf03b097c class: AbstractBackground
Claus Gittinger <cg@exept.de>
parents: 5704
diff changeset
    40
    Instances of me (and subclasses) can be set as a widget's
d62bf03b097c class: AbstractBackground
Claus Gittinger <cg@exept.de>
parents: 5704
diff changeset
    41
    viewBackground, and will get 
d62bf03b097c class: AbstractBackground
Claus Gittinger <cg@exept.de>
parents: 5704
diff changeset
    42
        fillRectangleX:x y:y width:w height:h in:aView
d62bf03b097c class: AbstractBackground
Claus Gittinger <cg@exept.de>
parents: 5704
diff changeset
    43
    messages whenever the widget wants to redraw (parts of) its background.
d62bf03b097c class: AbstractBackground
Claus Gittinger <cg@exept.de>
parents: 5704
diff changeset
    44
d62bf03b097c class: AbstractBackground
Claus Gittinger <cg@exept.de>
parents: 5704
diff changeset
    45
    See the example in GradientBackground.
5398
9f94824ab735 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
9f94824ab735 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
    [author:]
9f94824ab735 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
        Claus Gittinger
6238
d62bf03b097c class: AbstractBackground
Claus Gittinger <cg@exept.de>
parents: 5704
diff changeset
    49
d62bf03b097c class: AbstractBackground
Claus Gittinger <cg@exept.de>
parents: 5704
diff changeset
    50
    [see also:]
d62bf03b097c class: AbstractBackground
Claus Gittinger <cg@exept.de>
parents: 5704
diff changeset
    51
        GradientBackground
5398
9f94824ab735 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
"
5683
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
    53
!
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
    54
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
    55
examples
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
    56
"
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
    57
    |v|
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
    58
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
    59
    v := View new.
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
    60
    v viewBackground:(SolidBackground new color:Color red).
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
    61
    v open.
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
    62
"
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
    63
! !
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
    64
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
    65
!AbstractBackground methodsFor:'drawing'!
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
    66
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
    67
fillRectangleX:x y:y width:w height:h in:aView
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
    68
    self subclassResponsibility
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
    69
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
    70
    "Created: / 23-01-2011 / 01:59:29 / cg"
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
    71
! !
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
    72
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
    73
!AbstractBackground methodsFor:'ignored conversion'!
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
    74
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
    75
asFormOn:aDevice
5704
d7c401801223 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5683
diff changeset
    76
    self subclassResponsibility
5683
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
    77
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
    78
    "Created: / 23-01-2011 / 01:45:35 / cg"
5704
d7c401801223 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5683
diff changeset
    79
    "Modified: / 03-02-2011 / 19:55:49 / cg"
5683
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
    80
!
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
    81
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
    82
onDevice:aDevice
5704
d7c401801223 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5683
diff changeset
    83
    self subclassResponsibility
5683
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
    84
Claus Gittinger <cg@exept.de>
parents: 5459
diff changeset
    85
    "Created: / 23-01-2011 / 01:46:11 / cg"
5704
d7c401801223 comment/format in: #initializeAllPluginClasses
Claus Gittinger <cg@exept.de>
parents: 5683
diff changeset
    86
    "Modified: / 03-02-2011 / 19:55:40 / cg"
5398
9f94824ab735 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
! !
9f94824ab735 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
6239
6566276ba3dc class: AbstractBackground
Claus Gittinger <cg@exept.de>
parents: 6238
diff changeset
    89
!AbstractBackground methodsFor:'testing'!
6566276ba3dc class: AbstractBackground
Claus Gittinger <cg@exept.de>
parents: 6238
diff changeset
    90
6566276ba3dc class: AbstractBackground
Claus Gittinger <cg@exept.de>
parents: 6238
diff changeset
    91
isViewBackground
6566276ba3dc class: AbstractBackground
Claus Gittinger <cg@exept.de>
parents: 6238
diff changeset
    92
    ^ true
6566276ba3dc class: AbstractBackground
Claus Gittinger <cg@exept.de>
parents: 6238
diff changeset
    93
! !
6566276ba3dc class: AbstractBackground
Claus Gittinger <cg@exept.de>
parents: 6238
diff changeset
    94
5398
9f94824ab735 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
!AbstractBackground class methodsFor:'documentation'!
9f94824ab735 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
6239
6566276ba3dc class: AbstractBackground
Claus Gittinger <cg@exept.de>
parents: 6238
diff changeset
    97
version
6566276ba3dc class: AbstractBackground
Claus Gittinger <cg@exept.de>
parents: 6238
diff changeset
    98
    ^ '$Header: /cvs/stx/stx/libview/AbstractBackground.st,v 1.6 2014-02-05 13:29:03 cg Exp $'
6566276ba3dc class: AbstractBackground
Claus Gittinger <cg@exept.de>
parents: 6238
diff changeset
    99
!
6566276ba3dc class: AbstractBackground
Claus Gittinger <cg@exept.de>
parents: 6238
diff changeset
   100
5398
9f94824ab735 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
version_CVS
6239
6566276ba3dc class: AbstractBackground
Claus Gittinger <cg@exept.de>
parents: 6238
diff changeset
   102
    ^ '$Header: /cvs/stx/stx/libview/AbstractBackground.st,v 1.6 2014-02-05 13:29:03 cg Exp $'
5398
9f94824ab735 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
! !
6238
d62bf03b097c class: AbstractBackground
Claus Gittinger <cg@exept.de>
parents: 5704
diff changeset
   104