home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1999 January / pcwk_01_1999.iso / Wtestowe / Vistdstd / Install / Data.Z / FrmConfig.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-06-26  |  10.6 KB  |  299 lines

  1. VERSION 5.00
  2. Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.1#0"; "COMCTL32.OCX"
  3. Begin VB.Form frmConfig 
  4.    Caption         =   "Current Configuration"
  5.    ClientHeight    =   6555
  6.    ClientLeft      =   2115
  7.    ClientTop       =   915
  8.    ClientWidth     =   2370
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    MinButton       =   0   'False
  12.    OLEDropMode     =   1  'Manual
  13.    ScaleHeight     =   6555
  14.    ScaleWidth      =   2370
  15.    Begin ComctlLib.Toolbar Toolbar1 
  16.       Align           =   1  'Align Top
  17.       Height          =   420
  18.       Left            =   0
  19.       TabIndex        =   4
  20.       Top             =   0
  21.       Width           =   2370
  22.       _ExtentX        =   4180
  23.       _ExtentY        =   741
  24.       ButtonWidth     =   609
  25.       ButtonHeight    =   582
  26.       Appearance      =   1
  27.       ImageList       =   "ImageList1"
  28.       _Version        =   327680
  29.       BeginProperty Buttons {0713E452-850A-101B-AFC0-4210102A8DA7} 
  30.          NumButtons      =   1
  31.          BeginProperty Button1 {0713F354-850A-101B-AFC0-4210102A8DA7} 
  32.             Key             =   "Rollup"
  33.             Object.Tag             =   ""
  34.             ImageIndex      =   1
  35.             Style           =   1
  36.          EndProperty
  37.       EndProperty
  38.       MouseIcon       =   "frmConfig.frx":0000
  39.    End
  40.    Begin ComctlLib.TreeView TreeView1 
  41.       Height          =   2772
  42.       Left            =   0
  43.       TabIndex        =   0
  44.       Top             =   360
  45.       Width           =   2292
  46.       _ExtentX        =   4048
  47.       _ExtentY        =   4895
  48.       _Version        =   327680
  49.       HideSelection   =   0   'False
  50.       Indentation     =   176
  51.       LabelEdit       =   1
  52.       LineStyle       =   1
  53.       Style           =   7
  54.       ImageList       =   "ImageList1"
  55.       Appearance      =   1
  56.       MouseIcon       =   "frmConfig.frx":001C
  57.       OLEDragMode     =   1
  58.    End
  59.    Begin VB.PictureBox picSplitter 
  60.       BackColor       =   &H00808080&
  61.       BorderStyle     =   0  'None
  62.       FillColor       =   &H00808080&
  63.       Height          =   50
  64.       Left            =   -480
  65.       ScaleHeight     =   20.848
  66.       ScaleMode       =   0  'User
  67.       ScaleWidth      =   29328
  68.       TabIndex        =   3
  69.       Top             =   6000
  70.       Visible         =   0   'False
  71.       Width           =   4512
  72.    End
  73.    Begin ComctlLib.StatusBar StatusBar1 
  74.       Align           =   2  'Align Bottom
  75.       Height          =   360
  76.       Left            =   0
  77.       TabIndex        =   2
  78.       Top             =   6195
  79.       Width           =   2370
  80.       _ExtentX        =   4180
  81.       _ExtentY        =   635
  82.       SimpleText      =   "None"
  83.       _Version        =   327680
  84.       BeginProperty Panels {0713E89E-850A-101B-AFC0-4210102A8DA7} 
  85.          NumPanels       =   2
  86.          BeginProperty Panel1 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
  87.             AutoSize        =   2
  88.             Object.Width           =   1773
  89.             MinWidth        =   1764
  90.             TextSave        =   ""
  91.             Key             =   ""
  92.             Object.Tag             =   ""
  93.          EndProperty
  94.          BeginProperty Panel2 {0713E89F-850A-101B-AFC0-4210102A8DA7} 
  95.             TextSave        =   ""
  96.             Key             =   ""
  97.             Object.Tag             =   ""
  98.          EndProperty
  99.       EndProperty
  100.       MouseIcon       =   "frmConfig.frx":0038
  101.       OLEDropMode     =   1
  102.    End
  103.    Begin ComctlLib.ListView ListView1 
  104.       Height          =   1812
  105.       Left            =   0
  106.       TabIndex        =   1
  107.       Top             =   3240
  108.       Width           =   2292
  109.       _ExtentX        =   4048
  110.       _ExtentY        =   3201
  111.       View            =   3
  112.       LabelEdit       =   1
  113.       LabelWrap       =   -1  'True
  114.       HideSelection   =   0   'False
  115.       _Version        =   327680
  116.       ForeColor       =   -2147483640
  117.       BackColor       =   -2147483643
  118.       BorderStyle     =   1
  119.       Appearance      =   1
  120.       MouseIcon       =   "frmConfig.frx":0054
  121.       NumItems        =   2
  122.       BeginProperty ColumnHeader(1) {0713E8C7-850A-101B-AFC0-4210102A8DA7} 
  123.          Key             =   "Prop"
  124.          Object.Tag             =   ""
  125.          Text            =   "Property"
  126.          Object.Width           =   1764
  127.       EndProperty
  128.       BeginProperty ColumnHeader(2) {0713E8C7-850A-101B-AFC0-4210102A8DA7} 
  129.          SubItemIndex    =   1
  130.          Key             =   "Value"
  131.          Object.Tag             =   ""
  132.          Text            =   "Value"
  133.          Object.Width           =   2540
  134.       EndProperty
  135.    End
  136.    Begin VB.Image imgSplitter 
  137.       Height          =   50
  138.       Left            =   0
  139.       MousePointer    =   7  'Size N S
  140.       Top             =   3120
  141.       Width           =   3516
  142.    End
  143.    Begin ComctlLib.ImageList ImageList1 
  144.       Left            =   1320
  145.       Top             =   5160
  146.       _ExtentX        =   794
  147.       _ExtentY        =   794
  148.       BackColor       =   -2147483643
  149.       ImageWidth      =   16
  150.       ImageHeight     =   16
  151.       MaskColor       =   12632256
  152.       _Version        =   327680
  153.       BeginProperty Images {0713E8C2-850A-101B-AFC0-4210102A8DA7} 
  154.          NumListImages   =   7
  155.          BeginProperty ListImage1 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  156.             Picture         =   "frmConfig.frx":0070
  157.             Key             =   "Up"
  158.          EndProperty
  159.          BeginProperty ListImage2 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  160.             Picture         =   "frmConfig.frx":038A
  161.             Key             =   "Open"
  162.          EndProperty
  163.          BeginProperty ListImage3 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  164.             Picture         =   "frmConfig.frx":06A4
  165.             Key             =   "Close"
  166.          EndProperty
  167.          BeginProperty ListImage4 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  168.             Picture         =   "frmConfig.frx":09BE
  169.             Key             =   "Hutch"
  170.          EndProperty
  171.          BeginProperty ListImage5 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  172.             Picture         =   "frmConfig.frx":0CD8
  173.             Key             =   "DoorChest"
  174.          EndProperty
  175.          BeginProperty ListImage6 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  176.             Picture         =   "frmConfig.frx":0FF2
  177.             Key             =   "Dresser"
  178.          EndProperty
  179.          BeginProperty ListImage7 {0713E8C3-850A-101B-AFC0-4210102A8DA7} 
  180.             Picture         =   "frmConfig.frx":130C
  181.             Key             =   "Desk"
  182.          EndProperty
  183.       EndProperty
  184.    End
  185. Attribute VB_Name = "frmConfig"
  186. Attribute VB_GlobalNameSpace = False
  187. Attribute VB_Creatable = False
  188. Attribute VB_PredeclaredId = True
  189. Attribute VB_Exposed = False
  190. ' -----------------------------------------------------------------------------
  191. ' Copyright (C) 1997 Visio Corporation. All rights reserved.
  192. ' You have a royalty-free right to use, modify, reproduce and distribute
  193. ' the Sample Application Files (and/or any modified version) in any way
  194. ' you find useful, provided that you agree that Visio has no warranty,
  195. ' obligations or liability for any Sample Application Files.
  196. ' -----------------------------------------------------------------------------
  197. Option Explicit
  198. ' SetWindowPos() hwndInsertAfter values
  199. Const HWND_TOPMOST = -1
  200. ' SetWindowPos Flags
  201. Const SWP_NOSIZE = &H1
  202. Const SWP_NOMOVE = &H2
  203. Public tvcProduct As ProductView
  204. Dim mbMoving As Boolean
  205. Dim oldHeight As Single
  206. Dim hidden As Boolean
  207. Const sglSplitLimit = 1000
  208. Private Sub Form_load()
  209.     Dim ret As Long
  210.     Dim flags As Long
  211.     'Force the form window to always remain on top
  212.     flags = SWP_NOSIZE Or SWP_NOMOVE
  213.     ret = SetWindowPos(Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, flags)
  214. End Sub
  215. Private Sub Form_Resize()
  216. 'Resize the form
  217.     On Error Resume Next
  218.     If Not hidden Then
  219.         If Me.Height < 2500 Then Me.Height = 2500
  220.         SizeControls imgSplitter.Top
  221.     End If
  222. End Sub
  223. Private Sub Form_Unload(Cancel As Integer)
  224.     Unload Me
  225. End Sub
  226. Private Sub imgSplitter_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
  227. 'The form window shows two lists, the list of objects and a
  228. 'selected objects properties list. The portion of the form used
  229. 'by each list can be modified by moving the imgSplitter. By detecting
  230. 'MouseDown, MouseMove, and MouseUp events the size of the two lists
  231. 'can be modified together and controlled by the position of the
  232. 'imgSplitter.
  233.     With imgSplitter
  234.         picSplitter.Move .Left, .Top, .Width, .Height
  235.     End With
  236.     picSplitter.Visible = True
  237.     mbMoving = True
  238. End Sub
  239. Private Sub imgSplitter_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
  240. 'See MouseDown
  241.     Dim sglPos As Single
  242.     If mbMoving Then
  243.         sglPos = y + imgSplitter.Top
  244.         If sglPos < sglSplitLimit Then
  245.             picSplitter.Top = sglSplitLimit
  246.         ElseIf sglPos > Height - sglSplitLimit Then
  247.             picSplitter.Top = Height - sglSplitLimit
  248.         Else
  249.             picSplitter.Top = sglPos
  250.         End If
  251.     End If
  252. End Sub
  253. Private Sub imgSplitter_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
  254. 'See MouseDown
  255.     SizeControls picSplitter.Top
  256.     picSplitter.Visible = False
  257.     mbMoving = False
  258. End Sub
  259. Sub SizeControls(y As Single)
  260. 'Called on form resizing
  261.     On Error Resume Next
  262. If Not hidden Then
  263.     'set the Height
  264.     Toolbar1.Width = Me.ScaleWidth
  265.     imgSplitter.Width = Me.ScaleWidth
  266.     imgSplitter.Top = y
  267.     With TreeView1
  268.         .Top = Toolbar1.Height
  269.         .Width = Me.ScaleWidth
  270.         .Height = y - Toolbar1.Height
  271.     End With
  272.     With ListView1
  273.         .Top = y + imgSplitter.Height
  274.         .Width = Me.ScaleWidth
  275.         .Height = Me.ScaleHeight - .Top - StatusBar1.Height
  276.     End With
  277. End If
  278. End Sub
  279. Private Sub Toolbar1_ButtonClick(ByVal Button As ComctlLib.Button)
  280. 'Minimize the form selecting the toolbar button
  281.     Select Case Button.Key
  282.         Case "Rollup"
  283.             If Button.Value = tbrPressed Then
  284.                 oldHeight = frmConfig.Height
  285.                 hidden = True
  286.                 frmConfig.Height = (frmConfig.Height - frmConfig.ScaleHeight) + Toolbar1.Height
  287.              Else
  288.                 hidden = False
  289.                 frmConfig.Height = oldHeight
  290.                 Call Form_Resize
  291.             End If
  292.         Case Else
  293.     End Select
  294. End Sub
  295. Private Sub TreeView1_Click()
  296. 'The user has selected an item from the list
  297.     tvcProduct.ClickedOnNode TreeView1.SelectedItem.Key
  298. End Sub
  299.