home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / VBASIC / DBTTIP.ZIP / FORM1.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-09-16  |  10.5 KB  |  301 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "DBTTip v1.3 Demo"
  5.    ClientHeight    =   3330
  6.    ClientLeft      =   1650
  7.    ClientTop       =   1935
  8.    ClientWidth     =   5835
  9.    ClipControls    =   0   'False
  10.    Height          =   3735
  11.    Left            =   1590
  12.    LinkTopic       =   "Form1"
  13.    ScaleHeight     =   3330
  14.    ScaleWidth      =   5835
  15.    Top             =   1590
  16.    Width           =   5955
  17.    Begin Frame Frame1 
  18.       BackColor       =   &H00C0C0C0&
  19.       Caption         =   "Invisible tool tips"
  20.       Height          =   1095
  21.       Left            =   240
  22.       TabIndex        =   7
  23.       Top             =   2040
  24.       Width           =   5415
  25.       Begin CommandButton Command4 
  26.          BackColor       =   &H00C0C0C0&
  27.          Caption         =   "Button 3"
  28.          Enabled         =   0   'False
  29.          Height          =   375
  30.          Index           =   2
  31.          Left            =   3600
  32.          TabIndex        =   10
  33.          Tag             =   "DBTTip99:Over ""Button 3"". Note that it's disabled!"
  34.          Top             =   300
  35.          Width           =   1335
  36.       End
  37.       Begin CommandButton Command4 
  38.          BackColor       =   &H00C0C0C0&
  39.          Caption         =   "Button 2"
  40.          Height          =   375
  41.          Index           =   1
  42.          Left            =   2040
  43.          TabIndex        =   9
  44.          Tag             =   "DBTTip99:Over ""Button 2"""
  45.          Top             =   300
  46.          Width           =   1335
  47.       End
  48.       Begin CommandButton Command4 
  49.          BackColor       =   &H00C0C0C0&
  50.          Caption         =   "Button 1"
  51.          Height          =   375
  52.          Index           =   0
  53.          Left            =   360
  54.          TabIndex        =   8
  55.          Tag             =   "DBTTip99:Over ""Button 1"""
  56.          Top             =   300
  57.          Width           =   1335
  58.       End
  59.       Begin Label lblInv 
  60.          BackColor       =   &H00C0C0C0&
  61.          BorderStyle     =   1  'Fixed Single
  62.          Caption         =   " Not above any of these buttons!"
  63.          Height          =   255
  64.          Left            =   360
  65.          TabIndex        =   11
  66.          Tag             =   "DBTTip:Here you'll see when the mouse if above any of these buttons"
  67.          Top             =   720
  68.          Width           =   4575
  69.       End
  70.    End
  71.    Begin DBTTip DBTTip1 
  72.       Alignment       =   2  'Center
  73.       Aspect          =   25
  74.       Delay           =   750
  75.       FontBold        =   0   'False
  76.       FontItalic      =   -1  'True
  77.       FontName        =   "Arial"
  78.       FontSize        =   9.75
  79.       FontStrikethru  =   0   'False
  80.       FontUnderline   =   0   'False
  81.       ForeColor       =   &H00000000&
  82.       Height          =   1092
  83.       HotSpotX        =   50
  84.       HotSpotY        =   0
  85.       Index           =   1
  86.       Left            =   1320
  87.       MouseOffX       =   0
  88.       MouseOffY       =   25
  89.       Picture         =   FORM1.FRX:0000
  90.       PopupMode       =   1  'Manual
  91.       Sensivity       =   5
  92.       TextBottom      =   90
  93.       TextLeft        =   10
  94.       TextRight       =   90
  95.       TextTop         =   10
  96.       Top             =   3060
  97.       TractorBeam     =   0
  98.       Width           =   2232
  99.    End
  100.    Begin CommandButton Command3 
  101.       BackColor       =   &H00C0C0C0&
  102.       Caption         =   "Help"
  103.       Height          =   372
  104.       Left            =   1860
  105.       TabIndex        =   4
  106.       Tag             =   "DBTTip:Get some info on DBTTip"
  107.       Top             =   1320
  108.       Width           =   1212
  109.    End
  110.    Begin PictureBox Picture1 
  111.       BackColor       =   &H00800000&
  112.       ClipControls    =   0   'False
  113.       DrawStyle       =   3  'Dash-Dot
  114.       FontBold        =   -1  'True
  115.       FontItalic      =   0   'False
  116.       FontName        =   "Arial"
  117.       FontSize        =   7.5
  118.       FontStrikethru  =   0   'False
  119.       FontUnderline   =   0   'False
  120.       ForeColor       =   &H0000FFFF&
  121.       Height          =   1212
  122.       Left            =   3180
  123.       ScaleHeight     =   1185
  124.       ScaleWidth      =   2445
  125.       TabIndex        =   6
  126.       Top             =   600
  127.       Width           =   2472
  128.    End
  129.    Begin ComboBox Combo1 
  130.       Height          =   288
  131.       Left            =   3180
  132.       Style           =   2  'Dropdown List
  133.       TabIndex        =   5
  134.       Tag             =   "DBTTip1:A drop down list box"
  135.       Top             =   180
  136.       Width           =   2472
  137.    End
  138.    Begin CheckBox Check1 
  139.       BackColor       =   &H00C0C0C0&
  140.       Caption         =   "Tractor beam"
  141.       Height          =   252
  142.       Left            =   240
  143.       TabIndex        =   3
  144.       Top             =   1380
  145.       Width           =   1512
  146.    End
  147.    Begin TextBox Text1 
  148.       Height          =   312
  149.       Left            =   240
  150.       TabIndex        =   2
  151.       Top             =   900
  152.       Width           =   2112
  153.    End
  154.    Begin CommandButton Command2 
  155.       BackColor       =   &H00C0C0C0&
  156.       Caption         =   "Button 2 "
  157.       Height          =   552
  158.       Index           =   0
  159.       Left            =   1320
  160.       TabIndex        =   1
  161.       Tag             =   "DBTTip:This is command button number 2"
  162.       Top             =   180
  163.       Width           =   1152
  164.    End
  165.    Begin CommandButton Command1 
  166.       BackColor       =   &H00C0C0C0&
  167.       Caption         =   "Button 1"
  168.       Height          =   552
  169.       Left            =   180
  170.       TabIndex        =   0
  171.       Tag             =   "DBTTip:This is command button number 1"
  172.       Top             =   180
  173.       Width           =   1152
  174.    End
  175.    Begin DBTTip DBTTip1 
  176.       Alignment       =   2  'Center
  177.       Aspect          =   25
  178.       Delay           =   750
  179.       FontBold        =   0   'False
  180.       FontItalic      =   0   'False
  181.       FontName        =   "Arial"
  182.       FontSize        =   8.25
  183.       FontStrikethru  =   0   'False
  184.       FontUnderline   =   0   'False
  185.       ForeColor       =   &H00000000&
  186.       Height          =   1092
  187.       HotSpotX        =   100
  188.       HotSpotY        =   100
  189.       Index           =   0
  190.       Left            =   3900
  191.       MouseOffX       =   -3
  192.       MouseOffY       =   -3
  193.       Picture         =   FORM1.FRX:025A
  194.       PopupMode       =   0  'Automatic
  195.       Sensivity       =   5
  196.       TextBottom      =   70
  197.       TextLeft        =   5
  198.       TextRight       =   95
  199.       TextTop         =   10
  200.       Top             =   3060
  201.       TractorBeam     =   0
  202.       Width           =   2232
  203.    End
  204.    Begin Image Image1 
  205.       Height          =   480
  206.       Left            =   2580
  207.       Picture         =   FORM1.FRX:061A
  208.       Tag             =   "DBTTip:This is an image control containing a little beautiful icon!"
  209.       Top             =   720
  210.       Width           =   480
  211.    End
  212. Option Explicit
  213. Dim strPicturePos As String
  214. Sub Check1_Click ()
  215.   If Check1.Value Then
  216.     DBTTip1(0).TractorBeam = 10
  217.   Else
  218.     DBTTip1(0).TractorBeam = 0
  219.   End If
  220. End Sub
  221. Sub Command3_Click ()
  222.   Dim S As String
  223.   S = "DBTTip brings configurable tool tips to VB - without the need to write "
  224.   S = S + "a single code line (as the the command buttons in this "
  225.   S = S + "demo show)! With just a few lines of code, it's possible "
  226.   S = S + "to determine exactly where the tip shall pop up (shown by "
  227.   S = S + "the drop down list box), and to specify different behavior "
  228.   S = S + "within a single control (shown by the picture box). DBTTip operates "
  229.   S = S + "application-wide. It's therefore not necessary to put a DBTTip "
  230.   S = S + "in more that one form. "
  231.   S = S + "For a complete description, please refer to the document "
  232.   S = S + """DBTTIP.WRI.""" + Chr$(13) + Chr$(10) + Chr$(13) + Chr$(10)
  233.   S = S + "A new feature of DBTTip v1.1 is the possibility to use different "
  234.   S = S + "shapes for different controls, again, without the need to write "
  235.   S = S + "any code. This feature is also demonstrated by the drop down "
  236.   S = S + "list box." + Chr$(13) + Chr$(10) + Chr$(13) + Chr$(10)
  237.   S = S + "A new feature of DBTTip v1.2 is the possibility to take advantage "
  238.   S = S + "of DBTTip's tracking mechanism, without having to show a ""bubble"". "
  239.   S = S + "This feature is demonstrated by the group at the bottom of the form."
  240.   S = S + Chr$(13) + Chr$(10) + Chr$(13) + Chr$(10)
  241.   S = S + "DBTTip was written by Dan Bystr
  242. m." + Chr$(13) + Chr$(10)
  243.   S = S + "e-mail: ""dan.bystrom@visual-design.se"""
  244.   MsgBox S, 0, "About DBTTip"
  245. End Sub
  246. Sub Command4_MouseMove (Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  247.   If Not DBTTip1(0).IsVisible Then DBTTip1(0).IsVisible = True
  248. End Sub
  249. Sub DBTTip1_PopDown (Index As Integer)
  250.   If DBTTip1(0).UseIndex = 99 Then
  251.     lblInv = ""
  252.   End If
  253. End Sub
  254. Sub DBTTip1_Popup (Index As Integer, CtlName As String, CtlIndex As Integer, hWnd As Integer, strText As String, X As Single, Y As Single)
  255.   If hWnd = Combo1.hWnd Then
  256.     DBTTip1(0).ExtraOffX = (Combo1.Width \ 2 - X) \ Screen.TwipsPerPixelX
  257.     DBTTip1(0).ExtraOffY = -Y \ Screen.TwipsPerPixelY
  258.     Exit Sub
  259.   End If
  260.   If hWnd = Text1.hWnd Then
  261.     strText = "A text input field containing """ & Text1 & """"
  262.     Exit Sub
  263.   End If
  264.   If hWnd = Check1.hWnd Then
  265.     If Check1.Value Then
  266.       strText = "Click to turn off tractor beam mode"
  267.     Else
  268.       strText = "Click to make the tip follow the mouse"
  269.     End If
  270.     Exit Sub
  271.   End If
  272.   If DBTTip1(0).UseIndex = 99 Then
  273.     lblInv = " " + strText
  274.   End If
  275. End Sub
  276. Sub Picture1_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  277.   Dim P As Single
  278.   strPicturePos = "X:" & Right$("    " & X, 4) & " / Y:" & Right$("    " & Y, 4)
  279.   Picture1.Refresh
  280.   P = (X * 4) / Picture1.Width
  281. Select Case Int(P)
  282.     Case 0:
  283.       Picture1.Tag = "DBTTip:The left part of a picture control"
  284.     Case 3:
  285.       Picture1.Tag = "DBTTip:The right part of a picture control"
  286.     Case Else
  287.       Picture1.Tag = ""
  288.       DBTTip1(0).IsVisible = False
  289.   End Select
  290. End Sub
  291. Sub Picture1_Paint ()
  292.   Picture1.Line (Picture1.Width \ 4, 0)-Step(0, Picture1.Width)
  293.   Picture1.Line (3 * Picture1.Width \ 4, 0)-Step(0, Picture1.Width)
  294.   Picture1.CurrentX = (Picture1.Width - Picture1.TextWidth(strPicturePos)) \ 2
  295.   Picture1.CurrentY = (Picture1.Height - Picture1.TextHeight(strPicturePos)) \ 2
  296.   Picture1.Print strPicturePos
  297. End Sub
  298. Sub Text1_Change ()
  299.   DBTTip1(0).IsVisible = False
  300. End Sub
  301.