home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Programming Tool Box
/
SIMS_2.iso
/
tool
/
design
/
tbar
/
mdiform1.frm
< prev
next >
Wrap
Text File
|
1995-02-27
|
6KB
|
214 lines
VERSION 2.00
Begin MDIForm MDIForm1
Caption = "TBar Demo"
ClientHeight = 3030
ClientLeft = 150
ClientTop = 825
ClientWidth = 6525
Height = 3960
Left = 90
LinkTopic = "MDIForm1"
Top = -45
Width = 6645
Begin PictureBox Picture1
Align = 2 'Align Bottom
BackColor = &H00C0C0C0&
Height = 384
Left = 0
ScaleHeight = 360
ScaleWidth = 6495
TabIndex = 0
Top = 2640
Width = 6528
Begin Label Label1
BackColor = &H00C0C0C0&
Caption = "No Mouse Events Received Yet!"
Height = 252
Left = 96
TabIndex = 1
Top = 48
Width = 7548
End
End
Begin TBar TBar1
Align = 1 'Align Top
AutoPlacement = 0 'False
BackColor = &H00C0C0C0&
BevelWidth = 2
Bitmap = MDIFORM1.FRX:0000
ButtonHeight = 15 ButtonVisible = ""
ButtonWidth = 16 Disabled = ";;;1;1;1"
EnableHelp = -1 'True
ForeColor = &H00000000&
Gap = "0;;8;;;8;8"
Group = "None;;;;;;None;8,9;7,9;7,8"
Height = 348
HelpBackColor = &H0080FFFF&
HelpForeColor = &H00000000&
HelpInterval = 1000
HelpPosition = 0 'Below Cursor
HelpQuickInterval= 250
HelpStyle = 0 'Box
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"
Interval = 0
LeadingInterval = 10
Left = 0
Outline = -1 'True
OutlineColor = &H00000000&
PressedBevelWidth= 1
RoundedCorners = -1 'True
Sticky = "0;;;;;;1;1;1;1"
ToolbarStyle = 0 'Horizontal
Top = 0
Version = "02.40"
VisibileButtons = 10
Width = 6528
End
Begin Menu mnuFile
Caption = "&File"
Begin Menu mnuTest
Caption = "&Test"
End
End
End
Const BS_IS_TOGGLED = 1
Const BS_IS_ENABLED = 2
Const BS_IS_NOTTOGGLED = 3
Const BS_IS_NOTENABLED = 4
Const BS_IS_VISIBLE = 5
Const BS_IS_INVISIBLE = 6
Sub MDIForm_Load ()
' TBar1.Id(0) = 1
' TBar1.Id(1) = 0
TBar1.ButtonState(4) = BS_IS_ENABLED
TBar1.ButtonState(0) = BS_IS_NOTENABLED
TBar1.ButtonState(7) = BS_IS_TOGGLED
' TBar1.ButtonState(6) = BS_IS_TOGGLED
' TBar1.ButtonState(6) = BS_IS_NOTTOGGLED
' TBar1.ButtonState(1) = BS_IS_INVISIBLE
Form1.Show
Form2.Show
Form1.SetFocus
End Sub
Sub mnuTest_Click ()
Static A As Integer
If A = 1 Then
A = 0
TBar1.ButtonState(7) = BS_IS_TOGGLED
Else
A = 1
TBar1.ButtonState(7) = BS_IS_NOTTOGGLED
End If
TBar1.IdList = "2,1,0,3,4,5,6,7,8,9"
TBar1.Refresh
End Sub
Sub TBar1_Click (Button As Integer)
Debug.Print "Button "; Button; " was clicked!"
End Sub
Sub TBar1_DoubleClick (Button As Integer)
Debug.Print "Double click received for button "; Button
End Sub
Sub TBar1_MouseDown (MouseButton As Integer, Shift As Integer, X As Single, Y As Single, Button As Integer)
If MouseButton And 1 Then Debug.Print "Left mouse button is pressed! Button is "; Button
If MouseButton And 2 Then Debug.Print "Right mouse button is pressed! Button is "; Button
If MouseButton And 4 Then Debug.Print "Middle mouse button is pressed! Button is "; Button
If Shift And 1 Then Debug.Print "Shift button is down"
If Shift And 2 Then Debug.Print "Control button is down"
If Shift And 4 Then Debug.Print "Alt button is down"
End Sub
Sub TBar1_MouseMove (MouseButton As Integer, Shift As Integer, X As Single, Y As Single, Button As Integer)
Dim CurX As Integer, CurY As Integer
CurX = -1
CurY = -1
If Button <> -1 Then
Select Case Button
Case 0:
Label1.Caption = "Open an empty document"
Case 1:
Label1.Caption = "Open existing document"
Case 2:
Label1.Caption = "Save current document"
Case 3:
Label1.Caption = "Cut currently selected text"
Case 4:
Label1.Caption = "Cut currently selected text to the clipboard"
Case 5:
Label1.Caption = "Insert text in clipboard into text"
Case 6:
Label1.Caption = "Change line styles"
Case 7:
Label1.Caption = "Print the current document"
Case 8:
Label1.Caption = "Open help"
Case 9:
Label1.Caption = "Open context sensitive help"
End Select
Else
Label1.Caption = "Mouse is moving"
End If
' Uncommenting this line doesn't allow other events to be processed
' So uncomment it only for testing purposes
' If CurX <> X Or CurY <> Y Then Debug.Print "Mouse is at:"; X; ","; Y
'If MouseButton And 1 Then Debug.Print "Left mouse button is pressed!"
'If MouseButton And 2 Then Debug.Print "Right mouse button is pressed!"
'If MouseButton And 4 Then Debug.Print "Middle mouse button is pressed!"
'If Shift And 1 Then Debug.Print "Shift button is down"
'If Shift And 2 Then Debug.Print "Control button is down"
End Sub
Sub TBar1_MouseUp (MouseButton As Integer, Shift As Integer, X As Single, Y As Single, Button As Integer)
'If MouseButton And 1 Then Debug.Print "Left mouse button is Up! Button is "; Button
'If MouseButton And 2 Then Debug.Print "Right mouse button is Up! Button is "; Button
'If MouseButton And 4 Then Debug.Print "Middle mouse button is Up! Button is "; Button
'If Shift And 1 Then Debug.Print "Shift button is down"
'If Shift And 2 Then Debug.Print "Control button is down"
'If Shift And 4 Then Debug.Print "Alt button is down"
End Sub
Sub TBar1_Toggle (Button As Integer, State As Integer)
Dim aString
If State Then
aString = "On."
Else
aString = "Off."
End If
Debug.Print "Button "; Button; " toggled to "; aString
End Sub