1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
|
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, ToolWin, ImgList, Menus, Buttons, XPMan,IniFiles;
type
TForm1 = class(TForm)
MainMenu1: TMainMenu;
Fichier1: TMenuItem;
Ouvrir1: TMenuItem;
N1: TMenuItem;
Quiter1: TMenuItem;
Edition1: TMenuItem;
Copier1: TMenuItem;
Configuration1: TMenuItem;
Outils1: TMenuItem;
Aide1: TMenuItem;
StatusBar1: TStatusBar;
ImageList1: TImageList;
ToolBar1: TToolBar;
ToolButton1: TToolButton;
ToolButton5: TToolButton;
Configurer1: TMenuItem;
Compo1: TMenuItem;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
SpeedButton3: TSpeedButton;
SpeedButton4: TSpeedButton;
SpeedButton5: TSpeedButton;
SpeedButton6: TSpeedButton;
ListedesClients1: TMenuItem;
Aide2: TMenuItem;
ListedesComptes1: TMenuItem;
ListeClientComptes1: TMenuItem;
XPManifest1: TXPManifest;
procedure FormCreate(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
procedure Quiter1Click(Sender: TObject);
procedure OuvertureFiche(Class_Fiche: TFormClass);
procedure SpeedButton2Click(Sender: TObject);
procedure ListedesClients1Click(Sender: TObject);
procedure Aide2Click(Sender: TObject);
procedure SpeedButton3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
Passe,Asist : boolean;
ini:TIniFile;
implementation
Uses Unit2,Unit4,quickcli,apropos,Unit5,Unit6,Unit7;
{$R *.dfm}
//la fonction d'ouverture des fiches
procedure TForm1.OuvertureFiche(Class_Fiche: TFormClass);
var
Num_Fiche : integer;
trouve_Fiche : Boolean;
begin
trouve_Fiche := false;
Num_Fiche := 0;
while (Not trouve_Fiche) and (Num_Fiche<Screen.FormCount) do
begin
if (Screen.Forms[Num_Fiche] is Class_Fiche) then
begin
if Not (csDestroying in Screen.Forms[Num_Fiche].ComponentState) then
Screen.Forms[Num_Fiche].Show;
trouve_Fiche := true;
break;
end;
Inc(Num_Fiche);
end;
if Not trouve_Fiche then
with Class_Fiche.Create(Self) do
show;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
//rien
ini:=TIniFile.Create(ExtractFilePath(Application.EXEName)+'SysInfo.ini');
Passe :=ini.ReadBool('securite','mdp',true);
Asist :=ini.ReadBool('securite','ast',true);
ini.Free;
//Asist:=true;
//Passe:=false;
if Asist then
begin
formAssist:=TformAssist.Create(Form1);
formAssist.Show
//form1.Visible:=false;
end
else if Passe then
begin
FormPass:=TFormPass.Create(Form1);
FormPass.Show;
end;
end;
procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
//Form2:=TForm2.Create(Form1); {création}
//Form2.Show;
OuvertureFiche(TForm2);
end;
procedure TForm1.Quiter1Click(Sender: TObject);
begin
application.Terminate;
end;
procedure TForm1.SpeedButton2Click(Sender: TObject);
begin
OuvertureFiche(TForm4);
end;
procedure TForm1.ListedesClients1Click(Sender: TObject);
begin
QuickReport5.Preview;
end;
procedure TForm1.Aide2Click(Sender: TObject);
begin
prop:=Tprop.Create(Form1); {création}
prop.Show;
end;
procedure TForm1.SpeedButton3Click(Sender: TObject);
begin
Form7:=TForm7.Create(Form1); {création}
Form7.Show;
end;
end. |
Partager