PageRenderTime 116ms CodeModel.GetById 51ms app.highlight 58ms RepoModel.GetById 2ms app.codeStats 0ms

/Source Code/PowerSong/Styles/frmEditStyle.vb

#
Visual Basic | 477 lines | 314 code | 126 blank | 37 comment | 0 complexity | 22fb1c59eaa0719e8df4117875e48d9a MD5 | raw file
  1Imports System.Windows.Forms
  2Imports PowerSong.SongDatabase
  3Imports PowerSong.SongDatabase.Style.ETextAlignment
  4Imports PowerSong.SongDatabase.Style.EBackgroundType
  5Imports PowerSong.Projection
  6
  7Public Class frmEditStyle
  8
  9    Private FStyle As Style = Nothing
 10    Private FSelectedProjectlet As ProjectletStyle = Nothing
 11    Private FStyles As Styles = Nothing
 12    Private FProjector As Projector = Nothing
 13    Private FIgnoreControlEvents As Boolean = True
 14
 15    Dim ProjectletHolderObject As New Object
 16
 17    Public Sub New(ByVal style As Style, ByVal styles As Styles)
 18        InitializeComponent()
 19        FStyles = styles
 20        FStyle = style
 21        FSelectedProjectlet = style("Verse")
 22    End Sub
 23
 24    Private Sub frmEditStyle_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
 25
 26        ' Add items to the alignment drop down combo box
 27        cboTextAlignment.Items.Clear()
 28        cboTextAlignment.Items.Add(New ListItem(Of Style.ETextAlignment)("Top left", Style.ETextAlignment.TopLeft))
 29        cboTextAlignment.Items.Add(New ListItem(Of Style.ETextAlignment)("Top middle", Style.ETextAlignment.TopMiddle))
 30        cboTextAlignment.Items.Add(New ListItem(Of Style.ETextAlignment)("Top right", Style.ETextAlignment.TopRight))
 31        cboTextAlignment.Items.Add(New ListItem(Of Style.ETextAlignment)("Center left", Style.ETextAlignment.MiddleLeft))
 32        cboTextAlignment.Items.Add(New ListItem(Of Style.ETextAlignment)("Center middle", Style.ETextAlignment.MiddleMiddle))
 33        cboTextAlignment.Items.Add(New ListItem(Of Style.ETextAlignment)("Center right", Style.ETextAlignment.MiddleRight))
 34        cboTextAlignment.Items.Add(New ListItem(Of Style.ETextAlignment)("Bottom left", Style.ETextAlignment.BottomLeft))
 35        cboTextAlignment.Items.Add(New ListItem(Of Style.ETextAlignment)("Bottom middle", Style.ETextAlignment.BottomMiddle))
 36        cboTextAlignment.Items.Add(New ListItem(Of Style.ETextAlignment)("Bottom right", Style.ETextAlignment.BottomRight))
 37
 38        ' Add items to the available projectlets drop down combo box
 39        cboSelectedProjectlet.Items.Clear()
 40        cboSelectedProjectlet.Items.Add(New ListItem(Of String)("Main Verse Text", "Verse"))
 41        cboSelectedProjectlet.Items.Add(New ListItem(Of String)("Song Title", "Title"))
 42        cboSelectedProjectlet.Items.Add(New ListItem(Of String)("Copyright Line", "Copyright"))
 43
 44        ' Add items to the display option drop down combo box
 45        cboDisplayOption.Items.Clear()
 46        cboDisplayOption.Items.Add(New ListItem(Of Style.EDisplayOption)("Always", Style.EDisplayOption.Always))
 47        cboDisplayOption.Items.Add(New ListItem(Of Style.EDisplayOption)("Never", Style.EDisplayOption.Never))
 48        cboDisplayOption.Items.Add(New ListItem(Of Style.EDisplayOption)("First verse", Style.EDisplayOption.FirstVerse))
 49        cboDisplayOption.Items.Add(New ListItem(Of Style.EDisplayOption)("Second verse", Style.EDisplayOption.SecondVerse))
 50        cboDisplayOption.Items.Add(New ListItem(Of Style.EDisplayOption)("Last verse", Style.EDisplayOption.LastVerse))
 51        cboDisplayOption.Items.Add(New ListItem(Of Style.EDisplayOption)("First verse (once)", Style.EDisplayOption.FirstVerseOnce))
 52        cboDisplayOption.Items.Add(New ListItem(Of Style.EDisplayOption)("Second verse (once)", Style.EDisplayOption.SecondVerseOnce))
 53        cboDisplayOption.Items.Add(New ListItem(Of Style.EDisplayOption)("Last verse (once)", Style.EDisplayOption.LastVerseOnce))
 54
 55        ' Add items to the font effect drop down combo box
 56        cboFontEffect.Items.Clear()
 57        cboFontEffect.Items.Add(New ListItem(Of Style.ETextEffect)("None", Style.ETextEffect.None))
 58        cboFontEffect.Items.Add(New ListItem(Of Style.ETextEffect)("Inner outline", Style.ETextEffect.InnerOutline))
 59        cboFontEffect.Items.Add(New ListItem(Of Style.ETextEffect)("Outline", Style.ETextEffect.Outline))
 60        cboFontEffect.Items.Add(New ListItem(Of Style.ETextEffect)("Shadow", Style.ETextEffect.Shadow))
 61        cboFontEffect.Items.Add(New ListItem(Of Style.ETextEffect)("Outlined box", Style.ETextEffect.OutlineBox))
 62        cboFontEffect.Items.Add(New ListItem(Of Style.ETextEffect)("Filled box", Style.ETextEffect.FilledBox))
 63
 64        ' Set up projectlet area control
 65        pnlProjectlet.Clear()
 66        Dim Widget As New Widget(ProjectletHolderObject, New RectangleF(0, 0, 1, 0))
 67        AddHandler Widget.Draw, AddressOf HandleDrawWidget
 68        AddHandler Widget.AreaChanged, AddressOf HandleWidgetMovement
 69        pnlProjectlet.AddWidget(Widget)
 70
 71        ' Set up preview projection
 72        InitializeProjector()
 73        SetControlsToReflectStyle(FStyle)
 74        FIgnoreControlEvents = False
 75        cboSelectedProjectlet.SelectedIndex = 0
 76
 77    End Sub
 78
 79    Private Sub OK_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK_Button.Click
 80
 81        ' Save the changed style
 82        UpdateStyle(FStyle, FSelectedProjectlet)
 83        FStyles.EditStyle(FStyle.StyleID, FStyle)
 84
 85        ' Close the form
 86        Me.DialogResult = System.Windows.Forms.DialogResult.OK
 87        Me.Close()
 88
 89    End Sub
 90
 91    Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel_Button.Click
 92        Me.DialogResult = System.Windows.Forms.DialogResult.Cancel
 93        Me.Close()
 94    End Sub
 95
 96    Private Sub btnSetBackgroundImage_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSetBackgroundImage.Click
 97
 98        If dlgOpenImage.ShowDialog = Windows.Forms.DialogResult.OK Then
 99            txtBackgroundImage.Text = dlgOpenImage.FileName
100            FStyle.DefaultBackgroundImage = dlgOpenImage.FileName
101            UpdateAllPreviews()
102        End If
103
104    End Sub
105
106    Private Sub btnSelectSolidColour_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSelectSolidColour.Click, pbSolidColour.Click
107
108        If dlgSelectColour.ShowDialog = Windows.Forms.DialogResult.OK Then
109            pbSolidColour.BackColor = dlgSelectColour.Color
110            lblFontAppearance.BackColor = dlgSelectColour.Color
111            FStyle.DefaultBackgroundColour = dlgSelectColour.Color
112            UpdateAllPreviews()
113        End If
114
115    End Sub
116
117    Private Sub optUseImage_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles optUseImage.CheckedChanged
118
119        If FIgnoreControlEvents Then Exit Sub
120
121        If optUseImage.Checked Then
122
123            btnSelectSolidColour.Enabled = False
124            btnSetBackgroundImage.Enabled = True
125            txtBackgroundImage.Enabled = True
126            If txtBackgroundImage.Text = "" Then
127                ' FStyle is not set until the form is fully loaded, which prevents the button being 'clicked'
128                If FStyle IsNot Nothing Then
129                    If optUseImage.Checked Then FStyle.BackgroundType = Image
130                    btnSetBackgroundImage_Click(sender, e)
131                End If
132            End If
133
134            ' Update the style, preview projection and placement controls
135            UpdateAllPreviews()
136
137        End If
138
139    End Sub
140
141    Private Sub optUseSolidColour_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles optUseSolidColour.CheckedChanged
142
143        If FIgnoreControlEvents Then Exit Sub
144
145        If optUseSolidColour.Checked Then
146
147            btnSelectSolidColour.Enabled = True
148            btnSetBackgroundImage.Enabled = False
149            txtBackgroundImage.Enabled = False
150            If optUseSolidColour.Checked Then FStyle.BackgroundType = SolidColour
151
152            ' Update the style, preview projection and placement controls
153            UpdateAllPreviews()
154
155        End If
156
157    End Sub
158
159    Private Sub btnSetAppearance_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSetAppearance.Click
160
161        ' First set up the style dialog box
162        dlgFont.Font = New Font(FSelectedProjectlet.FontName, _
163                                FSelectedProjectlet.FontSize, _
164                                FSelectedProjectlet.FontStyle, _
165                                GraphicsUnit.Point)
166        dlgFont.Color = FSelectedProjectlet.FontColour
167
168        ' Show the font dialog
169        If dlgFont.ShowDialog = Windows.Forms.DialogResult.OK Then
170
171            ' Reflect the changes made to the sample text
172            lblFontAppearance.Text = dlgFont.Font.Name
173            lblFontAppearance.Font = New Font(dlgFont.Font.Name, lblFontAppearance.Font.Size, dlgFont.Font.Style, GraphicsUnit.Pixel)
174            lblFontSize.Text = dlgFont.Font.SizeInPoints.ToString
175
176            ' Update the style, preview projection and placement controls
177            UpdateStyle(FStyle, FSelectedProjectlet)
178            UpdateAllPreviews()
179
180        End If
181
182    End Sub
183
184    Private Sub tmrProjection_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrProjection.Tick
185        FProjector.Update()
186    End Sub
187
188    Private Sub btnSetEffectColour_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSetEffectColour.Click, pbEffectColour.Click
189
190        dlgSelectColour.Color = pbEffectColour.BackColor
191        If dlgSelectColour.ShowDialog = Windows.Forms.DialogResult.OK Then
192            pbEffectColour.BackColor = dlgSelectColour.Color
193        End If
194
195        ' Update the style
196        UpdateStyle(FStyle, FSelectedProjectlet)
197        FProjector.ProjectletByName(FSelectedProjectlet.Category).FontEffectColour = dlgSelectColour.Color
198
199    End Sub
200
201    Private Sub cboFontEffect_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboFontEffect.SelectedIndexChanged
202
203        If FIgnoreControlEvents Then Exit Sub
204
205        UpdateStyle(FStyle, FSelectedProjectlet)
206        Dim SelectedEffect As ListItem(Of Style.ETextEffect) = cboFontEffect.SelectedItem
207        FProjector.ProjectletByName(FSelectedProjectlet.Category).FontEffect = SelectedEffect.Key
208
209    End Sub
210
211    Private Sub btnSetFontColour_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSetFontColour.Click, pbFontColour.Click
212
213        dlgSelectColour.Color = pbFontColour.BackColor
214        If dlgSelectColour.ShowDialog = Windows.Forms.DialogResult.OK Then
215            pbFontColour.BackColor = dlgSelectColour.Color
216            lblFontAppearance.ForeColor = dlgSelectColour.Color
217        End If
218
219        ' Update the style
220        UpdateStyle(FStyle, FSelectedProjectlet)
221        FProjector.ProjectletByName(FSelectedProjectlet.Category).FontColour = dlgSelectColour.Color
222
223    End Sub
224
225#Region " Helper Methods "
226
227    Private Sub SetControlsToReflectStyle(ByVal style As Style)
228
229        ' Update main details
230        txtName.Text = style.Name
231        pbSolidColour.BackColor = style.DefaultBackgroundColour
232        txtBackgroundImage.Text = style.DefaultBackgroundImage
233        Select Case style.BackgroundType
234            Case Image : optUseImage.Checked = True
235            Case SolidColour : optUseSolidColour.Checked = True
236        End Select
237        lblFontAppearance.BackColor = style.DefaultBackgroundColour
238
239        ' Update fading
240        cboGeneralFade.SelectedIndex = style.GeneralFade
241        cboVerseFade.SelectedIndex = style.VerseFade
242        txtGeneralFadeDuration.Text = style.GeneralFadeDuration.ToString
243        txtVerseFadeDuration.Text = style.VerseFadeDuration.ToString
244
245    End Sub
246
247    Private Sub UpdateAllPreviews()
248        UpdateProjector()
249        UpdatePlacer()
250    End Sub
251
252    Private Sub UpdateStyle(ByVal style As Style, _
253                            ByVal projectlet As ProjectletStyle)
254
255        ' Update main style details
256        style.Name = txtName.Text
257        If optUseImage.Checked Then
258            style.BackgroundType = Image
259        ElseIf optUseSolidColour.Checked Then
260            style.BackgroundType = SolidColour
261        End If
262
263        style.DefaultBackgroundImage = txtBackgroundImage.Text
264        style.DefaultBackgroundColour = pbSolidColour.BackColor
265
266        ' Update projectlet
267        projectlet.Area = pnlProjectlet.GetWidgetContainingObject(ProjectletHolderObject).Area
268        projectlet.Alignment = DirectCast(cboTextAlignment.SelectedItem, ListItem(Of Style.ETextAlignment)).Key
269        projectlet.FontName = lblFontAppearance.Font.Name
270        projectlet.FontStyle = lblFontAppearance.Font.Style
271        projectlet.FontColour = pbFontColour.BackColor
272        projectlet.FontSize = CInt(lblFontSize.Text)
273        projectlet.FontEffect = DirectCast(cboFontEffect.SelectedItem, ListItem(Of Style.ETextEffect)).Key
274        projectlet.FontEffectColour = pbEffectColour.BackColor
275        projectlet.DisplayOption = DirectCast(cboDisplayOption.SelectedItem, ListItem(Of Style.EDisplayOption)).Key
276
277        ' Update fading
278        style.GeneralFade = cboGeneralFade.SelectedIndex
279        style.VerseFade = cboVerseFade.SelectedIndex
280        style.GeneralFadeDuration = CInt(txtGeneralFadeDuration.Text)
281        style.VerseFadeDuration = CInt(txtVerseFadeDuration.Text)
282
283    End Sub
284
285    Private Sub UpdateProjector()
286
287        ' Fade out
288        FProjector.FadeToBlack(FStyle.GeneralFadeDuration)
289
290        ' Configure the projector background
291        Select Case FStyle.BackgroundType
292            Case SolidColour : FProjector.SetBackgroundColour(pbSolidColour.BackColor)
293            Case Image : FProjector.SetBackgroundImage(txtBackgroundImage.Text)
294        End Select
295
296        ' Configure projectlets
297        For Each Item As Projectlet In FProjector.Projectlets
298            Dim SubStyle As ProjectletStyle = FStyle.ProjectletsByName(Item.Category)
299
300            ' Configure projectlet style on projector
301            FProjector.SetProjectletStyle(Item, SubStyle)
302
303            ' Set text
304            FProjector.SetText(Item, 0, 2, GetSampleText(SubStyle.Category), True)
305
306        Next
307
308        ' Fade in
309        FProjector.FadeToText(FStyle.GeneralFadeDuration)
310
311    End Sub
312
313    Private Sub UpdatePlacer()
314        Dim Widget As Widget = pnlProjectlet.GetWidgetContainingObject(ProjectletHolderObject)
315        Widget.Area = FSelectedProjectlet.Area
316        pnlProjectlet.Invalidate()
317    End Sub
318
319    Private Function GetSampleText(ByVal category As String) As String
320
321        Dim Result As String = String.Empty
322        Select Case category
323            Case "Title" : Result = "The Song Title"
324            Case "Verse" : Result = "Sample of verse, line 1." + Environment.NewLine + _
325                                    "Sample of verse, line 2." + Environment.NewLine + _
326                                    "Sample of verse, line 3." + Environment.NewLine + _
327                                    "Sample of verse, line 4." + Environment.NewLine + _
328                                    "Sample of verse, line 5." + Environment.NewLine + _
329                                    "Sample of verse, line 6." + Environment.NewLine + _
330                                    "Sample of verse, line 7."
331            Case "Copyright" : Result = "© 2010 Copyright Line Sample"
332        End Select
333        Return Result
334
335    End Function
336
337    Private Sub InitializeProjector()
338
339        FProjector = New Projector(pbPreview)
340        FProjector.Projectlets.Add(New Projectlet("Title", ProjectletStyle.TITLE_TAG))
341        FProjector.Projectlets.Add(New Projectlet("Verse", ProjectletStyle.VERSE_TAG))
342        FProjector.Projectlets.Add(New Projectlet("Copyright", ProjectletStyle.SIMPLE_COPYRIGHT_TAG))
343
344    End Sub
345
346#End Region
347
348    Private Sub cboSelectedProjectlet_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboSelectedProjectlet.SelectedIndexChanged
349
350        If FIgnoreControlEvents Then Exit Sub
351        If cboSelectedProjectlet.SelectedIndex = -1 Then Exit Sub
352
353        FIgnoreControlEvents = True
354
355        Dim SelectedProjectletName As String = DirectCast(cboSelectedProjectlet.SelectedItem, ListItem(Of String)).Key
356        FSelectedProjectlet = FStyle(SelectedProjectletName)
357
358        ' Update projectlet font information
359        lblFontAppearance.Text = FSelectedProjectlet.FontName
360        lblFontAppearance.Font = New Font(FSelectedProjectlet.FontName, lblFontAppearance.Font.Size, FSelectedProjectlet.FontStyle, GraphicsUnit.Pixel)
361        lblFontAppearance.ForeColor = FSelectedProjectlet.FontColour
362        lblFontSize.Text = FSelectedProjectlet.FontSize
363        pbEffectColour.BackColor = FSelectedProjectlet.FontEffectColour
364        pbFontColour.BackColor = FSelectedProjectlet.FontColour
365
366        ' Update projectlet location
367        pnlProjectlet.GetWidgetContainingObject(ProjectletHolderObject).Area = FSelectedProjectlet.Area
368
369        ' Update font effect
370        For Each Value As ListItem(Of Style.ETextEffect) In cboFontEffect.Items
371            If Value.Key = FSelectedProjectlet.FontEffect Then cboFontEffect.SelectedItem = Value
372        Next
373
374        ' Update projectlet display option
375        For Each Value As ListItem(Of Style.EDisplayOption) In cboDisplayOption.Items
376            If Value.Key = FSelectedProjectlet.DisplayOption Then cboDisplayOption.SelectedItem = Value
377        Next
378
379        ' Update projectlet text alignment
380        For Each Value As ListItem(Of Style.ETextAlignment) In cboTextAlignment.Items
381            If Value.Key = FSelectedProjectlet.Alignment Then cboTextAlignment.SelectedItem = Value
382        Next
383
384        FIgnoreControlEvents = False
385
386        UpdateAllPreviews()
387
388    End Sub
389
390    Private Sub HandleFontTransparencySelection(ByVal sender As System.Object, ByVal e As System.EventArgs) _
391    Handles mnuFTrans0.Click, mnuFTrans1.Click, mnuFTrans2.Click, mnuFTrans3.Click, mnuFTrans4.Click, mnuFTrans5.Click, mnuFTrans6.Click, mnuFTrans7.Click, mnuFTrans8.Click, mnuFTrans9.Click
392
393        Dim Value As Integer = DirectCast(sender, ToolStripMenuItem).Tag
394        Dim Transparency As Byte = CDbl(255) * (CDbl(Value) / 100)
395
396        Dim Colour1 As Color = pbEffectColour.BackColor
397        Dim Colour2 As Color = Color.FromArgb(255 - Transparency, Colour1.R, Colour1.G, Colour1.B)
398        pbEffectColour.BackColor = Colour2
399        FSelectedProjectlet.FontColour = Colour2
400        UpdateStyle(FStyle, FSelectedProjectlet)
401        UpdateAllPreviews()
402
403    End Sub
404
405    Private Sub HandleEffectTransparencySelection(ByVal sender As System.Object, ByVal e As System.EventArgs) _
406    Handles mnuETrans0.Click, mnuETrans1.Click, mnuETrans2.Click, mnuETrans3.Click, mnuETrans4.Click, mnuETrans5.Click, mnuETrans6.Click, mnuETrans7.Click, mnuETrans8.Click, mnuETrans9.Click
407
408        Dim Value As Integer = DirectCast(sender, ToolStripMenuItem).Tag
409        Dim Transparency As Byte = CDbl(255) * (CDbl(Value) / 100)
410
411        Dim Colour1 As Color = pbFontColour.BackColor
412        Dim Colour2 As Color = Color.FromArgb(255 - Transparency, Colour1.R, Colour1.G, Colour1.B)
413        pbFontColour.BackColor = Colour2
414        FSelectedProjectlet.FontEffectColour = Colour2
415        UpdateStyle(FStyle, FSelectedProjectlet)
416        UpdateAllPreviews()
417
418    End Sub
419
420    Private Sub cboTextAlignment_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboTextAlignment.SelectedIndexChanged
421
422        If FIgnoreControlEvents Then Exit Sub
423
424        Dim SelectedItem As ListItem(Of Style.ETextAlignment) = cboTextAlignment.SelectedItem
425        FProjector.ProjectletByName(FSelectedProjectlet.Category).FontFormat = Projectlet.CreateFontFormat(SelectedItem.Key)
426        FSelectedProjectlet.Alignment = SelectedItem.Key
427        UpdateStyle(FStyle, FSelectedProjectlet)
428
429        pnlProjectlet.Invalidate()
430
431    End Sub
432
433    Private Sub cboDisplayOption_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboDisplayOption.SelectedIndexChanged
434
435        If FIgnoreControlEvents Then Exit Sub
436
437        Dim SelectedItem As ListItem(Of Style.EDisplayOption) = cboDisplayOption.SelectedItem
438        FProjector.ProjectletByName(FSelectedProjectlet.Category).DisplayOption = SelectedItem.Key
439        FSelectedProjectlet.DisplayOption = SelectedItem.Key
440        UpdateStyle(FStyle, FSelectedProjectlet)
441
442        pnlProjectlet.Invalidate()
443
444    End Sub
445
446    Private Sub HandleDrawWidget(ByVal graphics As Graphics, ByVal region As Rectangle)
447
448        ' Determine what text to display
449        Dim TextToDisplay As String = GetSampleText(FSelectedProjectlet.Category)
450
451        ' Determine font to use
452        Dim FontSize As Integer = Projector.GetProjectingFontSize(FSelectedProjectlet.FontSize, pnlProjectlet.Width)
453        Dim Font As New Font(FSelectedProjectlet.FontName, _
454                             FontSize, _
455                             FSelectedProjectlet.FontStyle, _
456                             GraphicsUnit.Pixel)
457
458        ' TODO: LOW: Do this better!
459        ' Create a new image
460        Dim WidgetImage As New Bitmap(region.Width, region.Height, Imaging.PixelFormat.Format32bppPArgb)
461        Dim G As Graphics = graphics.FromImage(WidgetImage)
462        G.Clear(Color.White)
463        G.DrawString(TextToDisplay, Font, Brushes.Black, New RectangleF(0, 0, region.Width, region.Height), Projectlet.CreateFontFormat(FSelectedProjectlet.Alignment))
464        graphics.DrawImageUnscaled(WidgetImage, region.Left, region.Top)
465
466    End Sub
467
468    Private Sub HandleWidgetMovement(ByVal widget As Widget)
469
470        If FIgnoreControlEvents Then Exit Sub
471
472        FSelectedProjectlet.Area = widget.Area
473        FProjector.ProjectletByName(FSelectedProjectlet.Category).Area = widget.Area
474
475    End Sub
476
477End Class