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

@ -1,4 +1,4 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<ProjectGuid>{53d02113-9bb2-4326-83eb-53734f07dae7}</ProjectGuid> <ProjectGuid>{53d02113-9bb2-4326-83eb-53734f07dae7}</ProjectGuid>
<MainSource>heidisql.dpr</MainSource> <MainSource>heidisql.dpr</MainSource>
@ -26,7 +26,7 @@
<Base>true</Base> <Base>true</Base>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Base)'!=''"> <PropertyGroup Condition="'$(Base)'!=''">
<DCC_UnitAlias>WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;$(DCC_UnitAlias)</DCC_UnitAlias> <DCC_UnitAlias>WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;System.Actions=ActnList;$(DCC_UnitAlias)</DCC_UnitAlias>
<DCC_UnitSearchPath>..\..\components\graphicex;..\..\components\synapse;..\..\components\mORMot;$(DCC_UnitSearchPath)</DCC_UnitSearchPath> <DCC_UnitSearchPath>..\..\components\graphicex;..\..\components\synapse;..\..\components\mORMot;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
<DCC_SYMBOL_PLATFORM>false</DCC_SYMBOL_PLATFORM> <DCC_SYMBOL_PLATFORM>false</DCC_SYMBOL_PLATFORM>
<BRCC_OutputDir>..\..\res</BRCC_OutputDir> <BRCC_OutputDir>..\..\res</BRCC_OutputDir>

View File

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

View File

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