Module Dfentry.pkg
1//************************************************************************
2//
3// Copyright (c) 1997 Data Access Corporation, Miami Florida,
4// All rights reserved.
5// DataFlex is a registered trademark of Data Access Corporation.
6//
7// 08/19/94 JJT - Blended Classes from CB and DAF
8// 09/28/94 JJT - Added Entering to help with previous & switch_back
9// 10/28/94 JJT - Added better switch logic.
10// Added automatic prompt button creation support.
11//
12//************************************************************************
13// 4.0 Changes
14// 8/13/97 JJT - Moved prompt button logic to entry class
15// 07/23/96 JJT - New Class names
16// 06/03/96 JJT - Added DEO_Control_Object ID
17// 04/16/96 JJT - Added DD support (if USE$DATA_DICTIONARY is defined)
18// 03/28/95 JJT - Removed Layer for 0 class
19// Added DF navigate and Help DEO support.
20// Changed name to dfentry.pkg
21//************************************************************************
22
23Use Windows.pkg
24Use EnFrm_ds.pkg
25Use DFDEOft.pkg // deo floating panel object
26Use DFNav_mx.pkg // Navigation changes for DF DEOs
27Use DFCdDeo.pkg // DEO Code message support
28
29
30{ ClassType=Abstract }
31{ HelpTopic=dbForm_ }
32Class dbForm_ is a Entry STARTMAC EFstart
33 // the startmac is used to catch old obsolete code at compiletime
34 Import_Class_Protocol Entry_Form_DS_mixin
35End_Class
36
37//
38// EntryForm
39//
40{ ClassType=Abstract }
41{ OverrideProperty=Prompt_Button_Mode InitialValue=PB_PromptAuto }
42{ OverrideProperty=Floating_Menu_Object InitialValue=Default_dbFloating_Menu_ID }
43{ HelpTopic=dbFormDS }
44Class dbFormDS is a dbForm_
45
46 Procedure Construct_Object Integer Img#
47 Forward Send Construct_Object no_image
48
49 Send Define_DFNavigation // GUI navigate changes
50
51 Set Floating_Menu_Object to Default_dbFloating_Menu_ID
52
53 // This is a DAF compromise. Validation messages on single item
54 // based objects do not work well at all. You get validates when
55 // you exit the object (up or down). This fires way too many validates.
56 // This needs to be fixed but is beyond the scope of DAF. Here, we will
57 // change item validate to only validate on forward (next) navigation
58 // and, of course, on saves. The biggest problem here is that a
59 // single item mouse forward will not validate where a Tab/enter
60 // will. I have no better solution.
61 //
62 Set Validate_Mode to VALIDATE_ON_SAVE_NEXT
63
64 Set Prompt_Button_Mode to PB_PromptAuto
65
66 End_Procedure // Construct_Object
67
68 Import_Class_Protocol DFNavigate_Mixin
69 Import_Class_Protocol DFCode_DEO_Mixin
70
71 // Returns TRUE to indicate that this is a DEO control. This is used by
72 // if you are within a DEO control message and should therefore
73 // send a DEO message.
74 //
75 { MethodType=Property }
76 Function DEO_Control_Object Returns integer
77 Function_Return 1
78 End_Function // DEO_Control_Object
79
80 { Visibility=Private }
81 Procedure Bind_Data integer File# Integer Field#
82 Set Data_File item 0 to File#
83 Set Data_Field item 0 to Field#
84 Set New_Item to 0
85 Set Message item 0 to msg_Next
86 End_Procedure // Bind_Data
87
88 // added to improve autofind logic
89 //
90 { Visibility=Private }
91 procedure DoAutoFind
92 Integer bChanged bOn
93 // both changed_state and item_changed_state must be set for an autofind. If a default
94 // value is set item_changed_state will be true and changed_state will be false. We want to
95 // ignore these conditions
96 get item_changed_State item 0 to bChanged
97 if (bChanged and changed_state(self)) begin
98 get item_option item 0 AUTOFIND_BIT to bOn
99 if bOn begin
100 get item_option item 0 AUTOFIND_GE_BIT to bOn
101 Send entry_autofind (if(bOn,GE,EQ)) 0
102 end
103 end
104 end_procedure
105
106
107 // added to improve autofind
108 //
109 { MethodType=Event Nodoc=True }
110 Procedure Exiting Handle hoDestination Returns Integer
111 integer bErr
112 // although exiting does not do a validate it should do an
113 // autofind (if autofind is needed). This is consisent with
114 // character mode behavior.
115 send doAutofind // // this does an autofind if needed, this is needed before save
116 Forward get msg_exiting hoDestination to bErr
117 function_return bErr
118 end_procedure
119
120 procedure Request_Save
121 Send doAutofind // this does an autofind if needed, this is needed before save
122 forward send request_save
123 end_procedure
124
125
126End_Class
127
128Use DD_Deomx.pkg // mixin support for dd classes
129
130{ DataBindable=True }
131{ HelpTopic=dbForm }
132Class dbForm is a dbFormDS
133 Import_Class_Protocol Extended_DEO_Mixin
134 Import_Class_Protocol Extended_DEO_Status_Help_Mixin
135 Import_Class_Protocol Extended_DEO_Prompt_Mixin
136 Import_Class_Protocol Extended_DEO_Status_Help_Tooltip_Mixin
137End_Class
138
139// We don't use object command syntax anymore. We have this here to trigger errors for older
140// code that may use this.
141#COMMAND EFstart R R
142 FORWARD_BEGIN_CONSTRUCT !1 !2
143 bind_using !3 !4 !5 !6 !7 !8 !9
144#ENDCOMMAND
145