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;
|
||||
TButtonH MyButton;
|
||||
TLabelH MyLabel;
|
||||
|
||||
/* Callback for the close button */
|
||||
FASTCALL_TNOTIFYEVENT_START(MyButton_OnClick) /* void* Self, TObjectH Sender */
|
||||
@ -42,6 +43,13 @@ APPBEGIN()
|
||||
TControl_SetOnClick(MyButton, &MyButton_OnClick);
|
||||
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 */
|
||||
Application_Run();
|
||||
|
||||
|
@ -47,6 +47,8 @@ procedure TWinControl_SetParent(Self: TWinControl; AValue: TWinControl); cdecl;
|
||||
|
||||
implementation
|
||||
|
||||
{ TControl }
|
||||
|
||||
function TControl_GetOnClick(Self: TControl): TNotifyEvent; cdecl;
|
||||
begin
|
||||
Result := Self.OnClick;
|
||||
@ -117,6 +119,8 @@ begin
|
||||
Self.Width := AValue;
|
||||
end;
|
||||
|
||||
{ TWinControl }
|
||||
|
||||
function TWinControl_GetParent(Self: TWinControl): TWinControl; cdecl;
|
||||
begin
|
||||
Result := Self.Parent;
|
||||
|
@ -49,7 +49,8 @@ exports
|
||||
TCustomForm_Show,
|
||||
TForm_Create,
|
||||
{ StdCtrlsExports }
|
||||
TButton_Create;
|
||||
TButton_Create,
|
||||
TLabel_Create;
|
||||
|
||||
begin
|
||||
end.
|
||||
|
@ -14,7 +14,6 @@
|
||||
</VersionInfo>
|
||||
<PublishOptions>
|
||||
<Version Value="2"/>
|
||||
<IgnoreBinaries Value="False"/>
|
||||
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
|
||||
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
|
||||
</PublishOptions>
|
||||
|
@ -20,14 +20,29 @@ uses
|
||||
Classes, SysUtils,
|
||||
StdCtrls;
|
||||
|
||||
{ TButton }
|
||||
|
||||
function TButton_Create(TheOwner: TComponent): TButton; cdecl;
|
||||
|
||||
{ TLabel }
|
||||
|
||||
function TLabel_Create(TheOwner: TComponent): TLabel; cdecl;
|
||||
|
||||
implementation
|
||||
|
||||
{ TButton }
|
||||
|
||||
function TButton_Create(TheOwner: TComponent): TButton; cdecl;
|
||||
begin
|
||||
Result := TButton.Create(TheOwner);
|
||||
end;
|
||||
|
||||
{ TLabel }
|
||||
|
||||
function TLabel_Create(TheOwner: TComponent): TLabel; cdecl;
|
||||
begin
|
||||
Result := TLabel.Create(TheOwner);
|
||||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
@ -26,6 +26,12 @@ typedef void* TButtonH;
|
||||
|
||||
__cdecl TButtonH TButton_Create(TComponentH TheOwner);
|
||||
|
||||
/* TLabel */
|
||||
|
||||
typedef void* TLabelH;
|
||||
|
||||
__cdecl TLabelH TLabel_Create(TComponentH TheOwner);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user