home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / VISUAL_B / CODIGO_2 / T_BAR / MDIFORM1.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-06-11  |  6.2 KB  |  172 lines

  1. VERSION 2.00
  2. Begin MDIForm MDIForm1 
  3.    Caption         =   "TBar Demo"
  4.    ClientHeight    =   3024
  5.    ClientLeft      =   144
  6.    ClientTop       =   828
  7.    ClientWidth     =   6528
  8.    Height          =   3768
  9.    Left            =   96
  10.    LinkTopic       =   "MDIForm1"
  11.    Top             =   132
  12.    Width           =   6624
  13.    Begin PictureBox Picture1 
  14.       Align           =   2  'Align Bottom
  15.       BackColor       =   &H00C0C0C0&
  16.       Height          =   384
  17.       Left            =   0
  18.       ScaleHeight     =   360
  19.       ScaleWidth      =   6504
  20.       TabIndex        =   0
  21.       Top             =   2640
  22.       Width           =   6528
  23.       Begin Label Label1 
  24.          BackColor       =   &H00C0C0C0&
  25.          Caption         =   "No Mouse Events Received Yet!"
  26.          Height          =   252
  27.          Left            =   96
  28.          TabIndex        =   1
  29.          Top             =   48
  30.          Width           =   7548
  31.       End
  32.    End
  33.    Begin TBar TBar1 
  34.       Align           =   1  'Align Top
  35.       AutoPlacement   =   0   'False
  36.       BackColor       =   &H00C0C0C0&
  37.       BevelWidth      =   2
  38.       Bitmap          =   MDIFORM1.FRX:0000
  39.       ButtonHeight    =   15      ButtonVisible   =   ""
  40.       ButtonWidth     =   16      Disabled        =   ";;;1;1;1"
  41.       EnableHelp      =   -1  'True
  42.       ForeColor       =   &H00000000&
  43.       Gap             =   "0;;8;;;8;8"
  44.       Group           =   "None;;;;;;None;8,9;7,9;7,8"
  45.       Height          =   348
  46.       HelpBackColor   =   &H0080FFFF&
  47.       HelpForeColor   =   &H00000000&
  48.       HelpInterval    =   1000
  49.       HelpPosition    =   0  'Below Cursor
  50.       HelpQuickInterval=   250
  51.       HelpStyle       =   0  'Box
  52.       HelpText        =   "Help Button 1\rLIne 2;Help Button 2;Help Button 3;Help Button 4;Help Button 5;Help Button 6;Help Button 7;Help Button 8;Help Button 9;Help Button 10"
  53.       Interval        =   0
  54.       LeadingInterval =   10
  55.       Left            =   0
  56.       Outline         =   -1  'True
  57.       OutlineColor    =   &H00000000&
  58.       PressedBevelWidth=   1
  59.       RoundedCorners  =   -1  'True
  60.       Sticky          =   "0;;;;;;1;1;1;1"
  61.       ToolbarStyle    =   0  'Horizontal
  62.       Top             =   0
  63.       Version         =   "02.30"
  64.       VisibileButtons =   10
  65.       Width           =   6528
  66.    End
  67.    Begin Menu mnuFile 
  68.       Caption         =   "&File"
  69.       Begin Menu mnuTest 
  70.          Caption         =   "&Test"
  71.       End
  72.    End
  73. Const BS_IS_TOGGLED = 1
  74. Const BS_IS_ENABLED = 2
  75. Const BS_IS_NOTTOGGLED = 3
  76. Const BS_IS_NOTENABLED = 4
  77. Const BS_IS_VISIBLE = 5
  78. Const BS_IS_INVISIBLE = 6
  79. Sub MDIForm_Load ()
  80.   ' TBar1.Id(0) = 1
  81.   ' TBar1.Id(1) = 0
  82.   TBar1.ButtonState(4) = BS_IS_ENABLED
  83.   TBar1.ButtonState(0) = BS_IS_NOTENABLED
  84.   TBar1.ButtonState(7) = BS_IS_TOGGLED
  85.   ' TBar1.ButtonState(6) = BS_IS_TOGGLED
  86.   ' TBar1.ButtonState(6) = BS_IS_NOTTOGGLED
  87.   ' TBar1.ButtonState(1) = BS_IS_INVISIBLE
  88.   Form1.Show
  89.   Form2.Show
  90.   Form1.SetFocus
  91. End Sub
  92. Sub mnuTest_Click ()
  93.   Static A As Integer
  94.   If A = 1 Then
  95.     A = 0
  96.     TBar1.ButtonState(7) = BS_IS_TOGGLED
  97.   Else
  98.     A = 1
  99.     TBar1.ButtonState(7) = BS_IS_NOTTOGGLED
  100.   End If
  101. End Sub
  102. Sub TBar1_Click (Button As Integer)
  103.   Debug.Print "Button "; Button; " was clicked!"
  104. End Sub
  105. Sub TBar1_DoubleClick (Button As Integer)
  106.   Debug.Print "Double click received for button "; Button
  107. End Sub
  108. Sub TBar1_MouseDown (MouseButton As Integer, Shift As Integer, X As Single, Y As Single, Button As Integer)
  109.   If MouseButton And 1 Then Debug.Print "Left mouse button is pressed!  Button is "; Button
  110.   If MouseButton And 2 Then Debug.Print "Right mouse button is pressed!  Button is "; Button
  111.   If MouseButton And 4 Then Debug.Print "Middle mouse button is pressed! Button is "; Button
  112.   If Shift And 1 Then Debug.Print "Shift button is down"
  113.   If Shift And 2 Then Debug.Print "Control button is down"
  114.   If Shift And 4 Then Debug.Print "Alt button is down"
  115. End Sub
  116. Sub TBar1_MouseMove (MouseButton As Integer, Shift As Integer, X As Single, Y As Single, Button As Integer)
  117.   Dim CurX As Integer, CurY As Integer
  118.   CurX = -1
  119.   CurY = -1
  120.   If Button <> -1 Then
  121.     Select Case Button
  122.       Case 0:
  123.     Label1.Caption = "Open an empty document"
  124.       Case 1:
  125.     Label1.Caption = "Open existing document"
  126.       Case 2:
  127.     Label1.Caption = "Save current document"
  128.       Case 3:
  129.     Label1.Caption = "Cut currently selected text"
  130.       Case 4:
  131.     Label1.Caption = "Cut currently selected text to the clipboard"
  132.       Case 5:
  133.     Label1.Caption = "Insert text in clipboard into text"
  134.       Case 6:
  135.     Label1.Caption = "Change line styles"
  136.       Case 7:
  137.     Label1.Caption = "Print the current document"
  138.       Case 8:
  139.     Label1.Caption = "Open help"
  140.       Case 9:
  141.     Label1.Caption = "Open context sensitive help"
  142.     End Select
  143.   Else
  144.     Label1.Caption = "Mouse is moving"
  145.   End If
  146.   ' Uncommenting this line doesn't allow other events to be processed
  147.   ' So uncomment it only for testing purposes
  148.   ' If CurX <> X Or CurY <> Y Then Debug.Print "Mouse is at:"; X; ","; Y
  149.   'If MouseButton And 1 Then Debug.Print "Left mouse button is pressed!"
  150.   'If MouseButton And 2 Then Debug.Print "Right mouse button is pressed!"
  151.   'If MouseButton And 4 Then Debug.Print "Middle mouse button is pressed!"
  152.   'If Shift And 1 Then Debug.Print "Shift button is down"
  153.   'If Shift And 2 Then Debug.Print "Control button is down"
  154. End Sub
  155. Sub TBar1_MouseUp (MouseButton As Integer, Shift As Integer, X As Single, Y As Single, Button As Integer)
  156.   'If MouseButton And 1 Then Debug.Print "Left mouse button is Up!  Button is "; Button
  157.   'If MouseButton And 2 Then Debug.Print "Right mouse button is Up!  Button is "; Button
  158.   'If MouseButton And 4 Then Debug.Print "Middle mouse button is Up! Button is "; Button
  159.   'If Shift And 1 Then Debug.Print "Shift button is down"
  160.   'If Shift And 2 Then Debug.Print "Control button is down"
  161.   'If Shift And 4 Then Debug.Print "Alt button is down"
  162. End Sub
  163. Sub TBar1_Toggle (Button As Integer, State As Integer)
  164.   Dim aString
  165.   If State Then
  166.     aString = "On."
  167.   Else
  168.     aString = "Off."
  169.   End If
  170.   Debug.Print "Button "; Button; " toggled to "; aString
  171. End Sub
  172.