From f1587b020904c4cb66a93602cf92ba0ccf75cbea Mon Sep 17 00:00:00 2001 From: Raymond Date: Fri, 16 Apr 2010 00:30:19 +0200 Subject: [PATCH] Changed Tray behavior. --- Projects/SAMufasaGUI/testunit.lfm | 2 +- Projects/SAMufasaGUI/testunit.pas | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/Projects/SAMufasaGUI/testunit.lfm b/Projects/SAMufasaGUI/testunit.lfm index 94b4392..9dd41a7 100644 --- a/Projects/SAMufasaGUI/testunit.lfm +++ b/Projects/SAMufasaGUI/testunit.lfm @@ -2471,7 +2471,7 @@ object Form1: TForm1 00000000000000000000 } Visible = True - OnClick = NoTray + OnClick = MTrayIconClick left = 528 top = 104 end diff --git a/Projects/SAMufasaGUI/testunit.pas b/Projects/SAMufasaGUI/testunit.pas index c08298a..6a546e1 100644 --- a/Projects/SAMufasaGUI/testunit.pas +++ b/Projects/SAMufasaGUI/testunit.pas @@ -285,12 +285,12 @@ type procedure MenuItemTabCloseClick(Sender: TObject); procedure MenuItemTabCloseOthersClick(Sender: TObject); procedure MenuItemFunctionListClick(Sender: TObject); + procedure MTrayIconClick(Sender: TObject); procedure NewsTimerTimer(Sender: TObject); procedure OnLinePSScript(Sender: TObject); procedure ButtonPickClick(Sender: TObject); procedure ButtonSelectorDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); - procedure NoTray(Sender: TObject); procedure PageControl1Change(Sender: TObject); procedure ButtonTrayClick(Sender: TObject); procedure PageControl1Changing(Sender: TObject; var AllowChange: Boolean); @@ -2337,6 +2337,13 @@ begin FunctionListShown(not MenuItemFunctionList.Checked); end; +procedure TForm1.MTrayIconClick(Sender: TObject); +begin + self.Show; + if Self.CanFocus then + self.SetFocus; +end; + function TForm1.GetSimbaNews: String; var t: TDownloadThread; @@ -2404,14 +2411,6 @@ begin FormWritelnEx('New window: ' + IntToStr(Selector.LastPick)); end; -procedure TForm1.NoTray(Sender: TObject); -begin - if Not Form1.IsVisible then - Self.MenuItemShowClick(Sender) - else - Form1.Hide; -end; - procedure TForm1.PageControl1Change(Sender: TObject); begin RefreshTab();