home *** CD-ROM | disk | FTP | other *** search
/ On Hand / On_Hand_From_Softbank_1994_Release_2_Disc_2_1994.iso / 00202 / s / disk3 / gestfrm.fr_ / gestfrm.bin
Text File  |  1993-04-28  |  16KB  |  463 lines

  1. VERSION 2.00
  2. Begin Form GestFrm 
  3.    BackColor       =   &H00FFFFFF&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "Custom Gesture Actions"
  6.    ControlBox      =   0   'False
  7.    Height          =   7095
  8.    Left            =   270
  9.    LinkMode        =   1  'Source
  10.    LinkTopic       =   "Form2"
  11.    ScaleHeight     =   6690
  12.    ScaleWidth      =   9045
  13.    Top             =   30
  14.    Width           =   9165
  15.    Begin PictureBox Picture1 
  16.       BackColor       =   &H00C0C0C0&
  17.       Height          =   975
  18.       Left            =   120
  19.       ScaleHeight     =   945
  20.       ScaleWidth      =   8745
  21.       TabIndex        =   3
  22.       TabStop         =   0   'False
  23.       Top             =   120
  24.       Width           =   8775
  25.       Begin Label Label1 
  26.          Alignment       =   2  'Center
  27.          BackColor       =   &H00C0C0C0&
  28.          Caption         =   "The RcResult event can be used to invoke custom gesture functions.  For example, in the multiline HEdit below, a 'b' with a circle around it causes the text to turn bold.  An 'i' with a circle will toggle the Italic property of the control."
  29.          FontBold        =   -1  'True
  30.          FontItalic      =   0   'False
  31.          FontName        =   "MS Sans Serif"
  32.          FontSize        =   9.75
  33.          FontStrikethru  =   0   'False
  34.          FontUnderline   =   0   'False
  35.          ForeColor       =   &H00000000&
  36.          Height          =   855
  37.          Index           =   3
  38.          Left            =   360
  39.          TabIndex        =   4
  40.          Top             =   120
  41.          Width           =   8175
  42.       End
  43.    End
  44.    Begin VHedit HEdit1 
  45.       BackColor       =   &H00FFFFFF&
  46.       FontBold        =   0   'False
  47.       FontItalic      =   0   'False
  48.       FontName        =   "MS Sans Serif"
  49.       FontSize        =   13.5
  50.       FontStrikethru  =   0   'False
  51.       FontUnderline   =   0   'False
  52.       ForeColor       =   &H00000000&
  53.       Height          =   1095
  54.       InflateBottom   =   270
  55.       InflateLeft     =   270
  56.       InflateRight    =   270
  57.       InflateTop      =   270
  58.       Left            =   120
  59.       ScrollBars      =   2  'Vertical
  60.       TabIndex        =   5
  61.       TabStop         =   0   'False
  62.       Text            =   "This HEdit has several custom gestures including circled-b, circled-i and the copy gesture that looks like an alpha."
  63.       Top             =   1200
  64.       Version         =   268435458
  65.       Width           =   8775
  66.    End
  67.    Begin PictureBox Picture2 
  68.       BackColor       =   &H00C0C0C0&
  69.       Height          =   615
  70.       Index           =   0
  71.       Left            =   120
  72.       ScaleHeight     =   585
  73.       ScaleWidth      =   8745
  74.       TabIndex        =   1
  75.       TabStop         =   0   'False
  76.       Top             =   2400
  77.       Width           =   8775
  78.       Begin Label Label1 
  79.          BackColor       =   &H00C0C0C0&
  80.          Caption         =   "Standard Gestures can also be used.  If the copy gesture is issued, the contents of the HEdit will be copied to the label below."
  81.          ForeColor       =   &H00000000&
  82.          Height          =   495
  83.          Index           =   1
  84.          Left            =   720
  85.          TabIndex        =   2
  86.          Top             =   60
  87.          Width           =   7575
  88.       End
  89.    End
  90.    Begin PictureBox Picture2 
  91.       BackColor       =   &H00C0C0C0&
  92.       Height          =   615
  93.       Index           =   1
  94.       Left            =   120
  95.       ScaleHeight     =   585
  96.       ScaleWidth      =   8745
  97.       TabIndex        =   7
  98.       TabStop         =   0   'False
  99.       Top             =   3720
  100.       Width           =   8775
  101.       Begin Label Label1 
  102.          BackColor       =   &H00C0C0C0&
  103.          Caption         =   "We can also modify the correction gesture and supply a custom correction box.  This is very useful in places where space is limited."
  104.          ForeColor       =   &H00000000&
  105.          Height          =   495
  106.          Index           =   4
  107.          Left            =   720
  108.          TabIndex        =   8
  109.          Top             =   60
  110.          Width           =   7575
  111.       End
  112.    End
  113.    Begin PictureBox Picture3 
  114.       BackColor       =   &H00C0C0C0&
  115.       Height          =   1515
  116.       Left            =   120
  117.       ScaleHeight     =   1485
  118.       ScaleWidth      =   8745
  119.       TabIndex        =   9
  120.       Top             =   4500
  121.       Width           =   8775
  122.       Begin VHedit HEditArr 
  123.          BackColor       =   &H00FFFFFF&
  124.          ForeColor       =   &H00000000&
  125.          Height          =   315
  126.          Index           =   0
  127.          InflateBottom   =   270
  128.          InflateLeft     =   270
  129.          InflateRight    =   270
  130.          InflateTop      =   270
  131.          Left            =   120
  132.          TabIndex        =   13
  133.          TabStop         =   0   'False
  134.          Top             =   240
  135.          Version         =   268435458
  136.          Width           =   2775
  137.       End
  138.       Begin VHedit HEditArr 
  139.          BackColor       =   &H00FFFFFF&
  140.          ForeColor       =   &H00000000&
  141.          Height          =   315
  142.          Index           =   1
  143.          InflateBottom   =   270
  144.          InflateLeft     =   270
  145.          InflateRight    =   270
  146.          InflateTop      =   270
  147.          Left            =   2880
  148.          TabIndex        =   14
  149.          TabStop         =   0   'False
  150.          Top             =   240
  151.          Version         =   268435458
  152.          Width           =   3615
  153.       End
  154.       Begin VHedit HEditArr 
  155.          BackColor       =   &H00FFFFFF&
  156.          ForeColor       =   &H00000000&
  157.          Height          =   315
  158.          Index           =   2
  159.          InflateBottom   =   270
  160.          InflateLeft     =   270
  161.          InflateRight    =   270
  162.          InflateTop      =   270
  163.          Left            =   6480
  164.          TabIndex        =   15
  165.          TabStop         =   0   'False
  166.          Top             =   240
  167.          Version         =   268435458
  168.          Width           =   1935
  169.       End
  170.       Begin VHedit HEditArr 
  171.          BackColor       =   &H00FFFFFF&
  172.          ForeColor       =   &H00000000&
  173.          Height          =   315
  174.          Index           =   3
  175.          InflateBottom   =   270
  176.          InflateLeft     =   270
  177.          InflateRight    =   270
  178.          InflateTop      =   270
  179.          Left            =   120
  180.          TabIndex        =   16
  181.          TabStop         =   0   'False
  182.          Top             =   540
  183.          Version         =   268435458
  184.          Width           =   2775
  185.       End
  186.       Begin VHedit HEditArr 
  187.          BackColor       =   &H00FFFFFF&
  188.          ForeColor       =   &H00000000&
  189.          Height          =   315
  190.          Index           =   4
  191.          InflateBottom   =   270
  192.          InflateLeft     =   270
  193.          InflateRight    =   270
  194.          InflateTop      =   270
  195.          Left            =   2880
  196.          TabIndex        =   17
  197.          TabStop         =   0   'False
  198.          Top             =   540
  199.          Version         =   268435458
  200.          Width           =   3615
  201.       End
  202.       Begin VHedit HEditArr 
  203.          BackColor       =   &H00FFFFFF&
  204.          ForeColor       =   &H00000000&
  205.          Height          =   315
  206.          Index           =   5
  207.          InflateBottom   =   270
  208.          InflateLeft     =   270
  209.          InflateRight    =   270
  210.          InflateTop      =   270
  211.          Left            =   6480
  212.          TabIndex        =   18
  213.          TabStop         =   0   'False
  214.          Top             =   540
  215.          Version         =   268435458
  216.          Width           =   1935
  217.       End
  218.       Begin VHedit HEditArr 
  219.          BackColor       =   &H00FFFFFF&
  220.          ForeColor       =   &H00000000&
  221.          Height          =   315
  222.          Index           =   6
  223.          InflateBottom   =   270
  224.          InflateLeft     =   270
  225.          InflateRight    =   270
  226.          InflateTop      =   270
  227.          Left            =   120
  228.          TabIndex        =   19
  229.          TabStop         =   0   'False
  230.          Top             =   840
  231.          Version         =   268435458
  232.          Width           =   2775
  233.       End
  234.       Begin VHedit HEditArr 
  235.          BackColor       =   &H00FFFFFF&
  236.          ForeColor       =   &H00000000&
  237.          Height          =   315
  238.          Index           =   7
  239.          InflateBottom   =   270
  240.          InflateLeft     =   270
  241.          InflateRight    =   270
  242.          InflateTop      =   270
  243.          Left            =   2880
  244.          TabIndex        =   20
  245.          TabStop         =   0   'False
  246.          Top             =   840
  247.          Version         =   268435458
  248.          Width           =   3615
  249.       End
  250.       Begin VHedit HEditArr 
  251.          BackColor       =   &H00FFFFFF&
  252.          ForeColor       =   &H00000000&
  253.          Height          =   315
  254.          Index           =   8
  255.          InflateBottom   =   270
  256.          InflateLeft     =   270
  257.          InflateRight    =   270
  258.          InflateTop      =   270
  259.          Left            =   6480
  260.          TabIndex        =   21
  261.          TabStop         =   0   'False
  262.          Top             =   840
  263.          Version         =   268435458
  264.          Width           =   1935
  265.       End
  266.       Begin Label Label2 
  267.          BackColor       =   &H00C0C0C0&
  268.          Caption         =   "Name"
  269.          ForeColor       =   &H00000000&
  270.          Height          =   195
  271.          Index           =   0
  272.          Left            =   960
  273.          TabIndex        =   10
  274.          Top             =   0
  275.          Width           =   1095
  276.       End
  277.       Begin Label Label2 
  278.          BackColor       =   &H00C0C0C0&
  279.          Caption         =   "Address"
  280.          ForeColor       =   &H00000000&
  281.          Height          =   195
  282.          Index           =   1
  283.          Left            =   3960
  284.          TabIndex        =   11
  285.          Top             =   0
  286.          Width           =   1095
  287.       End
  288.       Begin Label Label2 
  289.          BackColor       =   &H00C0C0C0&
  290.          Caption         =   "Phone"
  291.          ForeColor       =   &H00000000&
  292.          Height          =   195
  293.          Index           =   2
  294.          Left            =   6780
  295.          TabIndex        =   12
  296.          Top             =   0
  297.          Width           =   1095
  298.       End
  299.       Begin Label Label1 
  300.          BackColor       =   &H00C0C0C0&
  301.          Caption         =   "To correct, make a checkmark on the entry."
  302.          ForeColor       =   &H00000000&
  303.          Height          =   315
  304.          Index           =   5
  305.          Left            =   2460
  306.          TabIndex        =   22
  307.          Top             =   1200
  308.          Width           =   4215
  309.       End
  310.    End
  311.    Begin CommandButton Command1 
  312.       Caption         =   "Return To Main Menu"
  313.       FontBold        =   -1  'True
  314.       FontItalic      =   0   'False
  315.       FontName        =   "MS Sans Serif"
  316.       FontSize        =   9.75
  317.       FontStrikethru  =   0   'False
  318.       FontUnderline   =   0   'False
  319.       Height          =   435
  320.       Left            =   120
  321.       TabIndex        =   0
  322.       Top             =   6120
  323.       Width           =   8775
  324.    End
  325.    Begin Label Label 
  326.       BackColor       =   &H00FFFFFF&
  327.       BorderStyle     =   1  'Fixed Single
  328.       ForeColor       =   &H00000000&
  329.       Height          =   495
  330.       Left            =   1020
  331.       TabIndex        =   6
  332.       Top             =   3120
  333.       Width           =   7035
  334.    End
  335. End
  336.  
  337. Sub Command1_Click ()
  338.     MainFrm.Show
  339.     GestFrm.Hide
  340. End Sub
  341.  
  342. Sub Form_Load ()
  343.     Label.Caption = ""
  344.     HEditArr(0).Text = "John F. Dow"
  345.     HEditArr(1).Text = "123 Nowhere Ave."
  346.     HEditArr(2).Text = "(206) 555-1234"
  347.     HEditArr(3).Text = "John Q. Public"
  348.     HEditArr(4).Text = "4567 There Way"
  349.     HEditArr(5).Text = "(321) 555-3456"
  350.     HEditArr(6).Text = "Jane Smith"
  351.     HEditArr(7).Text = "78 Back Over Ave."
  352.     HEditArr(8).Text = "(519) 555-3311"
  353. End Sub
  354.  
  355. Sub HEdit1_RcResult (RcResult As Long)
  356.     Dim VBrc As RcResult    'VB Copy of the RcResult Structure
  357.     Dim SyeTable() As SYE   'VB Copy of Symbol Element Array
  358.  
  359.     Rem --- Make a copy of the RCResult Structure
  360.     CPointerToVBType ByVal RcResult, VBrc, 80
  361.  
  362.     Rem --- Get the number of symbols in the graph
  363.     NumOfSymbols% = VBrc.SYGraph.cSye
  364.     lpSye& = VBrc.SYGraph.lpSye
  365.  
  366.     Rem --- Allocate enough space for all the symbols and copy them in
  367.     ReDim SyeTable(NumOfSymbols%)
  368.     CPointerToVBType ByVal lpSye&, SyeTable(0), NumOfSymbols% * 12
  369.  
  370.     Rem --- If there is only one symbol then check if it is a gesture
  371.     If (NumOfSymbols% = 1) Then
  372.         Syv& = SyeTable(0).Syv      'Get the symbol value
  373.         SyvType& = Syv& \ &H10000   'and calculate its type by looking at the HiWord
  374.     
  375.         Rem --- If it is a gesture, check if it is one that we change.
  376.         If (SyvType& = SYVHI_GESTURE) Then
  377.             
  378.             Rem --- If a circled-B then change the font and modify the RCResult
  379.             If (Syv& = (SYV_CIRCLELOA + Asc("b") - Asc("a"))) Then
  380.                 Hedit1.FontBold = Not Hedit1.FontBold
  381.                 VBrc.wREsultsType = VBrc.wREsultsType Or RCRT_ALREADYPROCESSED
  382.  
  383.             Rem --- If a circled-I then change the font and modify the RCResult
  384.             ElseIf (Syv& = (SYV_CIRCLELOA + Asc("i") - Asc("a"))) Then
  385.                 Hedit1.FontItalic = Not Hedit1.FontItalic
  386.                 VBrc.wREsultsType = VBrc.wREsultsType Or RCRT_ALREADYPROCESSED
  387.              
  388.             Rem --- If a copy ("alpha") gesture, then copy then text and modify the RCResult
  389.             ElseIf (Syv& = (SYV_COPY)) Then
  390.                 Label.Caption = Hedit1.Text
  391.                 VBrc.wREsultsType = VBrc.wREsultsType Or RCRT_ALREADYPROCESSED
  392.             End If
  393.         End If
  394.     
  395.         Rem --- Copy the Possibly modified RCResult back
  396.         VBTypeToCPointer VBrc, ByVal RcResult, 80
  397.     End If
  398.  
  399. End Sub
  400.  
  401. Sub HEditArr_GotFocus (Index As Integer)
  402.     Command1.SetFocus
  403. End Sub
  404.  
  405. Sub HEditArr_RcResult (Index As Integer, RcResult As Long)
  406.     Dim VBrc As RcResult    'VB Copy of the RcResult Structure
  407.     Dim SyeTable() As SYE   'VB Copy of Symbol Element Array
  408.  
  409.     Rem --- Make a copy of the RCResult Structure
  410.     CPointerToVBType ByVal RcResult, VBrc, 80
  411.  
  412.     Rem --- Get the number of symbols in the graph
  413.     NumOfSymbols% = VBrc.SYGraph.cSye
  414.     lpSye& = VBrc.SYGraph.lpSye
  415.  
  416.     Rem --- If there is only one symbol then check if it is a gesture
  417.     If (NumOfSymbols% = 1) Then
  418.  
  419.         Rem --- Allocate enough space for all the symbols and copy them in
  420.         ReDim SyeTable(NumOfSymbols%)
  421.         CPointerToVBType ByVal lpSye&, SyeTable(0), NumOfSymbols% * 12
  422.  
  423.         
  424.         Syv& = SyeTable(0).Syv      'Get the symbol value
  425.         SyvType& = Syv& \ &H10000   'and calculate it's type by looking at the HiWord
  426.     
  427.         Rem --- If it is a gesture, check if it is one that we change.
  428.         If (SyvType& = SYVHI_GESTURE) Then
  429.             
  430.             Rem --- If a correct gesture then call correct system
  431.             If (Syv& = (SYV_CORRECT)) Then
  432.                 Rem --- Disable current Form
  433.                 GestFrm.Enabled = False
  434.                 For i% = 0 To 8
  435.                     HEditArr(i%).BackColor = &HC0C0C0
  436.                 Next i%
  437.  
  438.                 GestFrm.BackColor = &HC0C0C0
  439.  
  440.                 Rem --- Load Editing form and fill data in
  441.                 Load EditSubForm
  442.                 first% = (Index \ 3) * 3
  443.                 EditSubForm.BName.Text = HEditArr(first%).Text
  444.                 EditSubForm.BAddr.Text = HEditArr(first% + 1).Text
  445.                 EditSubForm.BPhone(0).Text = Mid$(HEditArr(first% + 2).Text, 2, 3)
  446.                 EditSubForm.BPhone(1).Text = Mid$(HEditArr(first% + 2).Text, 7, 3)
  447.                 EditSubForm.BPhone(2).Text = Mid$(HEditArr(first% + 2).Text, 11, 4)
  448.                 EditSubForm.ElemNum.Caption = Str$(first%)
  449.  
  450.                 Rem --- Show Editing Form
  451.                 EditSubForm.Show
  452.             End If
  453.         End If
  454.     
  455.     End If
  456.  
  457.     Rem --- Ignore Everything
  458.     VBrc.wREsultsType = VBrc.wREsultsType Or RCRT_ALREADYPROCESSED
  459.     VBTypeToCPointer VBrc, ByVal RcResult, 80
  460.  
  461. End Sub
  462.  
  463.