Files
EgtUILib/gbLookFrom.vb
Dario Sassi 1d1693bd5e EgtUILib 1.5j5 :
- aggiunti operatori e trasformazioni su Vector, Point e Frame3d
- modifiche a funzioni di apertura file di Scene
2014-10-20 14:29:37 +00:00

131 lines
3.6 KiB
VB.net

Public Class gbLookFrom
Private m_scene As Scene
Dim tlpPanel As New TableLayoutPanel
'Create buttons
Dim btnTop As New Button
Dim btnIso As New Button
Dim btnFront As New Button
Dim btnBack As New Button
Dim btnLeft As New Button
Dim btnRight As New Button
Sub New()
Me.Anchor = AnchorStyles.None
Me.Dock = DockStyle.None
'Add tlpPanel to gbLookFrom
Me.Controls.Add(tlpPanel)
' 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 tlpPanel
'Set properties
.ColumnCount = 3
.ColumnStyles.Add(New ColumnStyle(SizeType.Percent, 33))
.ColumnStyles.Add(New ColumnStyle(SizeType.Percent, 33))
.ColumnStyles.Add(New ColumnStyle(SizeType.Percent, 33))
.Dock = DockStyle.Fill
.RowCount = 2
.RowStyles.Add(New RowStyle(SizeType.Percent, 50))
.RowStyles.Add(New RowStyle(SizeType.Percent, 50))
.Controls.Add(btnTop, 0, 0)
.Controls.Add(btnIso, 0, 1)
.Controls.Add(btnFront, 1, 0)
.Controls.Add(btnBack, 1, 1)
.Controls.Add(btnLeft, 2, 0)
.Controls.Add(btnRight, 2, 1)
End With
With btnTop
'Set properties
.Dock = DockStyle.Fill
.Name = "btnTop"
.Text = "Top"
End With
With btnIso
'Set properties
.Dock = DockStyle.Fill
.Name = "btnIso"
.Text = "Iso"
End With
With btnFront
'Set properties
.Dock = DockStyle.Fill
.Name = "btnFront"
.Text = "Front"
End With
With btnBack
'Set properties
.Dock = DockStyle.Fill
.Name = "btnBack"
.Text = "Back"
End With
With btnLeft
'Set properties
.Dock = DockStyle.Fill
.Name = "btnLeft"
.Text = "Left"
End With
With btnRight
'Set properties
.Dock = DockStyle.Fill
.Name = "btnRight"
.Text = "Right"
End With
'Create a Handle to a Click Event
AddHandler btnTop.Click, AddressOf btnTop_Click
AddHandler btnIso.Click, AddressOf btnIso_Click
AddHandler btnFront.Click, AddressOf btnFront_Click
AddHandler btnBack.Click, AddressOf btnBack_Click
AddHandler btnLeft.Click, AddressOf btnLeft_Click
AddHandler btnRight.Click, AddressOf btnRight_Click
End Sub
'The Click Events
Private Sub btnTop_Click(sender As Object, e As System.EventArgs)
m_scene.TopView()
End Sub
Private Sub btnIso_Click(sender As Object, e As System.EventArgs)
m_scene.IsoViewSW()
End Sub
Private Sub btnFront_Click(sender As Object, e As System.EventArgs)
m_scene.FrontView()
End Sub
Private Sub btnBack_Click(sender As Object, e As System.EventArgs)
m_scene.BackView()
End Sub
Private Sub btnLeft_Click(sender As Object, e As System.EventArgs)
m_scene.LeftView()
End Sub
Private Sub btnRight_Click(sender As Object, e As System.EventArgs)
m_scene.RightView()
End Sub
End Class