VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "Redecorator"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
'Klasa Redecorator
'Dekoruje zawartą w niej instancję dekoratora
Implements AbstractDecorator
Private deco As AbstractDecorator
Private pic As PictureBox
'--------
Public Sub init(d As Decorator)
  Set deco = d
  Set pic = deco.getControl
End Sub
'--------
Private Function AbstractDecorator_getControl() As Control
  Set AbstractDecorator_getControl = pic
End Function
'--------
Private Sub AbstractDecorator_init(c As Control, title As String)
 
End Sub
'--------
Private Sub AbstractDecorator_initContents(d As AbstractDecorator)
  init d
End Sub
'--------
Private Sub AbstractDecorator_mouseDown()
  deco.mouseDown
  AbstractDecorator_paint
End Sub
'--------
Private Sub AbstractDecorator_mouseMove(ByVal x As Single, ByVal y As Single)
  deco.mouseMove x, y
  AbstractDecorator_paint
End Sub
'--------
Private Sub AbstractDecorator_mouseUp()
  deco.mouseUp
End Sub
'--------
Private Sub AbstractDecorator_paint()
  Dim w As Integer, h As Integer
  w = pic.Width
  h = pic.Height
  'Narysuj ukosny czerwony odcinek
  pic.Line (0, 0)-(w, h), vbRed
  deco.paint                      'Odrysuj zawarty dekorator
End Sub
'--------
Private Sub AbstractDecorator_refresh()
  deco.refresh
  AbstractDecorator_paint
End Sub
