📄 untmain.pas
字号:
end
Else
Begin
Pen.Color:=Clgray;
Pen.Width:=1;
MoveTo(ARect.Left+20,ARect.Top + ((ARect.Bottom-ARect.Top) div 2)-1);
LineTo(ARect.Right,ARect.Top + ((ARect.Bottom-ARect.Top) div 2)-1);
Pen.Color:=ClWhite;
Pen.Width:=1;
MoveTo(ARect.Left + 20,ARect.Top + ((ARect.Bottom-ARect.Top) div 2));
LineTo(ARect.Right, ARect.Top + ((ARect.Bottom-ARect.Top) div 2));
Pen.Color := ClSilver;
Pen.Width := 1;
MoveTo(ARect.Left + 20, ARect.Top + ((ARect.Bottom - ARect.Top) div 2) + 1);
LineTo(ARect.Right, ARect.Top + ((ARect.Bottom - ARect.Top) div 2) + 1);
End;
if mnuMain.Images <> nil then
if TMenuItem(Sender).ImageIndex <> -1 then
Begin
mnuMain.Images.Draw(ACanvas,ARect.Left+1,ARect.Top+((Arect.Bottom-Arect.Top) div 2)-5, TMenuItem(Sender).imageindex);
End;
End;
end;
procedure TfrmMain.SetLoginInfo(const Value: TUserRec);
begin
FLoginInfo := Value;
StatusBar1.Panels[3].Text := Value.Name;
end;
procedure TfrmMain.actQuitExecute(Sender: TObject);
begin
Close;
end;
procedure TfrmMain.actQuestionGrpExecute(Sender: TObject);
begin
if (frmQuestionGrp = nil) or (not Assigned(frmQuestionGrp)) then
begin
frmQuestionGrp := TfrmQuestionGrp.Create(Application);
with frmQuestionGrp do begin
Conn := DM.cnn;
Title := '问题组设置';
LogicDel := True;
LoadData;
Show;
end;
end else
with frmQuestionGrp do begin
if WindowState <> wsMaximized then
WindowState := wsMaximized;
BringToFront;
end;
end;
procedure TfrmMain.actQuestionExecute(Sender: TObject);
begin
if (frmQuestions = nil) or (not Assigned(frmQuestions)) then
begin
frmQuestions := TfrmQuestions.Create(Application);
with frmQuestions do begin
Conn := DM.cnn;
Title := '问题设置';
LogicDel := False;
LoadData;
Show;
end;
end else
with frmQuestions do begin
if WindowState <> wsMaximized then
WindowState := wsMaximized;
BringToFront;
end;
end;
procedure TfrmMain.actMeasureExecute(Sender: TObject);
begin
if (frmMeasure = nil) or (not Assigned(frmMeasure)) then
begin
frmMeasure := TfrmMeasure.Create(Application);
with frmMeasure do begin
Conn := DM.cnn;
Title := '心理量表设置';
LogicDel := True;
LoadData;
Show;
end;
end else
with frmMeasure do begin
if WindowState <> wsMaximized then
WindowState := wsMaximized;
BringToFront;
end;
end;
procedure TfrmMain.actSchoolExecute(Sender: TObject);
begin
if (frmSchool = nil) or (not Assigned(frmSchool)) then
begin
frmSchool := TfrmSchool.Create(Application);
with frmSchool do
begin
Conn := DM.cnn;
Title := '学校班级设置';
LogicDel := False;
LoadData;
Show;
end;
end else
with frmSchool do begin
if WindowState <> wsMaximized then
WindowState := wsMaximized;
BringToFront;
end;
end;
procedure TfrmMain.actStudentExecute(Sender: TObject);
begin
if (frmStudent = nil) or (not Assigned(frmStudent)) then
begin
frmStudent := TfrmStudent.Create(Application);
with frmStudent do begin
Conn := DM.cnn;
Title := '学生资料设置';
LogicDel := False;
LoadData;
Show;
end;
end else
with frmStudent do begin
if WindowState <> wsMaximized then
WindowState := wsMaximized;
BringToFront;
end;
end;
procedure TfrmMain.actJudgeExecute(Sender: TObject);
begin
if (frmJudgeStd = nil) or (not Assigned(frmJudgeStd)) then
begin
frmJudgeStd := TfrmJudgeStd.Create(Application);
with frmJudgeStd do begin
Conn := DM.cnn;
Title := '判断标准设置';
LogicDel := False;
LoadData;
Show;
end;
end else
with frmJudgeStd do begin
if WindowState <> wsMaximized then
WindowState := wsMaximized;
BringToFront;
end;
end;
procedure TfrmMain.actImportDataExecute(Sender: TObject);
begin
with TfrmImportData.Create(Application) do begin
ShowModal;
Free;
end;
end;
procedure TfrmMain.actReportTextExecute(Sender: TObject);
begin
if (frmReportText = nil) or (not Assigned(frmReportText)) then
begin
frmReportText := TfrmReportText.Create(Application);
with frmReportText do begin
Conn := DM.cnn;
Title := '报表文本设置';
LogicDel := False;
LoadData;
Show;
end;
end else
with frmReportText do begin
if WindowState <> wsMaximized then
WindowState := wsMaximized;
BringToFront;
end;
end;
procedure TfrmMain.actReportExecute(Sender: TObject);
var
strFilter: string;
begin
strFilter := '';
with TfrmStudentCondition.Create(Application) do begin
if ShowModal <> mrOK then begin
Free;
Exit;
end;
strFilter := FilterStr;
Free;
end;
with TfrmSelectStudent.Create(Application) do begin
FilterString := strFilter;
ShowModal;
Free;
end;
end;
procedure TfrmMain.actWordExecute(Sender: TObject);
begin
frmSuggestWord := TfrmSuggestWord.Create(Application);
with frmSuggestWord do begin
ShowModal;
Free;
end;
end;
procedure TfrmMain.actreportprintExecute(Sender: TObject);
var
ASchoolID, AClassID, ADataType: Integer;
begin
frmExportCondition := TfrmExportCondition.Create(Application);
with frmExportCondition do begin
if ShowModal <> mrOK then begin
Free;
exit;
end;
ASchoolID := SchoolID;
AClassID := ClassID;
ADataType := DataType;
Free;
end;
frmExportData := TfrmExportData.Create(Application);
with frmExportData do begin
SchoolID := ASchoolID;
ClassID := AClassID;
DataType := ADataType;
ShowModal;
Free;
end;
end;
procedure TfrmMain.actDeleteDataExecute(Sender: TObject);
begin
frmDeleteData := TfrmDeleteData.Create(Application);
with frmDeleteData do begin
ShowModal;
Free;
end;
end;
procedure TfrmMain.actPatientMeasureExecute(Sender: TObject);
begin
with TfrmMeasureCase.Create(Application) do
begin
Conn := DM.cnn;
ChildrenID := -1;
FromMenu := false;
ShowModal;
Free;
end;
end;
procedure TfrmMain.FormShow(Sender: TObject);
var
i, j: Integer;
strCaption: string;
begin
FormResize(Sender);
//初始化系统菜单
//IniMainMenu;
//初始化抽屉控件
//IniBox;
//确定滚动栏的图标个数
MenuItemCnt := 5;
for i := 0 to PnlMainL.ControlCount - 1 do
begin
if UpperCase(Copy(PnlMainL.Controls[i].Name,1,7)) = 'PNLMENU' then
begin
if not TPanel(PnlMainL.Controls[i]).Visible then Continue;
for j := 0 to TPanel(PnlMainL.Controls[i]).ControlCount-1 do
begin
if TPanel(PnlMainL.Controls[i]).Controls[j] is TImage then
TImage(TPanel(PnlMainL.Controls[i]).Controls[j]).OnClick := ImgMenuClick
else if TPanel(PnlMainL.Controls[i]).Controls[j] is TAALabel then
begin
TAALabel(TPanel(PnlMainL.Controls[i]).Controls[j]).OnClick := ImgMenuClick;
strCaption := mnuMain.Items[TPanel(PnlMainL.Controls[i]).Tag-1].Caption;
if Pos('(', strCaption)<>0 then
strCaption := Copy(strCaption, 1, Pos('(', strCaption)-1);
TAALabel(TPanel(PnlMainL.Controls[i]).Controls[j]).Caption := strCaption;
end;
end;
end;
end;
//重绘滚动栏的背景图片
DrawImg;
RefreshLog;
//Self.Menu := self.mnuMain;
ImgMenuClick(ImgMenu1);
ImgDraw.Align := alNone;
ImgDraw.Align := alClient;
end;
procedure TfrmMain.FormResize(Sender: TObject);
begin
StatusBar1.Panels[1].Width := Self.Width
- StatusBar1.Panels[0].Width - StatusBar1.Panels[2].Width
- StatusBar1.Panels[3].Width - StatusBar1.Panels[4].Width
- StatusBar1.Panels[5].Width;
end;
procedure TfrmMain.RefreshLog;
begin
//
StatusBar1.Panels[3].Text := LoginInfo.Name;
end;
procedure TfrmMain.FormCreate(Sender: TObject);
var
i, j: Integer;
begin
Menu := nil;
for i:=0 to mnuMain.Items.Count-1 do
begin
mnuMain.Items[i].OnAdvancedDrawItem := AdvancedDrawMenuItem;
for j:=0 to mnuMain.Items[i].Count-1 do
mnuMain.Items[i].Items[j].OnAdvancedDrawItem := AdvancedDrawMenuItem;
end;
end;
procedure TfrmMain.actworkExecute(Sender: TObject);
begin
with Tfrmworkset.Create(Application) do
begin
try
Conn:=DM.cnn;
adsSingle.Active:=True;
ShowModal;
finally
Free;
end;
end;
end;
procedure TfrmMain.actEduExecute(Sender: TObject);
begin
with TfrmEduset.Create(Application) do
begin
try
Conn:=DM.cnn;
adsSingle.Active:=True;
ShowModal;
finally
Free;
end;
end;
end;
procedure TfrmMain.actEditPWDExecute(Sender: TObject);
begin
with TfrmEditPWD.Create(Application) do
begin
try
Conn:=DM.cnn;
LoginInfo:=FLoginInfo;
ShowModal;
finally
Free;
end;
end;
end;
procedure TfrmMain.actuserExecute(Sender: TObject);
begin
with TfrmUser.Create(Application) do
begin
try
Conn := DM.cnn;
loginInfo := FLoginInfo;
Title := '用户设置';
LogicDel := True;
LoadData;
ShowModal;
finally
Free;
end;
end;
end;
procedure TfrmMain.ActemportdatraExecute(Sender: TObject);
begin
frmExportExecl := TfrmExportExecl.Create(Application);
with frmExportExecl do begin
if ShowModal <> mrOK then begin
Free;
exit;
end;
//ASchoolID := SchoolID;
// AClassID := ClassID;
// ADataType := DataType;
Free;
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -