@@ -121,44 +121,44 @@ TPyDelphiTrackBar = class (TPyDelphiWinControl)
121121 end ;
122122
123123 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+
133133 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 ;
145145
146146 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+
162162implementation
163163
164164uses
@@ -196,7 +196,7 @@ procedure TComCtrlsRegistration.RegisterWrappers(APyDelphiWrapper: TPyDelphiWrap
196196 APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiTabSheet);
197197 APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiTrackBar);
198198 APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiToolButton);
199- APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiToolbar);
199+ APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiToolbar);
200200
201201 APyDelphiWrapper.EventHandlers.RegisterHandler(TTabChangingEventHandler);
202202end ;
@@ -375,7 +375,7 @@ class procedure TPyDelphiPageControl.RegisterGetSets(
375375 ' Specifies the page currently displayed by the page control.' , nil );
376376 { $IFNDEF FPC}
377377 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 );
379379 { $ENDIF FPC}
380380 PythonType.AddGetSet(' PageCount' , @TPyDelphiPageControl.Get_PageCount, nil ,
381381 ' Indicates the number of pages in the TPageControl object.' , nil );
@@ -731,23 +731,23 @@ function TToolbarAccess.GetSize: Integer;
731731
732732function TToolbarAccess.IndexOf (AValue: PPyObject): Integer;
733733var
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 ;
751751end ;
752752
753753class function TToolbarAccess.Name : string;
@@ -780,28 +780,28 @@ function TPyDelphiToolbar.GetDelphiObject: TToolbar;
780780function TPyDelphiToolbar.Get_Buttons (AContext: Pointer): PPyObject;
781781begin
782782 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));
787787end ;
788788
789789function TPyDelphiToolbar.Get_ButtonCount (AContext: Pointer): PPyObject;
790790begin
791791 Adjust(@Self);
792- Result := GetPythonEngine.PyLong_FromLong(DelphiObject.ButtonCount);
792+ Result := GetPythonEngine.PyLong_FromLong(DelphiObject.ButtonCount);
793793end ;
794794
795795class procedure TPyDelphiToolbar.RegisterGetSets (PythonType: TPythonType);
796796begin
797797 inherited ;
798798 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 ;
805805end ;
806806
807807procedure TPyDelphiToolbar.SetDelphiObject (const Value : TToolbar);
0 commit comments