home *** CD-ROM | disk | FTP | other *** search
/ The Developer Connection…ice Driver Kit for OS/2 3 / DEV3-D1.ISO / devtools / dataflex / ftxtclnt.pkg < prev    next >
Encoding:
Text File  |  1993-08-10  |  3.2 KB  |  114 lines

  1. //************************************************************************
  2. //
  3. // Copyright 1987-1992 Data Access Corporation, Miami FL, USA
  4. // All Rights reserved
  5. // DataFlex is a registered trademark of Data Access Corporation.
  6. //
  7. //
  8. //     $Source: /u3/source.30/product/pkg/RCS/ftxtclnt.pkg,v $
  9. //     $Revision: 1.1 $
  10. //     $State: Exp $
  11. //     $Author: james $
  12. //     $Date: 1992/09/08 14:43:05 $
  13. //     $Locker:  $
  14. //
  15. //     $Log: ftxtclnt.pkg,v $
  16. //Revision 1.1  1992/09/08  14:43:05  james
  17. //Initial revision
  18. //
  19. //Revision 1.3  92/05/14  15:59:22  unknown
  20. //Updated Copyright slug.
  21. //
  22. //Revision 1.2  92/03/09  19:02:12  james
  23. //Added #CHKSUB directive to insure source
  24. //only compiled with correct revision of 
  25. //compiler.
  26. //
  27. //Revision 1.1  91/10/23  10:20:53  elsa
  28. //Initial revision
  29. //
  30. //************************************************************************/
  31.  
  32. //************************************************************************
  33. //     File Name: FTxtClnt.Pkg
  34. // Creation Date: January 1, 1991
  35. // Modified Date: May 23, 1991
  36. //     Author(s): Steven A. Lowe
  37. //
  38. // This module contains the Find-Text pop-up object for the Text_Editor
  39. // class.
  40. //
  41. // This package implements a pop-up object for text searching within a
  42. // text-editor object
  43. //************************************************************************/
  44.  
  45. #CHKSUB 1 1 // Verify the UI subsystem.
  46.  
  47. Use UI
  48.  
  49.  
  50. /findTxtImg
  51. ┌──────────────────────────────────────────────────┐
  52. │                                                  │
  53. │ Find what: ____________________________________  │
  54. │                                                  │
  55. │          <__>                <______>            │
  56. └──────────────────────────────────────────────────┘
  57. /*
  58. sub_page findTxtWin  FROM findTxtImg 1
  59. sub_page findTxtBtns FROM findTxtImg 2 3
  60.  
  61. //
  62. //Attribute: Find_Text_Area
  63. //
  64. //Description: pop-up form to enter search text
  65. //
  66. //Representation: FORM, with item sending FIND message
  67. //
  68. object Find_Text_Area is a CLIENT findTxtImg
  69.   set LOCATION to 7 10 relative
  70.   set DELEGATION_MODE to DELEGATE_PRIOR_LEVEL
  71.   set BLOCK_MOUSE_STATE to true
  72.   set SCOPE_STATE to TRUE
  73.   set exit_msg to cancel_scope
  74.   procedure cancel_scope
  75.     send deactivate 3
  76.   end_procedure
  77.   on_key kCancel        SEND cancel_scope
  78.   on_key kExit_Function SEND cancel_scope
  79.   object Find_Text_Window is a FORM findTxtWin
  80.     item_list 
  81.       on_item "" SEND Find_Text
  82.     end_item_list 
  83.   end_object
  84.   object OK_Button_Area is a BUTTON findTxtBtns
  85.     item_list
  86.       on_item "OK"     SEND Finis
  87.       on_item "CANCEL" SEND cancel_scope
  88.     end_item_list
  89.   end_object
  90.   procedure Finis
  91.     send find_text
  92.     send cancel_scope
  93.   end_procedure
  94.   //
  95.   //Operation: FIND_TEXT
  96.   //
  97.   //Assumption(s): none
  98.   //
  99.   //Goal(s): perform find using value of Find_Text_Area's item as search
  100.   //         pattern.  if match not found, ring bell
  101.   //
  102.   //Algorithm: sends find, if result = 0, rings bell
  103.   //
  104.   //Usage: invoked by item
  105.   //
  106.   procedure Find_Text
  107.     local integer retval
  108.     send find (value(Find_Text_Window(current_object),0)) retval  
  109.     if retval eq 0 send bell to Desktop
  110.   end_procedure
  111. end_object
  112.  
  113.  
  114.