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:
sekelsenmat 2008-02-03 16:01:04 +00:00
parent d2a6c32d49
commit a44a9bb9b4
6 changed files with 35 additions and 2 deletions

View File

@ -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();

View File

@ -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;

View File

@ -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.

View File

@ -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>

View File

@ -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.

View File

@ -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