From ac0ac8241f5ea7249ea01c04452efc0b72f49b1f Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Tue, 19 Oct 1999 22:18:32 +0000 Subject: [PATCH 1/1] Fixed wxSlider95 bug; updated .dsp files; added Set/GetLastDirectory to wxDocManager git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4073 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/latex/wx/docmanag.tex | 18 ++++++++++++++++++ include/wx/docview.h | 4 ++++ include/wx/image.h | 2 +- src/common/docview.cpp | 5 ++++- src/makevc.env | 2 +- src/msw/slider95.cpp | 2 +- src/wxvc.dsp | 4 ++++ src/wxvc6.dsp | 4 ++++ src/wxvc_dll.dsp | 4 ++++ 9 files changed, 41 insertions(+), 4 deletions(-) diff --git a/docs/latex/wx/docmanag.tex b/docs/latex/wx/docmanag.tex index f49e353689..b2eecb5e39 100644 --- a/docs/latex/wx/docmanag.tex +++ b/docs/latex/wx/docmanag.tex @@ -58,6 +58,12 @@ A list of all documents. Stores the flags passed to the constructor. +\membersection{wxDocManager::m\_lastDirectory} + +The directory last selected by the user when opening a file. + +\member{wxFileHistory*}{m\_fileHistory} + \membersection{wxDocManager::m\_templates} \member{wxList}{mnTemplates} @@ -222,6 +228,12 @@ Returns a reference to the list of documents. Returns a pointer to file history. +\membersection{wxDocManager::GetLastDirectory}\label{wxdocmanagergetlastdirectory} + +\constfunc{wxString}{GetLastDirectory}{\void} + +Returns the directory last selected by the user when opening a file. Initially empty. + \membersection{wxDocManager::GetMaxDocsOpen} \func{int}{GetMaxDocsOpen}{\void} @@ -351,6 +363,12 @@ displaying a list of valid views. This function is used in wxDocManager::CreateV The dialog normally won't appear because the array of templates only contains those relevant to the document in question, and often there will only be one such. +\membersection{wxDocManager::SetLastDirectory}\label{wxdocmanagersetlastdirectory} + +\func{void}{SetLastDirectory}{\param{const wxString\&}{ dir}} + +Sets the directory to be displayed to the user when opening a file. Initially this is empty. + \membersection{wxDocManager::SetMaxDocsOpen} \func{void}{SetMaxDocsOpen}{\param{int}{ n}} diff --git a/include/wx/docview.h b/include/wx/docview.h index 3a11b7b5c5..39854b9847 100644 --- a/include/wx/docview.h +++ b/include/wx/docview.h @@ -375,6 +375,9 @@ public: virtual void FileHistoryAddFilesToMenu(); virtual void FileHistoryAddFilesToMenu(wxMenu* menu); + inline wxString GetLastDirectory() const { return m_lastDirectory; } + inline void SetLastDirectory(const wxString& dir) { m_lastDirectory = dir; } + protected: long m_flags; int m_defaultDocumentNameCounter; @@ -383,6 +386,7 @@ protected: wxList m_templates; wxView* m_currentView; wxFileHistory* m_fileHistory; + wxString m_lastDirectory; DECLARE_EVENT_TABLE() }; diff --git a/include/wx/image.h b/include/wx/image.h index 18ac41ad0f..f72667091b 100644 --- a/include/wx/image.h +++ b/include/wx/image.h @@ -53,7 +53,7 @@ class WXDLLEXPORT wxImage; class WXDLLEXPORT wxImageHandler: public wxObject { - DECLARE_DYNAMIC_CLASS(wxImageHandler) + DECLARE_CLASS(wxImageHandler) public: wxImageHandler() { m_name = ""; m_extension = ""; m_type = 0; } diff --git a/src/common/docview.cpp b/src/common/docview.cpp index 2c827b697a..95b489ee7d 100644 --- a/src/common/docview.cpp +++ b/src/common/docview.cpp @@ -706,6 +706,7 @@ wxDocManager::wxDocManager(long flags, bool initialize) m_currentView = (wxView *) NULL; m_maxDocsOpen = 10000; m_fileHistory = (wxFileHistory *) NULL; + m_lastDirectory = wxT("") ; if (initialize) Initialize(); } @@ -1224,7 +1225,7 @@ wxDocTemplate *wxDocManager::SelectDocumentPath(wxDocTemplate **templates, int FilterIndex = 0; wxString pathTmp = wxFileSelectorEx(_("Select a file"), - wxT(""), + m_lastDirectory, wxT(""), &FilterIndex, descrBuf, @@ -1233,6 +1234,8 @@ wxDocTemplate *wxDocManager::SelectDocumentPath(wxDocTemplate **templates, if (!pathTmp.IsEmpty()) { + m_lastDirectory = wxPathOnly(pathTmp); + path = pathTmp; wxString theExt = FindExtension(path); if (!theExt) diff --git a/src/makevc.env b/src/makevc.env index 2cae086a8c..3ec3459411 100644 --- a/src/makevc.env +++ b/src/makevc.env @@ -140,7 +140,7 @@ D=$(D)DLL WXLIB=$(WXDIR)\lib\$(WXLIBNAME).lib INC=-I$(WXINC) -I$(WXDIR)/src/png -I$(WXDIR)/src/zlib -I$(WXDIR)/src/jpeg $(EXTRAINC) -LIBS = $(EXTRALIBS) $(WXLIB) $(WINLIBS) $(WXDIR)\lib\winpng.lib $(WXDIR)\lib\zlib.lib # $(WXDIR)\lib\jpeg.lib $(WXDIR)\lib\xpm.lib +LIBS = $(EXTRALIBS) $(WXLIB) $(WINLIBS) $(WXDIR)\lib\winpng.lib $(WXDIR)\lib\zlib.lib $(WXDIR)\lib\jpeg.lib $(WXDIR)\lib\xpm.lib MAKEPRECOMP=/YcWX/WXPREC.H OPTIONS= diff --git a/src/msw/slider95.cpp b/src/msw/slider95.cpp index bc9805ff4d..bd75e7fd85 100644 --- a/src/msw/slider95.cpp +++ b/src/msw/slider95.cpp @@ -239,7 +239,7 @@ bool wxSlider95::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam, nScrollInc = 0; } - if ( nScrollInc == 0 ) + if (scrollEvent == wxEVT_NULL) { // no event... return FALSE; diff --git a/src/wxvc.dsp b/src/wxvc.dsp index 2641b3336f..beaba79fbd 100644 --- a/src/wxvc.dsp +++ b/src/wxvc.dsp @@ -79,6 +79,10 @@ LIB32=link.exe -lib # PROP Default_Filter "" # Begin Source File +SOURCE=.\common\appcmn.cpp +# End Source File +# Begin Source File + SOURCE=.\common\choiccmn.cpp # End Source File # Begin Source File diff --git a/src/wxvc6.dsp b/src/wxvc6.dsp index 9ec20280e6..e32664b1ee 100644 --- a/src/wxvc6.dsp +++ b/src/wxvc6.dsp @@ -85,6 +85,10 @@ LIB32=link.exe -lib # PROP Default_Filter "" # Begin Source File +SOURCE=.\common\appcmn.cpp +# End Source File +# Begin Source File + SOURCE=.\common\choiccmn.cpp # End Source File # Begin Source File diff --git a/src/wxvc_dll.dsp b/src/wxvc_dll.dsp index bc5ee9cbdf..301e4cd191 100644 --- a/src/wxvc_dll.dsp +++ b/src/wxvc_dll.dsp @@ -92,6 +92,10 @@ LINK32=link.exe # PROP Default_Filter "" # Begin Source File +SOURCE=.\common\appcmn.cpp +# End Source File +# Begin Source File + SOURCE=.\common\choiccmn.cpp # End Source File # Begin Source File -- 2.45.2