- proper ioresult checking when opening the printer device
  - disable/enable handling for print menu item

git-svn-id: trunk@6548 -
This commit is contained in:
florian 2007-02-18 18:50:23 +00:00
parent 81bccc253b
commit b8d56a1512
3 changed files with 5 additions and 2 deletions

View File

@ -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';

View File

@ -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

View File

@ -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]);