Get code running in both XE + XE5 compilers:

* Conditionally including units does not really work, because of a IDE bug: http://stackoverflow.com/questions/13776195/how-to-conditionally-include-some-units . So, we define a unit alias for System.Actions in XE, which we do not need in XE5.
* Dynamically use the fitting numeric type per compiler for a TUpDown.OnChangingEx event.
This commit is contained in:
Ansgar Becker
2013-10-20 08:29:28 +00:00
parent cb37bd6dd7
commit 317bf5e88e
3 changed files with 6 additions and 5 deletions

View File

@ -81,7 +81,8 @@ type
FUpDown: TUpDown;
procedure DoKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
procedure DoKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
procedure UpDownChangingEx(Sender: TObject; var AllowChange: Boolean; NewValue: SmallInt; Direction: TUpDownDirection);
procedure UpDownChangingEx(Sender: TObject; var AllowChange: Boolean;
NewValue: {$IF CompilerVersion<26}SmallInt{$ELSE}Integer{$IFEND}; Direction: TUpDownDirection);
procedure UpDownMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
procedure DoOnTimer(Sender: TObject);
procedure ModifyDate(Offset: Integer);
@ -634,7 +635,7 @@ end;
procedure TDateTimeEditorLink.UpDownChangingEx(Sender: TObject; var AllowChange: Boolean;
NewValue: SmallInt; Direction: TUpDownDirection);
NewValue: {$IF CompilerVersion<26}SmallInt{$ELSE}Integer{$IFEND}; Direction: TUpDownDirection);
begin
if FTimer.Enabled then
Exit;

View File

@ -19,7 +19,7 @@ uses
routine_editor, trigger_editor, event_editor, options, EditVar, helpers, createdatabase, table_editor,
TableTools, View, Usermanager, SelectDBObject, connections, sqlhelp, dbconnection,
insertfiles, searchreplace, loaddata, copytable, VTHeaderPopup, Cromis.DirectoryWatch, SyncDB, gnugettext,
JumpList;
JumpList, System.Actions;
type