소스 검색

调整提示窗口(包括错误、警告、提示、询问)

MaiXinRong 9 년 전
부모
커밋
fdfeb95eaa

+ 5 - 7
DataModules/BGLDm.pas

@@ -400,7 +400,7 @@ procedure TBGLData.cdsBGBillsViewBeforePost(DataSet: TDataSet);
     cdsBGBillsViewUnits.Tag := 0;
     cdsBGBillsViewPrice.Tag := 0;
     cdsBGBillsViewQuantity.Tag := 0;
-    ShowErrorMessage(AHint);
+    ErrorMessage(AHint);
     Abort;
   end;
 
@@ -428,9 +428,7 @@ begin
   if cdsBGBillsViewB_Code.Tag = 1 then
     if CheckSameB_Code(cdsBGBillsViewBGID.AsInteger, cdsBGBillsViewB_Code.AsString) then
     begin
-      cdsBGBillsViewB_Code.Tag := 0;
-      ShowErrorMessage('不允许存在同编号变更清单!');
-      Abort;
+      DisplayErrorMessage('不允许存在同编号变更清单!');
     end;
 end;
 
@@ -444,12 +442,12 @@ begin
     cdsBGLViewCode.Tag := 0;
     if cdsBGLViewLocked.AsBoolean then
     begin
-      ShowErrorMessage('当前变更令已锁定,不可修改');
+      ErrorMessage('当前变更令已锁定,不可修改');
       Abort;
     end;
     if CheckBGLUsed(cdsBGLViewID.AsInteger) then
     begin
-      ShowErrorMessage('当前变更令下变更清单已被应用到清单,不可修改');
+      ErrorMessage('当前变更令下变更清单已被应用到清单,不可修改');
       Abort;
     end;
   end;
@@ -457,7 +455,7 @@ begin
   sNewCode := cdsBGLViewCode.AsString;
   if Pos(';', sNewCode) > 0 then
   begin
-    ShowErrorMessage('变更令号不可输入'';'',请使用其他符号代替!');
+    ErrorMessage('变更令号不可输入'';'',请使用其他符号代替!');
     Abort;
   end;
   

+ 2 - 0
Forms/BGLSelectFrm.dfm

@@ -60,6 +60,8 @@ object BGLSelectForm: TBGLSelectForm
     DefaultFixedColWidth = 25
     Selection.AlphaBlend = False
     Selection.TransparentColor = False
+    FrozenCol = 0
+    FrozenRow = 0
     OnCellValueChanged = zgBGLCellValueChanged
     OnCellTextChanging = zgBGLCellTextChanging
     OnCellCanEdit = zgBGLCellCanEdit

+ 1 - 1
Forms/BGLSelectFrm.pas

@@ -317,7 +317,7 @@ begin
         zgBGL.Cells[5, zgBGL.CurRow].Text := FloatToStr(fCur)
       else
       begin
-        ShowErrorMessage('当前输入的变更数量大于可变更数量,请重新输入!');
+        ErrorMessage('当前输入的变更数量大于可变更数量,请重新输入!');
         zgBGL.Cells[5, zgBGL.CurRow].Text := '';
       end;
     end;

+ 4 - 0
Forms/BatchReplaceBillsFrm.dfm

@@ -46,6 +46,8 @@ object BatchReplaceBillsForm: TBatchReplaceBillsForm
       DefaultFixedColWidth = 25
       Selection.AlphaBlend = False
       Selection.TransparentColor = False
+      FrozenCol = 0
+      FrozenRow = 0
       OnCellTextChanged = zgBillsCellTextChanged
     end
     object pnlBillsSpr: TPanel
@@ -118,6 +120,8 @@ object BatchReplaceBillsForm: TBatchReplaceBillsForm
       DefaultFixedColWidth = 25
       Selection.AlphaBlend = False
       Selection.TransparentColor = False
+      FrozenCol = 0
+      FrozenRow = 0
       OnCellCanEdit = zgOrgBillsCellCanEdit
     end
     object pnlOrgBillsSpr: TPanel

+ 1 - 1
Forms/BatchReplaceBillsFrm.pas

@@ -153,7 +153,7 @@ begin
   begin
     if (zgBills.Cells[Col, Row].Text <> '') and not TryStrToFloat(zgBills.Cells[Col, Row].Text, fPrice) then
     begin
-      ShowErrorMessage('单价只允许输入数字');
+      ErrorMessage('单价只允许输入数字');
       zgBills.Cells[Col, Row].Text := '';
     end
     else

+ 2 - 2
Forms/ProjectPropertiesFrm.pas

@@ -454,9 +454,9 @@ begin
   if leUnlockPassword.Text = FProjProperties.UnlockInfoPassword then
     if leNewUnLockPassword.Text = leNewUnlockPasswordAgain.Text then
       FProjProperties.UnlockInfoPassword := leNewUnLockPassword.Text
-    else ShowErrorMessage('两次密码输入不一致,密码修改不成功!')
+    else ErrorMessage('两次密码输入不一致,密码修改不成功!')
   else if leUnlockPassword.Text <> '' then
-    ShowErrorMessage('原密码输入错误,密码修改不成功!');
+    ErrorMessage('原密码输入错误,密码修改不成功!');
 end;
 
 procedure TProjectPropertiesForm.leUnlockPasswordKeyPress(Sender: TObject;

+ 1 - 1
Forms/ReportsFrm.dfm

@@ -61,7 +61,7 @@ object ReportsForm: TReportsForm
     Width = 223
     Height = 25
     BevelInner = bvLowered
-    TabOrder = 5
+    TabOrder = 4
     object chkExcelMode: TCheckBox
       Left = 6
       Top = 4

+ 4 - 4
Forms/ReportsFrm.pas

@@ -452,7 +452,7 @@ begin
   if _IsEncrypt then
     PreviewComXML.Print(CurPage, 1)
   else
-    ShowTipMessage(GetHintStr);
+    TipMessage(GetHintStr);
 end;
 
 procedure TReportsForm.xcbStartPageChange(Sender: TObject);
@@ -474,7 +474,7 @@ begin
       PreviewComXML.PrintMultiPages(PrintStartPage, PrintEndPage);
   end
   else
-    ShowTipMessage(GetHintStr);
+    TipMessage(GetHintStr);
 end;
 
 procedure TReportsForm.PrintAllSelectedReports;
@@ -505,7 +505,7 @@ begin
       PreviewComXML.PrintPDF(PrintStartPage, PrintEndPage);
   end
   else
-    ShowTipMessage(GetHintStr);
+    TipMessage(GetHintStr);
 end;
 
 procedure TReportsForm.ExportAllSelectedPDFReports;
@@ -535,7 +535,7 @@ begin
       ExportCurXlsReport;
   end
   else
-    ShowTipMessage(GetHintStr);
+    TipMessage(GetHintStr);
 end;
 
 procedure TReportsForm.ExportAllSelectedXlsReports;

+ 4 - 0
Frames/BillsMeasureFme.dfm

@@ -61,6 +61,8 @@ object BillsMeasureFrame: TBillsMeasureFrame
       DefaultFixedColWidth = 30
       Selection.AlphaBlend = False
       Selection.TransparentColor = False
+      FrozenCol = 0
+      FrozenRow = 0
       OnCurrentChanged = zgBillsMeasureCurrentChanged
       OnCellButtonClick = zgBillsMeasureCellButtonClick
       OnCustomPaste = zgBillsMeasureCustomPaste
@@ -116,6 +118,8 @@ object BillsMeasureFrame: TBillsMeasureFrame
         DefaultColWidth = 73
         Selection.AlphaBlend = False
         Selection.TransparentColor = False
+        FrozenCol = 0
+        FrozenRow = 0
         OnCellTextChanged = zgDealPropertyCellTextChanged
         OnCellCanEdit = zgDealPropertyCellCanEdit
         OnCellGetFont = zgDealPropertyCellGetFont

+ 1 - 1
Frames/BillsMeasureFme.pas

@@ -506,7 +506,7 @@ procedure TBillsMeasureFrame.zgDealPropertyCellTextChanged(Sender: TObject;
     end
     else
     begin
-      ShowErrorMessage('只允许输入数字!!');
+      ErrorMessage('只允许输入数字!!');
       ACell.Text := ARec.ValueByName(AField).AsString;
     end;
   end;

+ 1 - 1
Frames/ProjectFme.pas

@@ -534,7 +534,7 @@ procedure TProjectFrame.dxsbViewControlItemClick(Sender: TObject;
   begin
     if FProjectData.ProjProperties.PhaseCount = 0 then
     begin
-      ShowErrorMessage('当前项目未开始计量,暂无审核比较数据!');
+      ErrorMessage('当前项目未开始计量,暂无审核比较数据!');
       dxsbViewControl.SelectedItem := dxsbViewControl.ActiveGroup.Items[jpsMain.ActivePageIndex];
       Abort;
     end;

+ 1 - 1
Frames/ProjectManagerFme.pas

@@ -1372,7 +1372,7 @@ var
 begin
   stnNode := stdProjects.IDTree.Selected;
   if stnNode.Rec.ValueByName('BackupFolder').AsString = '' then
-    ShowTipMessage('该项目暂无备份数据!')
+    TipMessage('该项目暂无备份数据!')
   else
     ShellExecute(Handle, 'open', 'Explorer.exe',
       PChar(FProjectManagerData.BackupPath(stnNode.ID)), nil, 1);

+ 2 - 2
Units/ExportExcel.pas

@@ -152,7 +152,7 @@ begin
   try
     ExportToXlsPage(AGrid, FXlsOutPut.AddPage);
     FXlsOutPut.SaveToFile(FTempFile);
-    if not FileExists(FFileName) or ShowQuestMessage('存在同名文件,是否替换?') then
+    if not FileExists(FFileName) or QuestMessage('存在同名文件,是否替换?') then
       CopyFile(PChar(FTempFile), PChar(FFileName), False);
   finally
     EndExport;
@@ -292,7 +292,7 @@ begin
     ExportToXlsPage(ATree, FXlsOutPut.AddPage);
     UpdateProgressHint('保存0号台账Excel数据');
     FXlsOutPut.SaveToFile(FTempFile);
-    if not FileExists(AFileName) or ShowQuestMessage('存在同名文件,是否替换?') then
+    if not FileExists(AFileName) or QuestMessage('存在同名文件,是否替换?') then
       CopyFile(PChar(FTempFile), PChar(AFileName), False);
   finally
     EndExport;

+ 1 - 1
Units/ProjectData.pas

@@ -1178,7 +1178,7 @@ begin
   else if InputPassword(sPassword) then
   begin
     Result := sPassword = ProjProperties.UnlockInfoPassword;
-    if not Result then ShowErrorMessage('您输入的密码不正确!');
+    if not Result then ErrorMessage('您输入的密码不正确!');
   end;
 end;
 

+ 1 - 1
Units/ReportManager.pas

@@ -322,7 +322,7 @@ begin
   except
     on E: Exception do
     begin
-      ShowTipMessage(Format('报表文件[%s]无法打开,错误信息:'#13#10'%s.'#13#10 +
+      TipMessage(Format('报表文件[%s]无法打开,错误信息:'#13#10'%s.'#13#10 +
         '请与纵横软件客服中心联系:(0756)3850888。', [FFileName, E.Message]));
     end;
   end;

+ 7 - 5
Units/UtilMethods.pas

@@ -23,6 +23,7 @@ type
   procedure ErrorMessage(const AMsg: string);
   function QuestMessage(const AMsg: string): Boolean;
   function QuestMessageYesNo(const AMsg: string): Boolean;
+  procedure TipMessage(const AMsg: string);
   procedure DataSetErrorMessage(var Allow: Boolean; const AMsg: string);
 
   {Get Common Path}
@@ -160,26 +161,27 @@ end;
 {Message}
 procedure WarningMessage(const AMsg: string);
 begin
-  MessageBox(Application.Handle, PChar(AMsg), PChar('¾¯¸æ'), MB_OK or MB_ICONWARNING);
-  Application.ProcessMessages;
+   MessageBox(Application.Handle, PChar(AMsg), PChar('¾¯¸æ'), MB_OK or MB_ICONWARNING);
 end;
 
 procedure ErrorMessage(const AMsg: string);
 begin
   MessageBox(Application.Handle, PChar(AMsg), PChar('´íÎó'), MB_OK or MB_ICONERROR);
-  Application.ProcessMessages;
 end;
 
 function QuestMessage(const AMsg: string): Boolean;
 begin
   Result := MessageBox(Application.Handle, PChar(AMsg), PChar('ѯÎÊ'), MB_OKCANCEL or MB_ICONQUESTION) = IDOK;
-  Application.ProcessMessages;
 end;
 
 function QuestMessageYesNo(const AMsg: string): Boolean;
 begin
   Result := MessageBox(Application.Handle, PChar(AMsg), PChar('ѯÎÊ'), MB_YESNO or MB_ICONQUESTION) = IDYes;
-  Application.ProcessMessages;
+end;
+
+procedure TipMessage(const AMsg: string);
+begin
+  MessageBox(Application.Handle, PChar(AMsg), PChar('Ìáʾ'), MB_OK or MB_ICONINFORMATION);
 end;
 
 procedure DataSetErrorMessage(var Allow: Boolean; const AMsg: string);

+ 4 - 4
Units/ZhAPI.pas

@@ -4,10 +4,10 @@ interface
 
 uses Classes, DB, Controls;
 
-  procedure ShowWarningMessage(const AMsg: string); stdcall; external 'ZhAPI.dll' name 'ShowWarningMessage';
-  procedure ShowTipMessage(const AMsg: string); stdcall; external 'ZhAPI.dll' name 'ShowTipMessage';
-  procedure ShowErrorMessage(const AMsg: string); stdcall; external 'ZhAPI.dll' name 'ShowErrorMessage';
-  function ShowQuestMessage(const AMsg: string): Boolean; stdcall; external 'ZhAPI.dll' name 'ShowQuestMessage';
+  //procedure ShowWarningMessage(const AMsg: string); stdcall; external 'ZhAPI.dll' name 'ShowWarningMessage';
+  //procedure ShowTipMessage(const AMsg: string); stdcall; external 'ZhAPI.dll' name 'ShowTipMessage';
+  //procedure ShowErrorMessage(const AMsg: string); stdcall; external 'ZhAPI.dll' name 'ShowErrorMessage';
+  //function ShowQuestMessage(const AMsg: string): Boolean; stdcall; external 'ZhAPI.dll' name 'ShowQuestMessage';
   function ShowInputQuery(const ACaption, APrompt: string; var Value: string; ANeedMark: Boolean = False): Boolean; stdcall; external 'ZhAPI.dll' name 'ShowInputQuery';
   function ShowInputBox(const ACaption, APrompt, ADefault: string): string; stdcall; external 'ZhAPI.dll' name 'ShowInputBox';