FMTips.pas
上传用户:yjb1804
上传日期:2021-01-30
资源大小:3105k
文件大小:2k
- unit FMTips;
- interface
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- StdCtrls, ExtCtrls, Menus, cxLookAndFeelPainters, cxButtons;
- type
- TTipsForm = class(TForm)
- CheckBox1: TCheckBox;
- Panel3: TPanel;
- Image2: TImage;
- Label1: TLabel;
- Label2: TLabel;
- ListBox1: TListBox;
- btn1: TcxButton;
- btn2: TcxButton;
- procedure FormShow(Sender: TObject);
- procedure CheckBox1Click(Sender: TObject);
- procedure Button1Click(Sender: TObject);
- procedure btn1Click(Sender: TObject);
- procedure btn2Click(Sender: TObject);
- private
- { Private declarations }
- load:Boolean;
- actual:Integer;
- public
- { Public declarations }
- end;
- var
- TipsForm: TTipsForm;
- implementation
- uses uMyXml, uCommon;
- {$R *.DFM}
- procedure TTipsForm.FormShow(Sender: TObject);
- var
- MyXml:TMyXml;
- begin
- MyXml:=TMyXml.Create(AppPath+'EmailServers.xml');
- try
- MyXml.GetAllTips(ListBox1.Items,load,actual);
- if actual < 0 then actual := 0;
- if actual > ListBox1.Items.Count-1 then actual := ListBox1.Items.Count-1;
- CheckBox1.Checked :=load;
- Label1.Caption := ListBox1.Items[actual];
- Inc(actual);
- if actual = ListBox1.Items.Count then actual := 0;
- finally
- MyXml.Free;
- end;
- end;
- procedure TTipsForm.CheckBox1Click(Sender: TObject);
- var
- MyXml:TMyXml;
- begin
- MyXml:=TMyXml.Create(AppPath+'EmailServers.xml');
- try
- MyXml.Root.FindNode('tips').AttributeByName['loadonstatup']:=BoolToStr(CheckBox1.Checked);
- finally
- MyXml.free;
- end;
- end;
- procedure TTipsForm.Button1Click(Sender: TObject);
- begin
- Close;
- end;
- procedure TTipsForm.btn1Click(Sender: TObject);
- var
- MyXml:TMyXml;
- begin
- Label1.Caption := ListBox1.Items[actual];
- Inc(actual);
- if actual = ListBox1.Items.Count then actual := 0;
- MyXml:=TMyXml.Create(AppPath+'EmailServers.xml');
- try
- MyXml.Root.FindNode('tips').AttributeByName['actual']:=IntToStr(actual);
- finally
- MyXml.free;
- end;
- end;
- procedure TTipsForm.btn2Click(Sender: TObject);
- begin
- close;
- end;
- end.