Commit Graph

117 Commits

Author SHA1 Message Date
Vadim Zeitlin
302674fe17 Use better title by default in wxDocPrintout.
Use the document name instead of the default "Printout" if no title is
explicitly specified when creating wxDocPrintout.

Closes #12885.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66852 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-02-06 01:01:09 +00:00
Vadim Zeitlin
a70d268a1b Add wxDocManager::FindTemplate() method.
This allows to find the template corresponding to the document of the given
class.

Closes #12170.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65915 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-10-24 23:03:38 +00:00
Vadim Zeitlin
c70da1a243 Fix processing of events for MRU entries #10 and more in docview.
We only handled events for wxID_FILE1..wxID_FILE9 range but there can be more
than 9 entries in the MRU list. Handle events for as many of them as there are
correctly.

This required adding a fallback handler for all menu events and checking if
the id of the menu item is in the MRU range inside it. Also move this to
wxDocManager itself from wxDocParentFrameAnyBase as it's common for all kinds
of frames anyhow.

Closes #12141.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64569 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-12 18:21:42 +00:00
Vadim Zeitlin
6c4da6d611 Translate strings used in doc-view printing code.
Simply use _() instead of wxT() for the user-visible strings.

Closes #12110.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64451 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-31 14:59:03 +00:00
Vadim Zeitlin
8325504f4b Activate the view of a newly created document.
This appears to be necessary under Mac where views are top level windows and
should do no harm elsewhere.

Also factor out the activation code in a new wxDocManager::ActivateDocument()
method to avoid duplicating it.

Closes #11417.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64440 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-30 20:05:44 +00:00
Vadim Zeitlin
b99017ce20 Store page setup data in wxDocManager.
Printing of documents from wxDocManager always used default page setup data,
allow the user to configure it now.

Add wxDocManager::m_pageSetupDialogData and add a handler for wxID_PRINT_SETUP
command to it.

Closes #11394.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64439 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-30 20:05:39 +00:00
Vadim Zeitlin
2954883593 Document wxDocument::DeleteContents().
This method purpose was not quite clear as it was only mentioned in passing in
documentation of OnCloseDocument() but not really documented itself.

Also don't call it from wxDocument dtor as this is useless: the user-defined
overridden version will never be called from here and the base class version
does nothing.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64299 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-13 14:37:00 +00:00
Vadim Zeitlin
c48bdb0c28 Refactor wxDocParentFrame and wxDocMDIParentFrame to share common base class.
Use the same approach as for the child frames: add a base template class which
allows wxDocParentFrame to inherit from wxFrame and wxDocMDIParentFrame from
wxMDIParentFrame while still allowing to reuse the common code.

This reduces code duplication and should make implementing parent AUI document
frame easier as well, see #8945.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64295 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-12 14:34:18 +00:00
Vadim Zeitlin
44070fd379 Use ProcessEventLocally() instead of ProcessEventHere() in docview code.
Use wxEvtHandler::ProcessEventLocally() instead of ProcessEventHere() when
forwarding events in the docview code. This ensures that any event handlers
chained with the objects involved (document manager, document, view) will be
used.

Incidentally the old code didn't work at all as ProcessEventHere() didn't even
call TryBefore() where the (further) forwarding was implemented.

Closes #10640.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64263 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-09 14:55:41 +00:00
Václav Slavík
a0219e4580 Move wxFileHistory out of docview framework, add wxUSE_FILE_HISTORY.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64205 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-04 12:15:14 +00:00
Vadim Zeitlin
94dc70d190 Allow overriding print preview frame creation in docview.
Add a virtual wxDocManager::CreatePreviewFrame() which can be overridden to
customize the print preview used by docview framework.

Closes #11390.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63757 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-03-25 20:07:58 +00:00
Vadim Zeitlin
4311588bfe Implement wxDocument::Revert() and show its use in the sample.
wxDocument::Revert() method existed but didn't do anything, provide a
default implementation for it. Also document it and show it in the sample.

Closes #11849.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63748 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-03-23 10:49:51 +00:00
Julian Smart
250ab35a3b Applied: wxDocument: Adding an asterix to the title
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62077 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-09-24 13:49:01 +00:00
Vadim Zeitlin
fb330c2ec3 disable MSVC warning 4275 correctly (closes #10885)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61010 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-06-12 03:37:47 +00:00
Vadim Zeitlin
e5033ed2f1 initialize wxDocChildFrameAnyBase before creating the real window to ensure that event handling is set up properly before the first events for the new window are received (closes #10825)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60719 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-05-22 22:46:18 +00:00
Vadim Zeitlin
c65c67beba allow 2 step creation of wxDocChildFrameAnyBase and derived classes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60713 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-05-22 14:02:07 +00:00
Vadim Zeitlin
b7341fe06f reset the associated view frame pointer when the frame is deleted directly instead of being closed gracefully
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59484 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-11 16:11:54 +00:00
Vadim Zeitlin
ada1ff0dbc close the associated frame if the view is deleted directly to avoid leaving zombie frames floating around
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59455 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-09 19:53:49 +00:00
Vadim Zeitlin
73bde1ef25 add missing WXDLLIMPEXP_CORE (which surprisingly is only needed in debug build for some reason)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59193 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-27 20:25:20 +00:00
Vadim Zeitlin
27d77a5990 VC6 compilation fix after last change: WXDLLIMPEXP_TEMPLATE_INSTANCE_BASE is not needed for template classes used as base classes apparently; do suppress some DLL export-related warnings
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59186 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-27 13:12:25 +00:00
Vadim Zeitlin
a9e2e6e52b refactor wxDocChildFrame and wxDocMDIChildFrame to use wxDocChildFrameAny intead of duplicating its code (with subtle differences, as usual); also added wxDocChildFrameAnyBase and store a pointer to it in wxView to reset the frame view if the view is being deleted because its creation fails to avoid crashes in this case
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59185 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-27 12:24:03 +00:00
Vadim Zeitlin
8cc208e39f deprecate the old TryValidator/Parent() and replace them with the new and documented TryBefore/After()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59164 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-26 16:16:31 +00:00
Vadim Zeitlin
c0c133e13b add wx-prefixed and semicolon-requiring versions of DECLARE_NO_{COPY,ASSIGN}_CLASS macros
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58757 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-08 11:45:59 +00:00
Vadim Zeitlin
575e4cd670 don't fall back to the only currently existing document in wxDocManager::GetCurrentView() as it breaks activation logic (#9518)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58496 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-01-29 13:04:40 +00:00
Vadim Zeitlin
89d94e046d no real changes, just minor refactoring and cleanup
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58494 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-01-29 12:52:17 +00:00
Vadim Zeitlin
d8efd2198f added wxStandardPaths::GetAppDocumentsDir() and use it by default for loading/saving documents in wxDocManager
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58259 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-01-21 14:01:30 +00:00
Francesco Montorsi
00e3ea1c6f minor cleanup; add wxDocument::OnChangeFilename for coherence with wxView::OnChangefilename; avoid some (small) code duplication; closes #10080
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57950 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-01-09 16:13:49 +00:00
Francesco Montorsi
3366d55c57 use wxFrameNameStr where possible instead of 'frame' string (for coherence with all other wxWidgets frame classes)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56705 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-11-08 15:01:00 +00:00
Vadim Zeitlin
de56f24082 added wxDocument::AlreadySaved() and use it in OnUpdateFileSave() to ensure that the "Save" menu item is enabled for new documents, even although they're not modified yet (otherwise the standard Ctrl-S key doesn't work in this case which is pretty annoying)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56581 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-10-29 16:23:25 +00:00
Vadim Zeitlin
d7b3a73d07 document wxDocument::GetDocumentSaved()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56580 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-10-29 16:15:03 +00:00
Vadim Zeitlin
b54129836c add a more readable wrapper for CreateDocument(wxEmptyString, wxDOC_NEW)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56018 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-10-01 17:04:43 +00:00
Vadim Zeitlin
bba5e72ad3 hook the docview-specific customization of event handling logic at TryValidator() level instead of ProcessEvent(): this ensures that the events are not sent to wxApp before they're passed to all the handlers which might process them (before the events were passed to wxDocument and then immediately to wxApp)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55786 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-09-22 00:33:11 +00:00
Vadim Zeitlin
c77049a04b general docview.cpp code cleanup; use wxVector<> instead of manually-allocated arrays; refactor wxDocManager::CreateDocument() and allow using wxDOC_SILENT with wxDOC_NEW; cleanup wxFileHistory code
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54965 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-08-04 00:37:00 +00:00
Vadim Zeitlin
9c8116f8f7 take const wxConfig object in wxDocManager::FileHistoryLoad() and wxFileHistory::Load() (patch 1942316)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53562 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-05-11 20:32:35 +00:00
Francesco Montorsi
53a2db124c substitute WXDLLEXPORT with WXDLLIMPEXP_CORE and WXDLLEXPORT_DATA with WXDLLIMPEXP_DATA_CORE
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52834 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-03-26 15:06:00 +00:00
Vadim Zeitlin
4f7d425f60 use correct WXDLLIMPEXP_FWD_XXX (patch from Tim Stahlhut)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50184 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-11-23 14:13:50 +00:00
Václav Slavík
b5dbe15d0b added WXDLLIMPEXP_FWD_FOO macros in addition to WXDLLIMPEXP_FOO for use with forward declarations (in preparation for GCC visibility support)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47254 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-07-09 10:09:52 +00:00
Vadim Zeitlin
724b119a15 replace wxDocument::GetPrintableName(wxString&) and wxDocManager::MakeDefaultName(wxString&) with GetUserReadableName() and MakeNewDocumentName() which return wxStrings directly
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46488 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-06-16 12:49:56 +00:00
Václav Slavík
47b378bd88 removed extra semicolons (patch #1700459; fixes compilation with gcc's -pedantic flag)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45450 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-04-14 09:58:37 +00:00
Vadim Zeitlin
8e4ac1a068 compilation fix after last commit
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45396 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-04-11 00:26:09 +00:00
Vadim Zeitlin
b4a980f4f5 don't use obsolete functions (mostly copystring() and Count()), remove their documentation (patch 1697956)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45395 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-04-11 00:23:19 +00:00
Vadim Zeitlin
a56a1234a5 removed wxABI_TESTS, they're irrelvant in 2.9
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44333 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-01-31 03:40:59 +00:00
Vadim Zeitlin
fc2b0e31bb added wxABI_VERSION check around new public wxFileHistory::Set/GetBaseId() methods and added them to version script
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44219 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-01-14 16:38:53 +00:00
Julian Smart
5d389b0445 Provide access to file history base id
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44217 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-01-14 12:43:01 +00:00
Paul Cornett
0c246b3ca3 add Create to wxDocParentFrame
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41225 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-09-14 17:53:06 +00:00
Vadim Zeitlin
d3c7fc996a mark all dtors which are virtual because base class dtor is virtual explicitly virtual themselves
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41020 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-09-05 20:47:48 +00:00
Włodzimierz Skiba
ca3e85cfa8 Better backward compatibility and deprecation markup for interface deprecated in comments.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38448 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-03-30 14:04:17 +00:00
Vadim Zeitlin
b80388aab6 don't use deprecated cast operator to wxList&
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35703 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-09-25 22:50:26 +00:00
Mart Raudsepp
8907154c1a Nuke #pragma implementation/interface's
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35650 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-09-23 12:56:45 +00:00
Julian Smart
99d800190a Added licence/copyright information
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33948 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-05-04 18:57:50 +00:00