Imports System.ComponentModel
Imports System.Drawing
Imports System.Windows.Forms

Public Class BarButton
  Inherits System.Windows.Forms.Button
  Implements Command
  Protected contxt As Context
  Public Sub New()
    MyBase.New()

    'This call is required by the Win Form Designer.
    InitializeComponent()

    'TODO: Add any initialization after the InitializeComponent() call
  End Sub

  'UserControl1 overrides dispose to clean up the component list.
  Protected Overloads Overrides Sub Dispose(ByVal dispose As Boolean)
    MyBase.Dispose(dispose)
    components.Dispose()
  End Sub

#Region " Windows Form Designer generated code "

  'Required by the Windows Form Designer
  Private components As System.ComponentModel.Container

  Dim WithEvents BarButton As System.Windows.Forms.UserControl

  'NOTE: The following procedure is required by the Windows Form Designer
  'It can be modified using the Windows Form Designer.  
  'Do not modify it using the code editor.
  Private Sub InitializeComponent()
    components = New System.ComponentModel.Container()
  End Sub

#End Region

  Public Sub setContext(ByVal cont As Context)
    contxt = cont
  End Sub

  Public Overridable Sub Execute() Implements Command.Execute
    contxt.setBarPlot()
    contxt.plot()
  End Sub

End Class
