@@ -121,44 +121,44 @@ TPyDelphiTrackBar = class (TPyDelphiWinControl)
121
121
end ;
122
122
123
123
TPyDelphiToolButton = class (TPyDelphiGraphicControl)
124
- private
125
- function GetDelphiObject : TToolButton;
126
- procedure SetDelphiObject (const Value : TToolButton);
127
- public
128
- class function DelphiObjectClass : TClass; override;
129
- property DelphiObject: TToolButton read GetDelphiObject
130
- write SetDelphiObject;
131
- end ;
132
-
124
+ private
125
+ function GetDelphiObject : TToolButton;
126
+ procedure SetDelphiObject (const Value : TToolButton);
127
+ public
128
+ class function DelphiObjectClass : TClass; override;
129
+ property DelphiObject: TToolButton read GetDelphiObject
130
+ write SetDelphiObject;
131
+ end ;
132
+
133
133
TToolbarAccess = class (TContainerAccess)
134
- private
135
- function GetContainer : TToolbar;
136
- public
137
- function GetItem (AIndex: Integer): PPyObject; override;
138
- function GetSize : Integer; override;
139
- function IndexOf (AValue: PPyObject): Integer; override;
140
- class function ExpectedContainerClass : TClass; override;
141
- class function SupportsIndexOf : Boolean; override;
142
- class function Name : string; override;
143
- property Container: TToolbar read GetContainer;
144
- end ;
134
+ private
135
+ function GetContainer : TToolbar;
136
+ public
137
+ function GetItem (AIndex: Integer): PPyObject; override;
138
+ function GetSize : Integer; override;
139
+ function IndexOf (AValue: PPyObject): Integer; override;
140
+ class function ExpectedContainerClass : TClass; override;
141
+ class function SupportsIndexOf : Boolean; override;
142
+ class function Name : string; override;
143
+ property Container: TToolbar read GetContainer;
144
+ end ;
145
145
146
146
TPyDelphiToolbar = class (TPyDelphiWinControl)
147
- private
148
- function GetDelphiObject : TToolbar;
149
- procedure SetDelphiObject (const Value : TToolbar);
150
- protected
151
- function Get_ButtonCount (AContext: Pointer): PPyObject; cdecl;
152
- function Get_Buttons (AContext: Pointer): PPyObject; cdecl;
153
- public
154
- class function DelphiObjectClass : TClass; override;
155
- class procedure RegisterGetSets (PythonType: TPythonType); override;
156
- class function GetContainerAccessClass : TContainerAccessClass; override;
157
-
158
- property DelphiObject: TToolbar read GetDelphiObject
159
- write SetDelphiObject;
160
- end ;
161
-
147
+ private
148
+ function GetDelphiObject : TToolbar;
149
+ procedure SetDelphiObject (const Value : TToolbar);
150
+ protected
151
+ function Get_ButtonCount (AContext: Pointer): PPyObject; cdecl;
152
+ function Get_Buttons (AContext: Pointer): PPyObject; cdecl;
153
+ public
154
+ class function DelphiObjectClass : TClass; override;
155
+ class procedure RegisterGetSets (PythonType: TPythonType); override;
156
+ class function GetContainerAccessClass : TContainerAccessClass; override;
157
+
158
+ property DelphiObject: TToolbar read GetDelphiObject
159
+ write SetDelphiObject;
160
+ end ;
161
+
162
162
implementation
163
163
164
164
uses
@@ -196,7 +196,7 @@ procedure TComCtrlsRegistration.RegisterWrappers(APyDelphiWrapper: TPyDelphiWrap
196
196
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiTabSheet);
197
197
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiTrackBar);
198
198
APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiToolButton);
199
- APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiToolbar);
199
+ APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiToolbar);
200
200
201
201
APyDelphiWrapper.EventHandlers.RegisterHandler(TTabChangingEventHandler);
202
202
end ;
@@ -375,7 +375,7 @@ class procedure TPyDelphiPageControl.RegisterGetSets(
375
375
' Specifies the page currently displayed by the page control.' , nil );
376
376
{ $IFNDEF FPC}
377
377
PythonType.AddGetSet(' Canvas' , @TPyDelphiPageControl.Get_Canvas, nil ,
378
- ' Gives access to the tab controls canvas.' , nil );
378
+ ' Gives access to the tab control canvas.' , nil );
379
379
{ $ENDIF FPC}
380
380
PythonType.AddGetSet(' PageCount' , @TPyDelphiPageControl.Get_PageCount, nil ,
381
381
' Indicates the number of pages in the TPageControl object.' , nil );
@@ -731,23 +731,23 @@ function TToolbarAccess.GetSize: Integer;
731
731
732
732
function TToolbarAccess.IndexOf (AValue: PPyObject): Integer;
733
733
var
734
- _obj: TPyObject;
735
- _item: TToolButton;
736
- begin
737
- Result := -1 ;
738
- with GetPythonEngine do
739
- begin
740
- if IsDelphiObject(AValue) then
741
- begin
742
- _obj := PythonToDelphi(AValue);
743
- if (_obj is TPyDelphiObject) and
744
- (TPyDelphiObject(_obj).DelphiObject is TToolButton) then
745
- begin
746
- _item := TToolButton(TPyDelphiObject(_obj).DelphiObject);
747
- Result := _item.Index;
748
- end ;
749
- end ;
750
- end ;
734
+ _obj: TPyObject;
735
+ _item: TToolButton;
736
+ begin
737
+ Result := -1 ;
738
+ with GetPythonEngine do
739
+ begin
740
+ if IsDelphiObject(AValue) then
741
+ begin
742
+ _obj := PythonToDelphi(AValue);
743
+ if (_obj is TPyDelphiObject) and
744
+ (TPyDelphiObject(_obj).DelphiObject is TToolButton) then
745
+ begin
746
+ _item := TToolButton(TPyDelphiObject(_obj).DelphiObject);
747
+ Result := _item.Index;
748
+ end ;
749
+ end ;
750
+ end ;
751
751
end ;
752
752
753
753
class function TToolbarAccess.Name : string;
@@ -780,28 +780,28 @@ function TPyDelphiToolbar.GetDelphiObject: TToolbar;
780
780
function TPyDelphiToolbar.Get_Buttons (AContext: Pointer): PPyObject;
781
781
begin
782
782
Adjust(@Self);
783
- Result := PyDelphiWrapper.DefaultContainerType.CreateInstance;
784
- with PythonToDelphi(Result) as TPyDelphiContainer do
785
- Setup(Self.PyDelphiWrapper, TToolbarAccess.Create(Self.PyDelphiWrapper,
786
- Self.DelphiObject));
783
+ Result := PyDelphiWrapper.DefaultContainerType.CreateInstance;
784
+ with PythonToDelphi(Result) as TPyDelphiContainer do
785
+ Setup(Self.PyDelphiWrapper, TToolbarAccess.Create(Self.PyDelphiWrapper,
786
+ Self.DelphiObject));
787
787
end ;
788
788
789
789
function TPyDelphiToolbar.Get_ButtonCount (AContext: Pointer): PPyObject;
790
790
begin
791
791
Adjust(@Self);
792
- Result := GetPythonEngine.PyLong_FromLong(DelphiObject.ButtonCount);
792
+ Result := GetPythonEngine.PyLong_FromLong(DelphiObject.ButtonCount);
793
793
end ;
794
794
795
795
class procedure TPyDelphiToolbar.RegisterGetSets (PythonType: TPythonType);
796
796
begin
797
797
inherited ;
798
798
with PythonType do
799
- begin
800
- AddGetSet(' ButtonCount' , @TPyDelphiToolbar.Get_ButtonCount, nil ,
801
- ' Indicates the number of buttons in the toolbar.' , nil );
802
- AddGetSet(' Actions' , @TPyDelphiToolbar.Get_Buttons, nil ,
803
- ' Lists the buttons of the toolbar.' , nil );
804
- end ;
799
+ begin
800
+ AddGetSet(' ButtonCount' , @TPyDelphiToolbar.Get_ButtonCount, nil ,
801
+ ' Indicates the number of buttons in the toolbar.' , nil );
802
+ AddGetSet(' Actions' , @TPyDelphiToolbar.Get_Buttons, nil ,
803
+ ' Lists the buttons of the toolbar.' , nil );
804
+ end ;
805
805
end ;
806
806
807
807
procedure TPyDelphiToolbar.SetDelphiObject (const Value : TToolbar);
0 commit comments