Skip to content

Commit 02d9d0f

Browse files
authored
Merge pull request #30 from reinaldoacdc/master
SimpleRTTI - ajuste no bind do componente ttrackbar
2 parents 92f3aa6 + 7854b06 commit 02d9d0f

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

SimpleRTTI.pas

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,10 @@ implementation
146146

147147

148148
{$IFNDEF CONSOLE}
149-
Vcl.ComCtrls,
150-
Vcl.Graphics,
149+
{$IFNDEF FMX}
150+
Vcl.ComCtrls,
151+
Vcl.Graphics,
152+
{$ENDIF}
151153
{$ENDIF}
152154
Variants,
153155
SimpleRTTIHelper,
@@ -193,8 +195,11 @@ function TSimpleRTTI<T>.__BindValueToComponent(aComponent: TComponent;
193195
{$ENDIF}
194196

195197
if aComponent is TTrackBar then
196-
(aComponent as TTrackBar).Position := aValue;
197-
198+
{$IFDEF VCL}
199+
(aComponent as TTrackBar).Position := aValue;
200+
{$ELSEIF IFDEF FMX}
201+
(aComponent as TTrackBar).Position.X := aValue;
202+
{$ENDIF}
198203

199204

200205

@@ -282,7 +287,11 @@ function TSimpleRTTI<T>.__GetComponentToValue(aComponent: TComponent): TValue;
282287

283288

284289
if aComponent is TTrackBar then
285-
Result := TValue.FromVariant((aComponent as TTrackBar).Position);
290+
{$IFDEF VCL}
291+
Result := TValue.FromVariant((aComponent as TTrackBar).Position);
292+
{$ELSEIF IFDEF FMX}
293+
Result := TValue.FromVariant((aComponent as TTrackBar).Position.X);
294+
{$ENDIF}
286295

287296
{$IFDEF VCL}
288297
if aComponent is TDateTimePicker then

0 commit comments

Comments
 (0)