home *** CD-ROM | disk | FTP | other *** search
/ The Developer Connection…ice Driver Kit for OS/2 3 / DEV3-D1.ISO / devtools / dataflex / golnclnt.pkg < prev    next >
Encoding:
Text File  |  1993-08-10  |  3.4 KB  |  123 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/golnclnt.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: golnclnt.pkg,v $
  16. //Revision 1.1  1992/09/08  14:43:05  james
  17. //Initial revision
  18. //
  19. //Revision 1.3  92/05/14  16:48:51  SWM
  20. //Updated Copyright slug.
  21. //
  22. //Revision 1.2  92/03/09  19:02:18  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:56  elsa
  28. //Initial revision
  29. //
  30. //************************************************************************/
  31.  
  32. //************************************************************************
  33. //     File Name: GoLnClnt.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 Goto-Line pop-up object for the Text_Editor
  39. // class.
  40. //
  41. // This package implements a pop-up object for absolute line positioning
  42. // within a text-editor object
  43. //************************************************************************/
  44.  
  45. #CHKSUB 1 1 // Verify the UI subsystem.
  46.  
  47. Use UI
  48.  
  49.  
  50. /goLineImg
  51. ┌─────────────────────┐
  52. │                     │
  53. │ Go To Line: _____.  │
  54. │                     │
  55. │                     │
  56. │   <__>   <______>   │
  57. └─────────────────────┘
  58. /*
  59. sub_page goLineNumImg FROM goLineImg 1
  60. sub_page goLineBtnImg FROM goLineImg 2 3
  61.  
  62. //
  63. //Attribute: Goto_Line_Area
  64. //
  65. //Description: pop-up form for target line number entry
  66. //
  67. //Representation: FORM, with item sending GOTO_LINE
  68. //
  69. object Goto_Line_Area is a CLIENT goLineImg
  70.   set location to 5 17 relative
  71.   set DELEGATION_MODE to DELEGATE_PRIOR_LEVEL
  72.   set BLOCK_MOUSE_STATE to true
  73.   set SCOPE_STATE to TRUE
  74.   set exit_msg to cancel_Scope
  75.   on_key kCancel        SEND cancel_Scope
  76.   on_key kExit_Function SEND cancel_scope
  77.   procedure cancel_scope
  78.     send deactivate 3
  79.   end_procedure
  80.   object Line_Window is a FORM goLineNumImg
  81.     item_list
  82.       on_item "" SEND Goto_Line
  83.     end_item_list
  84.   end_object
  85.   object Button_Area is a BUTTON goLineBtnImg
  86.     item_list
  87.       on_item "OK"     SEND Finis
  88.       on_item "CANCEL" SEND cancel_Scope
  89.     end_item_list
  90.   end_object
  91.   procedure Finis
  92.     send goto_line
  93.     send cancel_Scope
  94.   end_procedure
  95.   //
  96.   //Operation: GOTO_LINE
  97.   //
  98.   //Assumption(s): none
  99.   //
  100.   //Goal(s): make cursor in prior focus go to line number specified by item's
  101.   //  value; if specified line number is out of range, issue error
  102.   //  and re-activate pop-up form
  103.   //
  104.   //Algorithm: if value of item < 1,
  105.   //             issue error and send activate, then exit procedure
  106.   //           delegate send GOTO_LINE, passing (item value - 1)
  107.   //
  108.   //Usage: invoked externally
  109.   //
  110.   procedure Goto_Line
  111.     local integer lnum
  112.     move (value(Line_Window(current_object),0)) to lnum
  113.     if lnum lt 1 begin
  114.       error 101 "Line# must be > 0"
  115.       send activate
  116.       procedure_Return    //re-enter
  117.     end                //line#s start at 0
  118.     send goto_line to (prior_level(current_object)) (lnum - 1)
  119.   end_procedure
  120. end_object
  121.  
  122.  
  123.