diff --git a/applications/foobot/foobot_utility.pas b/applications/foobot/foobot_utility.pas
index b91434f8d..a7a9f20be 100644
--- a/applications/foobot/foobot_utility.pas
+++ b/applications/foobot/foobot_utility.pas
@@ -1,6 +1,6 @@
unit foobot_utility;
-{ Foobot Interrogator Utilities
+{ Foobot Utilities
Copyright (C)2016 Gordon Bamber minsadorada@charcodelvalle.com
diff --git a/applications/foobot/monitor/foobotmonitor.lpi b/applications/foobot/monitor/foobotmonitor.lpi
index 5c6f615f9..0c377c649 100644
--- a/applications/foobot/monitor/foobotmonitor.lpi
+++ b/applications/foobot/monitor/foobotmonitor.lpi
@@ -19,7 +19,8 @@
-
+
+
diff --git a/applications/foobot/monitor/foobotmonitor.lps b/applications/foobot/monitor/foobotmonitor.lps
index 58b59bd21..b5c4d8e1b 100644
--- a/applications/foobot/monitor/foobotmonitor.lps
+++ b/applications/foobot/monitor/foobotmonitor.lps
@@ -3,14 +3,14 @@
-
-
+
+
-
+
-
+
@@ -19,9 +19,8 @@
-
-
-
+
+
@@ -32,9 +31,8 @@
-
-
-
+
+
@@ -44,7 +42,7 @@
-
+
@@ -53,15 +51,15 @@
-
+
-
-
-
-
+
+
+
+
@@ -70,168 +68,208 @@
-
+
-
-
-
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
-
-
+
+
-
+
-
-
+
+
-
-
+
+
-
-
+
-
-
-
+
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/applications/foobot/monitor/foobotmonitor.res b/applications/foobot/monitor/foobotmonitor.res
index 71fa2a772..b10c4d151 100644
Binary files a/applications/foobot/monitor/foobotmonitor.res and b/applications/foobot/monitor/foobotmonitor.res differ
diff --git a/applications/foobot/monitor/innosetup/foobotmonitor.iss b/applications/foobot/monitor/innosetup/foobotmonitor.iss
index cc88919a1..6527a8f5a 100644
--- a/applications/foobot/monitor/innosetup/foobotmonitor.iss
+++ b/applications/foobot/monitor/innosetup/foobotmonitor.iss
@@ -9,7 +9,7 @@
[Setup]
AppName=Foobot Monitor
-AppVersion=0.1.0.0
+AppVersion=0.0.2.0
DefaultDirName={pf}\foobotmonitor
DefaultGroupName=Foobot
UninstallDisplayIcon={app}\foobotmonitor.exe
diff --git a/applications/foobot/monitor/innosetup/setup_foobotmonitor.exe b/applications/foobot/monitor/innosetup/setup_foobotmonitor.exe
index cb289b1b6..5aa4c1137 100644
Binary files a/applications/foobot/monitor/innosetup/setup_foobotmonitor.exe and b/applications/foobot/monitor/innosetup/setup_foobotmonitor.exe differ
diff --git a/applications/foobot/monitor/linuxbinaries/foobotmonitor.zip b/applications/foobot/monitor/linuxbinaries/foobotmonitor.zip
index bb5edae86..ca156c684 100644
Binary files a/applications/foobot/monitor/linuxbinaries/foobotmonitor.zip and b/applications/foobot/monitor/linuxbinaries/foobotmonitor.zip differ
diff --git a/applications/foobot/monitor/uconfigform.pas b/applications/foobot/monitor/uconfigform.pas
index 208f6eef7..6e3f23c70 100644
--- a/applications/foobot/monitor/uconfigform.pas
+++ b/applications/foobot/monitor/uconfigform.pas
@@ -1,5 +1,23 @@
unit uconfigform;
+ { Foobot Monitor
+ Copyright (C)2016 Gordon Bamber minsadorada@charcodelvalle.com
+
+ This source is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This code is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ details.
+
+ A copy of the GNU General Public License is available on the World Wide Web
+ at . You can also obtain it by writing
+ to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ MA 02111-1307, USA.
+}
{$mode objfpc}{$H+}
interface
diff --git a/applications/foobot/monitor/umainform.lfm b/applications/foobot/monitor/umainform.lfm
index 54a159071..89a65e448 100644
--- a/applications/foobot/monitor/umainform.lfm
+++ b/applications/foobot/monitor/umainform.lfm
@@ -3,8 +3,8 @@ object mainform: Tmainform
Height = 262
Top = 154
Width = 782
- BorderIcons = [biSystemMenu]
- BorderStyle = bsToolWindow
+ BorderIcons = [biSystemMenu, biMinimize]
+ BorderStyle = bsSingle
Caption = 'mainform'
ClientHeight = 242
ClientWidth = 782
@@ -14,7 +14,9 @@ object mainform: Tmainform
OnCreate = FormCreate
OnDestroy = FormDestroy
OnShow = FormShow
+ OnWindowStateChange = FormWindowStateChange
Position = poWorkAreaCenter
+ ShowInTaskBar = stNever
LCLVersion = '1.7'
Scaled = True
object grp_sensorDisplay: TGroupBox
@@ -378,6 +380,29 @@ object mainform: Tmainform
Checked = True
OnClick = mnu_optionsSaveHighLowsClick
end
+ object mnu_optionsMinimiseToTray: TMenuItem
+ Caption = 'Minimise to tray'
+ OnClick = mnu_optionsMinimiseToTrayClick
+ end
+ end
+ end
+ object TrayIcon1: TTrayIcon
+ PopUpMenu = traypopup
+ Visible = True
+ OnClick = TrayIcon1Click
+ Left = 96
+ Top = 8
+ end
+ object traypopup: TPopupMenu
+ Left = 136
+ Top = 8
+ object mnupopup_fileRestore: TMenuItem
+ Caption = '&Restore'
+ OnClick = mnupopup_fileRestoreClick
+ end
+ object mnu_pupupClose: TMenuItem
+ Caption = '&Close'
+ OnClick = mnu_fileExitClick
end
end
end
diff --git a/applications/foobot/monitor/umainform.pas b/applications/foobot/monitor/umainform.pas
index d2ff8c703..36fdec070 100644
--- a/applications/foobot/monitor/umainform.pas
+++ b/applications/foobot/monitor/umainform.pas
@@ -1,4 +1,29 @@
unit umainform;
+{ Foobot Monitor
+
+ Copyright (C)2016 Gordon Bamber minsadorada@charcodelvalle.com
+
+ This source is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2 of the License, or (at your option)
+ any later version.
+
+ This code is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ details.
+
+ A copy of the GNU General Public License is available on the World Wide Web
+ at . You can also obtain it by writing
+ to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ MA 02111-1307, USA.
+
+VERSION HISTORY
+===============
+V0.0.1.0: Initial commit
+V0.0.2.0: Trayicon added
+V0.0.3.0: ??
+}
{$mode objfpc}{$H+}
@@ -50,6 +75,9 @@ type
lbl_voclow: TLabel;
lbl_allpollulow: TLabel;
MainMenu1: TMainMenu;
+ mnupopup_fileRestore: TMenuItem;
+ mnu_pupupClose: TMenuItem;
+ mnu_optionsMinimiseToTray: TMenuItem;
mnu_optionsSaveHighLows: TMenuItem;
mnu_SampleEvery24Hours: TMenuItem;
mnu_SampleEvery8Hours: TMenuItem;
@@ -62,12 +90,17 @@ type
mnu_options: TMenuItem;
mnu_fileExit: TMenuItem;
mnu_file: TMenuItem;
+ traypopup: TPopupMenu;
tmr_foobot: TTimer;
+ TrayIcon1: TTrayIcon;
procedure FormActivate(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure FormShow(Sender: TObject);
+ procedure FormWindowStateChange(Sender: TObject);
+ procedure mnupopup_fileRestoreClick(Sender: TObject);
procedure mnu_fileExitClick(Sender: TObject);
+ procedure mnu_optionsMinimiseToTrayClick(Sender: TObject);
procedure mnu_optionsSaveHighLowsClick(Sender: TObject);
procedure mnu_optionsShowHighsAndLowsClick(Sender: TObject);
procedure mnu_optionsTakeReadingNowClick(Sender: TObject);
@@ -77,6 +110,7 @@ type
procedure mnu_SampleEvery4HoursClick(Sender: TObject);
procedure mnu_SampleEvery8HoursClick(Sender: TObject);
procedure tmr_foobotTimer(Sender: TObject);
+ procedure TrayIcon1Click(Sender: TObject);
private
sSecretKey, sFoobotUserName, sUUID: string;
bShowHighsAndLows: boolean;
@@ -120,6 +154,8 @@ begin
iFudgeFactor := 20;
ClientHeight := grp_sensorDisplay.Height + grp_highlow.Height + iFudgeFactor;
bShowHighsAndLows := True;
+ TrayIcon1.Icon:=Application.Icon;
+ TrayIcon1.Hint:=Application.Title;
end;
procedure Tmainform.FormActivate(Sender: TObject);
@@ -189,11 +225,32 @@ procedure Tmainform.FormShow(Sender: TObject);
begin
end;
+procedure Tmainform.FormWindowStateChange(Sender: TObject);
+begin
+ if mainform.WindowState = wsMinimized then
+ begin
+ mainform.WindowState := wsNormal;
+ mainform.Hide;
+ mainform.ShowInTaskBar := stNever;
+ end;
+end;
+
+procedure Tmainform.mnupopup_fileRestoreClick(Sender: TObject);
+begin
+ mainform.show;
+end;
+
procedure Tmainform.mnu_fileExitClick(Sender: TObject);
begin
Close;
end;
+procedure Tmainform.mnu_optionsMinimiseToTrayClick(Sender: TObject);
+begin
+ mainform.WindowState:=wsMinimized;
+ mainform.FormWindowStateChange(Self);
+end;
+
procedure Tmainform.mnu_optionsSaveHighLowsClick(Sender: TObject);
begin
SaveLoadHighLows:=mnu_optionsSaveHighLows.Checked;
@@ -261,6 +318,11 @@ begin
DisplayReadings;
end;
+procedure Tmainform.TrayIcon1Click(Sender: TObject);
+begin
+ mainform.show;
+end;
+
procedure Tmainform.UpdateHighLow(SensorNumber: integer);
begin
case SensorNumber of