All:
-- Added wxDir::FindFirst() (Francesco Montorsi)
-- Added wxPlatformInfo class (Francesco Montorsi)
-- Added wxLocale::IsAvailable() (Creighton)
+- Added wxDir::FindFirst() (Francesco Montorsi).
+- Added wxPlatformInfo class (Francesco Montorsi).
+- Added wxLocale::IsAvailable() (Creighton).
All (GUI):
-- Support for right-to-left text layout
- (started by Diaa Sami during Google Summer of Code, with a lot of help from
- Tim Kosse and others)
-- Added wxID_PAGE_SETUP standard id
-- Added wxSize::IncBy() and DecBy() methods
+- Support for right-to-left text layout (started by Diaa Sami during Google Summer of
+ Code, with a lot of help from Tim Kosse and others).
+- Added wxID_PAGE_SETUP standard id.
+- Added wxSize::IncBy() and DecBy() methods.
+- Added file type parameter to wxTextCtrl::LoadFile, wxTextCtrl::SaveFile for
+ consistency with wxRichTextCtrl.
+- wxRichTextCtrl: fixed range out-by-one bug to be consistent with wxTextCtrl API,
+ fixed some attribute bugs and added wxRichTextStyleComboCtrl.
wxMSW:
-- Implemented wxComboBox::SetEditable()
+- Implemented wxComboBox::SetEditable().
+- Fixed a bug whereby static controls didn't use the correct text colour if the
+ parent's background colour had been set (most noticeable when switching to a
+ high-contrast theme).
wxMac:
wxGTK:
-- Automatically use stock items for the menu items with standard ids
-- Setting cursor now works for all controls
+- Automatically use stock items for menu items with standard ids.
+- Setting cursor now works for all controls.
2.7.0
Previously, only the buffer would be returned, even if more data was requested.
- Added wxPowerEvent (currently MSW-only).
- Make wx-config compatible with Bourne shells.
-- Fixed wxDb::Open(wxDbConnectInf) when using connection string (Hellwolf Misty)
-- Fixed crash in wxDb::Open() in Unicode build (Massimiliano Marretta)
-- Fixed wxTimeSpan::Format() for negative time spans
-- Optionally count repeating wxLog messages instead of logging all (Lauri Nurmi)
+- Fixed wxDb::Open(wxDbConnectInf) when using connection string (Hellwolf Misty).
+- Fixed crash in wxDb::Open() in Unicode build (Massimiliano Marretta).
+- Fixed wxTimeSpan::Format() for negative time spans.
+- Optionally count repeating wxLog messages instead of logging all (Lauri Nurmi).
All (GUI):
-- New AUI (Advanced User Interface) library for docking windows and much more
+- New AUI (Advanced User Interface) library for docking windows and much more.
- Added wxComboCtrl and wxOwnerDrawnComboBox (Jaakko Salli).
- Added wxTreebook (uses a wxTreeCtrl to control pages).
- Added wxColour/Dir/File/Font/PickerCtrls (Francesco Montorsi).
- wxNB_HITTEST_* flags renamed to wxBK_HITTEST_* to serve all book controls.
- Added wxTopLevelWindow::SetTransparent and CanSetTransparent, with
implementations (so far) for wxMSW and wxMac.
-- Allow customizing individual grid lines appearance (Søren Lassen)
-- Fixed middle click events generation in generic wxTreeCtrl (Olly Betts)
+- Allow customizing individual grid lines appearance (Søren Lassen).
+- Fixed middle click events generation in generic wxTreeCtrl (Olly Betts).
- Added wxEVT_MOUSE_CAPTURE_LOST event that must be handled by all windows
that CaptureMouse() is called on.
- Switching page of a hidden notebook doesn't lose focus (Jamie Gadd).
- Removed wxImageList *GetImageList(int) const.
- Fixed MDI context menu problem.
-- Removed __WIN95__ define
+- Removed __WIN95__ define.
- Create msw/rcdefs.h in setup.h's directory, which can be included by
resource files. It containts platform/compiler specific defines (such as
target cpu) which can be used in #ifs in .rc files.
\membersection{wxTextCtrl::LoadFile}\label{wxtextctrlloadfile}
-\func{bool}{LoadFile}{\param{const wxString\& }{ filename}}
+\func{bool}{LoadFile}{\param{const wxString\& }{ filename}, \param{int }{fileType = wxTEXT\_TYPE\_ANY}}
Loads and displays the named file, if it exists.
\docparam{filename}{The filename of the file to load.}
+\docparam{fileType}{The type of file to load. This is currently ignored in wxTextCtrl.}
+
\wxheading{Return value}
{\tt true} if successful, {\tt false} otherwise.
\membersection{wxTextCtrl::SaveFile}\label{wxtextctrlsavefile}
-\func{bool}{SaveFile}{\param{const wxString\& }{ filename}}
+\func{bool}{SaveFile}{\param{const wxString\& }{ filename}, \param{int }{fileType = wxTEXT\_TYPE\_ANY}}
Saves the contents of the control in a text file.
\docparam{filename}{The name of the file in which to save the text.}
+\docparam{fileType}{The type of file to save. This is currently ignored in wxTextCtrl.}
+
\wxheading{Return value}
{\tt true} if the operation was successful, {\tt false} otherwise.
virtual void Replace(long from, long to, const wxString& value);
virtual void Remove(long from, long to);
- // load the controls contents from the file
- virtual bool LoadFile(const wxString& file);
- virtual bool LoadFile(const wxString& file, int WXUNUSED(fileType)) { return LoadFile(file); }
-
// sets/clears the dirty flag
virtual void MarkDirty();
virtual void DiscardEdits();
virtual void Replace(long from, long to, const wxString& value);
virtual void Remove(long from, long to);
- // load the controls contents from the file
- virtual bool LoadFile(const wxString& file);
-
// sets/clears the dirty flag
virtual void MarkDirty();
virtual void DiscardEdits();
virtual void Replace(long from, long to, const wxString& value);
virtual void Remove(long from, long to);
- // load the controls contents from the file
- virtual bool LoadFile(const wxString& file);
- virtual bool LoadFile(const wxString& file, int WXUNUSED(fileType)) { return LoadFile(file); }
+ // load the control's contents from the file
+ virtual bool DoLoadFile(const wxString& file, int fileType);
// clears the dirty flag
virtual void MarkDirty();
,long lTo
);
- virtual bool LoadFile(const wxString& rsFile);
+ virtual bool DoLoadFile(const wxString& rsFile, int fileType);
virtual void MarkDirty();
virtual void DiscardEdits(void);
virtual void Replace(long from, long to, const wxString& value);
virtual void Remove(long from, long to);
- // load the controls contents from the file
- virtual bool LoadFile(const wxString& file);
+ // load the control's contents from the file
+ virtual bool DoLoadFile(const wxString& file, int fileType);
// clears the dirty flag
virtual void MarkDirty();
virtual void Replace(long from, long to, const wxString& value);
virtual void Remove(long from, long to);
+#if !wxRICHTEXT_DERIVES_FROM_TEXTCTRLBASE
+ bool LoadFile(const wxString& file, int fileType = wxRICHTEXT_TYPE_ANY);
+ bool SaveFile(const wxString& file = wxEmptyString, int fileType = wxRICHTEXT_TYPE_ANY);
+#endif
+
// load/save the controls contents from/to the file
- virtual bool LoadFile(const wxString& file) { return LoadFile(file, wxRICHTEXT_TYPE_ANY); }
- virtual bool LoadFile(const wxString& file, int type);
- virtual bool SaveFile(const wxString& file = wxEmptyString) { return SaveFile(file, wxRICHTEXT_TYPE_ANY); }
- virtual bool SaveFile(const wxString& file, int type);
+ virtual bool DoLoadFile(const wxString& file, int fileType);
+ virtual bool DoSaveFile(const wxString& file = wxEmptyString, int fileType = wxRICHTEXT_TYPE_ANY);
// sets/clears the dirty flag
virtual void MarkDirty();
/// Text buffer
wxRichTextBuffer m_buffer;
+#if !wxRICHTEXT_DERIVES_FROM_TEXTCTRLBASE
/// Filename
wxString m_filename;
+#endif
wxMenu* m_contextMenu;
#define wxTE_CAPITALIZE 0
#endif
+// ----------------------------------------------------------------------------
+// wxTextCtrl file types
+// ----------------------------------------------------------------------------
+
+#define wxTEXT_TYPE_ANY 0
+
// ----------------------------------------------------------------------------
// wxTextCtrl::HitTest return values
// ----------------------------------------------------------------------------
virtual void Replace(long from, long to, const wxString& value) = 0;
virtual void Remove(long from, long to) = 0;
- // load/save the controls contents from/to the file
- virtual bool LoadFile(const wxString& file);
- virtual bool LoadFile(const wxString& file, int WXUNUSED(fileType)) { return LoadFile(file); }
- virtual bool SaveFile(const wxString& file = wxEmptyString);
- virtual bool SaveFile(const wxString& file, int WXUNUSED(fileType)) { return SaveFile(file); }
+ // load/save the control's contents from/to a file
+ bool LoadFile(const wxString& file, int fileType = wxTEXT_TYPE_ANY) { return DoLoadFile(file, fileType); }
+ bool SaveFile(const wxString& file = wxEmptyString, int fileType = wxTEXT_TYPE_ANY);
+
+ // implementation for loading/saving
+ virtual bool DoLoadFile(const wxString& file, int fileType);
+ virtual bool DoSaveFile(const wxString& file, int fileType);
// sets/clears the dirty flag
virtual void MarkDirty() = 0;
// file IO functions
// ----------------------------------------------------------------------------
-bool wxTextCtrlBase::LoadFile(const wxString& filename)
+bool wxTextCtrlBase::DoLoadFile(const wxString& filename, int WXUNUSED(fileType))
{
#if wxUSE_FFILE
wxFFile file(filename);
return false;
}
-bool wxTextCtrlBase::SaveFile(const wxString& filename)
+bool wxTextCtrlBase::SaveFile(const wxString& filename, int fileType)
{
wxString filenameToUse = filename.empty() ? m_filename : filename;
if ( filenameToUse.empty() )
return false;
}
+ return DoSaveFile(filenameToUse, fileType);
+}
+
+bool wxTextCtrlBase::DoSaveFile(const wxString& filename, int WXUNUSED(fileType))
+{
#if wxUSE_FFILE
- wxFFile file(filenameToUse, _T("w"));
+ wxFFile file(filename, _T("w"));
if ( file.IsOpened() && file.Write(GetValue()) )
{
+ // if it worked, save for future calls
+ m_filename = filename;
+
// it's not modified any longer
DiscardEdits();
- // if it worked, save for future calls
- m_filename = filenameToUse;
-
return true;
}
#endif // wxUSE_FFILE
GetPeer()->SetSelection( from , to ) ;
}
-bool wxTextCtrl::LoadFile(const wxString& file)
-{
- return wxTextCtrlBase::LoadFile( file );
-}
-
void wxTextCtrl::WriteText(const wxString& str)
{
// TODO: this MPRemoting will be moved into a remoting peer proxy for any command
}
}
-bool wxTextCtrl::LoadFile(const wxString& file)
-{
- if ( wxTextCtrlBase::LoadFile(file) )
- {
- return true;
- }
-
- return false;
-}
-
void wxTextCtrl::WriteText(const wxString& str)
{
wxString st = str ;
// Working with files
// ----------------------------------------------------------------------------
-bool wxTextCtrl::LoadFile(const wxString& file)
+bool wxTextCtrl::DoLoadFile(const wxString& file, int fileType)
{
- if ( wxTextCtrlBase::LoadFile(file) )
+ if ( wxTextCtrlBase::DoLoadFile(file, fileType) )
{
// update the size limit if needed
AdjustSpaceLimit();
} // end of wxTextCtrl::SetSelection
bool wxTextCtrl::LoadFile(
- const wxString& rsFile
+ const wxString& rsFile,
+ int fileType
)
{
- if ( wxTextCtrlBase::LoadFile(rsFile) )
+ if ( wxTextCtrlBase::DoLoadFile(rsFile, fileType) )
{
//
// Update the size limit if needed
return true;
}
return false;
-} // end of wxTextCtrl::LoadFile
+} // end of wxTextCtrl::DoLoadFile
bool wxTextCtrl::IsModified() const
{
// Working with files
// ----------------------------------------------------------------------------
-bool wxTextCtrl::LoadFile(const wxString& file)
+bool wxTextCtrl::DoLoadFile(const wxString& file, int fileType)
{
return false;
}
// file IO functions
// ----------------------------------------------------------------------------
-bool wxRichTextCtrl::LoadFile(const wxString& filename, int type)
+#if !wxRICHTEXT_DERIVES_FROM_TEXTCTRLBASE
+bool wxRichTextCtrl::LoadFile(const wxString& filename, int fileType)
+{
+ return DoLoadFile(filename, fileType);
+}
+
+bool wxRichTextCtrl::SaveFile(const wxString& filename, int fileType)
+{
+ wxString filenameToUse = filename.empty() ? m_filename : filename;
+ if ( filenameToUse.empty() )
+ {
+ // what kind of message to give? is it an error or a program bug?
+ wxLogDebug(wxT("Can't save textctrl to file without filename."));
+
+ return false;
+ }
+
+ return DoSaveFile(filenameToUse, fileType);
+}
+#endif
+
+bool wxRichTextCtrl::DoLoadFile(const wxString& filename, int fileType)
{
- bool success = GetBuffer().LoadFile(filename, type);
+ bool success = GetBuffer().LoadFile(filename, fileType);
if (success)
m_filename = filename;
}
}
-bool wxRichTextCtrl::SaveFile(const wxString& filename, int type)
+bool wxRichTextCtrl::DoSaveFile(const wxString& filename, int fileType)
{
- wxString filenameToUse = filename.empty() ? m_filename : filename;
- if ( filenameToUse.empty() )
- {
- // what kind of message to give? is it an error or a program bug?
- wxLogDebug(wxT("Can't save textctrl to file without filename."));
-
- return false;
- }
-
- if (GetBuffer().SaveFile(filenameToUse, type))
+ if (GetBuffer().SaveFile(filename, fileType))
{
- m_filename = filenameToUse;
+ m_filename = filename;
DiscardEdits();
return true;
-
}
wxLogError(_("The text couldn't be saved."));