home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / WINDOWS / EZNET.ZIP / DEMO.ZIP / ITEMPROP.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-10-31  |  15.2 KB  |  483 lines

  1. VERSION 4.00
  2. Begin VB.Form frmItemProp 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Properties"
  5.    ClientHeight    =   4965
  6.    ClientLeft      =   1500
  7.    ClientTop       =   1215
  8.    ClientWidth     =   6225
  9.    Height          =   5370
  10.    Left            =   1440
  11.    LinkTopic       =   "Form2"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   4965
  15.    ScaleWidth      =   6225
  16.    ShowInTaskbar   =   0   'False
  17.    Top             =   870
  18.    Width           =   6345
  19.    Begin VB.Frame FrameNodePicture 
  20.       Caption         =   "Node picture"
  21.       Height          =   1485
  22.       Left            =   4365
  23.       TabIndex        =   29
  24.       Top             =   1140
  25.       Width           =   1665
  26.       Begin VB.OptionButton OptionPicture 
  27.          Caption         =   "None"
  28.          Height          =   270
  29.          Index           =   0
  30.          Left            =   120
  31.          TabIndex        =   33
  32.          Top             =   210
  33.          Width           =   1395
  34.       End
  35.       Begin VB.OptionButton OptionPicture 
  36.          Caption         =   "Server"
  37.          Height          =   270
  38.          Index           =   3
  39.          Left            =   120
  40.          TabIndex        =   32
  41.          Top             =   1095
  42.          Width           =   1395
  43.       End
  44.       Begin VB.OptionButton OptionPicture 
  45.          Caption         =   "MAC client"
  46.          Height          =   270
  47.          Index           =   2
  48.          Left            =   120
  49.          TabIndex        =   31
  50.          Top             =   810
  51.          Width           =   1395
  52.       End
  53.       Begin VB.OptionButton OptionPicture 
  54.          Caption         =   "PC client"
  55.          Height          =   270
  56.          Index           =   1
  57.          Left            =   120
  58.          TabIndex        =   30
  59.          Top             =   510
  60.          Width           =   1395
  61.       End
  62.    End
  63.    Begin VB.Frame FrameUserData 
  64.       Caption         =   "User Data"
  65.       Height          =   2145
  66.       Left            =   2430
  67.       TabIndex        =   16
  68.       Top             =   2670
  69.       Width           =   3615
  70.       Begin VB.TextBox Text1 
  71.          Height          =   555
  72.          Left            =   1020
  73.          MultiLine       =   -1  'True
  74.          ScrollBars      =   2  'Vertical
  75.          TabIndex        =   27
  76.          Top             =   300
  77.          Width           =   2415
  78.       End
  79.       Begin VB.TextBox Text4 
  80.          Height          =   315
  81.          Left            =   1020
  82.          TabIndex        =   22
  83.          Top             =   1695
  84.          Width           =   825
  85.       End
  86.       Begin VB.TextBox Text3 
  87.          Height          =   315
  88.          Left            =   1020
  89.          TabIndex        =   21
  90.          Top             =   1305
  91.          Width           =   825
  92.       End
  93.       Begin VB.TextBox Text2 
  94.          Height          =   285
  95.          Left            =   1020
  96.          TabIndex        =   17
  97.          Top             =   930
  98.          Width           =   2415
  99.       End
  100.       Begin VB.Label Label1 
  101.          Alignment       =   1  'Right Justify
  102.          Caption         =   "Text:"
  103.          Height          =   255
  104.          Left            =   240
  105.          TabIndex        =   28
  106.          Top             =   300
  107.          Width           =   555
  108.       End
  109.       Begin VB.Label Label8 
  110.          Alignment       =   1  'Right Justify
  111.          Caption         =   "Long Data:"
  112.          Height          =   255
  113.          Left            =   120
  114.          TabIndex        =   20
  115.          Top             =   1710
  116.          Width           =   825
  117.       End
  118.       Begin VB.Label Label7 
  119.          Alignment       =   1  'Right Justify
  120.          Caption         =   "Short Data:"
  121.          Height          =   255
  122.          Left            =   105
  123.          TabIndex        =   19
  124.          Top             =   1350
  125.          Width           =   825
  126.       End
  127.       Begin VB.Label Label6 
  128.          Alignment       =   1  'Right Justify
  129.          Caption         =   "Item Tag:"
  130.          Height          =   255
  131.          Left            =   90
  132.          TabIndex        =   18
  133.          Top             =   960
  134.          Width           =   855
  135.       End
  136.    End
  137.    Begin VB.CommandButton CommandForeColor 
  138.       Caption         =   "Fore Color..."
  139.       Height          =   375
  140.       Left            =   180
  141.       TabIndex        =   15
  142.       Top             =   4440
  143.       Width           =   1305
  144.    End
  145.    Begin VB.CommandButton CommandDrawColor 
  146.       Caption         =   "Draw Color..."
  147.       Height          =   375
  148.       Left            =   180
  149.       TabIndex        =   14
  150.       Top             =   4020
  151.       Width           =   1305
  152.    End
  153.    Begin VB.CommandButton CommandFillColor 
  154.       Caption         =   "Fill Color..."
  155.       Height          =   375
  156.       Left            =   180
  157.       TabIndex        =   13
  158.       Top             =   3600
  159.       Width           =   1305
  160.    End
  161.    Begin VB.ComboBox ComboDrawStyle 
  162.       Height          =   315
  163.       ItemData        =   "Itemprop.frx":0000
  164.       Left            =   1590
  165.       List            =   "Itemprop.frx":0019
  166.       Style           =   2  'Dropdown List
  167.       TabIndex        =   11
  168.       Top             =   2220
  169.       Width           =   2415
  170.    End
  171.    Begin VB.CheckBox CheckHiding 
  172.       Alignment       =   1  'Right Justify
  173.       Caption         =   "Hiding Item"
  174.       Height          =   255
  175.       Left            =   180
  176.       TabIndex        =   10
  177.       Top             =   3210
  178.       Width           =   1635
  179.    End
  180.    Begin VB.CheckBox CheckTransparent 
  181.       Alignment       =   1  'Right Justify
  182.       Caption         =   "Node Transparent"
  183.       Height          =   255
  184.       Left            =   180
  185.       TabIndex        =   9
  186.       Top             =   2910
  187.       Width           =   1635
  188.    End
  189.    Begin VB.ComboBox ComboLinkHead 
  190.       Height          =   315
  191.       ItemData        =   "Itemprop.frx":007F
  192.       Left            =   1590
  193.       List            =   "Itemprop.frx":009B
  194.       Style           =   2  'Dropdown List
  195.       TabIndex        =   8
  196.       Top             =   1860
  197.       Width           =   2415
  198.    End
  199.    Begin VB.CheckBox CheckOriented 
  200.       Alignment       =   1  'Right Justify
  201.       Caption         =   "Link Oriented"
  202.       Height          =   255
  203.       Left            =   180
  204.       TabIndex        =   7
  205.       Top             =   2610
  206.       Width           =   1635
  207.    End
  208.    Begin VB.ComboBox ComboAlignment 
  209.       Height          =   315
  210.       ItemData        =   "Itemprop.frx":013F
  211.       Left            =   1590
  212.       List            =   "Itemprop.frx":015E
  213.       Style           =   2  'Dropdown List
  214.       TabIndex        =   4
  215.       Top             =   1500
  216.       Width           =   2415
  217.    End
  218.    Begin VB.CommandButton Command2 
  219.       Cancel          =   -1  'True
  220.       Caption         =   "Cancel"
  221.       Height          =   435
  222.       Left            =   5130
  223.       TabIndex        =   3
  224.       Top             =   630
  225.       Width           =   915
  226.    End
  227.    Begin VB.CommandButton Command1 
  228.       Caption         =   "Ok"
  229.       Default         =   -1  'True
  230.       Height          =   435
  231.       Left            =   5130
  232.       TabIndex        =   2
  233.       Top             =   150
  234.       Width           =   915
  235.    End
  236.    Begin VB.ComboBox ComboShape 
  237.       Height          =   315
  238.       ItemData        =   "Itemprop.frx":023D
  239.       Left            =   1590
  240.       List            =   "Itemprop.frx":025C
  241.       Style           =   2  'Dropdown List
  242.       TabIndex        =   0
  243.       Top             =   1140
  244.       Width           =   2415
  245.    End
  246.    Begin VB.Label LabelComment 
  247.       BorderStyle     =   1  'Fixed Single
  248.       BeginProperty Font 
  249.          name            =   "MS Sans Serif"
  250.          charset         =   0
  251.          weight          =   700
  252.          size            =   8.25
  253.          underline       =   0   'False
  254.          italic          =   0   'False
  255.          strikethrough   =   0   'False
  256.       EndProperty
  257.       Height          =   795
  258.       Left            =   180
  259.       TabIndex        =   26
  260.       Top             =   180
  261.       Width           =   3855
  262.    End
  263.    Begin VB.Label LabelForeColor 
  264.       BorderStyle     =   1  'Fixed Single
  265.       Height          =   345
  266.       Left            =   1590
  267.       TabIndex        =   25
  268.       Top             =   4440
  269.       Width           =   345
  270.    End
  271.    Begin VB.Label LabelDrawColor 
  272.       BorderStyle     =   1  'Fixed Single
  273.       Height          =   345
  274.       Left            =   1590
  275.       TabIndex        =   24
  276.       Top             =   4020
  277.       Width           =   345
  278.    End
  279.    Begin VB.Label LabelFillColor 
  280.       BorderStyle     =   1  'Fixed Single
  281.       Height          =   345
  282.       Left            =   1590
  283.       TabIndex        =   23
  284.       Top             =   3600
  285.       Width           =   345
  286.    End
  287.    Begin MSComDlg.CommonDialog CommonDialog1 
  288.       Left            =   4440
  289.       Top             =   390
  290.       _Version        =   65536
  291.       _ExtentX        =   847
  292.       _ExtentY        =   847
  293.       _StockProps     =   0
  294.    End
  295.    Begin VB.Label Label5 
  296.       Caption         =   "DrawStyle:"
  297.       Height          =   255
  298.       Left            =   180
  299.       TabIndex        =   12
  300.       Top             =   2220
  301.       Width           =   1320
  302.    End
  303.    Begin VB.Label Label4 
  304.       Caption         =   "Link Arrow Head:"
  305.       Height          =   255
  306.       Left            =   180
  307.       TabIndex        =   6
  308.       Top             =   1860
  309.       Width           =   1320
  310.    End
  311.    Begin VB.Label Label3 
  312.       Caption         =   "Text Alignment:"
  313.       Height          =   255
  314.       Left            =   180
  315.       TabIndex        =   5
  316.       Top             =   1500
  317.       Width           =   1320
  318.    End
  319.    Begin VB.Label Label2 
  320.       Caption         =   "Node Shape:"
  321.       Height          =   255
  322.       Left            =   180
  323.       TabIndex        =   1
  324.       Top             =   1140
  325.       Width           =   1320
  326.    End
  327. Attribute VB_Name = "frmItemProp"
  328. Attribute VB_Creatable = False
  329. Attribute VB_Exposed = False
  330. Option Explicit
  331. Dim PictureNum As Integer
  332. Sub SetItemProperties(Net1 As Control, item As Long)
  333.   With Net1
  334.     .SetItemDrawColor item, LabelDrawColor.BackColor
  335.     .SetItemForeColor item, LabelForeColor.BackColor
  336.     .SetItemText item, Text1
  337.     .SetItemTag item, Text2
  338.     .SetItemLong item, Val(Text4)
  339.     .SetItemDrawStyle item, ComboDrawStyle.ListIndex
  340.     .SetItemHiding item, (CheckHiding.Value = 1)
  341.     If .IsItemLink(item) Then
  342.       .SetLinkOriented item, (CheckOriented.Value = 1)
  343.       .SetLinkArrowHead item, ComboLinkHead.ListIndex
  344.     Else
  345.       .SetNodeTransparent item, (CheckTransparent.Value = 1)
  346.       .SetNodeShape item, ComboShape.ListIndex
  347.       .SetNodeAlignment item, ComboAlignment.ListIndex
  348.       .SetNodeFillColor item, LabelFillColor.BackColor
  349.       .SetItemShort item, PictureNum
  350.       .SetNodePicture item, Form2.Picture1(PictureNum).Picture
  351.     End If
  352.   End With
  353. End Sub
  354. Private Sub Command1_Click()
  355.   With Form2.Net1
  356.     If .item <> 0 Then
  357.       ' There is a current item
  358.       SetItemProperties Form2.Net1, .item
  359.     Else
  360.       ' No current item
  361.       .FillColor = LabelFillColor.BackColor
  362.       .ForeColor = LabelForeColor.BackColor
  363.       .DrawColor = LabelDrawColor.BackColor
  364.       .DrawStyle = ComboDrawStyle.ListIndex
  365.       .Oriented = (CheckOriented.Value = 1)
  366.       .LinkHead = ComboLinkHead.ListIndex
  367.       .Hiding = (CheckHiding.Value = 1)
  368.       .Transparent = (CheckTransparent.Value = 1)
  369.       .Shape = ComboShape.ListIndex
  370.       .Alignment = ComboAlignment.ListIndex
  371.     End If
  372.   End With
  373.   Unload Me
  374. End Sub
  375. Private Sub Command2_Click()
  376.   Unload Me
  377. End Sub
  378. Private Sub CommandDrawColor_Click()
  379.   With CommonDialog1
  380.     .Color = LabelDrawColor.BackColor
  381.     .Flags = cdlCCRGBInit
  382.     .Action = 3
  383.     LabelDrawColor.BackColor = .Color
  384.   End With
  385. End Sub
  386. Private Sub CommandFillColor_Click()
  387.   With CommonDialog1
  388.     .Color = LabelFillColor.BackColor
  389.     .Flags = cdlCCRGBInit
  390.     .Action = 3
  391.     LabelFillColor.BackColor = .Color
  392.   End With
  393. End Sub
  394. Private Sub CommandForeColor_Click()
  395.   With CommonDialog1
  396.     .Color = LabelForeColor.BackColor
  397.     .Flags = cdlCCRGBInit
  398.     .Action = 3
  399.     LabelForeColor.BackColor = .Color
  400.   End With
  401. End Sub
  402. Private Sub Form_Load()
  403.   With Form2.Net1
  404.     If .item = 0 Then
  405.       FrameUserData.Visible = False
  406.       FrameNodePicture.Visible = False
  407.       LabelComment.Caption = "No current item: therefore property settings are persistent. Next created items will received those property values by default."
  408.       Text1.Enabled = False
  409.       Text2.Enabled = False
  410.       Text3.Enabled = False
  411.       Text4.Enabled = False
  412.       If .Oriented Then
  413.         CheckOriented.Value = 1
  414.       Else
  415.         CheckOriented.Value = 0
  416.       End If
  417.       ComboLinkHead.ListIndex = .LinkHead
  418.       If .Transparent Then
  419.         CheckTransparent.Value = 1
  420.       Else
  421.         CheckTransparent.Value = 0
  422.       End If
  423.       ComboShape.ListIndex = .Shape
  424.       ComboAlignment.ListIndex = .Alignment
  425.       LabelFillColor.BackColor = .FillColor
  426.       If .Hiding Then
  427.         CheckHiding.Value = 1
  428.       Else
  429.         CheckHiding.Value = 0
  430.       End If
  431.       ComboDrawStyle.ListIndex = .DrawStyle
  432.       LabelDrawColor.BackColor = .DrawColor
  433.       LabelForeColor.BackColor = .ForeColor
  434.     Else
  435.       If .IsLink Then
  436.         FrameNodePicture.Visible = False
  437.         LabelComment.Caption = "The current item is a link. ""Node-only"" properties are disabled. Property settings will apply only to this current link."
  438.         If .Oriented Then
  439.           CheckOriented.Value = 1
  440.         Else
  441.           CheckOriented.Value = 0
  442.         End If
  443.         ComboShape.Enabled = False
  444.         ComboAlignment.Enabled = False
  445.         ComboLinkHead.ListIndex = .LinkHead
  446.         CommandFillColor.Enabled = False
  447.         CheckTransparent.Enabled = False
  448.       Else
  449.         FrameNodePicture.Visible = True
  450.         PictureNum = .Type
  451.         OptionPicture(PictureNum).Value = True
  452.         Text3.Enabled = False  'Since this value is used to store the picture number.
  453.         LabelComment.Caption = "The current item is a node. ""Link-only"" properties are disabled. Property settings will apply only to this current node."
  454.         If .Transparent Then
  455.           CheckTransparent.Value = 1
  456.         Else
  457.           CheckTransparent.Value = 0
  458.         End If
  459.         CheckOriented.Enabled = False
  460.         ComboLinkHead.Enabled = False
  461.         ComboShape.ListIndex = .Shape
  462.         ComboAlignment.ListIndex = .Alignment
  463.         LabelFillColor.BackColor = .FillColor
  464.       End If
  465.       If .Hiding Then
  466.         CheckHiding.Value = 1
  467.       Else
  468.         CheckHiding.Value = 0
  469.       End If
  470.       ComboDrawStyle.ListIndex = .DrawStyle
  471.       LabelDrawColor.BackColor = .DrawColor
  472.       LabelForeColor.BackColor = .ForeColor
  473.       Text1 = .Text
  474.       Text2 = .ItemTag
  475.       Text3 = Str(.Type)
  476.       Text4 = Str(.Data)
  477.     End If
  478.   End With
  479. End Sub
  480. Private Sub OptionPicture_Click(Index As Integer)
  481.   PictureNum = Index
  482. End Sub
  483.