Switched to CoolTrayIcon. Did some other stuff.
This commit is contained in:
parent
c26a635603
commit
b266dea53f
@ -11,7 +11,6 @@ begin
|
|||||||
Application.Initialize;
|
Application.Initialize;
|
||||||
Application.Title := 'SETI@home Statistics';
|
Application.Title := 'SETI@home Statistics';
|
||||||
Application.CreateForm(TMainForm, MainForm);
|
Application.CreateForm(TMainForm, MainForm);
|
||||||
Application.CreateForm(TSkymap, Skymap);
|
|
||||||
Application.ShowMainForm := false;
|
Application.ShowMainForm := false;
|
||||||
Application.Run;
|
Application.Run;
|
||||||
end.
|
end.
|
||||||
|
@ -326,6 +326,7 @@ object MainForm: TMainForm
|
|||||||
'tion of the current workunit'
|
'tion of the current workunit'
|
||||||
Caption = 'Start position only'
|
Caption = 'Start position only'
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
|
OnClick = CWUwhatClick
|
||||||
end
|
end
|
||||||
object CWUwhat2: TRadioButton
|
object CWUwhat2: TRadioButton
|
||||||
Left = 32
|
Left = 32
|
||||||
@ -340,6 +341,7 @@ object MainForm: TMainForm
|
|||||||
Checked = True
|
Checked = True
|
||||||
TabOrder = 2
|
TabOrder = 2
|
||||||
TabStop = True
|
TabStop = True
|
||||||
|
OnClick = CWUwhatClick
|
||||||
end
|
end
|
||||||
object CWUwhat3: TRadioButton
|
object CWUwhat3: TRadioButton
|
||||||
Left = 32
|
Left = 32
|
||||||
@ -351,6 +353,7 @@ object MainForm: TMainForm
|
|||||||
't workunit'
|
't workunit'
|
||||||
Caption = 'Complete track'
|
Caption = 'Complete track'
|
||||||
TabOrder = 3
|
TabOrder = 3
|
||||||
|
OnClick = CWUwhatClick
|
||||||
end
|
end
|
||||||
object Crosses: TCheckBox
|
object Crosses: TCheckBox
|
||||||
Left = 8
|
Left = 8
|
||||||
|
@ -4,7 +4,7 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||||||
Dialogs, StdCtrls, IniFiles, ComCtrls, ExtCtrls, DateUtils, CoolTrayIcon,
|
Dialogs, StdCtrls, IniFiles, ComCtrls, ExtCtrls, DateUtils, TrayIcon,
|
||||||
Menus, Math, jpeg;
|
Menus, Math, jpeg;
|
||||||
|
|
||||||
type
|
type
|
||||||
@ -65,6 +65,7 @@ type
|
|||||||
Label11: TLabel;
|
Label11: TLabel;
|
||||||
Label12: TLabel;
|
Label12: TLabel;
|
||||||
PrefsSheet: TTabSheet;
|
PrefsSheet: TTabSheet;
|
||||||
|
TrayIcon: TTrayIcon;
|
||||||
PopupMenu: TPopupMenu;
|
PopupMenu: TPopupMenu;
|
||||||
ShowHideItem: TMenuItem;
|
ShowHideItem: TMenuItem;
|
||||||
ExitItem: TMenuItem;
|
ExitItem: TMenuItem;
|
||||||
@ -114,7 +115,6 @@ type
|
|||||||
HistShow2: TRadioButton;
|
HistShow2: TRadioButton;
|
||||||
HistShow3: TRadioButton;
|
HistShow3: TRadioButton;
|
||||||
Crosses: TCheckBox;
|
Crosses: TCheckBox;
|
||||||
TrayIcon: TCoolTrayIcon;
|
|
||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||||
procedure ShowemailClick(Sender: TObject);
|
procedure ShowemailClick(Sender: TObject);
|
||||||
|
30
SkymapU.pas
30
SkymapU.pas
@ -66,6 +66,20 @@ begin
|
|||||||
DMout;
|
DMout;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure MakeCross(x,y: integer; c: TColor);
|
||||||
|
begin
|
||||||
|
DMin(Format('MakeCross(%d,%d)',[x,y]));
|
||||||
|
with Skymap.Map.Canvas do begin
|
||||||
|
Pen.Color := c;
|
||||||
|
Pen.Width := 1;
|
||||||
|
MoveTo(x,0);
|
||||||
|
LineTo(x,MapHeightPx);
|
||||||
|
MoveTo(0,y);
|
||||||
|
LineTo(MapWidthPx,y);
|
||||||
|
end;
|
||||||
|
DMout;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TSkymap.MapMouseMove(Sender: TObject; Shift: TShiftState; X,
|
procedure TSkymap.MapMouseMove(Sender: TObject; Shift: TShiftState; X,
|
||||||
Y: Integer);
|
Y: Integer);
|
||||||
var r,d: double;
|
var r,d: double;
|
||||||
@ -115,11 +129,11 @@ begin
|
|||||||
Replace(x,'.',',');
|
Replace(x,'.',',');
|
||||||
j := 0;
|
j := 0;
|
||||||
for i:=3 to Length(x)-1 do begin
|
for i:=3 to Length(x)-1 do begin
|
||||||
if (x[i]=' ') AND (x[i+1]=' ') AND (j>0) then begin
|
if (x[i]=' ') AND (x[i+1]<>' ') AND (j>0) then begin
|
||||||
r := StrToFloat(Copy(x,j,i-j));
|
r := StrToFloat(Copy(x,j,i-j));
|
||||||
j := i;
|
j := i;
|
||||||
end;
|
end;
|
||||||
if (x[i]=' ') AND (x[i+1]=' ') AND (j=0) then j:=i;
|
if (x[i]=' ') AND (x[i+1]<>' ') AND (j=0) then j:=i;
|
||||||
end;
|
end;
|
||||||
d := StrToFloat(Copy(x,j,Length(x)-j));
|
d := StrToFloat(Copy(x,j,Length(x)-j));
|
||||||
DM(Format('Result: %f, %f', [r,d]));
|
DM(Format('Result: %f, %f', [r,d]));
|
||||||
@ -143,19 +157,17 @@ begin
|
|||||||
if MainForm.CWUwhat.Checked then begin
|
if MainForm.CWUwhat.Checked then begin
|
||||||
ExtractRD(MainForm.SkyCoord.Text,r,d);
|
ExtractRD(MainForm.SkyCoord.Text,r,d);
|
||||||
SkyToXY(r,d,x,y);
|
SkyToXY(r,d,x,y);
|
||||||
MakeCircle(x,y,clLime);
|
if MainForm.Crosses.Checked then MakeCross(x,y,clYellow) else MakeCircle(x,y,clLime);
|
||||||
end else if MainForm.CWUwhat2.Checked then begin
|
end else if MainForm.CWUwhat2.Checked then begin
|
||||||
ExtractRD(MainForm.SkyCoord.Text,r,d);
|
|
||||||
SkyToXY(r,d,x,y);
|
|
||||||
MakeCircle(x,y,clLime);
|
|
||||||
ExtractRD(MainForm.SkyCoord2.Text,r,d);
|
ExtractRD(MainForm.SkyCoord2.Text,r,d);
|
||||||
SkyToXY(r,d,x,y);
|
SkyToXY(r,d,x,y);
|
||||||
MakeCircle(x,y,clRed);
|
if MainForm.Crosses.Checked then MakeCross(x,y,clRed) else MakeCircle(x,y,clRed);
|
||||||
|
ExtractRD(MainForm.SkyCoord.Text,r,d);
|
||||||
|
SkyToXY(r,d,x,y);
|
||||||
|
if MainForm.Crosses.Checked then MakeCross(x,y,clLime) else MakeCircle(x,y,clLime);
|
||||||
end else if MainForm.CWUwhat3.Checked then begin
|
end else if MainForm.CWUwhat3.Checked then begin
|
||||||
with Skymap.Map.Canvas do begin
|
with Skymap.Map.Canvas do begin
|
||||||
Pen.Color := clYellow;
|
Pen.Color := clYellow;
|
||||||
Pen.Style := psSolid;
|
|
||||||
Pen.Mode := pmCopy;
|
|
||||||
Pen.Width := 2;
|
Pen.Width := 2;
|
||||||
end;
|
end;
|
||||||
for i:=1 to MainForm.positions.Items.Count-1 do begin
|
for i:=1 to MainForm.positions.Items.Count-1 do begin
|
||||||
|
Reference in New Issue
Block a user