Skip to content

Commit 1f19bd8

Browse files
committed
Giving access to the StyleState property of a StyledControl
1 parent 96a9591 commit 1f19bd8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Source/fmx/WrapFmxControls.pas

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ TPyDelphiStyledControl = class(TPyDelphiControl)
8383
function Get_AutoTranslate(AContext: Pointer): PPyObject; cdecl;
8484
function Get_AdjustSizeValue(AContext: Pointer): PPyObject; cdecl;
8585
function Get_AdjustType(AContext: Pointer): PPyObject; cdecl;
86+
function Get_StyleState(AContext: Pointer): PPyObject; cdecl;
8687
// Property Setters
8788
function Set_StyleLookup(AValue: PPyObject; AContext: Pointer): integer; cdecl;
8889
function Set_AutoTranslate(AValue: PPyObject; AContext: Pointer): integer; cdecl;
@@ -526,6 +527,12 @@ function TPyDelphiStyledControl.Get_StyleLookup(AContext: Pointer): PPyObject;
526527
Result := GetPythonEngine.PyUnicodeFromString(DelphiObject.StyleLookup);
527528
end;
528529

530+
function TPyDelphiStyledControl.Get_StyleState(AContext: Pointer): PPyObject;
531+
begin
532+
Adjust(@Self);
533+
Result := GetPythonEngine.PyLong_FromLong(Ord(DelphiObject.StyleState));
534+
end;
535+
529536
function TPyDelphiStyledControl.Inflate_Wrapper(args: PPyObject): PPyObject;
530537
begin
531538
Adjust(@Self);
@@ -566,6 +573,8 @@ class procedure TPyDelphiStyledControl.RegisterGetSets(PythonType: TPythonType);
566573
AddGetSet('AdjustType', @TPyDelphiStyledControl.Get_AdjustType, nil,
567574
'Determines if and how the width and height of this control should be '
568575
+ 'modified to take the fixed space dictated by the style of this control', nil);
576+
AddGetSet('StyleState', @TPyDelphiStyledControl.Get_StyleState, nil,
577+
'This property allows you to define the current state of style', nil);
569578
end;
570579
end;
571580

0 commit comments

Comments
 (0)