Module Dfdeoft.pkg

     1// 2/26/2002  JJT - 8.2 clean up (indirect_file, local, self, etc.)
     2//  2/26/02 JJT - For 8.2 replaced field_main_index with File_field_Index
     3// 07/23/96 JJT - New Class names
     4Use LanguageText.pkg
     5Use Windows.pkg
     6
     7Register_Procedure Prompt
     8Register_Procedure find_Next
     9Register_Procedure find_Previous
    10Register_Procedure request_Clear_all
    11Register_Procedure request_Clear
    12Register_Procedure request_save
    13Register_Procedure request_delete
    14Register_function File_field_index integer iFile integer iField returns integer
    15
    16{ HelpTopic=dbFloatingPopupMenu }
    17Class dbFloatingPopupMenu is a FormFloatingPopupMenu
    18
    19   Procedure Construct_Object
    20      Forward Send Construct_Object
    21
    22      { Visibility=Private }
    23      Property integer First_item 0
    24
    25      Set First_Item to (Item_Count(self))
    26      Send Add_Item  Msg_None                  ""
    27      Send Add_Item  Msg_Prompt                C_$Prompt
    28      Send Add_Item  Msg_None                  ""
    29      Send Add_Item  Msg_find_Next             C_$FindNext
    30      Send Add_Item  Msg_find_Previous         C_$FindPrevious
    31      Send Add_Item  Msg_None                  ""
    32      Send Add_Item  Msg_request_Clear_all     C_$ClearAll
    33      Send Add_Item  Msg_request_Clear         C_$Clear
    34      Send Add_Item  Msg_request_save          C_$Save
    35      Send Add_Item  Msg_request_delete        C_$Delete
    36   End_Procedure
    37
    38   { NoDoc=True }
    39   Procedure Popup
    40      integer obj# Srvr itm# changed hasIndex Ordr Field# file#
    41      integer FrstItm
    42      Get First_item to FrstItm
    43      get Focus of desktop to Obj#
    44      Get Current_item of Obj# to itm#    // invoking item
    45      Get Server of obj# to Srvr          // invoking data-set
    46      Get Should_Save of Obj# to changed  // changed file?
    47      Get data_file of Obj# to file#
    48      Get data_field of Obj# to field#
    49      Move ( Srvr=0 OR (File#>0 AND ;
    50             (File_Field_Index(Srvr,File#,Field#)>-1)) ;
    51                ) to HasIndex             // has a find index?
    52
    53      // shadow prompt if no prompt object
    54      Set Shadow_state item (FrstItm+1) to (prompt_Object(Obj#,itm#)=0)
    55
    56      // if no index shut off the find choices
    57      Set Shadow_state item (FrstItm+3) to (hasIndex=0)
    58      Set Shadow_state item (FrstItm+4) to (hasIndex=0)
    59      // Always allow clears since they return to top of form
    60      // shadow save if no changes
    61      Set Shadow_state item (FrstItm+8) to (changed=0)
    62      // shadow delete if no record
    63      Set Shadow_state item (FrstItm+9) to (Srvr=0 OR not(HasRecord(Srvr)) )
    64      //
    65      Forward send Popup
    66      //
    67   End_Procedure // Popup
    68
    69End_Class
    70
    71Integer Default_dbFloating_Menu_ID
    72
    73Object dbFloatingMenu is a dbFloatingPopupMenu
    74   Move self to Default_dbFloating_Menu_ID
    75end_Object
    76