summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2012-08-02 17:21:05 +0100
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2012-08-02 17:21:05 +0100
commit1697e78142e8679c1bb4d19833cc1a64e1fd4c3b (patch)
treea304b8ee9fa0d2d86555e7a196fa79ebc1d44d97
parent3db9bd59e87ae9ac105500e0fda5824821365026 (diff)
downloadfpGUI-1697e78142e8679c1bb4d19833cc1a64e1fd4c3b.tar.xz
tools: Image Conversion tool - implements the 'Convert' button.
We are now not forced to only use DND to activate the conversion process.
-rw-r--r--tools/imageconvert/frm_main.pas14
1 files changed, 13 insertions, 1 deletions
diff --git a/tools/imageconvert/frm_main.pas b/tools/imageconvert/frm_main.pas
index 3ab50dbc..ecd6cc34 100644
--- a/tools/imageconvert/frm_main.pas
+++ b/tools/imageconvert/frm_main.pas
@@ -28,6 +28,7 @@ type
procedure MemoDragDrop(Sender, Source: TObject; X, Y: integer; AData: variant);
function ConvertImage(const AFileName: string): string;
procedure btnClearClicked(Sender: TObject);
+ procedure btnConvertClicked(Sender: TObject);
public
procedure AfterCreate; override;
end;
@@ -149,6 +150,16 @@ begin
memImages.Text := '';
end;
+procedure TMainForm.btnConvertClicked(Sender: TObject);
+begin
+ memImages.BeginUpdate;
+ try
+ memImages.Text := memImages.Text + ConvertImage(FilenameEdit1.FileName);
+ finally
+ memImages.EndUpdate;
+ end;
+end;
+
procedure TMainForm.AfterCreate;
begin
{%region 'Auto-generated GUI code' -fold}
@@ -198,11 +209,12 @@ begin
begin
Name := 'Button1';
SetPosition(396, 44, 80, 24);
- Text := 'Button';
+ Text := 'Convert';
FontDesc := '#Label1';
Hint := '';
ImageName := '';
TabOrder := 4;
+ OnClick := @btnConvertClicked;
end;
pmFile := TfpgPopupMenu.Create(self);