home *** CD-ROM | disk | FTP | other *** search
- //************************************************************************
- //
- // Copyright 1987-1992 Data Access Corporation, Miami FL, USA
- // All Rights reserved
- // DataFlex is a registered trademark of Data Access Corporation.
- //
- //
- // $Source: /u3/source.30/product/pkg/RCS/golnclnt.pkg,v $
- // $Revision: 1.1 $
- // $State: Exp $
- // $Author: james $
- // $Date: 1992/09/08 14:43:05 $
- // $Locker: $
- //
- // $Log: golnclnt.pkg,v $
- //Revision 1.1 1992/09/08 14:43:05 james
- //Initial revision
- //
- //Revision 1.3 92/05/14 16:48:51 SWM
- //Updated Copyright slug.
- //
- //Revision 1.2 92/03/09 19:02:18 james
- //Added #CHKSUB directive to insure source
- //only compiled with correct revision of
- //compiler.
- //
- //Revision 1.1 91/10/23 10:20:56 elsa
- //Initial revision
- //
- //************************************************************************/
-
- //************************************************************************
- // File Name: GoLnClnt.Pkg
- // Creation Date: January 1, 1991
- // Modified Date: May 23, 1991
- // Author(s): Steven A. Lowe
- //
- // This module contains the Goto-Line pop-up object for the Text_Editor
- // class.
- //
- // This package implements a pop-up object for absolute line positioning
- // within a text-editor object
- //************************************************************************/
-
- #CHKSUB 1 1 // Verify the UI subsystem.
-
- Use UI
-
-
- /goLineImg
- ┌─────────────────────┐
- │ │
- │ Go To Line: _____. │
- │ │
- │ │
- │ <__> <______> │
- └─────────────────────┘
- /*
- sub_page goLineNumImg FROM goLineImg 1
- sub_page goLineBtnImg FROM goLineImg 2 3
-
- //
- //Attribute: Goto_Line_Area
- //
- //Description: pop-up form for target line number entry
- //
- //Representation: FORM, with item sending GOTO_LINE
- //
- object Goto_Line_Area is a CLIENT goLineImg
- set location to 5 17 relative
- set DELEGATION_MODE to DELEGATE_PRIOR_LEVEL
- set BLOCK_MOUSE_STATE to true
- set SCOPE_STATE to TRUE
- set exit_msg to cancel_Scope
- on_key kCancel SEND cancel_Scope
- on_key kExit_Function SEND cancel_scope
- procedure cancel_scope
- send deactivate 3
- end_procedure
- object Line_Window is a FORM goLineNumImg
- item_list
- on_item "" SEND Goto_Line
- end_item_list
- end_object
- object Button_Area is a BUTTON goLineBtnImg
- item_list
- on_item "OK" SEND Finis
- on_item "CANCEL" SEND cancel_Scope
- end_item_list
- end_object
- procedure Finis
- send goto_line
- send cancel_Scope
- end_procedure
- //
- //Operation: GOTO_LINE
- //
- //Assumption(s): none
- //
- //Goal(s): make cursor in prior focus go to line number specified by item's
- // value; if specified line number is out of range, issue error
- // and re-activate pop-up form
- //
- //Algorithm: if value of item < 1,
- // issue error and send activate, then exit procedure
- // delegate send GOTO_LINE, passing (item value - 1)
- //
- //Usage: invoked externally
- //
- procedure Goto_Line
- local integer lnum
- move (value(Line_Window(current_object),0)) to lnum
- if lnum lt 1 begin
- error 101 "Line# must be > 0"
- send activate
- procedure_Return //re-enter
- end //line#s start at 0
- send goto_line to (prior_level(current_object)) (lnum - 1)
- end_procedure
- end_object
-
-