home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / AdvancedUI4390812242001.psc / Form1.frm (.txt) next >
Encoding:
Visual Basic Form  |  2001-12-24  |  9.6 KB  |  297 lines

  1. VERSION 5.00
  2. Object = "*\ASizeBar Control\AdvancedUI.vbp"
  3. Begin VB.Form frmMain 
  4.    Caption         =   "SizeBar Demo - by eidos"
  5.    ClientHeight    =   4230
  6.    ClientLeft      =   60
  7.    ClientTop       =   345
  8.    ClientWidth     =   7440
  9.    LinkTopic       =   "Form1"
  10.    ScaleHeight     =   4230
  11.    ScaleWidth      =   7440
  12.    StartUpPosition =   3  'Windows Default
  13.    Begin AdvancedUI.UISizeBar UISizeBar2 
  14.       Height          =   135
  15.       Left            =   2280
  16.       TabIndex        =   10
  17.       Top             =   2130
  18.       Width           =   4605
  19.       _ExtentX        =   8123
  20.       _ExtentY        =   238
  21.       BackColor       =   16761024
  22.       HighlightColor  =   16761024
  23.       Orientation     =   1
  24.       ShowBorderWhileMoving=   -1  'True
  25.       Edge_Left       =   0   'False
  26.       Edge_Right      =   0   'False
  27.    End
  28.    Begin AdvancedUI.UISizeBar UISizeBar1 
  29.       Height          =   4035
  30.       Left            =   30
  31.       TabIndex        =   2
  32.       Top             =   150
  33.       Width           =   1605
  34.       _ExtentX        =   2831
  35.       _ExtentY        =   7117
  36.       BackColor       =   16761024
  37.       HighlightColor  =   16761024
  38.       ShowBorderWhileMoving=   -1  'True
  39.       Begin VB.CommandButton cmdAnimate 
  40.          Caption         =   ">"
  41.          BeginProperty Font 
  42.             Name            =   "Tahoma"
  43.             Size            =   8.25
  44.             Charset         =   0
  45.             Weight          =   700
  46.             Underline       =   0   'False
  47.             Italic          =   0   'False
  48.             Strikethrough   =   0   'False
  49.          EndProperty
  50.          Height          =   225
  51.          Left            =   240
  52.          MousePointer    =   1  'Arrow
  53.          TabIndex        =   6
  54.          Top             =   1470
  55.          Width           =   315
  56.       End
  57.       Begin VB.OptionButton optSpeed 
  58.          BackColor       =   &H00FFC0C0&
  59.          Caption         =   "Slow"
  60.          BeginProperty Font 
  61.             Name            =   "Tahoma"
  62.             Size            =   8.25
  63.             Charset         =   0
  64.             Weight          =   400
  65.             Underline       =   0   'False
  66.             Italic          =   0   'False
  67.             Strikethrough   =   0   'False
  68.          EndProperty
  69.          Height          =   195
  70.          Index           =   2
  71.          Left            =   240
  72.          MousePointer    =   1  'Arrow
  73.          TabIndex        =   5
  74.          Top             =   1200
  75.          Value           =   -1  'True
  76.          Width           =   795
  77.       End
  78.       Begin VB.OptionButton optSpeed 
  79.          BackColor       =   &H00FFC0C0&
  80.          Caption         =   "Medium"
  81.          BeginProperty Font 
  82.             Name            =   "Tahoma"
  83.             Size            =   8.25
  84.             Charset         =   0
  85.             Weight          =   400
  86.             Underline       =   0   'False
  87.             Italic          =   0   'False
  88.             Strikethrough   =   0   'False
  89.          EndProperty
  90.          Height          =   195
  91.          Index           =   1
  92.          Left            =   210
  93.          MousePointer    =   1  'Arrow
  94.          TabIndex        =   4
  95.          Top             =   840
  96.          Width           =   915
  97.       End
  98.       Begin VB.OptionButton optSpeed 
  99.          BackColor       =   &H00FFC0C0&
  100.          Caption         =   "Fast"
  101.          BeginProperty Font 
  102.             Name            =   "Tahoma"
  103.             Size            =   8.25
  104.             Charset         =   0
  105.             Weight          =   400
  106.             Underline       =   0   'False
  107.             Italic          =   0   'False
  108.             Strikethrough   =   0   'False
  109.          EndProperty
  110.          Height          =   195
  111.          Index           =   0
  112.          Left            =   210
  113.          MousePointer    =   1  'Arrow
  114.          TabIndex        =   3
  115.          Top             =   480
  116.          Width           =   855
  117.       End
  118.       Begin VB.Label Label1 
  119.          BackStyle       =   0  'Transparent
  120.          Caption         =   "SizeBar Demo"
  121.          BeginProperty Font 
  122.             Name            =   "Tahoma"
  123.             Size            =   8.25
  124.             Charset         =   0
  125.             Weight          =   700
  126.             Underline       =   0   'False
  127.             Italic          =   0   'False
  128.             Strikethrough   =   0   'False
  129.          EndProperty
  130.          Height          =   225
  131.          Left            =   210
  132.          MousePointer    =   1  'Arrow
  133.          TabIndex        =   9
  134.          Top             =   210
  135.          Width           =   1275
  136.       End
  137.       Begin VB.Label Label2 
  138.          BackStyle       =   0  'Transparent
  139.          Caption         =   "Click to animate"
  140.          BeginProperty Font 
  141.             Name            =   "Tahoma"
  142.             Size            =   8.25
  143.             Charset         =   0
  144.             Weight          =   400
  145.             Underline       =   0   'False
  146.             Italic          =   0   'False
  147.             Strikethrough   =   0   'False
  148.          EndProperty
  149.          Height          =   195
  150.          Left            =   240
  151.          MousePointer    =   1  'Arrow
  152.          TabIndex        =   8
  153.          Top             =   1770
  154.          Width           =   1185
  155.       End
  156.       Begin VB.Label lblDes 
  157.          BackStyle       =   0  'Transparent
  158.          BorderStyle     =   1  'Fixed Single
  159.          Caption         =   "This is a SizeBar as well, it contains other controls!"
  160.          BeginProperty Font 
  161.             Name            =   "Tahoma"
  162.             Size            =   8.25
  163.             Charset         =   0
  164.             Weight          =   400
  165.             Underline       =   0   'False
  166.             Italic          =   0   'False
  167.             Strikethrough   =   0   'False
  168.          EndProperty
  169.          Height          =   915
  170.          Left            =   240
  171.          MousePointer    =   1  'Arrow
  172.          TabIndex        =   7
  173.          Top             =   2970
  174.          Width           =   1185
  175.       End
  176.    End
  177.    Begin VB.PictureBox picSel 
  178.       BorderStyle     =   0  'None
  179.       Height          =   1695
  180.       Left            =   1890
  181.       ScaleHeight     =   1695
  182.       ScaleWidth      =   5415
  183.       TabIndex        =   1
  184.       Top             =   2310
  185.       Width           =   5415
  186.    End
  187.    Begin VB.TextBox txtMain 
  188.       BorderStyle     =   0  'None
  189.       BeginProperty Font 
  190.          Name            =   "Tahoma"
  191.          Size            =   8.25
  192.          Charset         =   0
  193.          Weight          =   400
  194.          Underline       =   0   'False
  195.          Italic          =   0   'False
  196.          Strikethrough   =   0   'False
  197.       EndProperty
  198.       Height          =   2085
  199.       Left            =   1740
  200.       MultiLine       =   -1  'True
  201.       ScrollBars      =   2  'Vertical
  202.       TabIndex        =   0
  203.       Text            =   "Form1.frx":0000
  204.       Top             =   -30
  205.       Width           =   5475
  206.    End
  207. Attribute VB_Name = "frmMain"
  208. Attribute VB_GlobalNameSpace = False
  209. Attribute VB_Creatable = False
  210. Attribute VB_PredeclaredId = True
  211. Attribute VB_Exposed = False
  212. Option Explicit
  213. Dim iSpeed As sbSpeedEnum
  214. Private Sub ResizeForm()
  215. On Local Error Resume Next
  216.     UISizeBar1.MaxLeft = Me.ScaleWidth - 500
  217.     UISizeBar1.MinLeft = 0
  218.     UISizeBar2.MaxTop = Me.ScaleHeight - 500
  219.     UISizeBar2.MinTop = 200
  220.     With UISizeBar1
  221.         .Top = Me.ScaleTop
  222.         .Height = Me.ScaleHeight
  223.     End With
  224.     With UISizeBar2
  225.         .Left = UISizeBar1.Right
  226.         .Width = Me.ScaleWidth - .Left
  227.     End With
  228.     With txtMain
  229.         .Left = UISizeBar1.Right
  230.         .Width = Me.ScaleWidth - .Left
  231.         .Top = Me.ScaleTop
  232.         .Height = UISizeBar2.Top
  233.     End With
  234.     With picSel
  235.         .Left = UISizeBar1.Right
  236.         .Width = Me.ScaleWidth - .Left
  237.         .Top = UISizeBar2.Bottom
  238.         .Height = Me.ScaleHeight - .Top
  239.     End With
  240.     With lblDes
  241.         .Top = UISizeBar1.Height - .Height - 100
  242.     End With
  243. End Sub
  244. Private Sub cmdAnimate_Click()
  245.     If cmdAnimate.Caption = ">" Then
  246.         UISizeBar1.Animate UISizeBar1.MaxLeft, 0, iSpeed
  247.         cmdAnimate.Caption = "<"
  248.     ElseIf cmdAnimate.Caption = "<" Then
  249.         UISizeBar1.Animate UISizeBar1.MinLeft, 0, iSpeed
  250.         cmdAnimate.Caption = ">"
  251.     End If
  252. End Sub
  253. Private Sub Form_Load()
  254.     Call ResizeForm
  255. End Sub
  256. Private Sub Form_Resize()
  257.     Call ResizeForm
  258. End Sub
  259. Private Sub optSpeed_Click(Index As Integer)
  260.     Select Case Index
  261.         Case 0
  262.             iSpeed = fast
  263.         Case 1
  264.             iSpeed = Medium
  265.         Case 2
  266.             iSpeed = Slow
  267.             
  268.     End Select
  269. End Sub
  270. Private Sub txtMain_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  271.     '' a little eye candy
  272.     With picSel
  273.         .Cls
  274.         .AutoRedraw = True
  275.         .Font.Name = "Tahoma"
  276.         .Font.Size = 8
  277.         .Font.Bold = True
  278.         .CurrentX = 10
  279.         .CurrentY = 10
  280.         picSel.Print "Current Selection: "
  281.         
  282.         .Font.Bold = False
  283.         .Font.Size = 8
  284.         picSel.Print vbCrLf & txtMain.SelText
  285.         
  286.     End With
  287. End Sub
  288. Private Sub UISizeBar1_Move(Left As Single, Top As Single, Right As Single, Bottom As Single)
  289.     ResizeForm
  290. End Sub
  291. Private Sub UISizeBar1_MoveComplete(Left As Single, Top As Single, Right As Single, Bottom As Single)
  292.     ResizeForm
  293. End Sub
  294. Private Sub UISizeBar2_Move(Left As Single, Top As Single, Right As Single, Bottom As Single)
  295.     ResizeForm
  296. End Sub
  297.