Module findedit.pkg

     1//************************************************************************
     2//
     3// Confidential Trade Secret.
     4// Copyright 1987-1992 Data Access Corporation, Miami FL, USA
     5// All Rights reserved
     6//
     7//
     8//     $Source: k:\RCS\.\pkg\findedit.pkg,v $
     9//     $Revision: 1 $
    10//     $State: Exp $
    11//     $Author: james $
    12//     $Date: Apr 01 16:08:54 1997 $
    13//     $Locker:  $
    14//
    15//     $Log: findedit.pkg,v $
    16//Revision 2.1  1993/08/25  17:48:04  james
    17//Adding new main branch
    18//
    19//Revision 1.2  1993/04/28  00:20:34  james
    20//Initializing 3.04 source code.
    21//
    22//Revision 1.1  1992/09/08  14:43:05  james
    23//Initial revision
    24//
    25//Revision 1.7  92/06/20  04:21:14  lee
    26//altered wrapping to 1) ignore wrap_state, and 2) only save if not a child of
    27//a deo (child_wrapping will save if it's a child of a deo).
    28//
    29//Revision 1.6  92/06/03  15:19:44  steve-l
    30//altered WRAPPING to check wrap_state (kindly ignore comments for prior rev.)
    31//
    32//Revision 1.5  92/06/03  15:17:29  steve-l
    33//altered Child_Wrapping for proper argument dereferencing
    34//
    35//Revision 1.4  92/06/03  15:09:53  steve-l
    36//added WRAPPING function
    37//
    38//Revision 1.3  92/05/14  15:46:18  unknown
    39//Updated Copyright slug - SWM.
    40//
    41//Revision 1.2  92/03/09  19:01:57  james
    42//Added #CHKSUB directive to insure source
    43//only compiled with correct revision of
    44//compiler.
    45//
    46//Revision 1.1  91/10/23  10:20:43  elsa
    47//Initial revision
    48//
    49//************************************************************************/
    50
    51//************************************************************************
    52//     File Name: FindEdit.Inc
    53// Creation Date: January 1, 1991
    54// Modified Date: May 23, 1991
    55//     Author(s): Steven A. Lowe
    56//
    57// This module defines the messages and properties required to support
    58// the data-editing standard for data-entry objects, collected in the
    59// abstract class Find_Edit_Mixin.
    60//
    61// This file should be USEd prior to and IMPORTed within the scope of the
    62// class definition by any user-interface (esp. data-entry) class which
    63// must support the data-entry object standards.
    64//
    65// This file is used by ENTRYFRM.PKG, TEXT_WIN.PKG, and TABLE.PKG.
    66//************************************************************************/
    67
    68#CHKSUB 1 1 // Verify the UI subsystem.
    69
    70use VDFBase.pkg
    71use fndmodes.pkg    // special find modes
    72
    73class find_edit_mixin is a mixin
    74  //
    75  // Description
    76  //
    77  //   This procedure defines the accelerator keys and properties required to
    78  //   support the data-editing standard for data-entry objects.  This includes
    79  //   accelerator keys to support the finding, clearing, saving, and deleting
    80  //   of database records, and two properties governing certain automatic
    81  //   functions of editing (see Notes).
    82  //
    83  // Assumptions/Preconditions
    84  //
    85  //   This procedure should only be called from within the Construct_Object
    86  //   procedure of a class definition.
    87  //
    88  // Exceptions
    89  //
    90  //   None.
    91  //
    92  // Notes
    93  //
    94  //   The Auto_Save_State property governs whether a Save is automatically
    95  //   issued upon rotation wrap-around (from the last object/item to the
    96  //   first object/item).
    97  //
    98  //   The Auto_Clear_DEO_State property governs whether a Clear is
    99  //   automatically issued after a successful Save or Delete operation.
   100  //
   101  { MethodType=Event Visibility=Private }
   102  procedure define_find_edit
   103    on_key kClear               SEND Request_Clear      PRIVATE
   104    on_key kClear_All           SEND Request_Clear_All  PRIVATE
   105    on_key kDelete_Record       SEND Request_Delete     PRIVATE
   106//    on_key kBegin_of_Data       SEND Beginning_of_Data  PRIVATE
   107//    on_key kEnd_of_Data         SEND End_of_Data        PRIVATE
   108    on_key kBegin_of_Data       SEND Find_First         PRIVATE
   109    on_key kFind_Previous       SEND Find_Previous      PRIVATE
   110    on_key kFind                SEND Find_GE            PRIVATE
   111    on_key kFind_Next           SEND Find_Next          PRIVATE
   112    on_key kEnd_of_Data         SEND Find_Last          PRIVATE
   113    on_key kSave_Record         SEND Request_Save       PRIVATE
   114    on_key kSuper_Find          SEND SuperFind          PRIVATE
   115    on_key kSuper_Find_Next     SEND SuperFind_Next     PRIVATE
   116    on_key kSuper_Find_Previous SEND SuperFind_Previous PRIVATE
   117    { Category=Data }
   118    { PropertyType=Boolean }
   119    Property Integer Auto_Save_State      False
   120    { Category=Data }
   121    { PropertyType=Boolean }
   122    Property Integer Auto_Clear_DEO_State True
   123  end_procedure
   124
   125
   126  //
   127  // Description
   128  //
   129  //   This procedure finds greater-than-or-equal-to using the file and field,
   130  //   if any, of the current item.
   131  //
   132  // Assumptions/Preconditions
   133  //
   134  //   None.
   135  //
   136  // Exceptions
   137  //
   138  //   None.
   139  //
   140  // Notes
   141  //
   142  //   Depends entirely upon Request_Find.
   143  //
   144  procedure Find_GE
   145    send Request_Find GE TRUE
   146  end_procedure
   147
   148
   149  //
   150  // Description
   151  //
   152  //   This procedure finds greater-than using the file and field, if any,
   153  //   of the current item.
   154  //
   155  // Assumptions/Preconditions
   156  //
   157  //   None.
   158  //
   159  // Exceptions
   160  //
   161  //   None.
   162  //
   163  // Notes
   164  //
   165  //   Depends entirely upon Request_Find.
   166  //
   167  procedure Find_Next
   168    send Request_Find GT TRUE
   169  end_procedure
   170
   171
   172  //
   173  // Description
   174  //
   175  //   This procedure finds less-than using the file and field, if any,
   176  //   of the current item.
   177  //
   178  // Assumptions/Preconditions
   179  //
   180  //   None.
   181  //
   182  // Exceptions
   183  //
   184  //   None.
   185  //
   186  // Notes
   187  //
   188  //   Depends entirely upon Request_Find.
   189  //
   190  procedure Find_Previous
   191    send Request_Find LT TRUE
   192  end_procedure
   193
   194  // 3/22/2002: Added find_first and Find_last. Previously this
   195  // was accomplished by sending beginning_of_data and end_of_data. The
   196  // problem with that message is that it had multiple meaning. In a edit
   197  // or grid, it means go to top/bottom of file. In forms, it means first
   198  // last record. Since we can not change this without breaking existing
   199  // programs we will create a message that *always* does a find first/last
   200  // record. This can be used in tool bars (or anywhere) to consistently provide
   201  // the same behavior.
   202
   203  procedure Find_First
   204    send Request_Find FIRST_RECORD FALSE // param is false because entry-update is not needed
   205  end_procedure
   206
   207  procedure Find_Last
   208    send Request_Find LAST_RECORD FALSE
   209  end_procedure
   210
   211  //
   212  // Description
   213  //
   214  //   This procedure superfinds greater-than-or-equal-to using the file and
   215  //   field, if any, of the current item.
   216  //
   217  // Assumptions/Preconditions
   218  //
   219  //   None.
   220  //
   221  // Exceptions
   222  //
   223  //   None.
   224  //
   225  // Notes
   226  //
   227  //   Depends entirely upon Request_SuperFind.
   228  //
   229  procedure SuperFind
   230    send Request_SuperFind GE
   231  end_procedure
   232
   233
   234  //
   235  // Description
   236  //
   237  //   This procedure superfinds greater-than using the file and field, if
   238  //   any, of the current item.
   239  //
   240  // Assumptions/Preconditions
   241  //
   242  //   None.
   243  //
   244  // Exceptions
   245  //
   246  //   None.
   247  //
   248  // Notes
   249  //
   250  //   Depends entirely upon Request_SuperFind.
   251  //
   252  procedure SuperFind_Next
   253    send Request_SuperFind GT
   254  end_procedure
   255
   256
   257  //
   258  // Description
   259  //
   260  //   This procedure superfinds less-than using the file and field, if any,
   261  //   of the current item.
   262  //
   263  // Assumptions/Preconditions
   264  //
   265  //   None.
   266  //
   267  // Exceptions
   268  //
   269  //   None.
   270  //
   271  // Notes
   272  //
   273  //   Depends entirely upon Request_SuperFind.
   274  //
   275  procedure SuperFind_Previous
   276    send Request_SuperFind LT
   277  end_procedure
   278
   279  { MethodType=Event Visibility=Private }
   280  function Wrapping Returns Integer
   281    //
   282    // if this is a child of a DEO, it will be saved by child_wrapping.
   283    // however, if this is not a child of a DEO, and we are wrapping,
   284    // and auto_save is true, save.
   285    //
   286    if (not(component_state(self)) AND ;
   287        auto_save_state(self)) ;
   288        send request_Save
   289    Function_Return 0
   290  end_function
   291
   292
   293  //  Returns True to indicate that this DEO supports the Find mixin protocol. This is used by menu items
   294  //  to determine if you are within a DEO control finding obejct and should therefore send a DEO message.
   295  //
   296  Function Deo_Find_Object Returns Boolean
   297      Function_Return True
   298  End_Function  
   299End_Class
   300
   301