home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code1 / blun20 / generapp.frm < prev    next >
Text File  |  1993-12-23  |  14KB  |  375 lines

  1. VERSION 2.00
  2. Begin Form Balloon_Form 
  3.    Caption         =   "BALLOON Test"
  4.    ClientHeight    =   6510
  5.    ClientLeft      =   1035
  6.    ClientTop       =   1845
  7.    ClientWidth     =   5085
  8.    ClipControls    =   0   'False
  9.    Height          =   7200
  10.    Left            =   975
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   6510
  13.    ScaleWidth      =   5085
  14.    Top             =   1215
  15.    Width           =   5205
  16.    Begin Balloon Balloon1 
  17.       BackColor       =   &H00C0C0C0&
  18.       Prop13          =   -1  'True
  19.       Prop14          =   3  'Rounded
  20.       ForeColor       =   &H000000FF&
  21.       Prop12          =   0   'False
  22.       Left            =   2400
  23.       TimeOut         =   24000
  24.       Top             =   3360
  25.    End
  26.    Begin ComboBox Combo1 
  27.       Height          =   300
  28.       Left            =   240
  29.       TabIndex        =   15
  30.       Tag             =   "Combo1 tag text"
  31.       Text            =   "Combo1"
  32.       Top             =   2880
  33.       Width           =   2175
  34.    End
  35.    Begin CommandButton BTN_Dialog 
  36.       Caption         =   "Dialog"
  37.       Height          =   375
  38.       Left            =   240
  39.       TabIndex        =   14
  40.       Tag             =   "BTN_Dialog tag text"
  41.       Top             =   240
  42.       Width           =   1335
  43.    End
  44.    Begin OptionButton Option3 
  45.       Caption         =   "Maybe option"
  46.       Height          =   255
  47.       Left            =   1200
  48.       TabIndex        =   13
  49.       Tag             =   "Option3 tag text"
  50.       Top             =   4320
  51.       Width           =   1575
  52.    End
  53.    Begin PictureBox Picture1 
  54.       AutoSize        =   -1  'True
  55.       ClipControls    =   0   'False
  56.       Height          =   360
  57.       Left            =   360
  58.       Picture         =   GENERAPP.FRX:0000
  59.       ScaleHeight     =   330
  60.       ScaleWidth      =   360
  61.       TabIndex        =   12
  62.       Tag             =   "Picture1 tag text"
  63.       Top             =   3600
  64.       Width           =   390
  65.    End
  66.    Begin CheckBox Check2 
  67.       Caption         =   "That"
  68.       Height          =   255
  69.       Left            =   1200
  70.       TabIndex        =   11
  71.       Tag             =   "Check2 tag text"
  72.       Top             =   3840
  73.       Width           =   1200
  74.    End
  75.    Begin CheckBox Check1 
  76.       Caption         =   "This"
  77.       Height          =   255
  78.       Left            =   1200
  79.       TabIndex        =   10
  80.       Tag             =   "Check1 tag text"
  81.       Top             =   3360
  82.       Width           =   1200
  83.    End
  84.    Begin Frame Frame1 
  85.       Caption         =   "Do it now"
  86.       Height          =   1215
  87.       Left            =   3000
  88.       TabIndex        =   7
  89.       Tag             =   "Frame1 tag text"
  90.       Top             =   3120
  91.       Width           =   1695
  92.       Begin OptionButton Option2 
  93.          Caption         =   "No"
  94.          Height          =   255
  95.          Left            =   240
  96.          TabIndex        =   9
  97.          Tag             =   "Option2 tag text"
  98.          Top             =   720
  99.          Width           =   1000
  100.       End
  101.       Begin OptionButton Option1 
  102.          Caption         =   "Yes"
  103.          Height          =   255
  104.          Left            =   240
  105.          TabIndex        =   8
  106.          Tag             =   "Option1 tag text"
  107.          Top             =   360
  108.          Width           =   1000
  109.       End
  110.    End
  111.    Begin TextBox TXT_Result 
  112.       Height          =   1575
  113.       Left            =   120
  114.       MultiLine       =   -1  'True
  115.       TabIndex        =   6
  116.       Tag             =   "TXT_Result tag text"
  117.       Text            =   "Status output"
  118.       Top             =   4800
  119.       Width           =   4815
  120.    End
  121.    Begin TextBox TXT_KeyString 
  122.       Height          =   375
  123.       Left            =   120
  124.       TabIndex        =   3
  125.       Tag             =   "TXT_KeyString tag text."
  126.       Text            =   "This is a popup message to display in the window. The message can be of long length, or it can be short."
  127.       Top             =   1440
  128.       Width           =   4815
  129.    End
  130.    Begin CommandButton BTN_Exit 
  131.       Caption         =   "Exit"
  132.       Height          =   375
  133.       Left            =   3480
  134.       TabIndex        =   2
  135.       Tag             =   "BTN_Exit tag text"
  136.       Top             =   240
  137.       Width           =   1455
  138.    End
  139.    Begin TextBox TXT_SearchString 
  140.       Height          =   375
  141.       Left            =   120
  142.       TabIndex        =   1
  143.       Tag             =   "TXT_SearchString tag text"
  144.       Text            =   "Dawg"
  145.       Top             =   2280
  146.       Width           =   4815
  147.    End
  148.    Begin CommandButton Btn_HelpSession 
  149.       Caption         =   "Help Balloons"
  150.       Height          =   375
  151.       Left            =   1800
  152.       TabIndex        =   0
  153.       Tag             =   "Btn_HelpSession tag text"
  154.       Top             =   240
  155.       Width           =   1455
  156.    End
  157.    Begin Label Label3 
  158.       Alignment       =   2  'Center
  159.       Caption         =   "Search String"
  160.       Height          =   255
  161.       Left            =   120
  162.       TabIndex        =   5
  163.       Top             =   1920
  164.       Width           =   4815
  165.    End
  166.    Begin Label Label1 
  167.       Alignment       =   2  'Center
  168.       Caption         =   "Key String"
  169.       Height          =   255
  170.       Left            =   120
  171.       TabIndex        =   4
  172.       Top             =   1080
  173.       Width           =   4815
  174.    End
  175.    Begin Menu nmu_File 
  176.       Caption         =   "&File"
  177.       Begin Menu mnu_Exit 
  178.          Caption         =   "&Exit"
  179.       End
  180.    End
  181.    Begin Menu mnu_Edit 
  182.       Caption         =   "&Edit"
  183.       Begin Menu mnu_Cut 
  184.          Caption         =   "Cu&t"
  185.       End
  186.       Begin Menu mnu_Copy 
  187.          Caption         =   "&Copy"
  188.       End
  189.       Begin Menu mnu_Paste 
  190.          Caption         =   "&Paste"
  191.       End
  192.       Begin Menu mnu_submenu 
  193.          Caption         =   "SubMenu"
  194.          Begin Menu mnu_submenu1 
  195.             Caption         =   "SubMenu 1"
  196.          End
  197.          Begin Menu mnu_submenu2 
  198.             Caption         =   "SubMenu 2"
  199.          End
  200.       End
  201.    End
  202.    Begin Menu mnu_help 
  203.       Caption         =   "&Help"
  204.       Begin Menu mnu_HelpBalloons 
  205.          Caption         =   "Help &Balloons"
  206.       End
  207.    End
  208. End
  209. Option Explicit
  210.  
  211. ' Declare statements for utility functions included in BALLOON.VBX
  212. Declare Function Hwnd2ControlTabIndex Lib "BALLOON.VBX" (ByVal hwndControl%) As Integer
  213. Declare Function Hwnd2CtlName Lib "BALLOON.VBX" (ByVal hwndControl%) As String
  214. Declare Function Hwnd2HelpContextID Lib "BALLOON.VBX" (ByVal hwndControl%) As Long
  215. Declare Function Hwnd2TagText Lib "BALLOON.VBX" (ByVal hwndControl%) As String
  216.  
  217. Sub Balloon1_BalloonClick (hwndAtMouse As Integer)
  218. ' PURPOSE:  hwndAtMouse is the control the mouse is over
  219. ' COMMENTS: pass back the help text
  220. '           shows how to programmatcially end a session
  221. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  222. Dim Msg As String
  223. Dim CRLF As String
  224. Dim TestText As String
  225.  
  226.     CRLF = Chr$(13) + Chr$(10)
  227.  
  228.     TestText = "Use the balloon utility functions to retrieve other control properties. Display these properties in the ballon if desired." + CRLF
  229.     TestText = TestText + "CtlName = " + Hwnd2CtlName(hwndAtMouse) + CRLF
  230.     TestText = TestText + "Tag text = " + Hwnd2TagText(hwndAtMouse) + CRLF
  231.     TestText = TestText + "HelpContextID = " + Str$(Hwnd2HelpContextID(hwndAtMouse)) + CRLF
  232.     TestText = TestText + "ControlTabIndex = " + Str$(Hwnd2ControlTabIndex(hwndAtMouse))
  233.     TXT_Result.Text = TestText
  234.  
  235.     Select Case hwndAtMouse
  236.         Case Me.hWnd
  237.             Exit Sub    ' do nothing
  238.         Case BTN_Dialog.hWnd
  239.             'TestText = Hwnd2TagText$(hwndAtMouse)
  240.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  241.             
  242.             ' set font and back colors dynamically
  243.             Balloon1.ForeColor = QBColor(0)
  244.             Balloon1.BackColor = QBColor(2)
  245.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control BTN_Dialog."
  246.         Case Btn_HelpSession.hWnd
  247.             'TestText = Hwnd2TagText$(hwndAtMouse)
  248.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  249.             
  250.             ' set font and back colors dynamically
  251.             Balloon1.ForeColor = &HFF0000    ' blue
  252.             Balloon1.BackColor = &HC0C0C0    ' light grey
  253.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Btn_HelpSession."
  254.         Case BTN_Exit.hWnd
  255.             'TestText = Hwnd2TagText$(hwndAtMouse)
  256.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  257.             
  258.             ' set font and back colors dynamically
  259.             Balloon1.ForeColor = QBColor(4)
  260.             Balloon1.BackColor = QBColor(14)
  261.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control BTN_Exit."
  262.         Case TXT_KeyString.hWnd
  263.             'TestText = Hwnd2TagText$(hwndAtMouse)
  264.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  265.  
  266.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control TXT_KeyString."
  267.         Case TXT_SearchString.hWnd
  268.             'TestText = Hwnd2TagText$(hwndAtMouse)
  269.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  270.             
  271.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control TXT_SearchString."
  272.         Case TXT_Result.hWnd
  273.             'TestText = Hwnd2TagText$(hwndAtMouse)
  274.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  275.             
  276.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control TXT_Result."
  277.         Case Picture1.hWnd
  278.             'TestText = Hwnd2TagText$(hwndAtMouse)
  279.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  280.             
  281.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Picture1."
  282.         Case Check1.hWnd
  283.             'TestText = Hwnd2TagText$(hwndAtMouse)
  284.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  285.             
  286.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Check1."
  287.         Case Check2.hWnd
  288.             'TestText = Hwnd2TagText$(hwndAtMouse)
  289.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  290.             
  291.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Check2."
  292.         Case Frame1.hWnd
  293.             'TestText = Hwnd2TagText$(hwndAtMouse)
  294.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  295.             
  296.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Frame1."
  297.         Case Option1.hWnd
  298.             'TestText = Hwnd2TagText$(hwndAtMouse)
  299.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  300.             
  301.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Option1."
  302.         Case Option2.hWnd
  303.             'TestText = Hwnd2TagText$(hwndAtMouse)
  304.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  305.             
  306.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Option2."
  307.         Case Option3.hWnd
  308.             'TestText = Hwnd2TagText$(hwndAtMouse)
  309.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  310.             
  311.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Option3."
  312.         Case Combo1.hWnd
  313.             'TestText = Hwnd2TagText$(hwndAtMouse)
  314.             'TXT_Result.Text = "The hwndAtMouse = " + Hex$(hwndAtMouse) + "   " + TestText
  315.             
  316.             Balloon1.MessageText = "The hwndAtMouse = " + Hex$(hwndAtMouse) + CRLF + "The mouse is over the control Combo1."
  317.         Case Else
  318.         
  319.         End Select
  320.         
  321. End Sub
  322.  
  323. Sub BTN_Dialog_Click ()
  324.     Dialog.Show
  325. End Sub
  326.  
  327. Sub BTN_Exit_Click ()
  328.     mnu_Exit_Click
  329. End Sub
  330.  
  331. Sub Btn_HelpSession_Click ()
  332.  
  333.     ' initial help text string
  334.     ' here we get the text from the on screen text box
  335.     '
  336.     ' Initial text can be left blank, if blank then
  337.     ' Balloon.vbx control will display an internal init message
  338.     Balloon1.MessageText = TXT_KeyString.Text
  339.     
  340.     Balloon1.Action = 20     ' Balloon_START = 20
  341.  
  342. End Sub
  343.  
  344. Sub Form_Load ()
  345.     If Me.WindowState = 0 Then
  346.         Me.Top = 0
  347.         Me.Left = 0
  348.     End If
  349. End Sub
  350.  
  351. Sub Form_Resize ()
  352.     If Me.WindowState = 0 Then
  353.         Me.Height = 7200
  354.         Me.Width = 5175
  355.     End If
  356. End Sub
  357.  
  358. Sub mnu_Exit_Click ()
  359.     End
  360. End Sub
  361.  
  362. Sub mnu_HelpBalloons_Click ()
  363.  
  364.     ' initial help text string
  365.     ' here we get the text from the on screen text box
  366.     '
  367.     ' Initial text can be left blank, if blank then
  368.     ' Balloon.vbx control will display an internal init message
  369.     Balloon1.MessageText = TXT_KeyString.Text
  370.     
  371.     Balloon1.Action = 20     ' Balloon_START = 20
  372.  
  373. End Sub
  374.  
  375.