Added TLabel.Create to c bindings.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@341 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
parent
d2a6c32d49
commit
a44a9bb9b4
@ -12,6 +12,7 @@ AUTHOR: Felipe Monteiro de Carvalho
|
|||||||
|
|
||||||
TFormH MyForm;
|
TFormH MyForm;
|
||||||
TButtonH MyButton;
|
TButtonH MyButton;
|
||||||
|
TLabelH MyLabel;
|
||||||
|
|
||||||
/* Callback for the close button */
|
/* Callback for the close button */
|
||||||
FASTCALL_TNOTIFYEVENT_START(MyButton_OnClick) /* void* Self, TObjectH Sender */
|
FASTCALL_TNOTIFYEVENT_START(MyButton_OnClick) /* void* Self, TObjectH Sender */
|
||||||
@ -42,6 +43,13 @@ APPBEGIN()
|
|||||||
TControl_SetOnClick(MyButton, &MyButton_OnClick);
|
TControl_SetOnClick(MyButton, &MyButton_OnClick);
|
||||||
TControl_SetCaption(MyButton, "Close Button");
|
TControl_SetCaption(MyButton, "Close Button");
|
||||||
|
|
||||||
|
MyLabel = TLabel_Create(MyForm);
|
||||||
|
TWinControl_SetParent(MyLabel, MyForm);
|
||||||
|
|
||||||
|
TControl_SetTop(MyLabel, 50);
|
||||||
|
TControl_SetLeft(MyLabel, 60);
|
||||||
|
TControl_SetCaption(MyLabel, "Toolbox is cool!!!");
|
||||||
|
|
||||||
/* Enter main loop */
|
/* Enter main loop */
|
||||||
Application_Run();
|
Application_Run();
|
||||||
|
|
||||||
|
@ -47,6 +47,8 @@ procedure TWinControl_SetParent(Self: TWinControl; AValue: TWinControl); cdecl;
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
{ TControl }
|
||||||
|
|
||||||
function TControl_GetOnClick(Self: TControl): TNotifyEvent; cdecl;
|
function TControl_GetOnClick(Self: TControl): TNotifyEvent; cdecl;
|
||||||
begin
|
begin
|
||||||
Result := Self.OnClick;
|
Result := Self.OnClick;
|
||||||
@ -117,6 +119,8 @@ begin
|
|||||||
Self.Width := AValue;
|
Self.Width := AValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TWinControl }
|
||||||
|
|
||||||
function TWinControl_GetParent(Self: TWinControl): TWinControl; cdecl;
|
function TWinControl_GetParent(Self: TWinControl): TWinControl; cdecl;
|
||||||
begin
|
begin
|
||||||
Result := Self.Parent;
|
Result := Self.Parent;
|
||||||
|
@ -49,7 +49,8 @@ exports
|
|||||||
TCustomForm_Show,
|
TCustomForm_Show,
|
||||||
TForm_Create,
|
TForm_Create,
|
||||||
{ StdCtrlsExports }
|
{ StdCtrlsExports }
|
||||||
TButton_Create;
|
TButton_Create,
|
||||||
|
TLabel_Create;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
end.
|
end.
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
</VersionInfo>
|
</VersionInfo>
|
||||||
<PublishOptions>
|
<PublishOptions>
|
||||||
<Version Value="2"/>
|
<Version Value="2"/>
|
||||||
<IgnoreBinaries Value="False"/>
|
|
||||||
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||||
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
|
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
|
||||||
</PublishOptions>
|
</PublishOptions>
|
||||||
|
@ -20,14 +20,29 @@ uses
|
|||||||
Classes, SysUtils,
|
Classes, SysUtils,
|
||||||
StdCtrls;
|
StdCtrls;
|
||||||
|
|
||||||
|
{ TButton }
|
||||||
|
|
||||||
function TButton_Create(TheOwner: TComponent): TButton; cdecl;
|
function TButton_Create(TheOwner: TComponent): TButton; cdecl;
|
||||||
|
|
||||||
|
{ TLabel }
|
||||||
|
|
||||||
|
function TLabel_Create(TheOwner: TComponent): TLabel; cdecl;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
{ TButton }
|
||||||
|
|
||||||
function TButton_Create(TheOwner: TComponent): TButton; cdecl;
|
function TButton_Create(TheOwner: TComponent): TButton; cdecl;
|
||||||
begin
|
begin
|
||||||
Result := TButton.Create(TheOwner);
|
Result := TButton.Create(TheOwner);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TLabel }
|
||||||
|
|
||||||
|
function TLabel_Create(TheOwner: TComponent): TLabel; cdecl;
|
||||||
|
begin
|
||||||
|
Result := TLabel.Create(TheOwner);
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
@ -26,6 +26,12 @@ typedef void* TButtonH;
|
|||||||
|
|
||||||
__cdecl TButtonH TButton_Create(TComponentH TheOwner);
|
__cdecl TButtonH TButton_Create(TComponentH TheOwner);
|
||||||
|
|
||||||
|
/* TLabel */
|
||||||
|
|
||||||
|
typedef void* TLabelH;
|
||||||
|
|
||||||
|
__cdecl TLabelH TLabel_Create(TComponentH TheOwner);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user