lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi] Does wxDOC_NEW override wxDOC_SILENT?


From: Greg Chicares
Subject: [lmi] Does wxDOC_NEW override wxDOC_SILENT?
Date: Sun, 03 Aug 2008 12:03:17 +0000
User-agent: Thunderbird 2.0.0.16 (Windows/20080708)

This lmi command
  File | Default
gives this error message
  Lmi_wx Warning
  Unable to read file '\etc\opt\lmi\default.ill'.
  [file /lmi/src/lmi/illustration_document.cpp, line 109]
when no default file exists. Users wouldn't necessarily
have such a file; when we find none, we should create one
for them, transparently. I thought that it might work
if I called wxDocManager::CreateDocument with flags
'wxDOC_SILENT | wxDOC_NEW' [shown in patch below]; but
with that patch I'm shown a list of document templates,
which is what I wanted to prevent with wxDOC_SILENT.

I suppose that, instead of changing the flags in the patch
below, I could test whether the file exists, create it if it
doesn't, and then call CreateDocument() with wxDOC_SILENT as
in cvs without that patch. But is there a more natural way?

BTW, I'm still using wx-2.8.7 .

Index: main_wx.cpp
===================================================================
RCS file: /sources/lmi/lmi/main_wx.cpp,v
retrieving revision 1.112
diff -U 3 -r1.112 main_wx.cpp
--- main_wx.cpp 2 Aug 2008 03:47:23 -0000       1.112
+++ main_wx.cpp 3 Aug 2008 11:49:01 -0000
@@ -542,7 +542,7 @@
 {
     doc_manager_->CreateDocument
         (configurable_settings::instance().default_input_filename()
-        ,wxDOC_SILENT
+        ,wxDOC_SILENT | wxDOC_NEW
         );
 }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]