interface revisions of ta*h te*h headers; grouped wxTextAttr #defines into enums to make it easier to document them
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56075 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -22,7 +22,8 @@
|
|||||||
// Constants
|
// Constants
|
||||||
|
|
||||||
// TypeFlag values
|
// TypeFlag values
|
||||||
enum {
|
enum wxTarType
|
||||||
|
{
|
||||||
wxTAR_REGTYPE = '0', // regular file
|
wxTAR_REGTYPE = '0', // regular file
|
||||||
wxTAR_LNKTYPE = '1', // hard link
|
wxTAR_LNKTYPE = '1', // hard link
|
||||||
wxTAR_SYMTYPE = '2', // symbolic link
|
wxTAR_SYMTYPE = '2', // symbolic link
|
||||||
|
@@ -161,96 +161,108 @@ enum wxTextAttrAlignment
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Flags to indicate which attributes are being applied
|
// Flags to indicate which attributes are being applied
|
||||||
|
enum wxTextAttrFlags
|
||||||
|
{
|
||||||
|
wxTEXT_ATTR_TEXT_COLOUR = 0x00000001,
|
||||||
|
wxTEXT_ATTR_BACKGROUND_COLOUR = 0x00000002,
|
||||||
|
wxTEXT_ATTR_FONT_FACE = 0x00000004,
|
||||||
|
wxTEXT_ATTR_FONT_SIZE = 0x00000008,
|
||||||
|
wxTEXT_ATTR_FONT_WEIGHT = 0x00000010,
|
||||||
|
wxTEXT_ATTR_FONT_ITALIC = 0x00000020,
|
||||||
|
wxTEXT_ATTR_FONT_UNDERLINE = 0x00000040,
|
||||||
|
wxTEXT_ATTR_FONT_ENCODING = 0x02000000,
|
||||||
|
wxTEXT_ATTR_FONT = \
|
||||||
|
( wxTEXT_ATTR_FONT_FACE | wxTEXT_ATTR_FONT_SIZE | wxTEXT_ATTR_FONT_WEIGHT | \
|
||||||
|
wxTEXT_ATTR_FONT_ITALIC | wxTEXT_ATTR_FONT_UNDERLINE | wxTEXT_ATTR_FONT_ENCODING ),
|
||||||
|
|
||||||
#define wxTEXT_ATTR_TEXT_COLOUR 0x00000001
|
wxTEXT_ATTR_ALIGNMENT = 0x00000080,
|
||||||
#define wxTEXT_ATTR_BACKGROUND_COLOUR 0x00000002
|
wxTEXT_ATTR_LEFT_INDENT = 0x00000100,
|
||||||
#define wxTEXT_ATTR_FONT_FACE 0x00000004
|
wxTEXT_ATTR_RIGHT_INDENT = 0x00000200,
|
||||||
#define wxTEXT_ATTR_FONT_SIZE 0x00000008
|
wxTEXT_ATTR_TABS = 0x00000400,
|
||||||
#define wxTEXT_ATTR_FONT_WEIGHT 0x00000010
|
|
||||||
#define wxTEXT_ATTR_FONT_ITALIC 0x00000020
|
|
||||||
#define wxTEXT_ATTR_FONT_UNDERLINE 0x00000040
|
|
||||||
#define wxTEXT_ATTR_FONT_ENCODING 0x02000000
|
|
||||||
#define wxTEXT_ATTR_FONT \
|
|
||||||
( wxTEXT_ATTR_FONT_FACE | wxTEXT_ATTR_FONT_SIZE | wxTEXT_ATTR_FONT_WEIGHT | \
|
|
||||||
wxTEXT_ATTR_FONT_ITALIC | wxTEXT_ATTR_FONT_UNDERLINE | wxTEXT_ATTR_FONT_ENCODING )
|
|
||||||
#define wxTEXT_ATTR_ALIGNMENT 0x00000080
|
|
||||||
#define wxTEXT_ATTR_LEFT_INDENT 0x00000100
|
|
||||||
#define wxTEXT_ATTR_RIGHT_INDENT 0x00000200
|
|
||||||
#define wxTEXT_ATTR_TABS 0x00000400
|
|
||||||
|
|
||||||
#define wxTEXT_ATTR_PARA_SPACING_AFTER 0x00000800
|
wxTEXT_ATTR_PARA_SPACING_AFTER = 0x00000800,
|
||||||
#define wxTEXT_ATTR_PARA_SPACING_BEFORE 0x00001000
|
wxTEXT_ATTR_PARA_SPACING_BEFORE = 0x00001000,
|
||||||
#define wxTEXT_ATTR_LINE_SPACING 0x00002000
|
wxTEXT_ATTR_LINE_SPACING = 0x00002000,
|
||||||
#define wxTEXT_ATTR_CHARACTER_STYLE_NAME 0x00004000
|
wxTEXT_ATTR_CHARACTER_STYLE_NAME = 0x00004000,
|
||||||
#define wxTEXT_ATTR_PARAGRAPH_STYLE_NAME 0x00008000
|
wxTEXT_ATTR_PARAGRAPH_STYLE_NAME = 0x00008000,
|
||||||
#define wxTEXT_ATTR_LIST_STYLE_NAME 0x00010000
|
wxTEXT_ATTR_LIST_STYLE_NAME = 0x00010000,
|
||||||
#define wxTEXT_ATTR_BULLET_STYLE 0x00020000
|
wxTEXT_ATTR_BULLET_STYLE = 0x00020000,
|
||||||
#define wxTEXT_ATTR_BULLET_NUMBER 0x00040000
|
wxTEXT_ATTR_BULLET_NUMBER = 0x00040000,
|
||||||
#define wxTEXT_ATTR_BULLET_TEXT 0x00080000
|
wxTEXT_ATTR_BULLET_TEXT = 0x00080000,
|
||||||
#define wxTEXT_ATTR_BULLET_NAME 0x00100000
|
wxTEXT_ATTR_BULLET_NAME = 0x00100000,
|
||||||
#define wxTEXT_ATTR_URL 0x00200000
|
wxTEXT_ATTR_URL = 0x00200000,
|
||||||
#define wxTEXT_ATTR_PAGE_BREAK 0x00400000
|
wxTEXT_ATTR_PAGE_BREAK = 0x00400000,
|
||||||
#define wxTEXT_ATTR_EFFECTS 0x00800000
|
wxTEXT_ATTR_EFFECTS = 0x00800000,
|
||||||
#define wxTEXT_ATTR_OUTLINE_LEVEL 0x01000000
|
wxTEXT_ATTR_OUTLINE_LEVEL = 0x01000000,
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Character and paragraph combined styles
|
* Character and paragraph combined styles
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define wxTEXT_ATTR_CHARACTER (wxTEXT_ATTR_FONT|wxTEXT_ATTR_FONT_ENCODING|wxTEXT_ATTR_EFFECTS|wxTEXT_ATTR_BACKGROUND_COLOUR|wxTEXT_ATTR_TEXT_COLOUR|wxTEXT_ATTR_CHARACTER_STYLE_NAME|wxTEXT_ATTR_URL)
|
wxTEXT_ATTR_CHARACTER = \
|
||||||
|
(wxTEXT_ATTR_FONT|wxTEXT_ATTR_FONT_ENCODING|wxTEXT_ATTR_EFFECTS| \
|
||||||
|
wxTEXT_ATTR_BACKGROUND_COLOUR|wxTEXT_ATTR_TEXT_COLOUR|wxTEXT_ATTR_CHARACTER_STYLE_NAME|wxTEXT_ATTR_URL),
|
||||||
|
|
||||||
#define wxTEXT_ATTR_PARAGRAPH (wxTEXT_ATTR_ALIGNMENT|wxTEXT_ATTR_LEFT_INDENT|wxTEXT_ATTR_RIGHT_INDENT|wxTEXT_ATTR_TABS|\
|
wxTEXT_ATTR_PARAGRAPH = \
|
||||||
wxTEXT_ATTR_PARA_SPACING_BEFORE|wxTEXT_ATTR_PARA_SPACING_AFTER|wxTEXT_ATTR_LINE_SPACING|\
|
(wxTEXT_ATTR_ALIGNMENT|wxTEXT_ATTR_LEFT_INDENT|wxTEXT_ATTR_RIGHT_INDENT|wxTEXT_ATTR_TABS|\
|
||||||
wxTEXT_ATTR_BULLET_STYLE|wxTEXT_ATTR_BULLET_NUMBER|wxTEXT_ATTR_BULLET_TEXT|wxTEXT_ATTR_BULLET_NAME|\
|
wxTEXT_ATTR_PARA_SPACING_BEFORE|wxTEXT_ATTR_PARA_SPACING_AFTER|wxTEXT_ATTR_LINE_SPACING|\
|
||||||
wxTEXT_ATTR_PARAGRAPH_STYLE_NAME|wxTEXT_ATTR_LIST_STYLE_NAME|wxTEXT_ATTR_OUTLINE_LEVEL)
|
wxTEXT_ATTR_BULLET_STYLE|wxTEXT_ATTR_BULLET_NUMBER|wxTEXT_ATTR_BULLET_TEXT|wxTEXT_ATTR_BULLET_NAME|\
|
||||||
|
wxTEXT_ATTR_PARAGRAPH_STYLE_NAME|wxTEXT_ATTR_LIST_STYLE_NAME|wxTEXT_ATTR_OUTLINE_LEVEL),
|
||||||
|
|
||||||
#define wxTEXT_ATTR_ALL (wxTEXT_ATTR_CHARACTER|wxTEXT_ATTR_PARAGRAPH)
|
wxTEXT_ATTR_ALL = (wxTEXT_ATTR_CHARACTER|wxTEXT_ATTR_PARAGRAPH)
|
||||||
|
};
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Styles for wxTextAttr::SetBulletStyle
|
* Styles for wxTextAttr::SetBulletStyle
|
||||||
*/
|
*/
|
||||||
|
enum wxTextAttrBulletStyle
|
||||||
|
{
|
||||||
|
wxTEXT_ATTR_BULLET_STYLE_NONE = 0x00000000,
|
||||||
|
wxTEXT_ATTR_BULLET_STYLE_ARABIC = 0x00000001,
|
||||||
|
wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER = 0x00000002,
|
||||||
|
wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER = 0x00000004,
|
||||||
|
wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER = 0x00000008,
|
||||||
|
wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER = 0x00000010,
|
||||||
|
wxTEXT_ATTR_BULLET_STYLE_SYMBOL = 0x00000020,
|
||||||
|
wxTEXT_ATTR_BULLET_STYLE_BITMAP = 0x00000040,
|
||||||
|
wxTEXT_ATTR_BULLET_STYLE_PARENTHESES = 0x00000080,
|
||||||
|
wxTEXT_ATTR_BULLET_STYLE_PERIOD = 0x00000100,
|
||||||
|
wxTEXT_ATTR_BULLET_STYLE_STANDARD = 0x00000200,
|
||||||
|
wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS = 0x00000400,
|
||||||
|
wxTEXT_ATTR_BULLET_STYLE_OUTLINE = 0x00000800,
|
||||||
|
|
||||||
#define wxTEXT_ATTR_BULLET_STYLE_NONE 0x00000000
|
wxTEXT_ATTR_BULLET_STYLE_ALIGN_LEFT = 0x00000000,
|
||||||
#define wxTEXT_ATTR_BULLET_STYLE_ARABIC 0x00000001
|
wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT = 0x00001000,
|
||||||
#define wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER 0x00000002
|
wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE = 0x00002000
|
||||||
#define wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER 0x00000004
|
};
|
||||||
#define wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER 0x00000008
|
|
||||||
#define wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER 0x00000010
|
|
||||||
#define wxTEXT_ATTR_BULLET_STYLE_SYMBOL 0x00000020
|
|
||||||
#define wxTEXT_ATTR_BULLET_STYLE_BITMAP 0x00000040
|
|
||||||
#define wxTEXT_ATTR_BULLET_STYLE_PARENTHESES 0x00000080
|
|
||||||
#define wxTEXT_ATTR_BULLET_STYLE_PERIOD 0x00000100
|
|
||||||
#define wxTEXT_ATTR_BULLET_STYLE_STANDARD 0x00000200
|
|
||||||
#define wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS 0x00000400
|
|
||||||
#define wxTEXT_ATTR_BULLET_STYLE_OUTLINE 0x00000800
|
|
||||||
|
|
||||||
#define wxTEXT_ATTR_BULLET_STYLE_ALIGN_LEFT 0x00000000
|
|
||||||
#define wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT 0x00001000
|
|
||||||
#define wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE 0x00002000
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Styles for wxTextAttr::SetTextEffects
|
* Styles for wxTextAttr::SetTextEffects
|
||||||
*/
|
*/
|
||||||
|
enum wxTextAttrEffects
|
||||||
#define wxTEXT_ATTR_EFFECT_NONE 0x00000000
|
{
|
||||||
#define wxTEXT_ATTR_EFFECT_CAPITALS 0x00000001
|
wxTEXT_ATTR_EFFECT_NONE = 0x00000000,
|
||||||
#define wxTEXT_ATTR_EFFECT_SMALL_CAPITALS 0x00000002
|
wxTEXT_ATTR_EFFECT_CAPITALS = 0x00000001,
|
||||||
#define wxTEXT_ATTR_EFFECT_STRIKETHROUGH 0x00000004
|
wxTEXT_ATTR_EFFECT_SMALL_CAPITALS = 0x00000002,
|
||||||
#define wxTEXT_ATTR_EFFECT_DOUBLE_STRIKETHROUGH 0x00000008
|
wxTEXT_ATTR_EFFECT_STRIKETHROUGH = 0x00000004,
|
||||||
#define wxTEXT_ATTR_EFFECT_SHADOW 0x00000010
|
wxTEXT_ATTR_EFFECT_DOUBLE_STRIKETHROUGH = 0x00000008,
|
||||||
#define wxTEXT_ATTR_EFFECT_EMBOSS 0x00000020
|
wxTEXT_ATTR_EFFECT_SHADOW = 0x00000010,
|
||||||
#define wxTEXT_ATTR_EFFECT_OUTLINE 0x00000040
|
wxTEXT_ATTR_EFFECT_EMBOSS = 0x00000020,
|
||||||
#define wxTEXT_ATTR_EFFECT_ENGRAVE 0x00000080
|
wxTEXT_ATTR_EFFECT_OUTLINE = 0x00000040,
|
||||||
#define wxTEXT_ATTR_EFFECT_SUPERSCRIPT 0x00000100
|
wxTEXT_ATTR_EFFECT_ENGRAVE = 0x00000080,
|
||||||
#define wxTEXT_ATTR_EFFECT_SUBSCRIPT 0x00000200
|
wxTEXT_ATTR_EFFECT_SUPERSCRIPT = 0x00000100,
|
||||||
|
wxTEXT_ATTR_EFFECT_SUBSCRIPT = 0x00000200
|
||||||
|
};
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Line spacing values
|
* Line spacing values
|
||||||
*/
|
*/
|
||||||
|
enum wxTextAttrLineSpacing
|
||||||
#define wxTEXT_ATTR_LINE_SPACING_NORMAL 10
|
{
|
||||||
#define wxTEXT_ATTR_LINE_SPACING_HALF 15
|
wxTEXT_ATTR_LINE_SPACING_NORMAL = 10,
|
||||||
#define wxTEXT_ATTR_LINE_SPACING_TWICE 20
|
wxTEXT_ATTR_LINE_SPACING_HALF = 15,
|
||||||
|
wxTEXT_ATTR_LINE_SPACING_TWICE = 20
|
||||||
|
};
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxTextAttr: a structure containing the visual attributes of a text
|
// wxTextAttr: a structure containing the visual attributes of a text
|
||||||
@@ -345,6 +357,8 @@ public:
|
|||||||
const wxString& GetListStyleName() const { return m_listStyleName; }
|
const wxString& GetListStyleName() const { return m_listStyleName; }
|
||||||
int GetParagraphSpacingAfter() const { return m_paragraphSpacingAfter; }
|
int GetParagraphSpacingAfter() const { return m_paragraphSpacingAfter; }
|
||||||
int GetParagraphSpacingBefore() const { return m_paragraphSpacingBefore; }
|
int GetParagraphSpacingBefore() const { return m_paragraphSpacingBefore; }
|
||||||
|
|
||||||
|
// TODO: should return the relative wxTextAttr* enumeration values
|
||||||
int GetLineSpacing() const { return m_lineSpacing; }
|
int GetLineSpacing() const { return m_lineSpacing; }
|
||||||
int GetBulletStyle() const { return m_bulletStyle; }
|
int GetBulletStyle() const { return m_bulletStyle; }
|
||||||
int GetBulletNumber() const { return m_bulletNumber; }
|
int GetBulletNumber() const { return m_bulletNumber; }
|
||||||
|
@@ -22,7 +22,7 @@
|
|||||||
When there are no more entries, GetNextEntry() returns @NULL and sets Eof().
|
When there are no more entries, GetNextEntry() returns @NULL and sets Eof().
|
||||||
|
|
||||||
@library{wxbase}
|
@library{wxbase}
|
||||||
@category{archive}
|
@category{archive,streams}
|
||||||
|
|
||||||
@see @ref overview_archive, wxArchiveEntry, wxArchiveOutputStream
|
@see @ref overview_archive, wxArchiveEntry, wxArchiveOutputStream
|
||||||
*/
|
*/
|
||||||
@@ -65,7 +65,7 @@ public:
|
|||||||
Another call to PutNextEntry() closes the current entry and begins the next.
|
Another call to PutNextEntry() closes the current entry and begins the next.
|
||||||
|
|
||||||
@library{wxbase}
|
@library{wxbase}
|
||||||
@category{archive}
|
@category{archive,streams}
|
||||||
|
|
||||||
@see @ref overview_archive, wxArchiveEntry, wxArchiveInputStream
|
@see @ref overview_archive, wxArchiveEntry, wxArchiveInputStream
|
||||||
*/
|
*/
|
||||||
@@ -178,7 +178,7 @@ public:
|
|||||||
been reached, i.e. after GetNextEntry() returns NULL and Eof() is true.
|
been reached, i.e. after GetNextEntry() returns NULL and Eof() is true.
|
||||||
|
|
||||||
@library{wxbase}
|
@library{wxbase}
|
||||||
@category{archive}
|
@category{archive,streams}
|
||||||
|
|
||||||
@see @ref overview_archive, @ref overview_archive_generic,
|
@see @ref overview_archive, @ref overview_archive_generic,
|
||||||
wxArchiveInputStream, wxArchiveOutputStream, wxArchiveNotifier
|
wxArchiveInputStream, wxArchiveOutputStream, wxArchiveNotifier
|
||||||
@@ -332,7 +332,7 @@ enum wxStreamProtocolType
|
|||||||
wxArchiveClassFactory::GetFirst() and wxArchiveClassFactory::GetNext().
|
wxArchiveClassFactory::GetFirst() and wxArchiveClassFactory::GetNext().
|
||||||
|
|
||||||
@library{wxbase}
|
@library{wxbase}
|
||||||
@category{archive}
|
@category{archive,streams}
|
||||||
|
|
||||||
@see @ref overview_archive, @ref overview_archive_generic, wxArchiveEntry,
|
@see @ref overview_archive, @ref overview_archive_generic, wxArchiveEntry,
|
||||||
wxArchiveInputStream, wxArchiveOutputStream, wxFilterClassFactory
|
wxArchiveInputStream, wxArchiveOutputStream, wxFilterClassFactory
|
||||||
@@ -488,7 +488,7 @@ public:
|
|||||||
See @ref overview_archive_noseek.
|
See @ref overview_archive_noseek.
|
||||||
|
|
||||||
@library{wxbase}
|
@library{wxbase}
|
||||||
@category{archive}
|
@category{archive,streams}
|
||||||
|
|
||||||
@see @ref overview_archive_noseek, wxArchiveEntry, wxArchiveInputStream,
|
@see @ref overview_archive_noseek, wxArchiveEntry, wxArchiveInputStream,
|
||||||
wxArchiveOutputStream
|
wxArchiveOutputStream
|
||||||
@@ -597,7 +597,7 @@ public:
|
|||||||
@endcode
|
@endcode
|
||||||
|
|
||||||
@library{wxbase}
|
@library{wxbase}
|
||||||
@category{archive}
|
@category{archive,streams}
|
||||||
|
|
||||||
@see wxArchiveEntry, wxArchiveInputStream, wxArchiveOutputStream
|
@see wxArchiveEntry, wxArchiveInputStream, wxArchiveOutputStream
|
||||||
*/
|
*/
|
||||||
|
@@ -1,31 +1,55 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
// Name: tarstrm.h
|
// Name: tarstrm.h
|
||||||
// Purpose: interface of wxTarInputStream
|
// Purpose: interface of wxTar* classes
|
||||||
// Author: wxWidgets team
|
// Author: wxWidgets team
|
||||||
// RCS-ID: $Id$
|
// RCS-ID: $Id$
|
||||||
// Licence: wxWindows license
|
// Licence: wxWindows license
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
/** wxTarEntry::GetTypeFlag() values */
|
||||||
|
enum wxTarType
|
||||||
|
{
|
||||||
|
wxTAR_REGTYPE = '0', //!< regular file
|
||||||
|
wxTAR_LNKTYPE = '1', //!< hard link
|
||||||
|
wxTAR_SYMTYPE = '2', //!< symbolic link
|
||||||
|
wxTAR_CHRTYPE = '3', //!< character special
|
||||||
|
wxTAR_BLKTYPE = '4', //!< block special
|
||||||
|
wxTAR_DIRTYPE = '5', //!< directory
|
||||||
|
wxTAR_FIFOTYPE = '6', //!< named pipe
|
||||||
|
wxTAR_CONTTYPE = '7' //!< contiguous file
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Archive Formats (use wxTAR_PAX, it's backward compatible) used by wxTarEntry */
|
||||||
|
enum wxTarFormat
|
||||||
|
{
|
||||||
|
wxTAR_USTAR, //!< POSIX.1-1990 tar format
|
||||||
|
wxTAR_PAX //!< POSIX.1-2001 tar format
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@class wxTarInputStream
|
@class wxTarInputStream
|
||||||
|
|
||||||
Input stream for reading tar files.
|
Input stream for reading tar files.
|
||||||
|
|
||||||
wxTarInputStream::GetNextEntry returns an
|
wxTarInputStream::GetNextEntry() returns a wxTarEntry object containing the
|
||||||
wxTarEntry object containing the meta-data
|
meta-data for the next entry in the tar (and gives away ownership).
|
||||||
for the next entry in the tar (and gives away ownership). Reading from
|
Reading from the wxTarInputStream then returns the entry's data.
|
||||||
the wxTarInputStream then returns the entry's data. Eof() becomes @true
|
wxTarInputStream::Eof() becomes @true after an attempt has been made to read
|
||||||
after an attempt has been made to read past the end of the entry's data.
|
past the end of the entry's data.
|
||||||
When there are no more entries, GetNextEntry() returns @NULL and sets Eof().
|
|
||||||
|
When there are no more entries, wxTarInputStream::GetNextEntry() returns @NULL
|
||||||
|
and sets wxTarInputStream::Eof().
|
||||||
|
|
||||||
Tar entries are seekable if the parent stream is seekable. In practice this
|
Tar entries are seekable if the parent stream is seekable. In practice this
|
||||||
usually means they are only seekable if the tar is stored as a local file and
|
usually means they are only seekable if the tar is stored as a local file and
|
||||||
is not compressed.
|
is not compressed.
|
||||||
|
|
||||||
@library{wxbase}
|
@library{wxbase}
|
||||||
@category{streams}
|
@category{archive,streams}
|
||||||
|
|
||||||
@see @ref overview_wxarcbyname "Looking up an archive entry by name"
|
@see @ref overview_archive_byname
|
||||||
*/
|
*/
|
||||||
class wxTarInputStream : public wxArchiveInputStream
|
class wxTarInputStream : public wxArchiveInputStream
|
||||||
{
|
{
|
||||||
@@ -33,9 +57,11 @@ public:
|
|||||||
//@{
|
//@{
|
||||||
/**
|
/**
|
||||||
Constructor. In a Unicode build the second parameter @a conv is
|
Constructor. In a Unicode build the second parameter @a conv is
|
||||||
used to translate fields from the standard tar header into Unicode. It has
|
used to translate fields from the standard tar header into Unicode.
|
||||||
no effect on the stream's data. @a conv is only used for the standard
|
|
||||||
|
It has no effect on the stream's data. @a conv is only used for the standard
|
||||||
tar headers, any pax extended headers are always UTF-8 encoded.
|
tar headers, any pax extended headers are always UTF-8 encoded.
|
||||||
|
|
||||||
If the parent stream is passed as a pointer then the new filter stream
|
If the parent stream is passed as a pointer then the new filter stream
|
||||||
takes ownership of it. If it is passed by reference then it does not.
|
takes ownership of it. If it is passed by reference then it does not.
|
||||||
*/
|
*/
|
||||||
@@ -46,23 +72,24 @@ public:
|
|||||||
//@}
|
//@}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Closes the current entry. On a non-seekable stream reads to the end of
|
Closes the current entry.
|
||||||
the current entry first.
|
On a non-seekable stream reads to the end of the current entry first.
|
||||||
*/
|
*/
|
||||||
bool CloseEntry();
|
bool CloseEntry();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Closes the current entry if one is open, then reads the meta-data for
|
Closes the current entry if one is open, then reads the meta-data for
|
||||||
the next entry and returns it in a wxTarEntry
|
the next entry and returns it in a wxTarEntry object, giving away ownership.
|
||||||
object, giving away ownership. The stream is then open and can be read.
|
The stream is then open and can be read.
|
||||||
*/
|
*/
|
||||||
wxTarEntry* GetNextEntry();
|
wxTarEntry* GetNextEntry();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Closes the current entry if one is open, then opens the entry specified
|
Closes the current entry if one is open, then opens the entry specified
|
||||||
by the @a entry object.
|
by the @a entry object.
|
||||||
@a entry should be from the same tar file, and the tar should
|
|
||||||
be on a seekable stream.
|
@a entry should be from the same tar file, and the tar should be on a
|
||||||
|
seekable stream.
|
||||||
*/
|
*/
|
||||||
bool OpenEntry(wxTarEntry& entry);
|
bool OpenEntry(wxTarEntry& entry);
|
||||||
};
|
};
|
||||||
@@ -72,14 +99,14 @@ public:
|
|||||||
/**
|
/**
|
||||||
@class wxTarClassFactory
|
@class wxTarClassFactory
|
||||||
|
|
||||||
Class factory for the tar archive format. See the base class
|
Class factory for the tar archive format.
|
||||||
for details.
|
See the base class for details.
|
||||||
|
|
||||||
@library{wxbase}
|
@library{wxbase}
|
||||||
@category{FIXME}
|
@category{archive,streams}
|
||||||
|
|
||||||
@see @ref overview_wxarc "Archive formats such as zip", @ref
|
@see @ref overview_archive, @ref overview_archive_generic,
|
||||||
overview_wxarcgeneric "Generic archive programming", wxTarEntry, wxTarInputStream, wxTarOutputStream
|
wxTarEntry, wxTarInputStream, wxTarOutputStream
|
||||||
*/
|
*/
|
||||||
class wxTarClassFactory : public wxArchiveClassFactory
|
class wxTarClassFactory : public wxArchiveClassFactory
|
||||||
{
|
{
|
||||||
@@ -94,16 +121,15 @@ public:
|
|||||||
|
|
||||||
Output stream for writing tar files.
|
Output stream for writing tar files.
|
||||||
|
|
||||||
wxTarOutputStream::PutNextEntry is used to create
|
wxTarOutputStream::PutNextEntry() is used to create a new entry in the output tar,
|
||||||
a new entry in the output tar, then the entry's data is written to the
|
then the entry's data is written to the wxTarOutputStream.
|
||||||
wxTarOutputStream. Another call to PutNextEntry() closes the current
|
Another call to wxTarOutputStream::PutNextEntry() closes the current entry
|
||||||
entry and begins the next.
|
and begins the next.
|
||||||
|
|
||||||
@library{wxbase}
|
@library{wxbase}
|
||||||
@category{streams}
|
@category{streams}
|
||||||
|
|
||||||
@see @ref overview_wxarc "Archive formats such as zip", wxTarEntry,
|
@see @ref overview_archive, wxTarEntry, wxTarInputStream
|
||||||
wxTarInputStream
|
|
||||||
*/
|
*/
|
||||||
class wxTarOutputStream : public wxArchiveOutputStream
|
class wxTarOutputStream : public wxArchiveOutputStream
|
||||||
{
|
{
|
||||||
@@ -112,18 +138,21 @@ public:
|
|||||||
/**
|
/**
|
||||||
If the parent stream is passed as a pointer then the new filter stream
|
If the parent stream is passed as a pointer then the new filter stream
|
||||||
takes ownership of it. If it is passed by reference then it does not.
|
takes ownership of it. If it is passed by reference then it does not.
|
||||||
|
|
||||||
In a Unicode build the third parameter @a conv is used to translate the
|
In a Unicode build the third parameter @a conv is used to translate the
|
||||||
headers fields into an 8-bit encoding. It has no effect on the stream's data.
|
headers fields into an 8-bit encoding. It has no effect on the stream's data.
|
||||||
|
|
||||||
When the @a format is @e wxTAR_PAX, pax extended headers are generated
|
When the @a format is @e wxTAR_PAX, pax extended headers are generated
|
||||||
when any header field will not fit the standard tar header block or if it
|
when any header field will not fit the standard tar header block or if it
|
||||||
uses any non-ascii characters.
|
uses any non-ascii characters.
|
||||||
|
|
||||||
Extended headers are stored as extra 'files' within the tar, and will be
|
Extended headers are stored as extra 'files' within the tar, and will be
|
||||||
extracted as such by any other tar program that does not understand them.
|
extracted as such by any other tar program that does not understand them.
|
||||||
The @a conv parameter only affect the standard tar headers, the extended
|
The @a conv parameter only affect the standard tar headers, the extended
|
||||||
headers are always UTF-8 encoded.
|
headers are always UTF-8 encoded.
|
||||||
When the @a format is @e wxTAR_USTAR, no extended headers are
|
|
||||||
generated, and instead a warning message is logged if any header field
|
When the @a format is @e wxTAR_USTAR, no extended headers are generated,
|
||||||
overflows.
|
and instead a warning message is logged if any header field overflows.
|
||||||
*/
|
*/
|
||||||
wxTarOutputStream(wxOutputStream& stream,
|
wxTarOutputStream(wxOutputStream& stream,
|
||||||
wxTarFormat format = wxTAR_PAX,
|
wxTarFormat format = wxTAR_PAX,
|
||||||
@@ -134,8 +163,8 @@ public:
|
|||||||
//@}
|
//@}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The destructor calls Close() to finish
|
The destructor calls Close() to finish writing the tar if it has
|
||||||
writing the tar if it has not been called already.
|
not been called already.
|
||||||
*/
|
*/
|
||||||
virtual ~wxTarOutputStream();
|
virtual ~wxTarOutputStream();
|
||||||
|
|
||||||
@@ -146,63 +175,64 @@ public:
|
|||||||
bool Close();
|
bool Close();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Close the current entry. It is called implicitly whenever another new
|
Close the current entry.
|
||||||
entry is created with CopyEntry()
|
|
||||||
or PutNextEntry(), or
|
It is called implicitly whenever another new entry is created with
|
||||||
when the tar is closed.
|
CopyEntry() or PutNextEntry(), or when the tar is closed.
|
||||||
*/
|
*/
|
||||||
bool CloseEntry();
|
bool CloseEntry();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
See wxArchiveOutputStream::CopyArchiveMetaData.
|
See wxArchiveOutputStream::CopyArchiveMetaData().
|
||||||
For the tar format this function does nothing.
|
For the tar format this function does nothing.
|
||||||
*/
|
*/
|
||||||
bool CopyArchiveMetaData(wxTarInputStream& s);
|
bool CopyArchiveMetaData(wxTarInputStream& s);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Takes ownership of @a entry and uses it to create a new entry
|
Takes ownership of @a entry and uses it to create a new entry in the tar.
|
||||||
in the tar. @a entry is then opened in @a inputStream and its contents
|
@a entry is then opened in @a inputStream and its contents copied to this stream.
|
||||||
copied to this stream.
|
|
||||||
For some other archive formats CopyEntry() is much more efficient than
|
For some other archive formats CopyEntry() is much more efficient than
|
||||||
transferring the data using Read() and Write() since it will copy them
|
transferring the data using Read() and Write() since it will copy them
|
||||||
without decompressing and recompressing them. For tar however it makes
|
without decompressing and recompressing them.
|
||||||
no difference.
|
For tar however it makes no difference.
|
||||||
|
|
||||||
For tars on seekable streams, @a entry must be from the same tar file
|
For tars on seekable streams, @a entry must be from the same tar file
|
||||||
as @e stream. For non-seekable streams, @a entry must also be the
|
as @a inputStream. For non-seekable streams, @a entry must also be the
|
||||||
last thing read from @e inputStream.
|
last thing read from @a inputStream.
|
||||||
*/
|
*/
|
||||||
bool CopyEntry(wxTarEntry* entry, wxTarInputStream& inputStream);
|
bool CopyEntry(wxTarEntry* entry, wxTarInputStream& inputStream);
|
||||||
|
|
||||||
//@{
|
//@{
|
||||||
/**
|
/**
|
||||||
The tar is zero padded to round its size up to @e BlockingFactor * 512 bytes.
|
The tar is zero padded to round its size up to @e BlockingFactor * 512 bytes.
|
||||||
Defaults to 10 for @e wxTAR_PAX and 20 for @e wxTAR_USTAR
|
|
||||||
(see the @ref wxtaroutputstream() constructor), as
|
The blocking factor defaults to 10 for @e wxTAR_PAX and 20 for @e wxTAR_USTAR
|
||||||
specified in the POSIX standards.
|
(see wxTarOutputStream()), as specified in the POSIX standards.
|
||||||
*/
|
*/
|
||||||
int GetBlockingFactor();
|
int GetBlockingFactor() const;
|
||||||
const void SetBlockingFactor(int factor);
|
void SetBlockingFactor(int factor);
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
)
|
Create a new directory entry (see wxArchiveEntry::IsDir()) with the given
|
||||||
Create a new directory entry
|
name and timestamp.
|
||||||
(see wxArchiveEntry::IsDir)
|
|
||||||
with the given name and timestamp.
|
PutNextEntry() can also be used to create directory entries, by supplying
|
||||||
PutNextEntry() can
|
a name with a trailing path separator.
|
||||||
also be used to create directory entries, by supplying a name with
|
*/
|
||||||
a trailing path separator.
|
bool PutNextDirEntry(const wxString& name, const wxDateTime& dt = wxDateTime::Now());
|
||||||
*/
|
|
||||||
bool PutNextDirEntry(const wxString& name);
|
|
||||||
|
|
||||||
//@{
|
|
||||||
/**
|
/**
|
||||||
, @b wxFileOffset@e size = wxInvalidOffset)
|
Takes ownership of entry and uses it to create a new entry in the tar.
|
||||||
Create a new entry with the given name, timestamp and size.
|
|
||||||
*/
|
*/
|
||||||
bool PutNextEntry(wxTarEntry* entry);
|
bool PutNextEntry(wxTarEntry* entry);
|
||||||
bool PutNextEntry(const wxString& name);
|
|
||||||
//@}
|
/**
|
||||||
|
Create a new entry with the given name, timestamp and size.
|
||||||
|
*/
|
||||||
|
bool PutNextEntry(const wxString& name, const wxDateTime& dt = wxDateTime::Now(),
|
||||||
|
wxFileOffset size = wxInvalidOffset);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -212,135 +242,161 @@ public:
|
|||||||
|
|
||||||
Holds the meta-data for an entry in a tar.
|
Holds the meta-data for an entry in a tar.
|
||||||
|
|
||||||
@library{wxbase}
|
@section tarentry_fields Field availability
|
||||||
@category{FIXME}
|
|
||||||
|
|
||||||
@see @ref overview_wxarc "Archive formats such as zip", wxTarInputStream,
|
The tar format stores all the meta-data for an entry ahead of its data,
|
||||||
wxTarOutputStream
|
therefore GetNextEntry() always returns a fully populated wxTarEntry object,
|
||||||
|
both when reading from seekable and non-seekable streams.
|
||||||
|
|
||||||
|
@library{wxbase}
|
||||||
|
@category{archive,streams}
|
||||||
|
|
||||||
|
@see @ref overview_archive, wxTarInputStream, wxTarOutputStream
|
||||||
*/
|
*/
|
||||||
class wxTarEntry : public wxArchiveEntry
|
class wxTarEntry : public wxArchiveEntry
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
//@{
|
/**
|
||||||
|
Constructor.
|
||||||
|
|
||||||
|
The tar archive format stores the entry's size ahead of the entry's data.
|
||||||
|
Therefore when creating an archive on a non-seekable stream it is necessary
|
||||||
|
to supply the correct size when each entry is created.
|
||||||
|
*/
|
||||||
|
wxTarEntry(const wxString& name = wxEmptyString,
|
||||||
|
const wxDateTime& dt = wxDateTime::Now(),
|
||||||
|
wxFileOffset size = wxInvalidOffset);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Copy constructor.
|
Copy constructor.
|
||||||
*/
|
*/
|
||||||
wxTarEntry(const wxString& name = wxEmptyString);
|
|
||||||
wxTarEntry(const wxTarEntry& entry);
|
wxTarEntry(const wxTarEntry& entry);
|
||||||
|
|
||||||
|
//@{
|
||||||
|
/**
|
||||||
|
Gets/sets the entry's access time stamp.
|
||||||
|
See also wxArchiveEntry::GetDateTime() and wxArchiveEntry::SetDateTime().
|
||||||
|
*/
|
||||||
|
wxDateTime GetAccessTime() const;
|
||||||
|
void SetAccessTime(const wxDateTime& dt);
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
//@{
|
//@{
|
||||||
/**
|
/**
|
||||||
The entry's access time stamp. See also
|
The entry's creation time stamp.
|
||||||
wxArchiveEntry::Get/SetDateTime.
|
See also wxArchiveEntry::GetDateTime() and wxArchiveEntry::SetDateTime().
|
||||||
*/
|
*/
|
||||||
wxDateTime GetAccessTime();
|
wxDateTime GetCreateTime() const;
|
||||||
const void SetAccessTime(const wxDateTime& dt);
|
void SetCreateTime(const wxDateTime& dt);
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
//@{
|
//@{
|
||||||
/**
|
/**
|
||||||
The entry's creation time stamp. See also
|
OS specific IDs defining a device; these are only meaningful when
|
||||||
wxArchiveEntry::Get/SetDateTime.
|
wxTarEntry::GetTypeFlag() is @e wxTAR_CHRTYPE or @e wxTAR_BLKTYPE.
|
||||||
*/
|
*/
|
||||||
wxDateTime GetCreateTime();
|
int GetDevMajor() const;
|
||||||
const void SetCreateTime(const wxDateTime& dt);
|
int GetDevMinor() const;
|
||||||
//@}
|
void SetDevMajor(int dev);
|
||||||
|
|
||||||
//@{
|
|
||||||
/**
|
|
||||||
OS specific IDs defining a device, these are only meaningful when
|
|
||||||
TypeFlag() is set to @e wxTAR_CHRTYPE
|
|
||||||
or @e wxTAR_BLKTYPE.
|
|
||||||
*/
|
|
||||||
int GetDevMajor();
|
|
||||||
const int GetDevMinor();
|
|
||||||
const void SetDevMajor(int dev);
|
|
||||||
void SetDevMinor(int dev);
|
void SetDevMinor(int dev);
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
//@{
|
//@{
|
||||||
/**
|
/**
|
||||||
The user ID and group ID that has @ref mode() permissions over
|
The user ID and group ID that has permissions (see wxTarEntry::GetMode())
|
||||||
this entry. These values aren't usually useful unless the file will only be
|
over this entry.
|
||||||
restored to the same system it originated from. @ref unamegname()
|
|
||||||
"Get/SetGroupName and
|
These values aren't usually useful unless the file will only be
|
||||||
Get/SetUserName" can be used instead.
|
restored to the same system it originated from.
|
||||||
|
wxTarEntry::GetGroupName() and wxTarEntry::GetUserName() can be used instead.
|
||||||
*/
|
*/
|
||||||
int GetGroupId();
|
int GetGroupId() const;
|
||||||
const int GetUserId();
|
int GetUserId() const;
|
||||||
const void SetGroupId(int id);
|
void SetGroupId(int id);
|
||||||
void SetUserId(int id);
|
void SetUserId(int id);
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
//@{
|
//@{
|
||||||
/**
|
/**
|
||||||
The names of the user and group that has @ref mode() permissions
|
The names of the user and group that has permissions (see wxTarEntry::GetMode())
|
||||||
over this entry. These are not present in very old tars.
|
over this entry. These are not present in very old tars.
|
||||||
*/
|
*/
|
||||||
wxString GetGroupName();
|
wxString GetGroupName() const;
|
||||||
const wxString GetUserName();
|
wxString GetUserName() const;
|
||||||
const void SetGroupName(const wxString& group);
|
void SetGroupName(const wxString& group);
|
||||||
void SetUserName(const wxString& user);
|
void SetUserName(const wxString& user);
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
//@{
|
//@{
|
||||||
/**
|
/**
|
||||||
The filename of a previous entry in the tar that this entry is a link to.
|
The filename of a previous entry in the tar that this entry is a link to.
|
||||||
Only meaningful when TypeFlag() is set
|
Only meaningful when wxTarEntry::GetTypeFlag() is set to @e wxTAR_LNKTYPE
|
||||||
to @e wxTAR_LNKTYPE or @e wxTAR_SYMTYPE.
|
or @e wxTAR_SYMTYPE.
|
||||||
*/
|
*/
|
||||||
wxString GetLinkName();
|
wxString GetLinkName() const;
|
||||||
const void SetLinkName(const wxString& link);
|
void SetLinkName(const wxString& link);
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
//@{
|
//@{
|
||||||
/**
|
/**
|
||||||
UNIX permission bits for this entry. Giving read, write and execute permissions
|
UNIX permission bits for this entry.
|
||||||
to the file's @ref unamegname() "User and Group" and to others.
|
Giving read, write and execute permissions to the file's user and group
|
||||||
Symbols are defined for them in wx/file.h.
|
(see GetGroupName() and GetUserName()) and to others.
|
||||||
|
|
||||||
|
The integer is one or more ::wxPosixPermissions flags OR-combined.
|
||||||
*/
|
*/
|
||||||
int GetMode();
|
int GetMode() const;
|
||||||
const void SetMode(int mode);
|
void SetMode(int mode);
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
//@{
|
//@{
|
||||||
/**
|
/**
|
||||||
The size of the entry's data in bytes.
|
The size of the entry's data in bytes.
|
||||||
|
|
||||||
The tar archive format stores the entry's size ahead of the entry's data.
|
The tar archive format stores the entry's size ahead of the entry's data.
|
||||||
Therefore when creating an archive on a non-seekable stream it is necessary to
|
Therefore when creating an archive on a non-seekable stream it is necessary to
|
||||||
supply the correct size when each entry is created. For seekable streams this
|
supply the correct size when each entry is created.
|
||||||
is not necessary as wxTarOutputStream will attempt
|
|
||||||
|
For seekable streams this is not necessary as wxTarOutputStream will attempt
|
||||||
to seek back and fix the entry's header when the entry is closed, though it is
|
to seek back and fix the entry's header when the entry is closed, though it is
|
||||||
still more efficient if the size is given beforehand.
|
still more efficient if the size is given beforehand.
|
||||||
*/
|
*/
|
||||||
void SetSize(wxFileOffset size) const;
|
void SetSize(wxFileOffset size);
|
||||||
wxFileOffset GetSize() const;
|
wxFileOffset GetSize() const;
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
//@{
|
//@{
|
||||||
/**
|
/**
|
||||||
Returns the type of the entry. It should be one of the following:
|
Returns/Sets the type of the entry as a ::wxTarType value.
|
||||||
|
|
||||||
When creating archives use just these values. When reading archives
|
When creating archives use only one of ::wxTarType values.
|
||||||
any other values should be treated as @e wxTAR_REGTYPE.
|
When reading archives, GetTypeFlag() may return a value which does not
|
||||||
|
match any value of ::wxTarType; in this case the returned value should be
|
||||||
|
treated as @e wxTAR_REGTYPE.
|
||||||
*/
|
*/
|
||||||
int GetTypeFlag();
|
int GetTypeFlag() const;
|
||||||
const void SetTypeFlag(int type);
|
void SetTypeFlag(int type);
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
//@{
|
/**
|
||||||
|
Returns the entry's filename in the internal format used within the archive.
|
||||||
|
|
||||||
|
The name can include directory components, i.e. it can be a full path.
|
||||||
|
The names of directory entries are returned without any trailing path separator.
|
||||||
|
This gives a canonical name that can be used in comparisons.
|
||||||
|
*/
|
||||||
|
wxString GetInternalName() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
A static member that translates a filename into the internal format used
|
A static member that translates a filename into the internal format used
|
||||||
within the archive. If the third parameter is provided, the bool pointed
|
within the archive.
|
||||||
to is set to indicate whether the name looks like a directory name
|
|
||||||
(i.e. has a trailing path separator).
|
If the third parameter is provided, the bool pointed to is set to indicate
|
||||||
|
whether the name looks like a directory name (i.e. has a trailing path separator).
|
||||||
*/
|
*/
|
||||||
wxString GetInternalName();
|
static wxString GetInternalName(const wxString& name,
|
||||||
const wxString GetInternalName(const wxString& name,
|
|
||||||
wxPathFormat format = wxPATH_NATIVE,
|
wxPathFormat format = wxPATH_NATIVE,
|
||||||
bool* pIsDir = NULL);
|
bool* pIsDir = NULL);
|
||||||
//@}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Assignment operator.
|
Assignment operator.
|
||||||
|
@@ -9,11 +9,49 @@
|
|||||||
/**
|
/**
|
||||||
@class wxTaskBarIcon
|
@class wxTaskBarIcon
|
||||||
|
|
||||||
This class represents a taskbar icon. A taskbar icon is an icon that appears in
|
This class represents a taskbar icon.
|
||||||
the 'system tray' and responds to mouse clicks, optionally with a tooltip above it to help provide information.
|
A taskbar icon is an icon that appears in the 'system tray' and responds to
|
||||||
|
mouse clicks, optionally with a tooltip above it to help provide information.
|
||||||
|
|
||||||
|
@section taskbaricon_xnote X Window System Note
|
||||||
|
Under X Window System, the window manager must support either the
|
||||||
|
@link http://freedesktop.org/wiki/Specifications/systemtray-spec "System Tray Protocol"
|
||||||
|
by freedesktop.org (WMs used by modern desktop environments such as GNOME >= 2,
|
||||||
|
KDE >= 3 and XFCE >= 4 all do) or the older methods used in GNOME 1.2 and KDE 1 and 2.
|
||||||
|
|
||||||
|
If it doesn't, the icon will appear as a toplevel window on user's desktop.
|
||||||
|
Because not all window managers have system tray, there's no guarantee that
|
||||||
|
wxTaskBarIcon will work correctly under X Window System and so the applications
|
||||||
|
should use it only as an optional component of their user interface.
|
||||||
|
The user should be required to explicitly enable the taskbar icon on Unix,
|
||||||
|
it shouldn't be on by default.
|
||||||
|
|
||||||
|
@beginEventTable{wxTaskBarIconEvent}
|
||||||
|
Note that not all ports are required to send these events and so it's better
|
||||||
|
to override wxTaskBarIcon::CreatePopupMenu() if all that the application does
|
||||||
|
is that it shows a popup menu in reaction to mouse click.
|
||||||
|
@event{EVT_TASKBAR_MOVE(func)}
|
||||||
|
Process a wxEVT_TASKBAR_MOVE event.
|
||||||
|
@event{EVT_TASKBAR_LEFT_DOWN(func)}
|
||||||
|
Process a wxEVT_TASKBAR_LEFT_DOWN event.
|
||||||
|
@event{EVT_TASKBAR_LEFT_UP(func)}
|
||||||
|
Process a wxEVT_TASKBAR_LEFT_UP event.
|
||||||
|
@event{EVT_TASKBAR_RIGHT_DOWN(func)}
|
||||||
|
Process a wxEVT_TASKBAR_RIGHT_DOWN event.
|
||||||
|
@event{EVT_TASKBAR_RIGHT_UP(func)}
|
||||||
|
Process a wxEVT_TASKBAR_RIGHT_UP event.
|
||||||
|
@event{EVT_TASKBAR_LEFT_DCLICK(func)}
|
||||||
|
Process a wxEVT_TASKBAR_LEFT_DCLICK event.
|
||||||
|
@event{EVT_TASKBAR_RIGHT_DCLICK(func)}
|
||||||
|
Process a wxEVT_TASKBAR_RIGHT_DCLICK event.
|
||||||
|
@event{EVT_TASKBAR_CLICK(func)}
|
||||||
|
This is a synonym for either EVT_TASKBAR_RIGHT_DOWN or UP depending on
|
||||||
|
the platform, use this event macro to catch the event which should result
|
||||||
|
in the menu being displayed on the current platform.
|
||||||
|
@endEventTable
|
||||||
|
|
||||||
@library{wxadv}
|
@library{wxadv}
|
||||||
@category{FIXME}
|
@category{misc}
|
||||||
*/
|
*/
|
||||||
class wxTaskBarIcon : public wxEvtHandler
|
class wxTaskBarIcon : public wxEvtHandler
|
||||||
{
|
{
|
||||||
@@ -31,18 +69,20 @@ public:
|
|||||||
/**
|
/**
|
||||||
This method is called by the library when the user requests popup menu
|
This method is called by the library when the user requests popup menu
|
||||||
(on Windows and Unix platforms, this is when the user right-clicks the icon).
|
(on Windows and Unix platforms, this is when the user right-clicks the icon).
|
||||||
|
|
||||||
Override this function in order to provide popup menu associated with the icon.
|
Override this function in order to provide popup menu associated with the icon.
|
||||||
If CreatePopupMenu returns @NULL (this happens by default),
|
If CreatePopupMenu() returns @NULL (this happens by default), no menu is shown,
|
||||||
no menu is shown, otherwise the menu is
|
otherwise the menu is displayed and then deleted by the library as soon as the
|
||||||
displayed and then deleted by the library as soon as the user dismisses it.
|
user dismisses it.
|
||||||
|
|
||||||
The events can be handled by a class derived from wxTaskBarIcon.
|
The events can be handled by a class derived from wxTaskBarIcon.
|
||||||
*/
|
*/
|
||||||
virtual wxMenu* CreatePopupMenu();
|
virtual wxMenu* CreatePopupMenu();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This method is similar to wxWindow::Destroy and can
|
This method is similar to wxWindow::Destroy and can be used to schedule
|
||||||
be used to schedule the task bar icon object for the delayed destruction: it
|
the task bar icon object for the delayed destruction: it will be deleted
|
||||||
will be deleted during the next event loop iteration, which allows the task bar
|
during the next event loop iteration, which allows the task bar
|
||||||
icon to process any pending events for it before being destroyed.
|
icon to process any pending events for it before being destroyed.
|
||||||
*/
|
*/
|
||||||
void Destroy();
|
void Destroy();
|
||||||
@@ -58,8 +98,13 @@ public:
|
|||||||
bool IsOk() const;
|
bool IsOk() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Pops up a menu at the current mouse position. The events can be handled by
|
Pops up a menu at the current mouse position.
|
||||||
a class derived from wxTaskBarIcon.
|
The events can be handled by a class derived from wxTaskBarIcon.
|
||||||
|
|
||||||
|
@note
|
||||||
|
It is recommended to override CreatePopupMenu() callback instead of
|
||||||
|
calling this method from event handler, because some ports (e.g. wxCocoa)
|
||||||
|
may not implement PopupMenu() and mouse click events at all.
|
||||||
*/
|
*/
|
||||||
virtual bool PopupMenu(wxMenu* menu);
|
virtual bool PopupMenu(wxMenu* menu);
|
||||||
|
|
||||||
|
@@ -6,6 +6,163 @@
|
|||||||
// Licence: wxWindows license
|
// Licence: wxWindows license
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
The following values can be passed to wxTextAttr::SetAlignment to determine paragraph alignment.
|
||||||
|
*/
|
||||||
|
enum wxTextAttrAlignment
|
||||||
|
{
|
||||||
|
wxTEXT_ALIGNMENT_DEFAULT,
|
||||||
|
wxTEXT_ALIGNMENT_LEFT,
|
||||||
|
wxTEXT_ALIGNMENT_CENTRE,
|
||||||
|
wxTEXT_ALIGNMENT_CENTER = wxTEXT_ALIGNMENT_CENTRE,
|
||||||
|
wxTEXT_ALIGNMENT_RIGHT,
|
||||||
|
|
||||||
|
/** wxTEXT_ALIGNMENT_JUSTIFIED is unimplemented.
|
||||||
|
In future justification may be supported when printing or previewing, only. */
|
||||||
|
wxTEXT_ALIGNMENT_JUSTIFIED
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
The following values are passed in a bitlist to wxTextAttr::SetFlags() to
|
||||||
|
determine what attributes will be considered when setting the attributes for a text control.
|
||||||
|
*/
|
||||||
|
enum wxTextAttrFlags
|
||||||
|
{
|
||||||
|
wxTEXT_ATTR_TEXT_COLOUR = 0x00000001,
|
||||||
|
wxTEXT_ATTR_BACKGROUND_COLOUR = 0x00000002,
|
||||||
|
wxTEXT_ATTR_FONT_FACE = 0x00000004,
|
||||||
|
wxTEXT_ATTR_FONT_SIZE = 0x00000008,
|
||||||
|
wxTEXT_ATTR_FONT_WEIGHT = 0x00000010,
|
||||||
|
wxTEXT_ATTR_FONT_ITALIC = 0x00000020,
|
||||||
|
wxTEXT_ATTR_FONT_UNDERLINE = 0x00000040,
|
||||||
|
wxTEXT_ATTR_FONT_ENCODING = 0x02000000,
|
||||||
|
wxTEXT_ATTR_FONT = \
|
||||||
|
( wxTEXT_ATTR_FONT_FACE | wxTEXT_ATTR_FONT_SIZE | wxTEXT_ATTR_FONT_WEIGHT | \
|
||||||
|
wxTEXT_ATTR_FONT_ITALIC | wxTEXT_ATTR_FONT_UNDERLINE | wxTEXT_ATTR_FONT_ENCODING ),
|
||||||
|
|
||||||
|
wxTEXT_ATTR_ALIGNMENT = 0x00000080,
|
||||||
|
wxTEXT_ATTR_LEFT_INDENT = 0x00000100,
|
||||||
|
wxTEXT_ATTR_RIGHT_INDENT = 0x00000200,
|
||||||
|
wxTEXT_ATTR_TABS = 0x00000400,
|
||||||
|
|
||||||
|
wxTEXT_ATTR_PARA_SPACING_AFTER = 0x00000800,
|
||||||
|
wxTEXT_ATTR_PARA_SPACING_BEFORE = 0x00001000,
|
||||||
|
wxTEXT_ATTR_LINE_SPACING = 0x00002000,
|
||||||
|
wxTEXT_ATTR_CHARACTER_STYLE_NAME = 0x00004000,
|
||||||
|
wxTEXT_ATTR_PARAGRAPH_STYLE_NAME = 0x00008000,
|
||||||
|
wxTEXT_ATTR_LIST_STYLE_NAME = 0x00010000,
|
||||||
|
wxTEXT_ATTR_BULLET_STYLE = 0x00020000,
|
||||||
|
wxTEXT_ATTR_BULLET_NUMBER = 0x00040000,
|
||||||
|
wxTEXT_ATTR_BULLET_TEXT = 0x00080000,
|
||||||
|
wxTEXT_ATTR_BULLET_NAME = 0x00100000,
|
||||||
|
wxTEXT_ATTR_URL = 0x00200000,
|
||||||
|
wxTEXT_ATTR_PAGE_BREAK = 0x00400000,
|
||||||
|
wxTEXT_ATTR_EFFECTS = 0x00800000,
|
||||||
|
wxTEXT_ATTR_OUTLINE_LEVEL = 0x01000000,
|
||||||
|
|
||||||
|
/**
|
||||||
|
Character and paragraph combined styles
|
||||||
|
*/
|
||||||
|
|
||||||
|
wxTEXT_ATTR_CHARACTER = \
|
||||||
|
(wxTEXT_ATTR_FONT|wxTEXT_ATTR_FONT_ENCODING|wxTEXT_ATTR_EFFECTS| \
|
||||||
|
wxTEXT_ATTR_BACKGROUND_COLOUR|wxTEXT_ATTR_TEXT_COLOUR|wxTEXT_ATTR_CHARACTER_STYLE_NAME|wxTEXT_ATTR_URL),
|
||||||
|
|
||||||
|
wxTEXT_ATTR_PARAGRAPH = \
|
||||||
|
(wxTEXT_ATTR_ALIGNMENT|wxTEXT_ATTR_LEFT_INDENT|wxTEXT_ATTR_RIGHT_INDENT|wxTEXT_ATTR_TABS|\
|
||||||
|
wxTEXT_ATTR_PARA_SPACING_BEFORE|wxTEXT_ATTR_PARA_SPACING_AFTER|wxTEXT_ATTR_LINE_SPACING|\
|
||||||
|
wxTEXT_ATTR_BULLET_STYLE|wxTEXT_ATTR_BULLET_NUMBER|wxTEXT_ATTR_BULLET_TEXT|wxTEXT_ATTR_BULLET_NAME|\
|
||||||
|
wxTEXT_ATTR_PARAGRAPH_STYLE_NAME|wxTEXT_ATTR_LIST_STYLE_NAME|wxTEXT_ATTR_OUTLINE_LEVEL),
|
||||||
|
|
||||||
|
wxTEXT_ATTR_ALL = (wxTEXT_ATTR_CHARACTER|wxTEXT_ATTR_PARAGRAPH)
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
Styles for wxTextAttr::SetBulletStyle
|
||||||
|
*/
|
||||||
|
enum wxTextAttrBulletStyle
|
||||||
|
{
|
||||||
|
wxTEXT_ATTR_BULLET_STYLE_NONE = 0x00000000,
|
||||||
|
wxTEXT_ATTR_BULLET_STYLE_ARABIC = 0x00000001,
|
||||||
|
wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER = 0x00000002,
|
||||||
|
wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER = 0x00000004,
|
||||||
|
wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER = 0x00000008,
|
||||||
|
wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER = 0x00000010,
|
||||||
|
wxTEXT_ATTR_BULLET_STYLE_SYMBOL = 0x00000020,
|
||||||
|
|
||||||
|
/** wxTEXT_ATTR_BULLET_STYLE_BITMAP is unimplemented. */
|
||||||
|
wxTEXT_ATTR_BULLET_STYLE_BITMAP = 0x00000040,
|
||||||
|
wxTEXT_ATTR_BULLET_STYLE_PARENTHESES = 0x00000080,
|
||||||
|
wxTEXT_ATTR_BULLET_STYLE_PERIOD = 0x00000100,
|
||||||
|
wxTEXT_ATTR_BULLET_STYLE_STANDARD = 0x00000200,
|
||||||
|
wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS = 0x00000400,
|
||||||
|
wxTEXT_ATTR_BULLET_STYLE_OUTLINE = 0x00000800,
|
||||||
|
|
||||||
|
wxTEXT_ATTR_BULLET_STYLE_ALIGN_LEFT = 0x00000000,
|
||||||
|
wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT = 0x00001000,
|
||||||
|
wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE = 0x00002000
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
Styles for wxTextAttr::SetTextEffects().
|
||||||
|
|
||||||
|
Of these, only wxTEXT_ATTR_EFFECT_CAPITALS and wxTEXT_ATTR_EFFECT_STRIKETHROUGH are implemented.
|
||||||
|
*/
|
||||||
|
enum wxTextAttrEffects
|
||||||
|
{
|
||||||
|
wxTEXT_ATTR_EFFECT_NONE = 0x00000000,
|
||||||
|
wxTEXT_ATTR_EFFECT_CAPITALS = 0x00000001,
|
||||||
|
wxTEXT_ATTR_EFFECT_SMALL_CAPITALS = 0x00000002,
|
||||||
|
wxTEXT_ATTR_EFFECT_STRIKETHROUGH = 0x00000004,
|
||||||
|
wxTEXT_ATTR_EFFECT_DOUBLE_STRIKETHROUGH = 0x00000008,
|
||||||
|
wxTEXT_ATTR_EFFECT_SHADOW = 0x00000010,
|
||||||
|
wxTEXT_ATTR_EFFECT_EMBOSS = 0x00000020,
|
||||||
|
wxTEXT_ATTR_EFFECT_OUTLINE = 0x00000040,
|
||||||
|
wxTEXT_ATTR_EFFECT_ENGRAVE = 0x00000080,
|
||||||
|
wxTEXT_ATTR_EFFECT_SUPERSCRIPT = 0x00000100,
|
||||||
|
wxTEXT_ATTR_EFFECT_SUBSCRIPT = 0x00000200
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
Line spacing values; see wxTextAttr::SetLineSpacing().
|
||||||
|
*/
|
||||||
|
enum wxTextAttrLineSpacing
|
||||||
|
{
|
||||||
|
wxTEXT_ATTR_LINE_SPACING_NORMAL = 10,
|
||||||
|
wxTEXT_ATTR_LINE_SPACING_HALF = 15,
|
||||||
|
wxTEXT_ATTR_LINE_SPACING_TWICE = 20
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Describes the possible return values of wxTextCtrl::HitTest().
|
||||||
|
|
||||||
|
The element names correspond to the relationship between the point asked
|
||||||
|
for and the character returned, e.g. @c wxTE_HT_BEFORE means that the point
|
||||||
|
is before (leftward or upward) it and so on.
|
||||||
|
*/
|
||||||
|
enum wxTextCtrlHitTestResult
|
||||||
|
{
|
||||||
|
/// Indicates that wxTextCtrl::HitTest() is not implemented on this
|
||||||
|
/// platform.
|
||||||
|
wxTE_HT_UNKNOWN = -2,
|
||||||
|
|
||||||
|
/// The point is before the character returned.
|
||||||
|
wxTE_HT_BEFORE,
|
||||||
|
|
||||||
|
/// The point is directly on the character returned.
|
||||||
|
wxTE_HT_ON_TEXT,
|
||||||
|
|
||||||
|
/// The point is below the last line of the control.
|
||||||
|
wxTE_HT_BELOW,
|
||||||
|
|
||||||
|
/// The point is beyond the end of line containing the character returned.
|
||||||
|
wxTE_HT_BEYOND
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@class wxTextAttr
|
@class wxTextAttr
|
||||||
|
|
||||||
@@ -13,8 +170,8 @@
|
|||||||
for a range of text in a wxTextCtrl or wxRichTextCtrl.
|
for a range of text in a wxTextCtrl or wxRichTextCtrl.
|
||||||
|
|
||||||
When setting up a wxTextAttr object, pass a bitlist mask to
|
When setting up a wxTextAttr object, pass a bitlist mask to
|
||||||
wxTextAttr::SetFlags to indicate which style elements should be changed. As
|
wxTextAttr::SetFlags() to indicate which style elements should be changed.
|
||||||
a convenience, when you call a setter such as SetFont, the relevant bit
|
As a convenience, when you call a setter such as SetFont, the relevant bit
|
||||||
will be set.
|
will be set.
|
||||||
|
|
||||||
@library{wxcore}
|
@library{wxcore}
|
||||||
@@ -51,37 +208,38 @@ public:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Returns the alignment flags.
|
Returns the alignment flags.
|
||||||
See SetAlignment() for a list of available styles.
|
See ::wxTextAttrAlignment for a list of available styles.
|
||||||
*/
|
*/
|
||||||
wxTextAttrAlignment GetAlignment() const;
|
wxTextAttrAlignment GetAlignment() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Returns the background colour.
|
Returns the background colour.
|
||||||
*/
|
*/
|
||||||
const wxColour GetBackgroundColour() const;
|
const wxColour& GetBackgroundColour() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Returns a string containing the name of the font associated with the bullet
|
Returns a string containing the name of the font associated with the bullet symbol.
|
||||||
symbol.
|
|
||||||
Only valid for attributes with wxTEXT_ATTR_BULLET_SYMBOL.
|
Only valid for attributes with wxTEXT_ATTR_BULLET_SYMBOL.
|
||||||
*/
|
*/
|
||||||
const wxString GetBulletFont() const;
|
const wxString& GetBulletFont() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Returns the standard bullet name, applicable if the bullet style is
|
Returns the standard bullet name, applicable if the bullet style is
|
||||||
wxTEXT_ATTR_BULLET_STYLE_STANDARD.
|
wxTEXT_ATTR_BULLET_STYLE_STANDARD.
|
||||||
|
|
||||||
Currently the following standard bullet names are supported:
|
Currently the following standard bullet names are supported:
|
||||||
@c standard/circle
|
- @c standard/circle
|
||||||
@c standard/square
|
- @c standard/square
|
||||||
@c standard/diamond
|
- @c standard/diamond
|
||||||
@c standard/triangle
|
- @c standard/triangle
|
||||||
|
|
||||||
|
@note
|
||||||
For wxRichTextCtrl users only: if you wish your rich text controls to support
|
For wxRichTextCtrl users only: if you wish your rich text controls to support
|
||||||
further bullet graphics, you can derive a
|
further bullet graphics, you can derive a class from wxRichTextRenderer or
|
||||||
class from wxRichTextRenderer or wxRichTextStdRenderer, override @c
|
wxRichTextStdRenderer, override @c DrawStandardBullet and @c EnumerateStandardBulletNames,
|
||||||
DrawStandardBullet and @c EnumerateStandardBulletNames, and
|
and set an instance of the class using wxRichTextBuffer::SetRenderer.
|
||||||
set an instance of the class using wxRichTextBuffer::SetRenderer.
|
|
||||||
*/
|
*/
|
||||||
const wxString GetBulletName() const;
|
const wxString& GetBulletName() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Returns the bullet number.
|
Returns the bullet number.
|
||||||
@@ -90,7 +248,7 @@ public:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Returns the bullet style.
|
Returns the bullet style.
|
||||||
See SetBulletStyle() for a list of available styles.
|
See ::wxTextAttrBulletStyle for a list of available styles.
|
||||||
*/
|
*/
|
||||||
int GetBulletStyle() const;
|
int GetBulletStyle() const;
|
||||||
|
|
||||||
@@ -113,10 +271,10 @@ public:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Creates and returns a font specified by the font attributes in the wxTextAttr
|
Creates and returns a font specified by the font attributes in the wxTextAttr
|
||||||
object. Note that
|
object. Note that wxTextAttr does not store a wxFont object, so this is only
|
||||||
wxTextAttr does not store a wxFont object, so this is only a temporary font.
|
a temporary font.
|
||||||
For greater
|
|
||||||
efficiency, access the font attributes directly.
|
For greater efficiency, access the font attributes directly.
|
||||||
*/
|
*/
|
||||||
wxFont GetFont() const;
|
wxFont GetFont() const;
|
||||||
|
|
||||||
@@ -168,8 +326,7 @@ public:
|
|||||||
long GetLeftSubIndent() const;
|
long GetLeftSubIndent() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Returns the line spacing value, one of wxTEXT_ATTR_LINE_SPACING_NORMAL,
|
Returns the line spacing value, one of ::wxTextAttrLineSpacing values.
|
||||||
wxTEXT_ATTR_LINE_SPACING_HALF, and wxTEXT_ATTR_LINE_SPACING_TWICE.
|
|
||||||
*/
|
*/
|
||||||
int GetLineSpacing() const;
|
int GetLineSpacing() const;
|
||||||
|
|
||||||
@@ -204,10 +361,10 @@ public:
|
|||||||
long GetRightIndent() const;
|
long GetRightIndent() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Returns an array of tab stops, each expressed in tenths of a millimeter. Each
|
Returns an array of tab stops, each expressed in tenths of a millimeter.
|
||||||
stop
|
|
||||||
is measured from the left margin and therefore each value must be larger than
|
Each stop is measured from the left margin and therefore each value must
|
||||||
the last.
|
be larger than the last.
|
||||||
*/
|
*/
|
||||||
const wxArrayInt GetTabs() const;
|
const wxArrayInt GetTabs() const;
|
||||||
|
|
||||||
@@ -217,22 +374,23 @@ public:
|
|||||||
const wxColour GetTextColour() const;
|
const wxColour GetTextColour() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Returns the text effect bits of interest. See SetFlags() for further
|
Returns the text effect bits of interest.
|
||||||
information.
|
See SetFlags() for further information.
|
||||||
*/
|
*/
|
||||||
int GetTextEffectFlags() const;
|
int GetTextEffectFlags() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Returns the text effects, a bit list of styles. See SetTextEffects() for
|
Returns the text effects, a bit list of styles.
|
||||||
details.
|
See SetTextEffects() for details.
|
||||||
*/
|
*/
|
||||||
int GetTextEffects() const;
|
int GetTextEffects() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Returns the URL for the content. Content with wxTEXT_ATTR_URL style
|
Returns the URL for the content.
|
||||||
causes wxRichTextCtrl to show a hand cursor over it, and wxRichTextCtrl
|
|
||||||
generates
|
Content with @a wxTEXT_ATTR_URL style causes wxRichTextCtrl to show a
|
||||||
a wxTextUrlEvent when the content is clicked.
|
hand cursor over it, and wxRichTextCtrl generates a wxTextUrlEvent
|
||||||
|
when the content is clicked.
|
||||||
*/
|
*/
|
||||||
const wxString GetURL() const;
|
const wxString GetURL() const;
|
||||||
|
|
||||||
@@ -399,24 +557,25 @@ public:
|
|||||||
*/
|
*/
|
||||||
bool IsParagraphStyle() const;
|
bool IsParagraphStyle() const;
|
||||||
|
|
||||||
//@{
|
|
||||||
/**
|
/**
|
||||||
Creates a new @c wxTextAttr which is a merge of @a base and
|
Copies all defined/valid properties from overlay to current object.
|
||||||
@a overlay. Properties defined in @a overlay take precedence over those
|
|
||||||
in @a base. Properties undefined/invalid in both are undefined in the
|
|
||||||
result.
|
|
||||||
*/
|
*/
|
||||||
void Merge(const wxTextAttr& overlay);
|
void Merge(const wxTextAttr& overlay);
|
||||||
static wxTextAttr Merge(const wxTextAttr& base,
|
|
||||||
const wxTextAttr& overlay);
|
|
||||||
//@}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Sets the paragraph alignment. These are the possible values for @a alignment:
|
Creates a new @c wxTextAttr which is a merge of @a base and @a overlay.
|
||||||
|
|
||||||
Of these, wxTEXT_ALIGNMENT_JUSTIFIED is unimplemented. In future justification
|
Properties defined in @a overlay take precedence over those in @a base.
|
||||||
may be supported
|
Properties undefined/invalid in both are undefined in the result.
|
||||||
when printing or previewing, only.
|
*/
|
||||||
|
static wxTextAttr Merge(const wxTextAttr& base,
|
||||||
|
const wxTextAttr& overlay);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Sets the paragraph alignment. See ::wxTextAttrAlignment enumeration values.
|
||||||
|
|
||||||
|
Of these, wxTEXT_ALIGNMENT_JUSTIFIED is unimplemented.
|
||||||
|
In future justification may be supported when printing or previewing, only.
|
||||||
*/
|
*/
|
||||||
void SetAlignment(wxTextAttrAlignment alignment);
|
void SetAlignment(wxTextAttrAlignment alignment);
|
||||||
|
|
||||||
@@ -434,8 +593,9 @@ public:
|
|||||||
/**
|
/**
|
||||||
Sets the standard bullet name, applicable if the bullet style is
|
Sets the standard bullet name, applicable if the bullet style is
|
||||||
wxTEXT_ATTR_BULLET_STYLE_STANDARD.
|
wxTEXT_ATTR_BULLET_STYLE_STANDARD.
|
||||||
See GetBulletName() for a list
|
|
||||||
of supported names, and how to expand the range of supported types.
|
See GetBulletName() for a list of supported names, and how
|
||||||
|
to expand the range of supported types.
|
||||||
*/
|
*/
|
||||||
void SetBulletName(const wxString& name);
|
void SetBulletName(const wxString& name);
|
||||||
|
|
||||||
@@ -445,15 +605,16 @@ public:
|
|||||||
void SetBulletNumber(int n);
|
void SetBulletNumber(int n);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Sets the bullet style. The following styles can be passed:
|
Sets the bullet style.
|
||||||
|
|
||||||
Currently wxTEXT_ATTR_BULLET_STYLE_BITMAP is not supported.
|
The ::wxTextAttrBulletStyle enumeration values are all supported,
|
||||||
|
except for wxTEXT_ATTR_BULLET_STYLE_BITMAP.
|
||||||
*/
|
*/
|
||||||
void SetBulletStyle(int style);
|
void SetBulletStyle(int style);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Sets the bullet text, which could be a symbol, or (for example) cached outline
|
Sets the bullet text, which could be a symbol, or (for example) cached
|
||||||
text.
|
outline text.
|
||||||
*/
|
*/
|
||||||
void SetBulletText(const wxString text);
|
void SetBulletText(const wxString text);
|
||||||
|
|
||||||
@@ -463,14 +624,14 @@ public:
|
|||||||
void SetCharacterStyleName(const wxString& name);
|
void SetCharacterStyleName(const wxString& name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Sets the flags determining which styles are being specified. The following
|
Sets the flags determining which styles are being specified.
|
||||||
flags can be passed in a bitlist:
|
The ::wxTextAttrFlags values can be passed in a bitlist.
|
||||||
*/
|
*/
|
||||||
void SetFlags(long flags);
|
void SetFlags(long flags);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Sets the attributes for the given font. Note that wxTextAttr does not store an
|
Sets the attributes for the given font.
|
||||||
actual wxFont object.
|
Note that wxTextAttr does not store an actual wxFont object.
|
||||||
*/
|
*/
|
||||||
void SetFont(const wxFont& font);
|
void SetFont(const wxFont& font);
|
||||||
|
|
||||||
@@ -507,26 +668,25 @@ public:
|
|||||||
/**
|
/**
|
||||||
Sets the left indent and left subindent in tenths of a millimetre.
|
Sets the left indent and left subindent in tenths of a millimetre.
|
||||||
The sub-indent is an offset from the left of the paragraph, and is used for all
|
The sub-indent is an offset from the left of the paragraph, and is used for all
|
||||||
but the
|
but the first line in a paragraph.
|
||||||
first line in a paragraph. A positive value will cause the first line to appear
|
|
||||||
to the left
|
A positive value will cause the first line to appear to the left
|
||||||
of the subsequent lines, and a negative value will cause the first line to be
|
of the subsequent lines, and a negative value will cause the first line to be
|
||||||
indented
|
indented relative to the subsequent lines.
|
||||||
relative to the subsequent lines.
|
|
||||||
wxRichTextBuffer uses indentation to render a bulleted item. The left indent is
|
wxRichTextBuffer uses indentation to render a bulleted item.
|
||||||
the distance between
|
The left indent is the distance between the margin and the bullet.
|
||||||
the margin and the bullet. The content of the paragraph, including the first
|
The content of the paragraph, including the first line, starts
|
||||||
line, starts
|
at leftMargin + leftSubIndent.
|
||||||
at leftMargin + leftSubIndent. So the distance between the left edge of the
|
So the distance between the left edge of the bullet and the
|
||||||
bullet and the
|
|
||||||
left of the actual paragraph is leftSubIndent.
|
left of the actual paragraph is leftSubIndent.
|
||||||
*/
|
*/
|
||||||
void SetLeftIndent(int indent, int subIndent = 0);
|
void SetLeftIndent(int indent, int subIndent = 0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Sets the line spacing. @a spacing is a multiple, where 10 means single-spacing,
|
Sets the line spacing. @a spacing is a multiple, where 10 means single-spacing,
|
||||||
15 means 1.5 spacing, and 20 means double spacing. The following constants are
|
15 means 1.5 spacing, and 20 means double spacing.
|
||||||
defined for convenience:
|
The ::wxTextAttrLineSpacing values are defined for convenience.
|
||||||
*/
|
*/
|
||||||
void SetLineSpacing(int spacing);
|
void SetLineSpacing(int spacing);
|
||||||
|
|
||||||
@@ -536,11 +696,10 @@ public:
|
|||||||
void SetListStyleName(const wxString& name);
|
void SetListStyleName(const wxString& name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Specifies the outline level. Zero represents normal text. At present, the
|
Specifies the outline level. Zero represents normal text.
|
||||||
outline level is
|
At present, the outline level is not used, but may be used in future for
|
||||||
not used, but may be used in future for determining list levels and for
|
determining list levels and for applications that need to store document
|
||||||
applications
|
structure information.
|
||||||
that need to store document structure information.
|
|
||||||
*/
|
*/
|
||||||
void SetOutlineLevel(int level);
|
void SetOutlineLevel(int level);
|
||||||
|
|
||||||
@@ -582,33 +741,34 @@ public:
|
|||||||
void SetTextColour(const wxColour& colText);
|
void SetTextColour(const wxColour& colText);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Sets the text effect bits of interest. You should also pass wxTEXT_ATTR_EFFECTS
|
Sets the text effect bits of interest.
|
||||||
to SetFlags().
|
|
||||||
|
You should also pass wxTEXT_ATTR_EFFECTS to SetFlags().
|
||||||
See SetFlags() for further information.
|
See SetFlags() for further information.
|
||||||
*/
|
*/
|
||||||
void SetTextEffectFlags(int flags);
|
void SetTextEffectFlags(int flags);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Sets the text effects, a bit list of styles.
|
Sets the text effects, a bit list of styles.
|
||||||
The following styles can be passed:
|
The ::wxTextAttrEffects enumeration values can be used.
|
||||||
|
|
||||||
Of these, only wxTEXT_ATTR_EFFECT_CAPITALS and wxTEXT_ATTR_EFFECT_STRIKETHROUGH
|
Of these, only wxTEXT_ATTR_EFFECT_CAPITALS and wxTEXT_ATTR_EFFECT_STRIKETHROUGH
|
||||||
are implemented.
|
are implemented.
|
||||||
|
|
||||||
wxTEXT_ATTR_EFFECT_CAPITALS capitalises text when displayed (leaving the case
|
wxTEXT_ATTR_EFFECT_CAPITALS capitalises text when displayed (leaving the case
|
||||||
of the actual buffer
|
of the actual buffer text unchanged), and wxTEXT_ATTR_EFFECT_STRIKETHROUGH draws
|
||||||
text unchanged), and wxTEXT_ATTR_EFFECT_STRIKETHROUGH draws a line through text.
|
a line through text.
|
||||||
|
|
||||||
To set effects, you should also pass wxTEXT_ATTR_EFFECTS to SetFlags(), and call
|
To set effects, you should also pass wxTEXT_ATTR_EFFECTS to SetFlags(), and call
|
||||||
SetTextEffectFlags() with the styles (taken from the
|
SetTextEffectFlags() with the styles (taken from the above set) that you
|
||||||
above set) that you are interested in setting.
|
are interested in setting.
|
||||||
*/
|
*/
|
||||||
void SetTextEffects(int effects);
|
void SetTextEffects(int effects);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Sets the URL for the content. Sets the wxTEXT_ATTR_URL style; content with this
|
Sets the URL for the content. Sets the wxTEXT_ATTR_URL style; content with this
|
||||||
style
|
style causes wxRichTextCtrl to show a hand cursor over it, and wxRichTextCtrl
|
||||||
causes wxRichTextCtrl to show a hand cursor over it, and wxRichTextCtrl
|
generates a wxTextUrlEvent when the content is clicked.
|
||||||
generates
|
|
||||||
a wxTextUrlEvent when the content is clicked.
|
|
||||||
*/
|
*/
|
||||||
void SetURL(const wxString& url);
|
void SetURL(const wxString& url);
|
||||||
|
|
||||||
@@ -618,32 +778,6 @@ public:
|
|||||||
void operator operator=(const wxTextAttr& attr);
|
void operator operator=(const wxTextAttr& attr);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
Describes the possible return values of wxTextCtrl::HitTest().
|
|
||||||
|
|
||||||
The element names correspond to the relationship between the point asked
|
|
||||||
for and the character returned, e.g. @c wxTE_HT_BEFORE means that the point
|
|
||||||
is before (leftward or upward) it and so on.
|
|
||||||
*/
|
|
||||||
enum wxTextCtrlHitTestResult
|
|
||||||
{
|
|
||||||
/// Indicates that wxTextCtrl::HitTest() is not implemented on this
|
|
||||||
/// platform.
|
|
||||||
wxTE_HT_UNKNOWN = -2,
|
|
||||||
|
|
||||||
/// The point is before the character returned.
|
|
||||||
wxTE_HT_BEFORE,
|
|
||||||
|
|
||||||
/// The point is directly on the character returned.
|
|
||||||
wxTE_HT_ON_TEXT,
|
|
||||||
|
|
||||||
/// The point is below the last line of the control.
|
|
||||||
wxTE_HT_BELOW,
|
|
||||||
|
|
||||||
/// The point is beyond the end of line containing the character returned.
|
|
||||||
wxTE_HT_BEYOND
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@class wxTextCtrl
|
@class wxTextCtrl
|
||||||
@@ -716,6 +850,11 @@ enum wxTextCtrlHitTestResult
|
|||||||
capitalized.
|
capitalized.
|
||||||
@endStyleTable
|
@endStyleTable
|
||||||
|
|
||||||
|
Note that alignment styles (wxTE_LEFT, wxTE_CENTRE and wxTE_RIGHT) can be
|
||||||
|
changed dynamically after control creation on wxMSW and wxGTK. wxTE_READONLY,
|
||||||
|
wxTE_PASSWORD and wrapping styles can be dynamically changed under wxGTK but
|
||||||
|
not wxMSW. The other styles can be only set during control creation.
|
||||||
|
|
||||||
|
|
||||||
@section textctrl_text_format wxTextCtrl Text Format
|
@section textctrl_text_format wxTextCtrl Text Format
|
||||||
|
|
||||||
@@ -840,17 +979,14 @@ enum wxTextCtrlHitTestResult
|
|||||||
wxID_REDO. The associated UI update events are also processed
|
wxID_REDO. The associated UI update events are also processed
|
||||||
automatically, when the control has the focus.
|
automatically, when the control has the focus.
|
||||||
|
|
||||||
To process input from a text control, use these event handler macros to
|
|
||||||
direct input to member functions that take a wxCommandEvent argument.
|
|
||||||
|
|
||||||
@beginEventTable{wxCommandEvent}
|
@beginEventTable{wxCommandEvent}
|
||||||
@event{EVT_TEXT(id, func)}
|
@event{EVT_TEXT(id, func)}
|
||||||
Respond to a wxEVT_COMMAND_TEXT_UPDATED event, generated when the text
|
Respond to a wxEVT_COMMAND_TEXT_UPDATED event, generated when the text
|
||||||
changes. Notice that this event will be sent when the text controls
|
changes. Notice that this event will be sent when the text controls
|
||||||
contents changes -- whether this is due to user input or comes from the
|
contents changes -- whether this is due to user input or comes from the
|
||||||
program itself (for example, if SetValue() is called); see
|
program itself (for example, if wxTextCtrl::SetValue() is called); see
|
||||||
ChangeValue() for a function which does not send this event. This
|
wxTextCtrl::ChangeValue() for a function which does not send this event.
|
||||||
event is however not sent during the control creation.
|
This event is however not sent during the control creation.
|
||||||
@event{EVT_TEXT_ENTER(id, func)}
|
@event{EVT_TEXT_ENTER(id, func)}
|
||||||
Respond to a wxEVT_COMMAND_TEXT_ENTER event, generated when enter is
|
Respond to a wxEVT_COMMAND_TEXT_ENTER event, generated when enter is
|
||||||
pressed in a text control which must have wxTE_PROCESS_ENTER style for
|
pressed in a text control which must have wxTE_PROCESS_ENTER style for
|
||||||
@@ -860,7 +996,7 @@ enum wxTextCtrlHitTestResult
|
|||||||
wxGTK2 only currently).
|
wxGTK2 only currently).
|
||||||
@event{EVT_TEXT_MAXLEN(id, func)}
|
@event{EVT_TEXT_MAXLEN(id, func)}
|
||||||
This event is generated when the user tries to enter more text into the
|
This event is generated when the user tries to enter more text into the
|
||||||
control than the limit set by SetMaxLength(), see its description.
|
control than the limit set by wxTextCtrl::SetMaxLength(), see its description.
|
||||||
@endEventTable
|
@endEventTable
|
||||||
|
|
||||||
@library{wxcore}
|
@library{wxcore}
|
||||||
@@ -872,12 +1008,10 @@ enum wxTextCtrlHitTestResult
|
|||||||
class wxTextCtrl : public wxControl
|
class wxTextCtrl : public wxControl
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
//@{
|
|
||||||
/**
|
/**
|
||||||
Constructor, creating and showing a text control.
|
Default ctor.
|
||||||
@see Create()
|
|
||||||
*/
|
*/
|
||||||
wxTextCtrl();
|
wxTextCtrl();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Constructor, creating and showing a text control.
|
Constructor, creating and showing a text control.
|
||||||
@@ -899,13 +1033,13 @@ public:
|
|||||||
@param name
|
@param name
|
||||||
Window name.
|
Window name.
|
||||||
|
|
||||||
@remarks The horizontal scrollbar (wxHSCROLL style flag) will only be
|
@remarks
|
||||||
|
The horizontal scrollbar (wxHSCROLL style flag) will only be
|
||||||
created for multi-line text controls. Without a horizontal
|
created for multi-line text controls. Without a horizontal
|
||||||
scrollbar, text lines that don't fit in the control's size will be
|
scrollbar, text lines that don't fit in the control's size will be
|
||||||
wrapped (but no newline character is inserted). Single line
|
wrapped (but no newline character is inserted).
|
||||||
controls don't have a horizontal scrollbar, the text is
|
Single line controls don't have a horizontal scrollbar, the text is
|
||||||
automatically scrolled so that the insertion point is always
|
automatically scrolled so that the insertion point is always visible.
|
||||||
visible.
|
|
||||||
|
|
||||||
@see Create(), wxValidator
|
@see Create(), wxValidator
|
||||||
*/
|
*/
|
||||||
@@ -916,7 +1050,6 @@ public:
|
|||||||
long style = 0,
|
long style = 0,
|
||||||
const wxValidator& validator = wxDefaultValidator,
|
const wxValidator& validator = wxDefaultValidator,
|
||||||
const wxString& name = wxTextCtrlNameStr);
|
const wxString& name = wxTextCtrlNameStr);
|
||||||
//@}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Destructor, destroying the text control.
|
Destructor, destroying the text control.
|
||||||
@@ -929,9 +1062,10 @@ public:
|
|||||||
@param text
|
@param text
|
||||||
Text to write to the text control.
|
Text to write to the text control.
|
||||||
|
|
||||||
@remarks After the text is appended, the insertion point will be at the
|
@remarks
|
||||||
|
After the text is appended, the insertion point will be at the
|
||||||
end of the text control. If this behaviour is not desired, the
|
end of the text control. If this behaviour is not desired, the
|
||||||
programmer should use GetInsertionPoint and SetInsertionPoint.
|
programmer should use GetInsertionPoint() and SetInsertionPoint().
|
||||||
|
|
||||||
@see WriteText()
|
@see WriteText()
|
||||||
*/
|
*/
|
||||||
@@ -1006,12 +1140,11 @@ public:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Sets the text value and marks the control as not-modified (which means
|
Sets the text value and marks the control as not-modified (which means
|
||||||
that IsModified() would return @false immediately after the call to
|
that IsModified() would return @false immediately after the call to SetValue()).
|
||||||
SetValue).
|
|
||||||
|
|
||||||
This functions does not generate the @c wxEVT_COMMAND_TEXT_UPDATED
|
This functions does not generate the @c wxEVT_COMMAND_TEXT_UPDATED
|
||||||
event but otherwise is identical to SetValue().
|
event but otherwise is identical to SetValue().
|
||||||
See @ref overview_progevent "this topic" for more information.
|
See @ref overview_eventhandling_prog for more information.
|
||||||
|
|
||||||
@since 2.7.1
|
@since 2.7.1
|
||||||
|
|
||||||
@@ -1064,14 +1197,12 @@ public:
|
|||||||
This functions inserts into the control the character which would have
|
This functions inserts into the control the character which would have
|
||||||
been inserted if the given key event had occurred in the text control.
|
been inserted if the given key event had occurred in the text control.
|
||||||
|
|
||||||
The @a event object should be the same as the one passed to @c
|
The @a event object should be the same as the one passed to @c EVT_KEY_DOWN
|
||||||
EVT_KEY_DOWN handler previously by wxWidgets. Please note that this
|
handler previously by wxWidgets. Please note that this function doesn't
|
||||||
function doesn't currently work correctly for all keys under any
|
currently work correctly for all keys under any platform but MSW.
|
||||||
platform but MSW.
|
|
||||||
|
|
||||||
@return
|
@return
|
||||||
@true if the event resulted in a change to the control, @false
|
@true if the event resulted in a change to the control, @false otherwise.
|
||||||
otherwise.
|
|
||||||
*/
|
*/
|
||||||
virtual bool EmulateKeyPress(const wxKeyEvent& event);
|
virtual bool EmulateKeyPress(const wxKeyEvent& event);
|
||||||
|
|
||||||
@@ -1088,9 +1219,20 @@ public:
|
|||||||
This is defined as the zero based index of the character position to
|
This is defined as the zero based index of the character position to
|
||||||
the right of the insertion point. For example, if the insertion point
|
the right of the insertion point. For example, if the insertion point
|
||||||
is at the end of the single-line text control, it is equal to both
|
is at the end of the single-line text control, it is equal to both
|
||||||
GetLastPosition() and GetValue().length() (but notice that the latter
|
GetLastPosition() and @c "GetValue().Length()" (but notice that the latter
|
||||||
equality is not necessarily true for multiline edit controls which may
|
equality is not necessarily true for multiline edit controls which may
|
||||||
use multiple new line characters).
|
use multiple new line characters).
|
||||||
|
|
||||||
|
The following code snippet safely returns the character at the insertion
|
||||||
|
point or the zero character if the point is at the end of the control.
|
||||||
|
|
||||||
|
@code
|
||||||
|
char GetCurrentChar(wxTextCtrl *tc) {
|
||||||
|
if (tc->GetInsertionPoint() == tc->GetLastPosition())
|
||||||
|
return '\0';
|
||||||
|
return tc->GetValue[tc->GetInsertionPoint()];
|
||||||
|
}
|
||||||
|
@endcode
|
||||||
*/
|
*/
|
||||||
virtual long GetInsertionPoint() const;
|
virtual long GetInsertionPoint() const;
|
||||||
|
|
||||||
@@ -1127,9 +1269,19 @@ public:
|
|||||||
/**
|
/**
|
||||||
Returns the number of lines in the text control buffer.
|
Returns the number of lines in the text control buffer.
|
||||||
|
|
||||||
@remarks Note that even empty text controls have one line (where the
|
@remarks
|
||||||
insertion point is), so GetNumberOfLines() never
|
Note that even empty text controls have one line (where the
|
||||||
returns 0.
|
insertion point is), so GetNumberOfLines() never returns 0.
|
||||||
|
For wxGTK using GTK+ 1.2.x and earlier, the number of lines in a
|
||||||
|
multi-line text control is calculated by actually counting newline
|
||||||
|
characters in the buffer, i.e. this function returns the number of
|
||||||
|
logical lines and doesn't depend on whether any of them are wrapped.
|
||||||
|
For all the other platforms, the number of physical lines in the
|
||||||
|
control is returned.
|
||||||
|
Also note that you may wish to avoid using functions that work with
|
||||||
|
line numbers if you are working with controls that contain large
|
||||||
|
amounts of text as this function has O(N) complexity for N being
|
||||||
|
the number of lines.
|
||||||
*/
|
*/
|
||||||
virtual int GetNumberOfLines() const;
|
virtual int GetNumberOfLines() const;
|
||||||
|
|
||||||
@@ -1185,6 +1337,7 @@ public:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Gets the contents of the control.
|
Gets the contents of the control.
|
||||||
|
|
||||||
Notice that for a multiline text control, the lines will be separated
|
Notice that for a multiline text control, the lines will be separated
|
||||||
by (Unix-style) @c \\n characters, even under Windows where they are
|
by (Unix-style) @c \\n characters, even under Windows where they are
|
||||||
separated by a @c \\r\\n sequence in the native control.
|
separated by a @c \\r\\n sequence in the native control.
|
||||||
@@ -1197,8 +1350,8 @@ public:
|
|||||||
|
|
||||||
If the return code is not @c wxTE_HT_UNKNOWN the row and column of the
|
If the return code is not @c wxTE_HT_UNKNOWN the row and column of the
|
||||||
character closest to this position are returned in the @a col and @a
|
character closest to this position are returned in the @a col and @a
|
||||||
row parameters (unless the pointers are @NULL which is allowed). Please
|
row parameters (unless the pointers are @NULL which is allowed).
|
||||||
note that this function is currently only implemented in wxUniv, wxMSW
|
Please note that this function is currently only implemented in wxUniv, wxMSW
|
||||||
and wxGTK2 ports.
|
and wxGTK2 ports.
|
||||||
|
|
||||||
@see PositionToXY(), XYToPosition()
|
@see PositionToXY(), XYToPosition()
|
||||||
@@ -1236,18 +1389,16 @@ public:
|
|||||||
virtual bool IsModified() const;
|
virtual bool IsModified() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Returns @true if this is a multi line edit control and @false
|
Returns @true if this is a multi line edit control and @false otherwise.
|
||||||
otherwise.
|
|
||||||
|
|
||||||
@see IsSingleLine()
|
@see IsSingleLine()
|
||||||
*/
|
*/
|
||||||
bool IsMultiLine() const;
|
bool IsMultiLine() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Returns @true if this is a single line edit control and @false
|
Returns @true if this is a single line edit control and @false otherwise.
|
||||||
otherwise.
|
|
||||||
|
|
||||||
@see @ref IsSingleLine() IsMultiLine
|
@see IsSingleLine(), IsMultiLine()
|
||||||
*/
|
*/
|
||||||
bool IsSingleLine() const;
|
bool IsSingleLine() const;
|
||||||
|
|
||||||
@@ -1317,8 +1468,8 @@ public:
|
|||||||
virtual void Redo();
|
virtual void Redo();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Removes the text starting at the first given position up to (but not
|
Removes the text starting at the first given position up to
|
||||||
including) the character at the last position.
|
(but not including) the character at the last position.
|
||||||
|
|
||||||
@param from
|
@param from
|
||||||
The first position.
|
The first position.
|
||||||
@@ -1328,8 +1479,8 @@ public:
|
|||||||
virtual void Remove(long from, long to);
|
virtual void Remove(long from, long to);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Replaces the text starting at the first position up to (but not
|
Replaces the text starting at the first position up to
|
||||||
including) the character at the last position with the given text.
|
(but not including) the character at the last position with the given text.
|
||||||
|
|
||||||
@param from
|
@param from
|
||||||
The first position.
|
The first position.
|
||||||
@@ -1361,8 +1512,9 @@ public:
|
|||||||
If either of the font, foreground, or background colour is not set in
|
If either of the font, foreground, or background colour is not set in
|
||||||
@a style, the values of the previous default style are used for them.
|
@a style, the values of the previous default style are used for them.
|
||||||
If the previous default style didn't set them neither, the global font
|
If the previous default style didn't set them neither, the global font
|
||||||
or colours of the text control itself are used as fall back. However if
|
or colours of the text control itself are used as fall back.
|
||||||
the @a style parameter is the default wxTextAttr, then the default
|
|
||||||
|
However if the @a style parameter is the default wxTextAttr, then the default
|
||||||
style is just reset (instead of being combined with the new style which
|
style is just reset (instead of being combined with the new style which
|
||||||
wouldn't change it at all).
|
wouldn't change it at all).
|
||||||
|
|
||||||
@@ -1410,15 +1562,17 @@ public:
|
|||||||
into the control.
|
into the control.
|
||||||
|
|
||||||
In other words, it allows to limit the text value length to @a len not
|
In other words, it allows to limit the text value length to @a len not
|
||||||
counting the terminating @c NUL character. If @a len is 0, the
|
counting the terminating @c NUL character.
|
||||||
previously set max length limit, if any, is discarded and the user may
|
|
||||||
enter as much text as the underlying native text control widget
|
If @a len is 0, the previously set max length limit, if any, is discarded
|
||||||
supports (typically at least 32Kb). If the user tries to enter more
|
and the user may enter as much text as the underlying native text control widget
|
||||||
characters into the text control when it already is filled up to the
|
supports (typically at least 32Kb).
|
||||||
maximal length, a @c wxEVT_COMMAND_TEXT_MAXLEN event is sent to notify
|
If the user tries to enter more characters into the text control when it
|
||||||
the program about it (giving it the possibility to show an explanatory
|
already is filled up to the maximal length, a @c wxEVT_COMMAND_TEXT_MAXLEN
|
||||||
message, for example) and the extra input is discarded. Note that in
|
event is sent to notify the program about it (giving it the possibility
|
||||||
wxGTK this function may only be used with single line text controls.
|
to show an explanatory message, for example) and the extra input is discarded.
|
||||||
|
|
||||||
|
Note that in wxGTK this function may only be used with single line text controls.
|
||||||
*/
|
*/
|
||||||
virtual void SetMaxLength(unsigned long len);
|
virtual void SetMaxLength(unsigned long len);
|
||||||
|
|
||||||
@@ -1477,8 +1631,7 @@ public:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Sets the text value and marks the control as not-modified (which means
|
Sets the text value and marks the control as not-modified (which means
|
||||||
that IsModified() would return @false immediately after the call to
|
that IsModified() would return @false immediately after the call to SetValue()).
|
||||||
SetValue).
|
|
||||||
|
|
||||||
Note that this function generates a @c wxEVT_COMMAND_TEXT_UPDATED
|
Note that this function generates a @c wxEVT_COMMAND_TEXT_UPDATED
|
||||||
event, to avoid this you can use ChangeValue() instead.
|
event, to avoid this you can use ChangeValue() instead.
|
||||||
@@ -1511,9 +1664,15 @@ public:
|
|||||||
@param text
|
@param text
|
||||||
Text to write to the text control.
|
Text to write to the text control.
|
||||||
|
|
||||||
@remarks Newlines in the text string are the only control characters
|
@remarks
|
||||||
allowed, and they will cause appropriate line breaks. See () and
|
Newlines in the text string are the only control characters
|
||||||
AppendText() for more convenient ways of writing to the window.
|
allowed, and they will cause appropriate line breaks.
|
||||||
|
See operator<<() and AppendText() for more convenient ways of
|
||||||
|
writing to the window.
|
||||||
|
After the write operation, the insertion point will be at the end
|
||||||
|
of the inserted text, so subsequent write operations will be appended.
|
||||||
|
To append text after the user may have interacted with the control,
|
||||||
|
call wxTextCtrl::SetInsertionPointEnd() before writing.
|
||||||
*/
|
*/
|
||||||
virtual void WriteText(const wxString& text);
|
virtual void WriteText(const wxString& text);
|
||||||
|
|
||||||
@@ -1561,11 +1720,13 @@ public:
|
|||||||
This class can be used to (temporarily) redirect all output sent to a C++
|
This class can be used to (temporarily) redirect all output sent to a C++
|
||||||
ostream object to a wxTextCtrl instead.
|
ostream object to a wxTextCtrl instead.
|
||||||
|
|
||||||
@note Some compilers and/or build configurations don't support multiply
|
@note
|
||||||
inheriting wxTextCtrl from @c std::streambuf in which
|
Some compilers and/or build configurations don't support multiply
|
||||||
case this class is not compiled in. You also must have @c wxUSE_STD_IOSTREAM
|
inheriting wxTextCtrl from @c std::streambuf in which case this class is
|
||||||
option on (i.e. set to 1) in your setup.h to be able to use it. Under Unix,
|
not compiled in.
|
||||||
specify @c --enable-std_iostreams switch when running configure for this.
|
You also must have @c wxUSE_STD_IOSTREAM option on (i.e. set to 1) in your
|
||||||
|
@c setup.h to be able to use it. Under Unix, specify @c --enable-std_iostreams
|
||||||
|
switch when running configure for this.
|
||||||
|
|
||||||
Example of usage:
|
Example of usage:
|
||||||
|
|
||||||
|
@@ -11,18 +11,40 @@
|
|||||||
|
|
||||||
This class represents a dialog that requests a one-line password string from
|
This class represents a dialog that requests a one-line password string from
|
||||||
the user.
|
the user.
|
||||||
|
|
||||||
It is implemented as a generic wxWidgets dialog.
|
It is implemented as a generic wxWidgets dialog.
|
||||||
|
|
||||||
@library{wxbase}
|
@library{wxbase}
|
||||||
@category{cmndlg}
|
@category{cmndlg}
|
||||||
|
|
||||||
@see @ref overview_wxpasswordentrydialogoverview "wxPassowrdEntryDialog
|
@see @ref overview_cmndlg_password
|
||||||
overview"
|
|
||||||
*/
|
*/
|
||||||
class wxPasswordEntryDialog : public wxTextEntryDialog
|
class wxPasswordEntryDialog : public wxTextEntryDialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/**
|
||||||
|
Constructor.
|
||||||
|
|
||||||
|
Use wxTextEntryDialog::ShowModal to show the dialog.
|
||||||
|
|
||||||
|
@param parent
|
||||||
|
Parent window.
|
||||||
|
@param message
|
||||||
|
Message to show on the dialog.
|
||||||
|
@param defaultValue
|
||||||
|
The default value, which may be the empty string.
|
||||||
|
@param style
|
||||||
|
A dialog style, specifying the buttons (wxOK, wxCANCEL) and an
|
||||||
|
optional wxCENTRE style. You do not need to specify the wxTE_PASSWORD style,
|
||||||
|
it is always applied.
|
||||||
|
@param pos
|
||||||
|
Dialog position.
|
||||||
|
*/
|
||||||
|
wxPasswordEntryDialog(wxWindow* parent, const wxString& message,
|
||||||
|
const wxString& caption = "Enter password",
|
||||||
|
const wxString& defaultValue = wxEmptyString,
|
||||||
|
long style = wxOK | wxCANCEL | wxCENTRE,
|
||||||
|
const wxPoint& pos = wxDefaultPosition);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -30,14 +52,13 @@ public:
|
|||||||
/**
|
/**
|
||||||
@class wxTextEntryDialog
|
@class wxTextEntryDialog
|
||||||
|
|
||||||
This class represents a dialog that requests a one-line text string from the
|
This class represents a dialog that requests a one-line text string from the user.
|
||||||
user.
|
|
||||||
It is implemented as a generic wxWidgets dialog.
|
It is implemented as a generic wxWidgets dialog.
|
||||||
|
|
||||||
@library{wxbase}
|
@library{wxbase}
|
||||||
@category{cmndlg}
|
@category{cmndlg}
|
||||||
|
|
||||||
@see @ref overview_wxtextentrydialogoverview "wxTextEntryDialog overview"
|
@see @ref overview_cmndlg_textentry
|
||||||
*/
|
*/
|
||||||
class wxTextEntryDialog : public wxDialog
|
class wxTextEntryDialog : public wxDialog
|
||||||
{
|
{
|
||||||
@@ -53,8 +74,8 @@ public:
|
|||||||
The default value, which may be the empty string.
|
The default value, which may be the empty string.
|
||||||
@param style
|
@param style
|
||||||
A dialog style, specifying the buttons (wxOK, wxCANCEL)
|
A dialog style, specifying the buttons (wxOK, wxCANCEL)
|
||||||
and an optional wxCENTRE style. Additionally, wxTextCtrl styles (such as
|
and an optional wxCENTRE style. Additionally, wxTextCtrl styles
|
||||||
wxTE_PASSWORD) may be specified here.
|
(such as wxTE_PASSWORD) may be specified here.
|
||||||
@param pos
|
@param pos
|
||||||
Dialog position.
|
Dialog position.
|
||||||
*/
|
*/
|
||||||
@@ -71,8 +92,7 @@ public:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Returns the text that the user has entered if the user has pressed OK, or the
|
Returns the text that the user has entered if the user has pressed OK, or the
|
||||||
original value
|
original value if the user has pressed Cancel.
|
||||||
if the user has pressed Cancel.
|
|
||||||
*/
|
*/
|
||||||
wxString GetValue() const;
|
wxString GetValue() const;
|
||||||
|
|
||||||
|
@@ -6,6 +6,18 @@
|
|||||||
// Licence: wxWindows license
|
// Licence: wxWindows license
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
/** The line termination type (kept wxTextFileType name for compability) */
|
||||||
|
enum wxTextFileType
|
||||||
|
{
|
||||||
|
wxTextFileType_None, //!< incomplete (the last line of the file only)
|
||||||
|
wxTextFileType_Unix, //!< line is terminated with 'LF' = 0xA = 10 = '\n'
|
||||||
|
wxTextFileType_Dos, //!< line is terminated with 'CR' 'LF'
|
||||||
|
wxTextFileType_Mac, //!< line is terminated with 'CR' = 0xD = 13 = '\r'
|
||||||
|
wxTextFileType_Os2 //!< line is terminated with 'CR' 'LF'
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@class wxTextFile
|
@class wxTextFile
|
||||||
|
|
||||||
@@ -18,38 +30,31 @@
|
|||||||
|
|
||||||
One word of warning: the class is not at all optimized for big files and thus
|
One word of warning: the class is not at all optimized for big files and thus
|
||||||
it will load the file entirely into memory when opened. Of course, you should
|
it will load the file entirely into memory when opened. Of course, you should
|
||||||
not
|
not work in this way with large files (as an estimation, anything over 1 Megabyte
|
||||||
work in this way with large files (as an estimation, anything over 1 Megabyte is
|
is surely too big for this class). On the other hand, it is not a serious
|
||||||
surely too big for this class). On the other hand, it is not a serious
|
|
||||||
limitation for small files like configuration files or program sources
|
limitation for small files like configuration files or program sources
|
||||||
which are well handled by wxTextFile.
|
which are well handled by wxTextFile.
|
||||||
|
|
||||||
The typical things you may do with wxTextFile in order are:
|
The typical things you may do with wxTextFile in order are:
|
||||||
|
|
||||||
Create and open it: this is done with either
|
- Create and open it: this is done with either wxTextFile::Create or wxTextFile::Open
|
||||||
wxTextFile::Create or wxTextFile::Open
|
function which opens the file (name may be specified either as the argument to
|
||||||
function which opens the file (name may be specified either as the argument to
|
these functions or in the constructor), reads its contents in memory (in the
|
||||||
these functions or in the constructor), reads its contents in memory (in the
|
case of @c Open()) and closes it.
|
||||||
case of @c Open()) and closes it.
|
- Work with the lines in the file: this may be done either with "direct
|
||||||
Work with the lines in the file: this may be done either with "direct
|
access" functions like wxTextFile::GetLineCount and wxTextFile::GetLine
|
||||||
access" functions like wxTextFile::GetLineCount and
|
(@e operator[] does exactly the same but looks more like array addressing)
|
||||||
wxTextFile::GetLine (@e operator[] does exactly the same
|
or with "sequential access" functions which include wxTextFile::GetFirstLine,
|
||||||
but looks more like array addressing) or with "sequential access" functions
|
wxTextFile::GetNextLine and also wxTextFile::GetLastLine, wxTextFile::GetPrevLine.
|
||||||
which include wxTextFile::GetFirstLine/
|
For the sequential access functions the current line number is maintained: it is
|
||||||
wxTextFile::GetNextLine and also
|
returned by wxTextFile::GetCurrentLine and may be changed with wxTextFile::GoToLine.
|
||||||
wxTextFile::GetLastLine/wxTextFile::GetPrevLine.
|
- Add/remove lines to the file: wxTextFile::AddLine and wxTextFile::InsertLine
|
||||||
For the sequential access functions the current line number is maintained: it is
|
add new lines while wxTextFile::RemoveLine deletes the existing ones.
|
||||||
returned by wxTextFile::GetCurrentLine and may be
|
wxTextFile::Clear resets the file to empty.
|
||||||
changed with wxTextFile::GoToLine.
|
- Save your changes: notice that the changes you make to the file will @b not be
|
||||||
Add/remove lines to the file: wxTextFile::AddLine and
|
saved automatically; calling wxTextFile::Close or doing nothing discards them!
|
||||||
wxTextFile::InsertLine add new lines while
|
To save the changes you must explicitly callwxTextFile::Write - here, you may
|
||||||
wxTextFile::RemoveLine deletes the existing ones.
|
also change the line termination type if you wish.
|
||||||
wxTextFile::Clear resets the file to empty.
|
|
||||||
Save your changes: notice that the changes you make to the file will @b not be
|
|
||||||
saved automatically; calling wxTextFile::Close or doing
|
|
||||||
nothing discards them! To save the changes you must explicitly call
|
|
||||||
wxTextFile::Write - here, you may also change the line
|
|
||||||
termination type if you wish.
|
|
||||||
|
|
||||||
|
|
||||||
@library{wxbase}
|
@library{wxbase}
|
||||||
@@ -60,6 +65,12 @@
|
|||||||
class wxTextFile
|
class wxTextFile
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/**
|
||||||
|
Default constructor, use Create() or Open() with a file name parameter to
|
||||||
|
initialize the object.
|
||||||
|
*/
|
||||||
|
wxTextFile();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Constructor does not load the file into memory, use Open() to do it.
|
Constructor does not load the file into memory, use Open() to do it.
|
||||||
*/
|
*/
|
||||||
@@ -82,21 +93,20 @@ public:
|
|||||||
void Clear() const;
|
void Clear() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Closes the file and frees memory, @b losing all changes. Use Write()
|
Closes the file and frees memory, @b "losing all changes".
|
||||||
if you want to save them.
|
Use Write() if you want to save them.
|
||||||
*/
|
*/
|
||||||
bool Close() const;
|
bool Close() const;
|
||||||
|
|
||||||
//@{
|
//@{
|
||||||
/**
|
/**
|
||||||
Creates the file with the given name or the name which was given in the
|
Creates the file with the given name or the name which was given in the
|
||||||
@ref ctor() constructor. The array of file lines is initially
|
@ref ctor() constructor. The array of file lines is initially empty.
|
||||||
empty.
|
|
||||||
It will fail if the file already exists, Open() should
|
It will fail if the file already exists, Open() should be used in this case.
|
||||||
be used in this case.
|
|
||||||
*/
|
*/
|
||||||
bool Create() const;
|
bool Create() const;
|
||||||
const bool Create(const wxString& strFile) const;
|
bool Create(const wxString& strFile) const;
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -113,41 +123,64 @@ public:
|
|||||||
/**
|
/**
|
||||||
Returns the current line: it has meaning only when you're using
|
Returns the current line: it has meaning only when you're using
|
||||||
GetFirstLine()/GetNextLine() functions, it doesn't get updated when
|
GetFirstLine()/GetNextLine() functions, it doesn't get updated when
|
||||||
you're using "direct access" functions like GetLine(). GetFirstLine() and
|
you're using "direct access" functions like GetLine().
|
||||||
GetLastLine() also change the value of the current line, as well as
|
GetFirstLine() and GetLastLine() also change the value of the current line,
|
||||||
GoToLine().
|
as well as GoToLine().
|
||||||
*/
|
*/
|
||||||
size_t GetCurrentLine() const;
|
size_t GetCurrentLine() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Get the line termination string corresponding to given constant. @e typeDefault
|
Get the line termination string corresponding to given constant.
|
||||||
is
|
|
||||||
the value defined during the compilation and corresponds to the native format
|
@e typeDefault is the value defined during the compilation and corresponds
|
||||||
of the platform, i.e. it will be wxTextFileType_Dos under Windows,
|
to the native format of the platform, i.e. it will be @c wxTextFileType_Dos
|
||||||
wxTextFileType_Unix under Unix (including Mac OS X when compiling with the
|
under Windows, @c wxTextFileType_Unix under Unix (including Mac OS X when
|
||||||
Apple Developer Tools) and wxTextFileType_Mac under Mac OS (including
|
compiling with the Apple Developer Tools) and @c wxTextFileType_Mac under
|
||||||
Mac OS X when compiling with CodeWarrior).
|
Mac OS (including Mac OS X when compiling with CodeWarrior).
|
||||||
*/
|
*/
|
||||||
static const char* GetEOL(wxTextFileType type = typeDefault) const;
|
static const char* GetEOL(wxTextFileType type = typeDefault) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This method together with GetNextLine()
|
This method together with GetNextLine() allows more "iterator-like"
|
||||||
allows more "iterator-like" traversal of the list of lines, i.e. you may
|
traversal of the list of lines, i.e. you may write something like:
|
||||||
write something like:
|
|
||||||
|
@code
|
||||||
|
wxTextFile file;
|
||||||
|
...
|
||||||
|
for ( str = file.GetFirstLine(); !file.Eof(); str = file.GetNextLine() )
|
||||||
|
{
|
||||||
|
// do something with the current line in str
|
||||||
|
}
|
||||||
|
// do something with the last line in str
|
||||||
|
@endcode
|
||||||
*/
|
*/
|
||||||
wxString GetFirstLine() const;
|
wxString GetFirstLine() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Gets the last line of the file. Together with
|
Gets the last line of the file.
|
||||||
GetPrevLine() it allows to enumerate the lines
|
|
||||||
|
Together with GetPrevLine() it allows to enumerate the lines
|
||||||
in the file from the end to the beginning like this:
|
in the file from the end to the beginning like this:
|
||||||
|
|
||||||
|
@code
|
||||||
|
wxTextFile file;
|
||||||
|
...
|
||||||
|
for ( str = file.GetLastLine();
|
||||||
|
file.GetCurrentLine() > 0;
|
||||||
|
str = file.GetPrevLine() )
|
||||||
|
{
|
||||||
|
// do something with the current line in str
|
||||||
|
}
|
||||||
|
// do something with the first line in str
|
||||||
|
@endcode
|
||||||
*/
|
*/
|
||||||
wxString GetLastLine();
|
wxString GetLastLine();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Retrieves the line number @a n from the file. The returned line may be
|
Retrieves the line number @a n from the file.
|
||||||
modified but you shouldn't add line terminator at the end - this will be done
|
|
||||||
by wxTextFile.
|
The returned line may be modified but you shouldn't add line terminator
|
||||||
|
at the end - this will be done by wxTextFile.
|
||||||
*/
|
*/
|
||||||
wxString GetLine(size_t n) const;
|
wxString GetLine(size_t n) const;
|
||||||
|
|
||||||
@@ -157,7 +190,7 @@ public:
|
|||||||
size_t GetLineCount() const;
|
size_t GetLineCount() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Get the type of the line (see also wxTextFile::GetEOL)
|
Get the type of the line (see also wxTextFile::GetEOL).
|
||||||
*/
|
*/
|
||||||
wxTextFileType GetLineType(size_t n) const;
|
wxTextFileType GetLineType(size_t n) const;
|
||||||
|
|
||||||
@@ -167,8 +200,7 @@ public:
|
|||||||
const char* GetName() const;
|
const char* GetName() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Gets the next line (see GetFirstLine() for
|
Gets the next line (see GetFirstLine() for the example).
|
||||||
the example).
|
|
||||||
*/
|
*/
|
||||||
wxString GetNextLine();
|
wxString GetNextLine();
|
||||||
|
|
||||||
@@ -178,20 +210,22 @@ public:
|
|||||||
wxString GetPrevLine();
|
wxString GetPrevLine();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Changes the value returned by GetCurrentLine()
|
Changes the value returned by GetCurrentLine() and used by GetFirstLine()
|
||||||
and used by wxTextFile::GetFirstLine/GetNextLine().
|
and GetNextLine().
|
||||||
*/
|
*/
|
||||||
void GoToLine(size_t n) const;
|
void GoToLine(size_t n) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Guess the type of file (which is supposed to be opened). If sufficiently
|
Guess the type of file (which is supposed to be opened).
|
||||||
many lines of the file are in DOS/Unix/Mac format, the corresponding value will
|
|
||||||
be returned. If the detection mechanism fails wxTextFileType_None is returned.
|
If sufficiently many lines of the file are in DOS/Unix/Mac format,
|
||||||
|
the corresponding value will be returned.
|
||||||
|
If the detection mechanism fails @c wxTextFileType_None is returned.
|
||||||
*/
|
*/
|
||||||
wxTextFileType GuessType() const;
|
wxTextFileType GuessType() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Insert a line before the line number @e n.
|
Insert a line before the line number @a n.
|
||||||
*/
|
*/
|
||||||
void InsertLine(const wxString& str, size_t n,
|
void InsertLine(const wxString& str, size_t n,
|
||||||
wxTextFileType type = typeDefault) const;
|
wxTextFileType type = typeDefault) const;
|
||||||
@@ -203,16 +237,16 @@ public:
|
|||||||
|
|
||||||
//@{
|
//@{
|
||||||
/**
|
/**
|
||||||
)
|
|
||||||
Open() opens the file with the given name or the name which was given in the
|
Open() opens the file with the given name or the name which was given in the
|
||||||
@ref ctor() constructor and also loads file in memory on
|
@ref ctor() constructor and also loads file in memory on success.
|
||||||
success. It will fail if the file does not exist,
|
|
||||||
Create() should be used in this case.
|
It will fail if the file does not exist, Create() should be used in this case.
|
||||||
The @e conv argument is only meaningful in Unicode build of wxWidgets when
|
|
||||||
|
The @a conv argument is only meaningful in Unicode build of wxWidgets when
|
||||||
it is used to convert the file to wide character representation.
|
it is used to convert the file to wide character representation.
|
||||||
*/
|
*/
|
||||||
bool Open() const;
|
bool Open(const wxMBConv& conv = wxConvAuto()) const;
|
||||||
const bool Open(const wxString& strFile) const;
|
bool Open(const wxString& strFile, const wxMBConv& conv = wxConvAuto()) const;
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -221,16 +255,21 @@ public:
|
|||||||
void RemoveLine(size_t n) const;
|
void RemoveLine(size_t n) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
)
|
Change the file on disk.
|
||||||
Change the file on disk. The @a typeNew parameter allows you to change the
|
|
||||||
file format (default argument means "don't change type") and may be used to
|
The @a typeNew parameter allows you to change the file format
|
||||||
convert, for example, DOS files to Unix.
|
(default argument means "don't change type") and may be used to convert,
|
||||||
The @e conv argument is only meaningful in Unicode build of wxWidgets when
|
for example, DOS files to Unix.
|
||||||
|
|
||||||
|
The @a conv argument is only meaningful in Unicode build of wxWidgets when
|
||||||
it is used to convert all lines to multibyte representation before writing them
|
it is used to convert all lines to multibyte representation before writing them
|
||||||
them to physical file.
|
them to physical file.
|
||||||
Returns @true if operation succeeded, @false if it failed.
|
|
||||||
|
@return
|
||||||
|
@true if operation succeeded, @false if it failed.
|
||||||
*/
|
*/
|
||||||
bool Write(wxTextFileType typeNew = wxTextFileType_None) const;
|
bool Write(wxTextFileType typeNew = wxTextFileType_None,
|
||||||
|
const wxMBConv& conv = wxConvAuto()) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The same as GetLine().
|
The same as GetLine().
|
||||||
|
@@ -98,7 +98,7 @@ enum wxZipFlags
|
|||||||
See @ref overview_archive_noseek.
|
See @ref overview_archive_noseek.
|
||||||
|
|
||||||
@library{wxbase}
|
@library{wxbase}
|
||||||
@category{archive}
|
@category{archive,streams}
|
||||||
|
|
||||||
@see @ref overview_archive_noseek, wxZipEntry, wxZipInputStream, wxZipOutputStream
|
@see @ref overview_archive_noseek, wxZipEntry, wxZipInputStream, wxZipOutputStream
|
||||||
*/
|
*/
|
||||||
@@ -160,7 +160,7 @@ public:
|
|||||||
- wxZipEntry::IsText
|
- wxZipEntry::IsText
|
||||||
|
|
||||||
@library{wxbase}
|
@library{wxbase}
|
||||||
@category{archive}
|
@category{archive,streams}
|
||||||
|
|
||||||
@see @ref overview_archive, wxZipInputStream, wxZipOutputStream, wxZipNotifier
|
@see @ref overview_archive, wxZipInputStream, wxZipOutputStream, wxZipNotifier
|
||||||
*/
|
*/
|
||||||
@@ -363,7 +363,7 @@ public:
|
|||||||
wxZipInputStream::SeekI() always returns ::wxInvalidOffset.
|
wxZipInputStream::SeekI() always returns ::wxInvalidOffset.
|
||||||
|
|
||||||
@library{wxbase}
|
@library{wxbase}
|
||||||
@category{streams}
|
@category{archive,streams}
|
||||||
|
|
||||||
@see @ref overview_archive, wxZipEntry, wxZipOutputStream
|
@see @ref overview_archive, wxZipEntry, wxZipOutputStream
|
||||||
*/
|
*/
|
||||||
@@ -445,7 +445,7 @@ public:
|
|||||||
See the base class for details.
|
See the base class for details.
|
||||||
|
|
||||||
@library{wxbase}
|
@library{wxbase}
|
||||||
@category{archive}
|
@category{archive,streams}
|
||||||
|
|
||||||
@see @ref overview_archive,
|
@see @ref overview_archive,
|
||||||
@ref overview_archive_generic,
|
@ref overview_archive_generic,
|
||||||
@@ -470,7 +470,7 @@ public:
|
|||||||
entry and begins the next.
|
entry and begins the next.
|
||||||
|
|
||||||
@library{wxbase}
|
@library{wxbase}
|
||||||
@category{streams}
|
@category{archive,streams}
|
||||||
|
|
||||||
@see @ref overview_archive, wxZipEntry, wxZipInputStream
|
@see @ref overview_archive, wxZipEntry, wxZipInputStream
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user