- Added support for Korean Johab and Vietnamese encodings (jank9201).
- Fix off by 1 bug with setting font size in points in wxHTML (gevorg).
- Fix return value of wxGenericListCtrl::InsertColumn() (Sebastian Walderich).
+- Add wxDocManager::Get{Views,Documents,Templates}Vector() (troelsk).
GTK:
#define wxMAX_FILE_HISTORY 9
+#ifndef __VISUALC6__
+typedef wxVector<wxDocument*> wxDocVector;
+typedef wxVector<wxView*> wxViewVector;
+typedef wxVector<wxDocTemplate*> wxDocTemplateVector;
+#endif
+
class WXDLLIMPEXP_CORE wxDocument : public wxEvtHandler
{
public:
virtual bool AddView(wxView *view);
virtual bool RemoveView(wxView *view);
+
+#ifndef __VISUALC6__
+ wxViewVector GetViewsVector() const { return m_documentViews.AsVector<wxView*>(); }
+#endif
wxList& GetViews() { return m_documentViews; }
const wxList& GetViews() const { return m_documentViews; }
+
wxView *GetFirstView() const;
virtual void UpdateAllViews(wxView *sender = NULL, wxObject *hint = NULL);
virtual void ActivateView(wxView *view, bool activate = true);
virtual wxView *GetCurrentView() const { return m_currentView; }
+#ifndef __VISUALC6__
+ wxDocVector GetDocumentsVector() const { return m_docs.AsVector<wxDocument*>(); }
+ wxDocTemplateVector GetTemplatesVector() const { return m_templates.AsVector<wxDocTemplate*>(); }
+#endif
wxList& GetDocuments() { return m_docs; }
wxList& GetTemplates() { return m_templates; }
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
+/**
+ A vector of wxDocument pointers.
+
+ @since 2.9.5
+*/
+typedef wxVector<wxDocument*> wxDocVector;
+
+/**
+ A vector of wxView pointers.
+
+ @since 2.9.5
+*/
+typedef wxVector<wxView*> wxViewVector;
+
+/**
+ A vector of wxDocTemplate pointers.
+
+ @since 2.9.5
+*/
+typedef wxVector<wxDocTemplate*> wxDocTemplateVector;
+
/**
@class wxDocTemplate
*/
virtual wxView* GetCurrentView() const;
+ /**
+ Returns a vector of wxDocument pointers.
+
+ @since 2.9.5
+ */
+ wxDocVector GetDocumentsVector() const;
+
+ /**
+ Returns a vector of wxDocTemplate pointers.
+
+ @since 2.9.5
+ */
+ wxDocTemplateVector GetTemplatesVector() const;
+
/**
Returns a reference to the list of documents.
*/
*/
virtual wxString GetUserReadableName() const;
+ /**
+ Returns a vector of wxView pointers.
+
+ @since 2.9.5
+ */
+ wxViewVector GetViewsVector() const;
+
//@{
/**
Returns the list whose elements are the views on the document.
default:
wxFAIL_MSG( "unknown mode ");
}
+ const wxDocVector
+ docList = wxDocManager::GetDocumentManager()->GetDocumentsVector();
wxLogMessage
(
"This is the wxWidgets Document/View Sample\n"
"running in %s mode.\n"
+ "%d open documents.\n"
"\n"
"Authors: Julian Smart, Vadim Zeitlin\n"
"\n"
"Usage: docview [--{mdi,sdi,single}]",
- modeName
+ modeName,
+ static_cast<int>(docList.size())
);
}
-
#include "wx/wfstream.h"
#endif
-typedef wxVector<wxDocTemplate *> wxDocTemplates;
-
// ----------------------------------------------------------------------------
// wxWidgets macros
// ----------------------------------------------------------------------------
{
// helper function: return only the visible templates
-wxDocTemplates GetVisibleTemplates(const wxList& allTemplates)
+wxDocTemplateVector GetVisibleTemplates(const wxList& allTemplates)
{
// select only the visible templates
const size_t totalNumTemplates = allTemplates.GetCount();
- wxDocTemplates templates;
+ wxDocTemplateVector templates;
if ( totalNumTemplates )
{
templates.reserve(totalNumTemplates);
// this ought to be const but SelectDocumentType/Path() are not
// const-correct and can't be changed as, being virtual, this risks
// breaking user code overriding them
- wxDocTemplates templates(GetVisibleTemplates(m_templates));
+ wxDocTemplateVector templates(GetVisibleTemplates(m_templates));
const size_t numTemplates = templates.size();
if ( !numTemplates )
{
wxView *wxDocManager::CreateView(wxDocument *doc, long flags)
{
- wxDocTemplates templates(GetVisibleTemplates(m_templates));
+ wxDocTemplateVector templates(GetVisibleTemplates(m_templates));
const size_t numTemplates = templates.size();
if ( numTemplates == 0 )