Files
Emmanuele Sassi deb1b8187d EgtUILib :
- aggiornati tutti i bottoni.
2014-09-14 19:23:56 +00:00

86 lines
2.4 KiB
VB.net

Imports EgtUILib.EgtInterface
Public Class tsZoom
Private m_scene As Scene
'Create buttons
Dim btnZoomAll As New ToolStripButton
Dim btnZoomIn As New ToolStripButton
Dim btnZoomOut As New ToolStripButton
Sub New()
MyBase.New()
Me.Anchor = AnchorStyles.None
Me.Dock = DockStyle.None
' Chiamata richiesta dalla finestra di progettazione.
InitializeComponent()
AddButtons()
' Aggiungere le eventuali istruzioni di inizializzazione dopo la chiamata a InitializeComponent().
End Sub
Public Sub SetScene(ByRef scene As Scene)
m_scene = scene
End Sub
Public Sub AddButtons()
With btnZoomAll
'Set properties
.Name = "btnZoomAll"
.AutoToolTip = True
.DisplayStyle = ToolStripItemDisplayStyle.Image
.Image = EgtUILib.My.Resources.Resources.ZoomAll
.Text = ""
.ToolTipText = "ZoomAll"
End With
With btnZoomIn
'Set properties
.Name = "btnZoomIn"
.AutoToolTip = True
.DisplayStyle = ToolStripItemDisplayStyle.Image
.Image = EgtUILib.My.Resources.Resources.ZoomIn
.Text = ""
.ToolTipText = "ZoomIn"
End With
With btnZoomOut
'Set properties
.Name = "btnZoomOut"
.AutoToolTip = True
.DisplayStyle = ToolStripItemDisplayStyle.Image
.Image = EgtUILib.My.Resources.Resources.ZoomOut
.Text = ""
.ToolTipText = "ZoomOut"
End With
'Create a Handle to a Click Event
AddHandler btnZoomAll.Click, AddressOf btnZoomAll_Click
AddHandler btnZoomIn.Click, AddressOf btnZoomIn_Click
AddHandler btnZoomOut.Click, AddressOf btnZoomOut_Click
'Add to toolstrip
MyClass.Items.Add(btnZoomAll)
MyClass.Items.Add(btnZoomIn)
MyClass.Items.Add(btnZoomOut)
End Sub
'The Click Events
Private Sub btnZoomAll_Click(sender As Object, e As System.EventArgs)
m_scene.ZoomAll()
End Sub
Private Sub btnZoomIn_Click(sender As Object, e As System.EventArgs)
m_scene.ZoomIn()
End Sub
Private Sub btnZoomOut_Click(sender As Object, e As System.EventArgs)
m_scene.ZoomOut()
End Sub
End Class