소스 검색

* fixed #6497:
- proper ioresult checking when opening the printer device
- disable/enable handling for print menu item

git-svn-id: trunk@6548 -

florian 18 년 전
부모
커밋
b8d56a1512
3개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 0
      ide/fpide.pas
  2. 3 1
      ide/fpmfile.inc
  3. 1 1
      ide/fpviews.pas

+ 1 - 0
ide/fpide.pas

@@ -460,6 +460,7 @@ resourcestring  menu_local_gotosource = '~G~oto source';
                 msg_confirmsourcediradd = 'Directory %s is not in search path for source files. '+
                                          'Should we add it ?';
                 msg_quitconfirm         = 'Do You really want to quit?';
+                msg_printernotopened = 'Can''t open printer,'#13#3'check device name in "print setup"';
                 msg_printerror = 'Error while printing';
                 msg_impossibletoreachcursor = 'Impossible to reach current cursor';
                 msg_impossibletosetbreakpoint = 'Impossible to set breakpoints here';

+ 3 - 1
ide/fpmfile.inc

@@ -266,10 +266,12 @@ procedure TIDEApp.Print;
     if assigned(P) then
       begin
         assign(f,d);
+{$I-}
         rewrite(f);
+{$I+}
         if ioresult<>0 then
           begin
-            MessageBox(#3+msg_PrintError,nil,mferror+mfokbutton);
+            MessageBox(#3+msg_printernotopened,nil,mferror+mfokbutton);
             exit;
           end;
         for i:=0 to P^.Editor^.Core^.GetLineCount-1 do

+ 1 - 1
ide/fpviews.pas

@@ -482,7 +482,7 @@ const
       SourceCmds  : TCommandSet =
         ([cmSave,cmSaveAs,cmCompile,cmHide,cmDoReload]);
       EditorCmds  : TCommandSet =
-        ([cmFind,cmReplace,cmSearchAgain,cmJumpLine,cmHelpTopicSearch,cmSelectAll,cmUnselect]);
+        ([cmPrint,cmFind,cmReplace,cmSearchAgain,cmJumpLine,cmHelpTopicSearch,cmSelectAll,cmUnselect]);
       CompileCmds : TCommandSet =
         ([cmMake,cmBuild,cmRun]);