summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-03-25 07:31:54 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-03-25 07:31:54 +0000
commit4e42945f27265f30981594c2daa182ca8cd82856 (patch)
tree916b108582e33449a7535ad94e23c52ee1eb94ff
parent5c41a80af782d5f6d8dfb36e5ce61fa935ed0580 (diff)
downloadfpGUI-4e42945f27265f30981594c2daa182ca8cd82856.tar.xz
applied patch from Jean-Marc allowing ImageName to be set at creation.
-rw-r--r--src/gui/gui_button.pas7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/gui/gui_button.pas b/src/gui/gui_button.pas
index 7026a45c..9eb1fea0 100644
--- a/src/gui/gui_button.pas
+++ b/src/gui/gui_button.pas
@@ -31,8 +31,6 @@ uses
type
- { TfpgButton }
-
TfpgButton = class(TfpgWidget, ICommandHolder)
private
FCommand: ICommand;
@@ -105,7 +103,7 @@ type
function CreateButton(AOwner: TComponent; x, y, w: TfpgCoord; AText: string;
- AOnClickEvent: TNotifyEvent): TfpgButton;
+ AOnClickEvent: TNotifyEvent; AImage: string = ''): TfpgButton;
implementation
@@ -114,12 +112,13 @@ uses
gui_form; {$Note Try and remove this gui_form dependency.}
function CreateButton(AOwner: TComponent; x, y, w: TfpgCoord; AText: string;
- AOnClickEvent: TNotifyEvent): TfpgButton;
+ AOnClickEvent: TNotifyEvent; AImage: string): TfpgButton;
begin
Result := TfpgButton.Create(AOwner);
Result.Text := AText;
Result.SetPosition(x, y, w, Result.Height); // font was used to calculate height.
Result.OnClick := AOnClickEvent;
+ Result.ImageName := AImage;
end;
{ TfpgButton }