home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1998 November
/
pcwk_11_98a.iso
/
Wtestowe
/
SOFTSRC
/
vtrial15.exe
/
DATA.1
/
EditPart.frm
< prev
next >
Wrap
Text File
|
1996-08-18
|
10KB
|
369 lines
VERSION 4.00
Begin VB.Form EditPartForm
Caption = "Edit Part"
ClientHeight = 4095
ClientLeft = 8145
ClientTop = 1200
ClientWidth = 4590
Height = 4500
Left = 8085
LinkTopic = "Form1"
ScaleHeight = 4095
ScaleWidth = 4590
Top = 855
Width = 4710
Begin VB.Frame Frame3
Caption = "Size"
Height = 735
Left = 240
TabIndex = 15
Top = 1800
Width = 2295
Begin VB.TextBox SizeY
Enabled = 0 'False
Height = 375
Left = 1440
TabIndex = 4
Top = 240
Width = 615
End
Begin VB.TextBox SizeX
Enabled = 0 'False
Height = 375
Left = 240
TabIndex = 3
Top = 240
Width = 615
End
Begin VB.Label Label2
Alignment = 2 'Center
Caption = "by"
Enabled = 0 'False
BeginProperty Font
name = "MS Sans Serif"
charset = 0
weight = 700
size = 12
underline = 0 'False
italic = 0 'False
strikethrough = 0 'False
EndProperty
Height = 375
Left = 960
TabIndex = 16
Top = 240
Width = 375
End
End
Begin VB.Frame Frame2
Height = 615
Left = 240
TabIndex = 14
Top = 2760
Width = 4215
Begin VB.OptionButton AlignX
Caption = "Align Sideways"
Enabled = 0 'False
Height = 255
Left = 2160
TabIndex = 6
Top = 240
Width = 1935
End
Begin VB.OptionButton AlignY
Caption = "Align Up /Down"
Enabled = 0 'False
Height = 255
Left = 120
TabIndex = 5
Top = 240
Width = 1575
End
End
Begin VB.ListBox Parts
Height = 1395
ItemData = "EditPart.frx":0000
Left = 2760
List = "EditPart.frx":0019
TabIndex = 7
Top = 1200
Width = 1695
End
Begin VB.Frame Frame1
Caption = "Coordinates"
Height = 855
Left = 240
TabIndex = 11
Top = 840
Width = 2295
Begin VB.TextBox PartX
Height = 375
Left = 240
TabIndex = 1
Top = 360
Width = 615
End
Begin VB.TextBox PartY
Height = 375
Left = 1440
TabIndex = 2
Top = 360
Width = 615
End
Begin VB.Label Label3
Alignment = 2 'Center
Caption = "by"
BeginProperty Font
name = "MS Sans Serif"
charset = 0
weight = 700
size = 12
underline = 0 'False
italic = 0 'False
strikethrough = 0 'False
EndProperty
Height = 375
Left = 960
TabIndex = 12
Top = 360
Width = 375
End
End
Begin VB.CommandButton DelCmd
Caption = "&Delete"
Height = 375
Left = 1800
TabIndex = 10
Top = 3600
Width = 1095
End
Begin VB.CommandButton CancelCmd
Cancel = -1 'True
Caption = "Cancel"
Height = 375
Left = 3120
TabIndex = 9
Top = 3600
Width = 1215
End
Begin VB.CommandButton OKCmd
Caption = "OK"
Default = -1 'True
Height = 375
Left = 240
TabIndex = 8
Top = 3600
Width = 1215
End
Begin VB.Label Label1
BorderStyle = 1 'Fixed Single
Caption = "Change part to..."
Height = 255
Left = 2760
TabIndex = 13
Top = 840
Width = 1695
End
Begin VB.Label CurrentPart
Alignment = 2 'Center
BorderStyle = 1 'Fixed Single
Height = 375
Left = 120
TabIndex = 0
Top = 240
Width = 4335
End
End
Attribute VB_Name = "EditPartForm"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Option Explicit
Dim epfAlignX As Integer
Private Sub AlignX_Click()
DirtyFlag% = True
End Sub
Private Sub AlignY_Click()
DirtyFlag% = True
End Sub
Private Sub CancelCmd_Click()
'
' abandon changes
'
Unload EditPartForm
End Sub
Private Sub DelCmd_Click()
'
' allows user to delete the current part
'
If (MsgBox("Are you sure you want to delete this part?", 36 + 4096, AppTitle$) = 6) Then
Dim Idx%
Idx% = MainForm.AppliedParts.ItemData(MainForm.AppliedParts.ListIndex)
DrawingParts(Idx%, dpType) = dpNothing
DrawingParts(Idx%, dpX) = 0
DrawingParts(Idx%, dpY) = 0
Unload EditPartForm ' done
End If
End Sub
Private Sub Form_Load()
'
' initialize the Edit Part form
' This form allows the user to edit
' a selected part on the AppliedParts
' list box on the main form
'
EditPartForm.Left = (Screen.Width - EditPartForm.Width) / 2
EditPartForm.Top = (Screen.Height - EditPartForm.Height) / 2
CurrentPart.Caption = MainForm.AppliedParts.List(MainForm.AppliedParts.ListIndex)
EditPartForm.PartX.Text = MainForm.PartX.Text
EditPartForm.PartY.Text = MainForm.PartY.Text
'
' show current alignment
Dim Idx%
Idx% = MainForm.AppliedParts.ItemData(MainForm.AppliedParts.ListIndex)
If (DrawingParts(Idx%, dpAlignX)) Then
AlignX.Value = True
Else
AlignY.Value = True
End If
'
' enable the alignment controls if appropriate to the item being edited
Dim P$
P$ = UCase$(CurrentPart.Caption)
If P$ = "BATH TUB" Or P$ = "SINK" Or P$ = "CLOSET" Or P$ = "TOILET" Or P$ = "BATHTUB" Then
AlignX.Enabled = True
AlignY.Enabled = True
epfAlignX = DrawingParts(MainForm.AppliedParts.ItemData(MainForm.AppliedParts.ListIndex), dpAlignX)
End If
Dim i%
For i% = 0 To Parts.ListCount
If UCase$(CurrentPart.Caption) = UCase$(Parts.List(i%)) Then
Parts.ListIndex = i%
Exit For
End If
Next
End Sub
Private Sub OKCmd_Click()
'
' done -- save changes
'
Dim X#, Y#, Idx%
Idx% = MainForm.AppliedParts.ItemData(MainForm.AppliedParts.ListIndex)
X# = CDbl(Val(EditPartForm.PartX.Text))
Y# = CDbl(Val(MainForm.RoomHeight)) - CDbl(Val(EditPartForm.PartY.Text))
DrawingParts(Idx%, dpX) = X#
DrawingParts(Idx%, dpY) = Y#
DrawingParts(Idx%, dpAlignX) = AlignX.Value
Select Case UCase$(CurrentPart.Caption)
Case "BATH TUB"
DrawingParts(Idx%, dpType) = dpBathTub
Case "DOOR"
DrawingParts(Idx%, dpType) = dpDoor
Case "LINEN CLOSET"
DrawingParts(Idx%, dpType) = dpCloset
Case "SHOWER"
DrawingParts(Idx%, dpType) = dpShower
Case "SINK"
DrawingParts(Idx%, dpType) = dpSink
Case "TOILET"
DrawingParts(Idx%, dpType) = dpToilet
Case "WINDOW"
DrawingParts(Idx%, dpType) = dpWindow
End Select
Unload EditPartForm
End Sub
Private Sub Parts_Click()
'
' allows the user to change to type of part it is
'
DirtyFlag% = True
Dim P$
Dim PartType As Integer
P$ = UCase$(Parts.List(Parts.ListIndex))
AlignX.Enabled = False
AlignY.Enabled = False
AlignX.Value = False
AlignY.Value = False
Select Case P$
Case "BATH TUB"
PartType = dpBathTub
CurrentPart.Caption = "Bath Tub"
Case "DOOR"
PartType = dpDoor
CurrentPart.Caption = "Door"
Case "LINEN CLOSET"
PartType = dpCloset
CurrentPart.Caption = "Linen Closet"
Case "SHOWER"
PartType = dpShower
CurrentPart.Caption = "Shower"
Case "SINK"
PartType = dpSink
CurrentPart.Caption = "Sink"
Case "TOILET"
PartType = dpToilet
CurrentPart.Caption = "Toilet"
Case "WINDOW"
PartType = dpWindow
CurrentPart.Caption = "Window"
End Select
If P$ = "BATH TUB" Or P$ = "SINK" Or P$ = "CLOSET" Or P$ = "TOILET" Or P$ = "BATHTUB" Then
AlignX.Enabled = True
AlignY.Enabled = True
AlignX.Value = epfAlignX
AlignY.Value = Not epfAlignX
End If
End Sub
Private Sub PartX_Change()
DirtyFlag% = True
End Sub
Private Sub PartY_Change()
DirtyFlag% = True
End Sub