Module nesting.pkg

     1//************************************************************************
     2//
     3// Confidential Trade Secret.
     4// Copyright 1987-1992 Data Access Corporation, Miami FL, USA
     5// All Rights reserved
     6// DataFlex is a registered trademark of Data Access Corporation.
     7//
     8//
     9//     $Source: k:\RCS\.\pkg\nesting.pkg,v $
    10//     $Revision: 1 $
    11//     $State: Exp $
    12//     $Author: james $
    13//     $Date: Apr 01 16:09:14 1997 $
    14//     $Locker:  $
    15//
    16// Augmented Messages:
    17//        Deactivate
    18//
    19//     $Log: nesting.pkg,v $
    20//Revision 2.1  1993/08/25  17:49:22  james
    21//Adding new main branch
    22//
    23//Revision 1.2  1993/04/28  00:20:34  james
    24//Initializing 3.04 source code.
    25//
    26//Revision 1.1  1992/09/08  14:43:07  james
    27//Initial revision
    28//
    29//Revision 1.8  92/06/27  09:35:58  lee
    30//changed inquire_first/last_deo to recurse into client_Areas. this keeps
    31//child_wrapping from sending get_auto_save_state to clients (which may
    32//not define auto_save_state property).
    33//
    34//Revision 1.7  92/05/29  14:06:09  lee
    35//removed end_construct_* messages from mixins; now, classes that use the mixin
    36//send the message that used to be sent by the end_construct_* message (for
    37//efficiency).
    38//
    39//Revision 1.6  92/05/14  15:48:59  unknown
    40//Updated Copyright slug - SWM.
    41//
    42//Revision 1.5  92/04/07  18:03:17  lee
    43//added NO_STOP option for broadcasting to override default behavior of
    44//stopping broadcast on a non-zero return value.
    45//
    46//Revision 1.4  92/04/03  18:00:16  lee
    47//updated add_focus/activate/deactivate/release_focus overrides to use (new)
    48//return value properly.
    49//
    50//Revision 1.3  92/03/29  18:45:05  lee
    51//added MSG_END_CONSTRUCT_OBJECT, moved ENDMAC macro stuff into END_CONSTRUCT-
    52//OBJECT procedures (in .pkgs). moved Flag_ITems to list.pkg after generalizing
    53//it based on PROTOTYPE_OBJECT instead of Whether or not it is a table-oriented
    54//object. Moved define_access_keys mechanism completely into actionbr.pkg.
    55//fixed two typos: import_class_protocol used !# instead of !3, and register-
    56//procedure used !1 instead of !2.
    57//
    58//Revision 1.2  92/03/09  19:03:42  james
    59//Added #CHKSUB directive to insure source
    60//only compiled with correct revision of
    61//compiler.
    62//
    63//Revision 1.1  91/10/23  10:21:51  elsa
    64//Initial revision
    65//
    66//************************************************************************/
    67// 12/16/94 - JJT Added stop_ui support (was in its own mixin)
    68//                We need to look at deactivate
    69//                Removed Add_focus which is called in server.pkg
    70// 09/04/95 JJT - Code Clean up (removed dead commented code)
    71//************************************************************************/
    72
    73//************************************************************************
    74//     File Name: Nesting.Inc
    75// Creation Date: January 1, 1991
    76// Modified Date: June 26, 1991
    77//     Author(s): Steven A. Lowe
    78//
    79// This module defines the properties and operations required to support
    80// nesting of data-entry objects, collected in the abstract class
    81// Navigate_Mixin.
    82//
    83// This file should be USEd prior to and IMPORTed within the scope of the
    84// class definition by any user-interface (esp. data-entry) class which
    85// must support the data-entry object standards.
    86//
    87// This file is used by ENTRYFRM.PKG, WIDELIST.PKG, TEXT_WIN.PKG, and
    88// ENCLIENT.PKG.
    89//************************************************************************/
    90
    91#CHKSUB 1 1 // Verify the UI subsystem.
    92
    93use VDFBase.pkg
    94
    95class nesting_mixin is a mixin
    96
    97  //
    98  // Description
    99  //
   100  //   This procedure defines the properties required to support the nesting
   101  //   of data-entry objects.
   102  //
   103  // Assumptions/Preconditions
   104  //
   105  //   This procedure should only be invoked from within the Construct_Object
   106  //   procedure of a class definition.
   107  //
   108  // Exceptions
   109  //
   110  //   None.
   111  //
   112  // Notes
   113  //
   114  //   Component_State indicates if this object has a parent object which is
   115  //   also a data-entry object.
   116  //
   117  //   Has_Components_State indicates if this object has at least one child-
   118  //   object which is also a data-entry object.
   119  //
   120  //   First_DEO and Last_DEO are used temporarily during the searches for
   121  //   the first and last data-entry object children of this object (see
   122  //   Find_First_DEO, Find_Last_DEO, Inquire_First_DEO and Inquire_Last_DEO).
   123  //
   124  { MethodType=Event Visibility=Private }
   125  procedure define_nesting
   126    { Visibility=Private }
   127    Property integer Component_State        0
   128    { Visibility=Private }
   129    Property integer Has_Components_State   0
   130    { Visibility=Private Obsolete=True }
   131    Property integer First_DEO              0
   132    { Visibility=Private Obsolete=True }
   133    Property integer Last_DEO               0
   134
   135    // Stop_ui support - Moved from its own mixin package.
   136    { Visibility=Private }
   137    property integer Stop_UI_State FALSE
   138
   139  end_procedure
   140
   141
   142  //
   143  // Description
   144  //
   145  //   If this object is focusable, set First_DEO to this object's id and
   146  //   return a non-zero value to terminate the parent object's BROADCAST.
   147  //
   148  //   This procedure is used to locate the first data-entry object among
   149  //   this object's siblings (its parent's children).
   150  //
   151  // Assumptions/Preconditions
   152  //
   153  //   None.
   154  //
   155  // Exceptions
   156  //
   157  //   None.
   158  //
   159  // Notes
   160  //
   161  //   This procedure is typically invoked via the BROADCAST command from
   162  //   the Find_First_DEO function of this object's parent.
   163  //
   164  { Visibility=Private Obsolete=True }
   165  procedure inquire_first_DEO integer obj# integer recurseClients
   166    if (focus_mode(self)) eq FOCUSABLE begin
   167      if (recurseClients AND client_area_state(self)) ;
   168          broadcast_focus send inquire_first_DEO obj# recurseClients
   169      else begin
   170        set first_DEO of obj# to self
   171        procedure_return 1  //to stop broadcast, since this object answered
   172      end
   173    end
   174  end_procedure
   175
   176  //
   177  // Description
   178  //
   179  //   If this object is focusable, set Lastt_DEO to this object's id.
   180  //
   181  //   This procedure is used to locate the last data-entry object among
   182  //   this object's siblings (its parent's children).
   183  //
   184  // Assumptions/Preconditions
   185  //
   186  //   None.
   187  //
   188  // Exceptions
   189  //
   190  //   None.
   191  //
   192  // Notes
   193  //
   194  //   This procedure is typically invoked via the BROADCAST command from
   195  //   the Find_Last_DEO function of this object's parent.
   196  //
   197  { Visibility=Private Obsolete=True }
   198  procedure inquire_last_DEO integer obj# integer recurseClients
   199    if (focus_mode(self)) eq FOCUSABLE begin
   200      if (recurseClients AND client_area_state(self)) ;
   201          broadcast_focus send inquire_last_DEO obj# recurseClients
   202      else set last_DEO of obj# to self
   203    end
   204  end_procedure
   205
   206  //
   207  // Description
   208  //
   209  //   This function returns the object id of the first data-entry object
   210  //   which is a child of this object, or 0.
   211  //
   212  // Assumptions/Preconditions
   213  //
   214  //   None.
   215  //
   216  // Exceptions
   217  //
   218  //   None.
   219  //
   220  // Notes
   221  //
   222  //   This function 'searches' by broadcasting Inquire_First_DEO, which
   223  //   returns a 1 to terminate the broadcast after the first data-entry
   224  //   object has been located.
   225  //
   226  { Visibility=Private Obsolete=True }
   227  function find_first_DEO returns integer
   228    set First_DEO to 0
   229    broadcast_focus send inquire_first_DEO self FALSE //sets First_DEO property
   230    function_return (first_deo(self))
   231  end_function
   232
   233
   234  //
   235  // Description
   236  //
   237  //   This function returns the object id of the last data-entry object
   238  //   which is a child of this object, or 0.
   239  //
   240  // Assumptions/Preconditions
   241  //
   242  //   None.
   243  //
   244  // Exceptions
   245  //
   246  //   None.
   247  //
   248  // Notes
   249  //
   250  //   This function 'searches' by broadcasting Inquire_Last_DEO, which sets
   251  //   the property Last_DEO.  Thus, the last object reached by the broadcast
   252  //   is the last value to be set into Last_DEO.
   253  //
   254  { Visibility=Private Obsolete=True }
   255  function find_last_DEO returns integer
   256    set Last_DEO to 0
   257    broadcast_focus send inquire_last_DEO self FALSE //sets Last_DEO property
   258    function_return (Last_DEO(self))
   259  end_function
   260
   261
   262  //
   263  // Description
   264  //
   265  //   Removes this object from the screen and focus-tree, and also removes
   266  //   this object's children from the screen and focus-tree.
   267  //
   268  // Assumptions/Preconditions
   269  //
   270  //   This object must understand Client_Area_State.
   271  //
   272  // Exceptions
   273  //
   274  //   None.
   275  //
   276  // Notes
   277  //
   278  //   If no flag argument was passed, AREA_TYPE becomes the flag parameter.
   279  //
   280  //   Client-objects already automatically remove their children from the
   281  //   focus-tree.
   282  //
   283  // 12/16/94 JJT- Altered so no param is not forwarded, Added stop_ui
   284 { NoDoc=True }
   285    Procedure Deactivate Integer eDeactivateScope Returns Integer
   286    integer retval Fg
   287    if NUM_ARGUMENTS gt 0 ;
   288       Move eDeactivateScope to Fg
   289    Else ;
   290       Move AREA_TYPE to Fg
   291    Forward get msg_deactivate fg to retval
   292
   293    if ( not(retval) AND (fg = 0) ) Begin
   294
   295// (LS) this broadcast no_stop is probably not ever used, but would be if a
   296// child was in the focus tree, but not as a focus-child. weird, but needs be here.
   297       If ( client_Area_state(self)=0) ;
   298           broadcast NO_STOP send deactivate 0
   299
   300       If ( Stop_UI_State(self) ) ;
   301           send Stop_Ui
   302    end
   303    procedure_return retval
   304  end_procedure
   305
   306  //
   307  // Description
   308  //
   309  //   This procedure marks an object as a child data-entry object, and
   310  //   attempts to use its parent's Server if this object has no Server.
   311  //
   312  // Assumptions/Preconditions
   313  //
   314  //   None.
   315  //
   316  // Exceptions
   317  //
   318  //   None.
   319  //
   320  // Notes
   321  //
   322  //   Typically senbt via broadcast from parent DEO.
   323  //
   324  { Visibility=Private }
   325  procedure Mark_As_Component
   326    set Component_State to true
   327    delegate set Has_Components_State to true
   328  end_procedure
   329
   330
   331  //
   332  // Description
   333  //
   334  //   This procedure marks child data-entry objects as components.
   335  //
   336  // Assumptions/Preconditions
   337  //
   338  //   The child data-entry objects must understand Mark_As_Component as a
   339  //   method of setting their Component_State to TRUE.
   340  //
   341  // Exceptions
   342  //
   343  //   None.
   344  //
   345  // Notes
   346  //
   347  //   Invoked by the DEOEnd macro (which manages completion of an object
   348  //   declaration).
   349  //
   350  { Visibility=Private }
   351  procedure Mark_Components
   352    set Component_State to false
   353    broadcast send Mark_As_Component
   354  end_procedure
   355end_class
   356