Module ExtFrm.pkg

     1//************************************************************************
     2// Confidential Trade Secret.
     3// Copyright (c) 1997 Data Access Corporation, Miami Florida
     4// as an unpublished work.  All rights reserved.
     5// DataFlex is a registered trademark of Data Access Corporation.
     6//
     7//************************************************************************
     8//************************************************************************
     9//
    10// $File name  : ExtFrm.pkg
    11// $File title : FormExternalControl
    12// Notice      :
    13// $Author(s)  : John Tuohy
    14//
    15// $Rev History
    16//
    17// 9/8/97    JJT - File created
    18//************************************************************************
    19
    20// This is very similar to dbExtFrm.pkg. That package is fully commented.
    21// Refer to that package for usage documentation.
    22
    23use windows.pkg
    24{ ClassType=Abstract }
    25{ HelpTopic=FormExternalControl }
    26Class FormExternalControl is a Form
    27
    28    Procedure Construct_Object
    29       Forward Send Construct_Object
    30       { Visibility=Private }
    31       Property integer Private.ControlChangingState false
    32       // set true when making a local (externally triggered) change. This is
    33       // set when a Set Value change is made
    34       { Visibility=Private }
    35       property integer LocalChangingState false
    36    End_Procedure // Construct_Object
    37
    38    { MethodType=Property }
    39    { Category=Data }
    40    Procedure set Value integer iItem string sVal
    41        forward set value item iItem to sVal
    42        If not (Private.ControlChangingState(self)) ;
    43            Send RefreshControl sVal
    44    End_Procedure
    45
    46    // It is expected that the sub-class (or more likely another
    47    // mixin included with the sub-class will provide functionality
    48    // for these messages. This gets and sets the value of the actual
    49    // window control. These should only be used to synchronize the window
    50    // control and the DF side. Do not use for any other purpose.
    51    { MethodType=Property }
    52    Procedure Set ControlValue string sVal
    53    End_Procedure
    54
    55    { MethodType=Property }
    56    Function ControlValue Returns String
    57    End_Function
    58
    59    // refresh control without triggering a DD changed condition.
    60    Procedure RefreshControl string sVal
    61        integer bOld
    62        Get LocalChangingState to bOld
    63        Set LocalChangingState to True
    64        set ControlValue to sval
    65        Set LocalChangingState to bOld
    66    End_Procedure
    67
    68    Procedure ControlValueChanged
    69        String sval
    70        Integer bOld
    71        Get Private.ControlChangingState to bOld
    72        Set Private.ControlChangingState to True
    73        Get ControlValue to sVal
    74        Set Value item 0 to sVal
    75        Set Item_Changed_State item 0 to True
    76        Set Private.ControlChangingState to bOld
    77    End_Procedure
    78
    79End_Class
    80