ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/examples/employee/unit1.pas
(Generate patch)

Comparing ibx/trunk/examples/employee/unit1.pas (file contents):
Revision 28 by tony, Tue Apr 14 13:10:23 2015 UTC vs.
Revision 29 by tony, Sat May 9 11:37:49 2015 UTC

# Line 80 | Line 80 | type
80      Panel2: TPanel;
81      EmployeeEditorPanel: TPanel;
82      SpeedButton1: TSpeedButton;
83 +    JobGradeChangeTimer: TTimer;
84 +    JobCodeChangeTimer: TTimer;
85      TotalsQueryTOTALSALARIES: TIBBCDField;
86      TotalsSource: TDataSource;
87      TotalsQuery: TIBQuery;
# Line 98 | Line 100 | type
100      IBTransaction1: TIBTransaction;
101      procedure EmployeesAfterPost(DataSet: TDataSet);
102      procedure EmployeesValidatePost(Sender: TObject; var CancelPost: boolean);
103 +    procedure JobCodeChangeTimerTimer(Sender: TObject);
104 +    procedure JobGradeChangeTimerTimer(Sender: TObject);
105      procedure JobGradeDBComboBoxCloseUp(Sender: TObject);
106      procedure SelectDeptExecute(Sender: TObject);
107      procedure AddEmployeeExecute(Sender: TObject);
# Line 237 | Line 241 | begin
241    CancelPost := (EmployeesLAST_NAME.AsString = sNoName) and  (EmployeesFIRST_NAME.AsString = sNoName);
242   end;
243  
244 + procedure TForm1.JobCodeChangeTimerTimer(Sender: TObject);
245 + begin
246 +  Countries.Active := false;
247 +  Countries.Active := true;
248 +  JobCodeChangeTimer.Interval := 0;
249 + end;
250 +
251 + procedure TForm1.JobGradeChangeTimerTimer(Sender: TObject);
252 + begin
253 +  Countries.Active := false;
254 +  JobCodes.Active := false;
255 +  Countries.Active := true;
256 +  JobCodes.Active := true;
257 +  JobGradeChangeTimer.Interval := 0;
258 + end;
259 +
260   procedure TForm1.JobGradeDBComboBoxCloseUp(Sender: TObject);
261   begin
262    JobGradeDBComboBox.EditingDone; //See http://bugs.freepascal.org/view.php?id=27186
# Line 298 | Line 318 | end;
318  
319   procedure TForm1.EmployeesAfterScroll(DataSet: TDataSet);
320   begin
321 <  Countries.Active := false;
302 <  JobCodes.Active := false;
303 <  Countries.Active := true;
304 <  JobCodes.Active := true;
321 >  JobGradeChangeTimer.Interval := 200;
322   end;
323  
324   procedure TForm1.EmployeesBeforeClose(DataSet: TDataSet);
# Line 337 | Line 354 | end;
354  
355   procedure TForm1.EmployeesJOB_CODEChange(Sender: TField);
356   begin
357 <  Countries.Active := false;
341 <  Countries.Active := true;
357 >  JobCodeChangeTimer.Interval := 200;
358   end;
359  
360   procedure TForm1.EmployeesJOB_GRADEChange(Sender: TField);
361   begin
362 <  Countries.Active := false;
347 <  JobCodes.Active := false;
348 <  Countries.Active := true;
349 <  JobCodes.Active := true;
362 >  JobGradeChangeTimer.Interval := 200;
363   end;
364  
365   procedure TForm1.FormClose(Sender: TObject; var CloseAction: TCloseAction);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines