Module Dfconfrm.pkg

     1//************************************************************************
     2//************************************************************************/
     3
     4//************************************************************************
     5// DFConfrm.Pkg
     6// Version: 1.0
     7// Copyright (c) 1993 2E Software
     8// Author: John J. Tuohy
     9//  09-01-94   : converted from DAF
    10//
    11//  11/11/94   JJT - Adjusted size of buttons (1 larger)
    12//  03/01/95   JJT - Adjusted size of textbox and vcentered it. removed
    13//                   the F2 and and Esc from the buttons (although they
    14//                   are still supported with the keys).
    15//
    16//************************************************************************
    17Use LanguageText.pkg
    18Use msgbox.pkg
    19
    20// General purpose confirm function. Added to all classes
    21//
    22Function Confirm for cUIObject String item_name Returns Integer
    23   Integer rval
    24   Get YesNo_Box item_name C_$Confirm to rval
    25   Function_Return (rval<>MBR_YES)
    26End_function
    27
    28Function Save_Confirmation for cUIObject Returns integer
    29  Function_return (confirm(self, C_$SaveThisRecord))
    30End_function
    31
    32Function Delete_Confirmation for cUIObject Returns integer
    33  Function_return (confirm(self, C_$DeleteThisRecord))
    34End_function
    35
    36Function Line_Save_Confirmation for cUIObject Returns Integer
    37  Function_return (confirm(self, C_$SaveThisLine))
    38End_function
    39
    40Function Line_Delete_Confirmation for cUIObject Returns Integer
    41  Function_return (confirm(self, C_$DeleteThisLine))
    42End_function
    43
    44Function Data_Loss_Confirmation for cUIObject Returns integer
    45  Function_return (confirm(self, C_$AbandonChanges))
    46End_function
    47
    48Function Exit_Loss_Confirmation for cUIObject Returns integer
    49  Integer tmp
    50  //Get Should_Save to tmp
    51  //if tmp eq 0 broadcast get Should_save_recursive to tmp
    52  get Should_save_recursive to tmp
    53  if tmp ne 0 Function_return (confirm(self, C_$ChangesExistAbandon))
    54End_function
    55
    56Function No_Confirmation for cUIObject Returns integer
    57End_function
    58
    59{ NoDoc=True }
    60Function Should_Save for cUIObject returns integer
    61end_function
    62
    63{ Visibility=Private }
    64Function Should_Save_Recursive for cUIObject returns integer
    65  Integer rVal
    66  Get Should_Save to Rval // changes in this object???
    67  If rVal eq 0 BroadCast Get Should_Save_Recursive to Rval // check w/ kids
    68  Function_return rVal
    69End_Function
    70
    71