U_mainform.pas
上传用户:psxgmh
上传日期:2013-04-08
资源大小:15112k
文件大小:8k
- unit U_mainform;
- interface
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- OleCtnrs, Menus, Buttons, ComCtrls, ToolWin, Db, DBClient, MConnect,
- SConnect, ImgList, ExtCtrls, registry, StdCtrls, shellapi, winsock,
- Grids, DBGrids, variants;
- type
- TfrmMain = class(TForm)
- MainMenu: TMainMenu;
- N_E: TMenuItem;
- ToolBar1: TToolBar;
- StatusBar1: TStatusBar;
- N_A: TMenuItem;
- N_B: TMenuItem;
- N_C: TMenuItem;
- N_D: TMenuItem;
- N8: TMenuItem;
- N9: TMenuItem;
- N11: TMenuItem;
- N12: TMenuItem;
- N17: TMenuItem;
- N18: TMenuItem;
- N20: TMenuItem;
- N21: TMenuItem;
- N23: TMenuItem;
- N24: TMenuItem;
- N_H_2: TMenuItem;
- N34: TMenuItem;
- N35: TMenuItem;
- ImageList1: TImageList;
- N2: TMenuItem;
- N3: TMenuItem;
- N29: TMenuItem;
- N36: TMenuItem;
- N37: TMenuItem;
- N38: TMenuItem;
- N39: TMenuItem;
- N40: TMenuItem;
- N41: TMenuItem;
- N42: TMenuItem;
- N48: TMenuItem;
- N26: TMenuItem;
- ToolButton1: TToolButton;
- ToolButton2: TToolButton;
- ToolButton3: TToolButton;
- ToolButton4: TToolButton;
- ToolButton5: TToolButton;
- ToolButton6: TToolButton;
- ToolButton7: TToolButton;
- ToolButton8: TToolButton;
- ToolBar2: TToolBar;
- ToolButton9: TToolButton;
- ToolButton10: TToolButton;
- ToolButton11: TToolButton;
- ToolButton12: TToolButton;
- ToolButton13: TToolButton;
- CoolBar1: TCoolBar;
- ImageList2: TImageList;
- ImageList3: TImageList;
- N28: TMenuItem;
- N32: TMenuItem;
- N47: TMenuItem;
- N49: TMenuItem;
- N_F: TMenuItem;
- N_G: TMenuItem;
- N53: TMenuItem;
- N54: TMenuItem;
- N55: TMenuItem;
- N56: TMenuItem;
- N57: TMenuItem;
- N58: TMenuItem;
- N59: TMenuItem;
- N60: TMenuItem;
- N15: TMenuItem;
- N27: TMenuItem;
- N63: TMenuItem;
- N65: TMenuItem;
- N66: TMenuItem;
- N62: TMenuItem;
- N67: TMenuItem;
- N68: TMenuItem;
- N70: TMenuItem;
- N30: TMenuItem;
- N31: TMenuItem;
- N71: TMenuItem;
- ToolButton14: TToolButton;
- ImageList4: TImageList;
- btnMenu: TSpeedButton;
- btnTree: TSpeedButton;
- ToolButton15: TToolButton;
- Panel1: TPanel;
- TreeView1: TTreeView;
- Panel2: TPanel;
- Label1: TLabel;
- Panel3: TPanel;
- SpeedButton3: TSpeedButton;
- ToolButton16: TToolButton;
- ToolButton17: TToolButton;
- ToolButton18: TToolButton;
- ToolButton19: TToolButton;
- N1: TMenuItem;
- SocketConnection: TSocketConnection;
- N4: TMenuItem;
- N5: TMenuItem;
- N6: TMenuItem;
- N7: TMenuItem;
- procedure SpeedButton3Click(Sender: TObject);
- procedure btnTreeClick(Sender: TObject);
- procedure btnMenuClick(Sender: TObject);
- procedure N30Click(Sender: TObject);
- procedure N31Click(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- procedure FormClose(Sender: TObject; var Action: TCloseAction);
- procedure N29Click(Sender: TObject);
- procedure N40Click(Sender: TObject);
- procedure N71Click(Sender: TObject);
- procedure N34Click(Sender: TObject);
- procedure N39Click(Sender: TObject);
- procedure N62Click(Sender: TObject);
- procedure N9Click(Sender: TObject);
- procedure N42Click(Sender: TObject);
- procedure N26Click(Sender: TObject);
- procedure N11Click(Sender: TObject);
- procedure TreeView1Click(Sender: TObject);
- procedure N35Click(Sender: TObject);
- procedure N4Click(Sender: TObject);
- private
- public
- end;
- var
- frmMain: TfrmMain;
- implementation
- uses U_qxgl_zhsz, U_qxgl_yhsz, u_public, U_dlck, U_qdck, U_dqflb, U_zgda,
- U_ljsz, U_xgmm, U_Bmda, U_clsldcx, U_clsld, U_ckxxwh,
- U_bmlldgl, U_djsh;
- {$R *.DFM}
- procedure TfrmMain.SpeedButton3Click(Sender: TObject);
- begin
- btnTree.Down := false;
- // splitter.Visible := btnTree.Down;
- Panel1.Visible := btnTree.Down;
- end;
- procedure TfrmMain.btnTreeClick(Sender: TObject);
- begin
- // splitter.Visible := btnTree.Down;
- Panel1.Visible := btnTree.Down;
- end;
- procedure TfrmMain.btnMenuClick(Sender: TObject);
- begin
- N_A.visible := btnMenu.down;
- N_B.visible := btnMenu.down;
- N_C.visible := btnMenu.down;
- N_D.visible := btnMenu.down;
- N_E.visible := btnMenu.down;
- end;
- procedure TfrmMain.N30Click(Sender: TObject);
- begin
- if not assigned(frmQxgl_Fzsz) then
- frmQxgl_Fzsz := TfrmQxgl_Fzsz(showMDIForm(TfrmQxgl_Fzsz))
- else
- frmQxgl_Fzsz.Show;
- end;
- procedure TfrmMain.N31Click(Sender: TObject);
- begin
- if not assigned(frmQxgl_Yhsz) then
- frmQxgl_Yhsz := TfrmQxgl_Yhsz(showMDIForm(TfrmQxgl_Yhsz))
- else
- frmQxgl_Yhsz.Show;
- end;
- procedure TfrmMain.FormCreate(Sender: TObject);
- begin
- if not ConnectAppServ then
- Application.Terminate; //如果未连接应用服务器,就退出应用程序。
- frmQdck.close;
- if not LoginExecute(TfrmLogin) then //如果身份验证无效,就退出系统
- Application.Terminate;
- end;
- procedure TfrmMain.FormClose(Sender: TObject; var Action: TCloseAction);
- begin
- if Application.MessageBox('请确认是否退出本系统', '提示信息', mb_iconinformation + mb_YesNo) = id_no then
- Abort;
- //将本次的登录信息从应用服务器上删除
- try
- SocketConnection.AppServer.DelUser(CurrentParam.Host, CurrentParam.IP, CurrentParam.userAliasName, CurrentParam.LoginTime);
- except
- end;
- end;
- procedure TfrmMain.N29Click(Sender: TObject);
- begin
- if not assigned(frmDqflb) then
- frmDqflb := TfrmDqflb(showMDIForm(TfrmDqflb))
- else
- frmDqflb.Show;
- end;
- procedure TfrmMain.N40Click(Sender: TObject);
- begin
- if not assigned(frmZgda) then
- frmZgda := TfrmZgda(showMDIForm(TfrmZgda))
- else
- frmZgda.Show;
- end;
- procedure TfrmMain.N71Click(Sender: TObject);
- begin
- ShowModalForm(TfrmLjsz);
- end;
- procedure TfrmMain.N34Click(Sender: TObject);
- begin
- ShowModalForm(TfrmXgmm);
- end;
- procedure TfrmMain.N39Click(Sender: TObject);
- begin
- if not assigned(frmBmda) then
- frmBmda := TfrmBmda(showMDIForm(TfrmBmda))
- else
- frmBmda.Show;
- end;
- procedure TfrmMain.N62Click(Sender: TObject);
- begin
- if not Assigned(frmClsld_cx) then
- frmClsld_cx := TfrmClsld_cx(showMDIForm(TFrmClsld_cx))
- else
- frmClsld_cx.show;
- end;
- procedure TfrmMain.N9Click(Sender: TObject);
- begin
- if not Assigned(frmClsld) then
- frmClsld := TfrmClsld(ShowMDIForm(TfrmClsld))
- else
- frmClsld.show;
- end;
- procedure TfrmMain.N42Click(Sender: TObject);
- begin
- if not Assigned(frmCkxx) then
- frmCkxx := TfrmCkxx(ShowMDIForm(TfrmCkxx))
- else
- frmCkxx.show;
- end;
- procedure TfrmMain.N26Click(Sender: TObject);
- begin
- if not Assigned(frmBmlld) then
- frmBmlld := TfrmBmlld(ShowMDIForm(TfrmBmlld))
- else
- frmBmlld.show;
- end;
- procedure TfrmMain.N11Click(Sender: TObject);
- begin
- if not Assigned(frmDjsh) then
- frmDjsh := TfrmDjsh(ShowMDIForm(TfrmDjsh))
- else
- frmDjsh.show;
- end;
- procedure TFrmMain.TreeView1Click(Sender: TObject);
- var
- i1, i2, i3: integer;
- ii, ii1, ii2: integer;
- v_caption: string;
- if_find: boolean;
- begin
- if treeview1.selected=nil then
- exit;
- if_find := false;
- i1 := -1; i2 := -1; i3 := -1;
- v_caption := treeview1.selected.Text;
- for ii := 0 to 4 do
- begin
- if if_find = true then
- continue;
- for ii1 := 0 to mainmenu.items[ii].count - 1 do
- begin
- if if_find = true then
- continue;
- for ii2 := 0 to mainmenu.items[ii].items[ii1].count - 1 do
- begin
- if v_caption = mainmenu.items[ii].items[ii1].items[ii2].Caption then
- begin
- i3 := ii2;
- i2 := ii1;
- i1 := ii;
- if_find := true;
- continue;
- end;
- end;
- if v_caption = mainmenu.items[ii].items[ii1].Caption then
- begin
- i2 := ii1;
- i1 := ii;
- if_find := true;
- continue;
- end;
- end;
- end;
- if if_find = true then
- begin
- if i3 <> -1 then
- MainMenu.items[i1].items[i2].items[i3].click
- else
- MainMenu.Items[i1].items[i2].click;
- end;
- end;
- procedure TfrmMain.N35Click(Sender: TObject);
- begin
- close;
- end;
- procedure TfrmMain.N4Click(Sender: TObject);
- begin
- ShellExecute(handle, 'open', 'Calc.exe', nil, nil, SW_SHOWNORMAL);
- end;
- end.