Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
r57zone committed May 1, 2016
1 parent 762cb68 commit 293ec4c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 22 deletions.
6 changes: 3 additions & 3 deletions Unit1.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ object Form1: TForm1
BorderStyle = bsSingle
Caption = 'Notification center'
ClientHeight = 322
ClientWidth = 380
ClientWidth = 390
Color = clWhite
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Expand All @@ -20,13 +20,13 @@ object Form1: TForm1
object WebBrowser1: TWebBrowser
Left = 0
Top = 0
Width = 380
Width = 390
Height = 306
TabOrder = 0
OnBeforeNavigate2 = WebBrowser1BeforeNavigate2
OnDocumentComplete = WebBrowser1DocumentComplete
ControlData = {
4C00000046270000A01F00000000000000000000000000000000000000000000
4C0000004F280000A01F00000000000000000000000000000000000000000000
000000004C000000000000000000000001000000E0D057007335CF11AE690800
2B2E126208000000000000004C0000000114020000000000C000000000000046
8000000000000000000000000000000000000000000000000000000000000000
Expand Down
24 changes: 12 additions & 12 deletions Unit1.pas
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, OleCtrls, SHDocVw, MSHTML, ShellAPI, StdCtrls;
Dialogs, OleCtrls, SHDocVw, MSHTML, ShellAPI, StdCtrls, ExtCtrls;

type
TForm1 = class(TForm)
Expand All @@ -21,8 +21,8 @@ TForm1 = class(TForm)
procedure WMCopyData(var Msg: TWMCopyData); message WM_COPYDATA;
protected
procedure CreateParams(var Params: TCreateParams); override;
procedure IconMouse(var msg:TMessage); message WM_USER+1;
procedure WMActivate(var msg:TMessage); message WM_ACTIVATE;
procedure IconMouse(var Msg:TMessage); message WM_USER+1;
procedure WMActivate(var Msg:TMessage); message WM_ACTIVATE;
{ Private declarations }
public
{ Public declarations }
Expand Down Expand Up @@ -71,12 +71,12 @@ procedure Tray(n:integer);
end;
end;

procedure TForm1.IconMouse(var msg: TMessage);
procedure TForm1.IconMouse(var Msg: TMessage);
begin
case msg.lparam of
wm_lbuttonup: if (Left=Screen.Width+Width) and (Top=Screen.Height+Height) then MyShow else MyHide;
case Msg.lparam of
WM_LButtonDown: if (Left=Screen.Width+Width) and (Top=Screen.Height+Height) then MyShow else MyHide;

wm_rbuttonup:
WM_RButtonDown:
begin
SetForegroundWindow(Application.Handle);
case MessageBox(Handle,'Çàêðûòü ïðèëîæåíèå',PChar(Application.Title),35) of
Expand Down Expand Up @@ -170,7 +170,7 @@ procedure TForm1.WMCopyData(var Msg: TWMCopyData);
if (p_img='null') and (p_img2<>'null') then p_img:=p_img2;
if (p_img='null') and (p_img2='null') then p_img:='sys.png';

if (a_desc<>'null') and (a_desc_sub<>'null') then a_desc:=a_desc+' '+a_desc_sub;
if (a_desc<>'null') and (a_desc_sub<>'null') then a_desc:=a_desc+' - '+a_desc_sub;
if (a_desc<>'null') and (a_desc_sub='null') then a_desc:=a_desc;
if (a_desc='null') and (a_desc_sub<>'null') then a_desc:=a_desc_sub;
if (a_desc='null') and (a_desc_sub='null') then a_desc:='';
Expand All @@ -188,7 +188,7 @@ procedure TForm1.WMCopyData(var Msg: TWMCopyData);
'6': a_color:='#222222';
end; end else a_color:='gray';

WebBrowser1.OleObject.Document.getElementById('items').innerHTML:='<div id="item"><div id="icon" style="background-color:'+a_color+';"><img src="'+p_img+'" /></div><div id="context"><div id="title">'+a_title+'</div><div id="clear"></div><div id="description">'+a_desc+'</div></div><div id="time">'+copy(TimeToStr(Time),1,5)+'</div></div>'+WebBrowser1.OleObject.Document.getElementById('items').innerHTML;
WebBrowser1.OleObject.Document.getElementById('items').innerHTML:='<div id="item"><div id="icon" style="background-color:'+a_color+';"><img src="'+p_img+'" /></div><div id="context"><div id="title">'+a_title+'</div><div id="clear"></div><div id="description">'+a_desc+'</div></div><div id="time">'+copy(TimeToStr(Time),1,5)+'<br>'+DateToStr(Date)+'</div></div>'+WebBrowser1.OleObject.Document.getElementById('items').innerHTML;
Notifications.Text:=WebBrowser1.OleObject.Document.getElementById('items').innerHTML;
Notifications.SaveToFile(ExtractFilePath(ParamStr(0))+'Notifications.txt');
end;
Expand All @@ -197,12 +197,12 @@ procedure TForm1.WMCopyData(var Msg: TWMCopyData);

procedure TForm1.FormClick(Sender: TObject);
begin
Application.MessageBox('Öåíòð óâåäîìëåíèé 0.3'+#13#10+'https://github.com/r57zone'+#13#10+'Ïîñëåäíåå îáíîâëåíèå: 28.04.2016','Î ïðîãðàììå...',0);
Application.MessageBox('Öåíòð óâåäîìëåíèé 0.4'+#13#10+'https://github.com/r57zone'+#13#10+'Ïîñëåäíåå îáíîâëåíèå: 01.05.2016','Î ïðîãðàììå...',0);
end;

procedure TForm1.WMActivate(var msg: TMessage);
procedure TForm1.WMActivate(var Msg: TMessage);
begin
if Msg.WParam=WA_INACTIVE then MyHide;
if Msg.WParam=WA_INACTIVE then MyHide;
end;

procedure TForm1.FormDestroy(Sender: TObject);
Expand Down
12 changes: 5 additions & 7 deletions main.htm
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="https://github.com/r57zone/"/>
<title>Центр уведомлений (стиль)</title>
<link rel="stylesheet" href="all.css">
<style type="text/css">
*{cursor:default;}
html,body{margin:0px;padding:0px;}
body{font-family: Segoe UI;font-weight:lighter;color:#666666;}
#main{width:800px;height:600px;}
#clear{clear:both;float:none;height:0;}

#header{color:#878787;margin:0 18px 10px 18px;}
Expand All @@ -20,18 +18,18 @@

#items{overflow:auto;height:250px;color:#545454;}

#item{margin:18px 22px 0 18px;height:45px;}
#item{margin:18px 22px 0 18px;height:45px;overflow:hidden;}
#item:first-child{margin:0 22px 0 18px;}
#item:hover{background-color:#f1f1f1;}
#icon{position:relative;float:left;width:45px;height:45px;}
#icon img{position:absolute;top:0;bottom:0;left:0;right:0;margin:auto;max-width:45px;max-height:45px;}
#context{float:left;}
#item #title{float:left;width:100%;padding:0 5px 2px 5px;font-weight:600;width:220px;overflow:hidden;height:22px;text-overflow:ellipsis;}
#description{float:left;width:100%;font-size:12px;padding:0 5px;font-weight:400;width:220px;overflow:hidden;height:18px;text-overflow:ellipsis;}
#time{float:right;font-weight:600px;padding:4px 7px 0 0;font-weight:600;font-size:13px;}
#item #title{float:left;padding:0 5px 2px 5px;font-weight:600;width:208px;overflow:hidden;height:22px;text-overflow:ellipsis;}
#description{float:left;font-size:12px;padding:0 5px;font-weight:400;width:208px;overflow:hidden;height:18px;text-overflow:ellipsis;}
#time{position:relative;top:0;float:right;padding:7px 4px 0 0;font-weight:500;font-size:13px;text-align:right;}
</style>
</head>
<body oncontextmenu="return false">
<body oncontextmenu="return false" onselectstart="return false">
<div id="header">
<div id="title">Уведомления</div>
<div id="clear_btn"><a onclick="document.location='#1';">УДАЛИТЬ ВСЕ</a></div>
Expand Down

0 comments on commit 293ec4c

Please sign in to comment.