@@ -18,6 +18,7 @@ TTabChangingEventHandler = class(TEventHandler)
1818 class function GetTypeInfo : PTypeInfo; override;
1919 end ;
2020
21+ { $IFNDEF FPC}
2122 TPyDelphiDateTimePicker = class (TPyDelphiWinControl)
2223 private
2324 function GetDelphiObject : TDateTimePicker;
@@ -27,6 +28,7 @@ TPyDelphiDateTimePicker = class (TPyDelphiWinControl)
2728 // Properties
2829 property DelphiObject: TDateTimePicker read GetDelphiObject write SetDelphiObject;
2930 end ;
31+ { $ENDIF FPC}
3032
3133 TPyDelphiTabSheet = class (TPyDelphiWinControl)
3234 private
@@ -69,19 +71,27 @@ TPyDelphiPageControl = class (TPyDelphiWinControl)
6971 procedure SetDelphiObject (const Value : TPageControl);
7072 protected
7173 // methods
74+ { $IFNDEF FPC}
7275 function IndexOfTabAt_Wrapper (args : PPyObject) : PPyObject; cdecl;
7376 function GetHitTestInfoAt_Wrapper (args : PPyObject) : PPyObject; cdecl;
77+ { $ENDIF FPC}
7478 function TabRect_Wrapper (args : PPyObject) : PPyObject; cdecl;
79+ { $IFNDEF FPC}
7580 function ScrollTabs_Wrapper (args : PPyObject) : PPyObject; cdecl;
81+ { $ENDIF FPC}
7682 function FindNextPage_Wrapper (args : PPyObject) : PPyObject; cdecl;
7783 function SelectNextPage_Wrapper (args : PPyObject) : PPyObject; cdecl;
7884 // Property Getters
7985 function Get_ActivePage ( AContext : Pointer) : PPyObject; cdecl;
8086 function Get_ActivePageIndex ( AContext : Pointer) : PPyObject; cdecl;
87+ { $IFNDEF FPC}
8188 function Get_Canvas ( AContext : Pointer) : PPyObject; cdecl;
89+ { $ENDIF FPC}
8290 function Get_PageCount ( AContext : Pointer) : PPyObject; cdecl;
8391 function Get_Pages ( AContext : Pointer) : PPyObject; cdecl;
92+ { $IFNDEF FPC}
8493 function Get_RowCount ( AContext : Pointer) : PPyObject; cdecl;
94+ { $ENDIF FPC}
8595 // Property Setters
8696 function Set_ActivePage ( AValue : PPyObject; AContext : Pointer) : integer; cdecl;
8797 function Set_ActivePageIndex ( AValue : PPyObject; AContext : Pointer) : integer; cdecl;
@@ -96,7 +106,7 @@ TPyDelphiPageControl = class (TPyDelphiWinControl)
96106implementation
97107
98108uses
99- WrapDelphiTypes;
109+ WrapDelphiTypes, ExtCtrls ;
100110
101111{ Register the wrappers, the globals and the constants }
102112type
@@ -122,13 +132,16 @@ function TComCtrlsRegistration.Name: String;
122132procedure TComCtrlsRegistration.RegisterWrappers (APyDelphiWrapper: TPyDelphiWrapper);
123133begin
124134 inherited ;
135+ { $IFNDEF FPC}
125136 APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiDateTimePicker);
137+ { $ENDIF FPC}
126138 APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiPageControl);
127139 APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiTabSheet);
128140
129141 APyDelphiWrapper.EventHandlers.RegisterHandler(TTabChangingEventHandler);
130142end ;
131143
144+ { $IFNDEF FPC}
132145{ TPyDelphiDateTimePicker }
133146
134147class function TPyDelphiDateTimePicker.DelphiObjectClass : TClass;
@@ -145,6 +158,7 @@ procedure TPyDelphiDateTimePicker.SetDelphiObject(const Value: TDateTimePicker);
145158begin
146159 inherited DelphiObject := Value ;
147160end ;
161+ { $ENDIF FPC}
148162
149163{ TPyDelphiPageControl }
150164
@@ -179,6 +193,7 @@ function TPyDelphiPageControl.GetDelphiObject: TPageControl;
179193 Result := TPageControl(inherited DelphiObject);
180194end ;
181195
196+ { $IFNDEF FPC}
182197function TPyDelphiPageControl.GetHitTestInfoAt_Wrapper (
183198 args: PPyObject): PPyObject;
184199
@@ -232,6 +247,7 @@ function TPyDelphiPageControl.GetHitTestInfoAt_Wrapper(
232247 Result := nil ;
233248 end ;
234249end ;
250+ { $ENDIF FPC}
235251
236252function TPyDelphiPageControl.Get_ActivePage (AContext: Pointer): PPyObject;
237253begin
@@ -247,10 +263,12 @@ function TPyDelphiPageControl.Get_ActivePageIndex(
247263 end ;
248264end ;
249265
266+ { $IFNDEF FPC}
250267function TPyDelphiPageControl.Get_Canvas (AContext: Pointer): PPyObject;
251268begin
252269 Result := Wrap(DelphiObject.Canvas);
253270end ;
271+ { $ENDIF FPC}
254272
255273function TPyDelphiPageControl.Get_PageCount (AContext: Pointer): PPyObject;
256274begin
@@ -270,6 +288,7 @@ function TPyDelphiPageControl.Get_Pages(AContext: Pointer): PPyObject;
270288 end ;
271289end ;
272290
291+ { $IFNDEF FPC}
273292function TPyDelphiPageControl.Get_RowCount (AContext: Pointer): PPyObject;
274293begin
275294 with GetPythonEngine do begin
@@ -292,6 +311,7 @@ function TPyDelphiPageControl.IndexOfTabAt_Wrapper(
292311 Result := nil ;
293312 end ;
294313end ;
314+ { $ENDIF FPC}
295315
296316class procedure TPyDelphiPageControl.RegisterGetSets (
297317 PythonType: TPythonType);
@@ -301,32 +321,40 @@ class procedure TPyDelphiPageControl.RegisterGetSets(
301321 ' Specifies the page currently displayed by the page control.' , nil );
302322 PythonType.AddGetSet(' ActivePageIndex' , @TPyDelphiPageControl.Get_ActivePageIndex, @TPyDelphiPageControl.Set_ActivePageIndex,
303323 ' Specifies the page currently displayed by the page control.' , nil );
324+ { $IFNDEF FPC}
304325 PythonType.AddGetSet(' Canvas' , @TPyDelphiPageControl.Get_Canvas, nil ,
305326 ' Gives access to the tab controls canvas.' , nil );
327+ { $ENDIF FPC}
306328 PythonType.AddGetSet(' PageCount' , @TPyDelphiPageControl.Get_PageCount, nil ,
307329 ' Indicates the number of pages in the TPageControl object.' , nil );
308330 PythonType.AddGetSet(' Pages' , @TPyDelphiPageControl.Get_Pages, nil ,
309331 ' Lists all the pages in the TPageControl.' , nil );
332+ { $IFNDEF FPC}
310333 PythonType.AddGetSet(' RowCount' , @TPyDelphiPageControl.Get_RowCount, nil ,
311334 ' ' , nil );
335+ { $ENDIF FPC}
312336end ;
313337
314338class procedure TPyDelphiPageControl.RegisterMethods (
315339 PythonType: TPythonType);
316340begin
317341 inherited ;
342+ { $IFNDEF FPC}
318343 PythonType.AddMethod(' IndexOfTabAt' , @TPyDelphiPageControl.IndexOfTabAt_Wrapper,
319344 ' TPageControl.IndexOfTabAt()' #10 +
320345 ' Indicates the index of the tab at a specified point.' );
321346 PythonType.AddMethod(' GetHitTestInfoAt' , @TPyDelphiPageControl.GetHitTestInfoAt_Wrapper,
322347 ' TPageControl.GetHitTestInfoAt()' #10 +
323348 ' Returns information about the location of a point relative to the client area of the tab control.' );
349+ { $ENDIF FPC}
324350 PythonType.AddMethod(' TabRect' , @TPyDelphiPageControl.TabRect_Wrapper,
325351 ' TPageControl.TabRect()' #10 +
326352 ' Returns the bounding rectangle for a specified tab.' );
353+ { $IFNDEF FPC}
327354 PythonType.AddMethod(' ScrollTabs' , @TPyDelphiPageControl.ScrollTabs_Wrapper,
328355 ' TPageControl.ScrollTabs()' #10 +
329356 ' Scrolls the tabs that are visible when the tab control is not multi-line.' );
357+ { $ENDIF FPC}
330358 PythonType.AddMethod(' FindNextPage' , @TPyDelphiPageControl.FindNextPage_Wrapper,
331359 ' TPageControl.FindNextPage()' #10 +
332360 ' Returns the next page in the page control before or after a specified page.' );
@@ -335,6 +363,7 @@ class procedure TPyDelphiPageControl.RegisterMethods(
335363 ' Changes the ActivePage to the first visible page that is before or after the currently active page.' );
336364end ;
337365
366+ { $IFNDEF FPC}
338367function TPyDelphiPageControl.ScrollTabs_Wrapper (
339368 args: PPyObject): PPyObject;
340369var
@@ -350,6 +379,7 @@ function TPyDelphiPageControl.ScrollTabs_Wrapper(
350379 Result := nil ;
351380 end ;
352381end ;
382+ { $ENDIF FPC}
353383
354384function TPyDelphiPageControl.SelectNextPage_Wrapper (
355385 args: PPyObject): PPyObject;
@@ -605,5 +635,7 @@ class function TTabChangingEventHandler.GetTypeInfo: PTypeInfo;
605635
606636initialization
607637 RegisteredUnits.Add( TComCtrlsRegistration.Create );
638+ { $IFNDEF FPC}
608639 Classes.RegisterClasses([TDateTimePicker]);
640+ { $ENDIF FPC}
609641end .
0 commit comments