view release on metacpan or search on metacpan
share/doc/wxwidgets.pod view on Meta::CPAN
Constructor.
=head2 Wx::ClientData::DESTROY
~wxClientData()
Virtual destructor.
=head1 Wx::ClientDataContainer
=head2 Wx::ClientDataContainer::new
wxClientDataContainer()
=head2 Wx::ClientDataContainer::DESTROY
~wxClientDataContainer()
=head2 Wx::ClientDataContainer::GetClientData
void* GetClientData() const
Get the untyped client data.
=head2 Wx::ClientDataContainer::GetClientObject
wxClientData* GetClientObject() const
Get a pointer to the client data object.
=head2 Wx::ClientDataContainer::SetClientData
void SetClientData(void* data)
Set the untyped client data.
=head2 Wx::ClientDataContainer::SetClientObject
void SetClientObject(wxClientData* data)
Set the client data object. Any previous object will be deleted.
=head1 Wx::Clipboard
=head2 Wx::Clipboard::new
wxClipboard()
Constructor.
=head2 Wx::Clipboard::DESTROY
~wxClipboard()
Destructor.
=head2 Wx::Clipboard::AddData
bool AddData(wxDataObject* data)
Call this function to add the data object to the clipboard. You may
call this function repeatedly after having cleared the clipboard using
wxClipboard::Clear.
After this function has been called, the clipboard owns the data, so
do not delete the data explicitly.
See also
wxClipboard::SetData
=head2 Wx::Clipboard::Clear
void Clear()
Clears the global clipboard object and the system's clipboard if
possible.
=head2 Wx::Clipboard::Close
void Close()
Call this function to close the clipboard, having opened it with
wxClipboard::Open.
=head2 Wx::Clipboard::Flush
bool Flush()
Flushes the clipboard: this means that the data which is currently on
clipboard will stay available even after the application exits
(possibly eating memory), otherwise the clipboard will be emptied on
exit. Returns false if the operation is unsuccessful for any reason.
=head2 Wx::Clipboard::GetData
bool GetData(wxDataObject& data)
Call this function to fill data with data on the clipboard, if
available in the required format. Returns true on success.
=head2 Wx::Clipboard::IsOpened
bool IsOpened() const
Returns true if the clipboard has been opened.
=head2 Wx::Clipboard::IsSupported
bool IsSupported(const wxDataFormat& format)
Returns true if there is data which matches the data format of the
given data object currently available (IsSupported sounds like a
misnomer, FIXME: better deprecate this name?) on the clipboard.
=head2 Wx::Clipboard::Open
bool Open()
Call this function to open the clipboard before calling
wxClipboard::SetData and wxClipboard::GetData.
Call wxClipboard::Close when you have finished with the clipboard. You
should keep the clipboard open for only a very short time.
Returns true on success. This should be tested (as in the sample shown
above).
=head2 Wx::Clipboard::SetData
bool SetData(wxDataObject* data)
Call this function to set the data object to the clipboard. This
function will clear all previous contents in the clipboard, so calling
it several times does not make any sense.
After this function has been called, the clipboard owns the data, so
do not delete the data explicitly.
See also
wxClipboard::AddData
=head2 Wx::Clipboard::UsePrimarySelection
void UsePrimarySelection(bool primary = true)
On platforms supporting it (currently only GTK), selects the so called
PRIMARY SELECTION as the clipboard as opposed to the normal clipboard,
if primary is true.
=head1 Wx::ClipboardTextEvent
=head2 Wx::ClipboardTextEvent::new
wxClipboardTextEvent(wxEventType commandType = wxEVT_NULL, int id = 0)
=head1 Wx::CloseEvent
=head2 Wx::CloseEvent::new
wxCloseEvent(WXTYPE commandEventType = 0, int id = 0)
Constructor.
=head2 Wx::CloseEvent::CanVeto
bool CanVeto()
Returns true if you can veto a system shutdown or a window close
event. Vetoing a window close event is not possible if the calling
code wishes to force the application to exit, and so this function
must be called to check this.
=head2 Wx::CloseEvent::GetLoggingOff
bool GetLoggingOff() const
Returns true if the user is just logging off or false if the system is
shutting down. This method can only be called for end session and
query end session events, it doesn't make sense for close window
event.
=head2 Wx::CloseEvent::SetCanVeto
void SetCanVeto(bool canVeto)
Sets the 'can veto' flag.
=head2 Wx::CloseEvent::SetForce
void SetForce(bool force) const
Sets the 'force' flag.
=head2 Wx::CloseEvent::SetLoggingOff
void SetLoggingOff(bool loggingOff) const
Sets the 'logging off' flag.
=head2 Wx::CloseEvent::Veto
void Veto(bool veto = true)
Call this from your event handler to veto a system shutdown or to
signal to the calling application that a window close did not happen.
You can only veto a shutdown if wxCloseEvent::CanVeto returns true.
share/doc/wxwidgets.pod view on Meta::CPAN
n
Number of strings with which to initialise the control.
choices
An array of strings with which to initialise the control.
style
Window style. See wxComboBox.
validator
Window validator.
name
Window name.
See also
wxComboBox::Create, wxValidator
wxPython note: The wxComboBox constructor in wxPython reduces the n
and choices arguments are to a single argument, which is a list of
strings.
wxPerl note: In wxPerl there is just an array reference in place of n
and choices.
=head2 Wx::ComboBox::DESTROY
~wxComboBox()
Destructor, destroying the combobox.
=head2 Wx::ComboBox::Create
bool Create(wxWindow* parent, wxWindowID id, const wxString& value =
"", const wxPoint& pos = wxDefaultPosition, const wxSize& size =
wxDefaultSize, int n, const wxString choices[], long style = 0, const
wxValidator& validator = wxDefaultValidator, const wxString& name =
"comboBox")
bool Create(wxWindow* parent, wxWindowID id, const wxString& value,
const wxPoint& pos, const wxSize& size, const wxArrayString& choices,
long style = 0, const wxValidator& validator = wxDefaultValidator,
const wxString& name = "comboBox")
Creates the combobox for two-step construction. Derived classes should
call or replace this function. See wxComboBox::wxComboBox for further
details.
=head2 Wx::ComboBox::CanCopy
bool CanCopy() const
Returns true if the combobox is editable and there is a text selection
to copy to the clipboard. Only available on Windows.
=head2 Wx::ComboBox::CanCut
bool CanCut() const
Returns true if the combobox is editable and there is a text selection
to copy to the clipboard. Only available on Windows.
=head2 Wx::ComboBox::CanPaste
bool CanPaste() const
Returns true if the combobox is editable and there is text on the
clipboard that can be pasted into the text field. Only available on
Windows.
=head2 Wx::ComboBox::CanRedo
bool CanRedo() const
Returns true if the combobox is editable and the last undo can be
redone. Only available on Windows.
=head2 Wx::ComboBox::CanUndo
bool CanUndo() const
Returns true if the combobox is editable and the last edit can be
undone. Only available on Windows.
=head2 Wx::ComboBox::Copy
void Copy()
Copies the selected text to the clipboard.
=head2 Wx::ComboBox::Cut
void Cut()
Copies the selected text to the clipboard and removes the selection.
=head2 Wx::ComboBox::GetCurrentSelection
int GetCurrentSelection() const
This function does the same things as wxChoice::GetCurrentSelection
and returns the item currently selected in the dropdown list if it's
open or the same thing as GetSelection otherwise.
=head2 Wx::ComboBox::GetInsertionPoint
long GetInsertionPoint() const
Returns the insertion point for the combobox's text field.
Note: Under wxMSW, this function always returns 0 if the combobox
doesn't have the focus.
=head2 Wx::ComboBox::GetLastPosition
virtual wxTextPos GetLastPosition() const
Returns the last position in the combobox text field.
=head2 Wx::ComboBox::GetSelection
void GetSelection(long *from, long *to) const
This is the same as wxTextCtrl::GetSelection for the text control
which is part of the combobox. Notice that this is a different method
from wxControlWithItems::GetSelection.
Currently this method is only implemented in wxMSW and wxGTK.
=head2 Wx::ComboBox::GetValue
wxString GetValue() const
Returns the current value in the combobox text field.
=head2 Wx::ComboBox::Paste
void Paste()
Pastes text from the clipboard to the text field.
=head2 Wx::ComboBox::Redo
void Redo()
Redoes the last undo in the text field. Windows only.
=head2 Wx::ComboBox::Replace
void Replace(long from, long to, const wxString& text)
Replaces the text between two positions with the given text, in the
combobox text field.
Parameters
from
The first position.
to
The second position.
text
The text to insert.
=head2 Wx::ComboBox::Remove
void Remove(long from, long to)
Removes the text between the two positions in the combobox text field.
Parameters
from
The first position.
to
The last position.
=head2 Wx::ComboBox::SetInsertionPoint
void SetInsertionPoint(long pos)
Sets the insertion point in the combobox text field.
Parameters
pos
The new insertion point.
=head2 Wx::ComboBox::SetInsertionPointEnd
void SetInsertionPointEnd()
share/doc/wxwidgets.pod view on Meta::CPAN
size
Window size. If the default size (-1, -1) is specified then the
window is sized appropriately.
style
Window style. See wxComboCtrl.
validator
Window validator.
name
Window name.
See also
wxComboCtrl::Create, wxValidator
=head2 Wx::ComboCtrl::DESTROY
~wxComboCtrl()
Destructor, destroying the combo control.
=head2 Wx::ComboCtrl::AnimateShow
virtual bool AnimateShow(const wxRect& rect, int flags)
This member function is not normally called in application code.
Instead, it can be implemented in a derived class to create a custom
popup animation.
Parameters
Same as in DoShowPopup.
Return value
true if animation finishes before the function returns. false
otherwise. In the latter case you need to manually call DoShowPopup
after the animation ends.
=head2 Wx::ComboCtrl::Create
bool Create(wxWindow* parent, wxWindowID id, const wxString& value =
"", const wxPoint& pos = wxDefaultPosition, const wxSize& size =
wxDefaultSize, long style = 0, const wxValidator& validator =
wxDefaultValidator, const wxString& name = "comboCtrl")
Creates the combo control for two-step construction. Derived classes
should call or replace this function. See wxComboCtrl::wxComboCtrl for
further details.
=head2 Wx::ComboCtrl::Copy
void Copy()
Copies the selected text to the clipboard.
=head2 Wx::ComboCtrl::Cut
void Cut()
Copies the selected text to the clipboard and removes the selection.
=head2 Wx::ComboCtrl::DoSetPopupControl
void DoSetPopupControl(wxComboPopup* popup)
This member function is not normally called in application code.
Instead, it can be implemented in a derived class to return default
wxComboPopup, incase popup is NULL.
Note: If you have implemented OnButtonClick to do something else than
show the popup, then DoSetPopupControl must always return NULL.
=head2 Wx::ComboCtrl::DoShowPopup
virtual void DoShowPopup(const wxRect& rect, int flags)
This member function is not normally called in application code.
Instead, it must be called in a derived class to make sure popup is
properly shown after a popup animation has finished (but only if
AnimateShow did not finish the animation within it's function scope).
Parameters
rect
Position to show the popup window at, in screen coordinates.
flags
Combination of any of the following:
=head2 Wx::ComboCtrl::EnablePopupAnimation
void EnablePopupAnimation(bool enable = true)
Enables or disables popup animation, if any, depending on the value of
the argument.
=head2 Wx::ComboCtrl::GetBitmapDisabled
const wxBitmap& GetBitmapDisabled() const
Returns disabled button bitmap that has been set with SetButtonBitmaps.
Return value
A reference to the disabled state bitmap.
=head2 Wx::ComboCtrl::GetBitmapHover
const wxBitmap& GetBitmapHover() const
Returns button mouse hover bitmap that has been set with
SetButtonBitmaps.
Return value
A reference to the mouse hover state bitmap.
=head2 Wx::ComboCtrl::GetBitmapNormal
share/doc/wxwidgets.pod view on Meta::CPAN
=head2 Wx::ComboCtrl::GetPopupWindow
wxWindow* GetPopupWindow() const
Returns popup window containing the popup control.
=head2 Wx::ComboCtrl::GetTextCtrl
wxTextCtrl* GetTextCtrl() const
Get the text control which is part of the combo control.
=head2 Wx::ComboCtrl::GetTextIndent
wxCoord GetTextIndent() const
Returns actual indentation in pixels.
=head2 Wx::ComboCtrl::GetTextRect
const wxRect& GetTextRect() const
Returns area covered by the text field (includes everything except
borders and the dropdown button).
=head2 Wx::ComboCtrl::GetValue
wxString GetValue() const
Returns text representation of the current value. For writable combo
control it always returns the value in the text field.
=head2 Wx::ComboCtrl::HidePopup
void HidePopup()
Dismisses the popup window.
=head2 Wx::ComboCtrl::IsPopupShown
bool IsPopupShown() const
Returns true if the popup is currently shown
=head2 Wx::ComboCtrl::OnButtonClick
void OnButtonClick()
Implement in a derived class to define what happens on dropdown button
click.
Default action is to show the popup.
Note: If you implement this to do something else than show the popup,
you must then also implement DoSetPopupControl to always return NULL.
=head2 Wx::ComboCtrl::Paste
void Paste()
Pastes text from the clipboard to the text field.
=head2 Wx::ComboCtrl::Remove
void Remove(long from, long to)
Removes the text between the two positions in the combo control text
field.
Parameters
from
The first position.
to
The last position.
=head2 Wx::ComboCtrl::Replace
void Replace(long from, long to, const wxString& value)
Replaces the text between two positions with the given text, in the
combo control text field.
Parameters
from
The first position.
to
The second position.
text
The text to insert.
=head2 Wx::ComboCtrl::SetButtonBitmaps
void SetButtonBitmaps(const wxBitmap& bmpNormal, bool pushButtonBg =
false, const wxBitmap& bmpPressed = wxNullBitmap, const wxBitmap&
bmpHover = wxNullBitmap, const wxBitmap& bmpDisabled = wxNullBitmap)
Sets custom dropdown button graphics.
Parameters
bmpNormal
Default button image.
=head2 Wx::ComboCtrl::SetButtonPosition
void SetButtonPosition(int width = -1, int height = -1, int side =
wxRIGHT, int spacingX = 0)
Sets size and position of dropdown button.
share/doc/wxwidgets.pod view on Meta::CPAN
virtual wxDC* GetDC()
Create DC on request. Internal.
=head2 Wx::DataViewCustomRenderer::GetSize
virtual wxSize GetSize()
Return size required to show content.
=head2 Wx::DataViewCustomRenderer::LeftClick
virtual bool LeftClick(wxPoint cursor, wxRect cell,
wxDataViewListModel* model, unsigned int col, unsigned int row)
Overrride this to react to a left click.
=head2 Wx::DataViewCustomRenderer::Render
virtual bool Render(wxRect cell, wxDC* dc, int state)
Override this to render the cell. Before this is called, SetValue was
called so that this instance knows what to render.
=head2 Wx::DataViewCustomRenderer::RightClick
virtual bool RightClick(wxPoint cursor, wxRect cell,
wxDataViewListModel* model, unsigned int col, unsigned int row)
Overrride this to react to a right click.
=head2 Wx::DataViewCustomRenderer::StartDrag
virtual bool StartDrag(wxPoint cursor, wxRect cell,
wxDataViewListModel* model, unsigned int col, unsigned int row)
Overrride this to start a drag operation.
=head1 Wx::DataObjectComposite
=head2 Wx::DataObjectComposite::new
wxDataObjectComposite()
The default constructor.
=head2 Wx::DataObjectComposite::Add
void Add( wxDataObjectSimple *dataObject, bool preferred = false)
Adds the dataObject to the list of supported objects and it becomes
the preferred object if preferred is true.
=head2 Wx::DataObjectComposite::GetReceivedFormat
wxDataFormat GetReceivedFormat() const
Report the format passed to the SetData method. This should be the
format of the data object within the composite that recieved data from
the clipboard or the DnD operation. You can use this method to find
out what kind of data object was recieved.
=head1 Wx::DataObjectSimple
=head2 Wx::DataObjectSimple::new
wxDataObjectSimple(const wxDataFormat& format = wxFormatInvalid)
Constructor accepts the supported format (none by default) which may
also be set later with SetFormat.
=head2 Wx::DataObjectSimple::GetFormat
const wxDataFormat& GetFormat() const
Returns the (one and only one) format supported by this object. It is
supposed that the format is supported in both directions.
=head2 Wx::DataObjectSimple::SetFormat
void SetFormat(const wxDataFormat& format)
Sets the supported format.
=head2 Wx::DataObjectSimple::GetDataSize
virtual size_t GetDataSize() const
Gets the size of our data. Must be implemented in the derived class if
the object supports rendering its data.
=head2 Wx::DataObjectSimple::GetDataHere
virtual bool GetDataHere(void *buf) const
Copy the data to the buffer, return true on success. Must be
implemented in the derived class if the object supports rendering its
data.
wxPython note: When implementing this method in wxPython, no
additional parameters are required and the data should be returned
from the method as a string.
=head2 Wx::DataObjectSimple::SetData
virtual bool SetData(size_t len, const void *buf)
Copy the data from the buffer, return true on success. Must be
implemented in the derived class if the object supports setting its
data.
wxPython note: When implementing this method in wxPython, the data
comes as a single string parameter rather than the two shown here.
=head1 Wx::DataOutputStream
=head2 Wx::DataOutputStream::new
wxDataOutputStream(wxOutputStream& stream)
share/doc/wxwidgets.pod view on Meta::CPAN
message
Message to show on the dialog.
caption
The dialog caption.
style
A dialog style (bitlist) containing flags chosen from the
following:
=head2 Wx::MessageDialog::DESTROY
~wxMessageDialog()
Destructor.
=head2 Wx::MessageDialog::ShowModal
int ShowModal()
Shows the dialog, returning one of wxID_OK, wxID_CANCEL, wxID_YES,
wxID_NO.
=head1 Wx::Metafile
=head2 Wx::Metafile::new
wxMetafile(const wxString& filename = "")
Constructor. If a filename is given, the Windows disk metafile is read
in. Check whether this was performed successfully by using the
wxMetafile:IsOk member.
=head2 Wx::Metafile::DESTROY
~wxMetafile()
Destructor. See reference-counted object destruction for more info.
=head2 Wx::Metafile::IsOk
bool Ok()
Returns true if the metafile is valid.
=head2 Wx::Metafile::Play
bool Play(wxDC *dc)
Plays the metafile into the given device context, returning true if
successful.
=head2 Wx::Metafile::SetClipboard
bool SetClipboard(int width = 0, int height = 0)
Passes the metafile data to the clipboard. The metafile can no longer
be used for anything, but the wxMetafile object must still be
destroyed by the application.
Below is a example of metafile, metafile device context and clipboard
use from the hello.cpp example. Note the way the metafile dimensions
are passed to the clipboard, making use of the device context's
ability to keep track of the maximum extent of drawing commands.
wxMetafileDC dc;
if (dc.Ok())
{
Draw(dc, false);
wxMetafile *mf = dc.Close();
if (mf)
{
bool success = mf->SetClipboard((int)(dc.MaxX() + 10), (int)(dc.MaxY() + 10));
delete mf;
}
}
=head1 Wx::MetafileDC
=head2 Wx::MetafileDC::new
wxMetafileDC(const wxString& filename = "")
Constructor. If no filename is passed, the metafile is created in
memory.
=head2 Wx::MetafileDC::DESTROY
~wxMetafileDC()
Destructor.
=head2 Wx::MetafileDC::Close
wxMetafile * Close()
This must be called after the device context is finished with. A
metafile is returned, and ownership of it passes to the calling
application (so it should be destroyed explicitly).
=head1 Wx::MimeTypesManager
=head2 Helper functions
All of these functions are static (i.e. don't need a
wxMimeTypesManager object to call them) and provide some useful
operations for string representations of MIME types. Their usage is
recommended instead of directly working with MIME types using wxString
functions.
IsOfType
=head2 Constructor and destructor
NB: You won't normally need to use more than one wxMimeTypesManager
object in a program.
wxMimeTypesManager
=head2 Query database
These functions are the heart of this class: they allow to find a file
type object from either file extension or MIME type. If the function
share/doc/wxwidgets.pod view on Meta::CPAN
=head2 Wx::RichTextBuffer::BeginStyle
bool BeginStyle(const wxTextAttrEx& style)
Begins using a specified style.
=head2 Wx::RichTextBuffer::BeginSuppressUndo
bool BeginSuppressUndo()
Begins suppressing undo/redo commands. The way undo is suppressed may
be implemented differently by each command. If not dealt with by a
command implementation, then it will be implemented automatically by
not storing the command in the undo history when the action is
submitted to the command processor.
=head2 Wx::RichTextBuffer::BeginStandardBullet
bool BeginStandardBullet(const wxString& bulletName, int leftIndent,
int leftSubIndent, int bulletStyle = wxTEXT_ATTR_BULLET_STYLE_STANDARD)
Begins applying a standard bullet, using one of the standard bullet
names (currently standard/circle or standard/square. See
BeginNumberedBullet for an explanation of how indentation is used to
render the bulleted paragraph.
=head2 Wx::RichTextBuffer::BeginSymbolBullet
bool BeginSymbolBullet(wxChar symbol, int leftIndent, int
leftSubIndent, int bulletStyle = wxTEXT_ATTR_BULLET_STYLE_SYMBOL)
Begins applying a symbol bullet, using a character from the current
font. See BeginNumberedBullet for an explanation of how indentation is
used to render the bulleted paragraph.
=head2 Wx::RichTextBuffer::BeginTextColour
bool BeginTextColour(const wxColour& colour)
Begins using the specified text foreground colour.
=head2 Wx::RichTextBuffer::BeginUnderline
bool BeginUnderline()
Begins using underline.
=head2 Wx::RichTextBuffer::BeginURL
bool BeginURL(const wxString& url, const wxString& characterStyle =
wxEmptyString)
Begins applying wxTEXT_ATTR_URL to the content. Pass a URL and
optionally, a character style to apply, since it is common to mark a
URL with a familiar style such as blue text with underlining.
=head2 Wx::RichTextBuffer::CanPasteFromClipboard
bool CanPasteFromClipboard() const
Returns true if content can be pasted from the clipboard.
=head2 Wx::RichTextBuffer::CleanUpHandlers
void CleanUpHandlers()
Cleans up the file handlers.
=head2 Wx::RichTextBuffer::Clear
void Clear()
Clears the buffer.
=head2 Wx::RichTextBuffer::ClearListStyle
bool ClearListStyle(const wxRichTextRange& range, int flags =
wxRICHTEXT_SETSTYLE_WITH_UNDO)
bool ClearListStyle(const wxRichTextRange& range, int flags =
wxRICHTEXT_SETSTYLE_WITH_UNDO)
Clears the list style from the given range, clearing list-related
attributes and applying any named paragraph style associated with each
paragraph.
flags is a bit list of the following:
=head2 Wx::RichTextBuffer::ClearStyleStack
void ClearStyleStack()
Clears the style stack.
=head2 Wx::RichTextBuffer::Clone
wxRichTextObject* Clone() const
Clones the object.
=head2 Wx::RichTextBuffer::Copy
void Copy(const wxRichTextBuffer& obj)
Copies the given buffer.
=head2 Wx::RichTextBuffer::CopyToClipboard
bool CopyToClipboard(const wxRichTextRange& range)
Copy the given range to the clipboard.
=head2 Wx::RichTextBuffer::DeleteRangeWithUndo
bool DeleteRangeWithUndo(const wxRichTextRange& range, wxRichTextCtrl*
ctrl)
Submits a command to delete the given range.
=head2 Wx::RichTextBuffer::Dump
void Dump()
void Dump(wxTextOutputStream& stream)
Dumps the contents of the buffer for debugging purposes.
=head2 Wx::RichTextBuffer::EndAlignment
bool EndAlignment()
Ends alignment.
=head2 Wx::RichTextBuffer::EndAllStyles
bool EndAllStyles()
Ends all styles that have been started with a Begin... command.
=head2 Wx::RichTextBuffer::EndBatchUndo
bool EndBatchUndo()
Ends collapsing undo/redo commands, and submits the combined command.
=head2 Wx::RichTextBuffer::EndBold
bool EndBold()
Ends using bold.
=head2 Wx::RichTextBuffer::EndCharacterStyle
bool EndCharacterStyle()
Ends using the named character style.
=head2 Wx::RichTextBuffer::EndFont
bool EndFont()
Ends using a font.
=head2 Wx::RichTextBuffer::EndFontSize
bool EndFontSize()
Ends using a point size.
=head2 Wx::RichTextBuffer::EndItalic
share/doc/wxwidgets.pod view on Meta::CPAN
bool InsertImageWithUndo(long pos, const wxRichTextImageBlock&
imageBlock, wxRichTextCtrl* ctrl)
Submits a command to insert the given image.
=head2 Wx::RichTextBuffer::InsertNewlineWithUndo
bool InsertNewlineWithUndo(long pos, wxRichTextCtrl* ctrl)
Submits a command to insert a newline.
=head2 Wx::RichTextBuffer::InsertTextWithUndo
bool InsertTextWithUndo(long pos, const wxString& text, wxRichTextCtrl*
ctrl)
Submits a command to insert the given text.
=head2 Wx::RichTextBuffer::IsModified
bool IsModified() const
Returns true if the buffer has been modified.
=head2 Wx::RichTextBuffer::LoadFile
bool LoadFile(wxInputStream& stream, int type = wxRICHTEXT_TYPE_ANY)
Loads content from a stream.
bool LoadFile(const wxString& filename, int type = wxRICHTEXT_TYPE_ANY)
Loads content from a file.
=head2 Wx::RichTextBuffer::Modify
void Modify(bool modify = true)
Marks the buffer as modified or unmodified.
=head2 Wx::RichTextBuffer::NumberList
bool NumberList(const wxRichTextRange& range, const
wxRichTextListStyleDefinition* style, int flags =
wxRICHTEXT_SETSTYLE_WITH_UNDO, int startFrom = -1, int listLevel = -1)
bool Number(const wxRichTextRange& range, const wxString& styleName,
int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int startFrom = -1, int
listLevel = -1)
Numbers the paragraphs in the given range. Pass flags to determine how
the attributes are set. Either the style definition or the name of the
style definition (in the current sheet) can be passed.
flags is a bit list of the following:
=head2 Wx::RichTextBuffer::PasteFromClipboard
bool PasteFromClipboard(long position)
Pastes the clipboard content to the buffer at the given position.
=head2 Wx::RichTextBuffer::PromoteList
bool PromoteList(int promoteBy, const wxRichTextRange& range, const
wxRichTextListStyleDefinition* style, int flags =
wxRICHTEXT_SETSTYLE_WITH_UNDO, int listLevel = -1)
bool PromoteList(int promoteBy, const wxRichTextRange& range, const
wxString& styleName, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int
listLevel = -1)
Promotes or demotes the paragraphs in the given range. A positive
promoteBy produces a smaller indent, and a negative number produces a
larger indent. Pass flags to determine how the attributes are set.
Either the style definition or the name of the style definition (in
the current sheet) can be passed.
flags is a bit list of the following:
=head2 Wx::RichTextBuffer::RemoveEventHandler
bool RemoveEventHandler(wxEvtHandler* handler, bool deleteHandler =
false)
Removes an event handler from the buffer's list of handlers, deleting
the object if deleteHandler is true.
=head2 Wx::RichTextBuffer::RemoveHandler
bool RemoveHandler(const wxString& name)
Removes a handler.
=head2 Wx::RichTextBuffer::ResetAndClearCommands
void ResetAndClearCommands()
Clears the buffer, adds a new blank paragraph, and clears the command
history.
=head2 Wx::RichTextBuffer::SaveFile
bool SaveFile(wxOutputStream& stream, int type = wxRICHTEXT_TYPE_ANY)
Saves content to a stream.
bool SaveFile(const wxString& filename, int type = wxRICHTEXT_TYPE_ANY)
Saves content to a file.
=head2 Wx::RichTextBuffer::SetBasicStyle
void SetBasicStyle(const wxRichTextAttr& style)
void SetBasicStyle(const wxTextAttrEx& style)
Sets the basic (overall) style. This is the style of the whole buffer
before further styles are applied, unlike the default style, which
only affects the style currently being applied (for example, setting
the default style to bold will cause subsequently inserted text to be
share/doc/wxwidgets.pod view on Meta::CPAN
after-paragraph spacing in tenths of a millimetre.
=head2 Wx::RichTextCtrl::BeginParagraphStyle
bool BeginParagraphStyle(const wxString& paragraphStyle)
Begins applying the named paragraph style.
=head2 Wx::RichTextCtrl::BeginRightIndent
bool BeginRightIndent(int rightIndent)
Begins a right indent, specified in tenths of a millimetre.
=head2 Wx::RichTextCtrl::BeginStyle
bool BeginStyle(const wxTextAttrEx& style)
Begins applying a style.
=head2 Wx::RichTextCtrl::BeginSuppressUndo
bool BeginSuppressUndo()
Starts suppressing undo history for commands.
=head2 Wx::RichTextCtrl::BeginSymbolBullet
bool BeginSymbolBullet(wxChar symbol, int leftIndent, int
leftSubIndent, int bulletStyle = wxTEXT_ATTR_BULLET_STYLE_SYMBOL)
Begins applying a symbol bullet, using a character from the current
font. See BeginNumberedBullet for an explanation of how indentation is
used to render the bulleted paragraph.
=head2 Wx::RichTextCtrl::BeginTextColour
bool BeginTextColour(const wxColour& colour)
Begins using this colour.
=head2 Wx::RichTextCtrl::BeginUnderline
bool BeginUnderline()
Begins using underlining.
=head2 Wx::RichTextCtrl::BeginURL
bool BeginURL(const wxString& url, const wxString& characterStyle =
wxEmptyString)
Begins applying wxTEXT_ATTR_URL to the content. Pass a URL and
optionally, a character style to apply, since it is common to mark a
URL with a familiar style such as blue text with underlining.
=head2 Wx::RichTextCtrl::CanCopy
bool CanCopy() const
Returns true if selected content can be copied to the clipboard.
=head2 Wx::RichTextCtrl::CanCut
bool CanCut() const
Returns true if selected content can be copied to the clipboard and
deleted.
=head2 Wx::RichTextCtrl::CanDeleteSelection
bool CanDeleteSelection() const
Returns true if selected content can be deleted.
=head2 Wx::RichTextCtrl::CanPaste
bool CanPaste() const
Returns true if the clipboard content can be pasted to the buffer.
=head2 Wx::RichTextCtrl::CanRedo
bool CanRedo() const
Returns true if there is a command in the command history that can be
redone.
=head2 Wx::RichTextCtrl::CanUndo
bool CanUndo() const
Returns true if there is a command in the command history that can be
undone.
=head2 Wx::RichTextCtrl::Clear
void Clear()
Clears the buffer content, leaving a single empty paragraph. Cannot be
undone.
=head2 Wx::RichTextCtrl::ClearListStyle
bool ClearListStyle(const wxRichTextRange& range, int flags =
wxRICHTEXT_SETSTYLE_WITH_UNDO)
bool ClearListStyle(const wxRichTextRange& range, int flags =
wxRICHTEXT_SETSTYLE_WITH_UNDO)
Clears the list style from the given range, clearing list-related
attributes and applying any named paragraph style associated with each
paragraph.
flags is a bit list of the following:
=head2 Wx::RichTextCtrl::Command
void Command(wxCommandEvent& event)
Sends the event to the control.
=head2 Wx::RichTextCtrl::Copy
void Copy()
Copies the selected content (if any) to the clipboard.
=head2 Wx::RichTextCtrl::Create
bool Create(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString&
value = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const
wxSize& size = wxDefaultSize, long style = wxRE_MULTILINE, const
wxValidator& validator = wxDefaultValidator, const wxString& name =
wxTextCtrlNameStr)
Creates the underlying window.
=head2 Wx::RichTextCtrl::Cut
void Cut()
Copies the selected content (if any) to the clipboard and deletes the
selection. This is undoable.
=head2 Wx::RichTextCtrl::Delete
bool Delete(const wxRichTextRange& range)
Deletes the content within the given range.
=head2 Wx::RichTextCtrl::DeleteSelectedContent
bool DeleteSelectedContent(long* newPos = NULL)
Deletes content if there is a selection, e.g. when pressing a key.
Returns the new caret position in newPos, or leaves it if there was no
action. This is undoable.
wxPerl note: In wxPerl this method takes no arguments and returns a
2-element list ( ok, newPos ).
=head2 Wx::RichTextCtrl::DeleteSelection
void DeleteSelection()
Deletes the content in the selection, if any. This is undoable.
=head2 Wx::RichTextCtrl::DiscardEdits
void DiscardEdits()
Sets the buffer's modified status to false, and clears the buffer's
command history.
=head2 Wx::RichTextCtrl::DoGetBestSize
wxSize DoGetBestSize() const
Currently this simply returns wxSize(10, 10).
=head2 Wx::RichTextCtrl::EndAlignment
bool EndAlignment()
Ends alignment.
=head2 Wx::RichTextCtrl::EndAllStyles
bool EndAllStyles()
Ends application of all styles in the current style stack.
=head2 Wx::RichTextCtrl::EndBatchUndo
bool EndBatchUndo()
Ends batching undo command history.
=head2 Wx::RichTextCtrl::EndBold
bool EndBold()
share/doc/wxwidgets.pod view on Meta::CPAN
Standard update handler for the wxID_CLEAR command.
=head2 Wx::RichTextCtrl::OnUpdateCopy
void OnUpdateCopy(wxUpdateUIEvent& event)
Standard update handler for the wxID_COPY command.
=head2 Wx::RichTextCtrl::OnUpdateCut
void OnUpdateCut(wxUpdateUIEvent& event)
Standard update handler for the wxID_CUT command.
=head2 Wx::RichTextCtrl::OnUpdatePaste
void OnUpdatePaste(wxUpdateUIEvent& event)
Standard update handler for the wxID_PASTE command.
=head2 Wx::RichTextCtrl::OnUpdateRedo
void OnUpdateRedo(wxUpdateUIEvent& event)
Standard update handler for the wxID_REDO command.
=head2 Wx::RichTextCtrl::OnUpdateSelectAll
void OnUpdateSelectAll(wxUpdateUIEvent& event)
Standard update handler for the wxID_SELECTALL command.
=head2 Wx::RichTextCtrl::OnUpdateUndo
void OnUpdateUndo(wxUpdateUIEvent& event)
Standard update handler for the wxID_UNDO command.
=head2 Wx::RichTextCtrl::PageDown
bool PageDown(int noPages = 1, int flags = 0)
Moves one or more pages down.
=head2 Wx::RichTextCtrl::PageUp
bool PageUp(int noPages = 1, int flags = 0)
Moves one or more pages up.
=head2 Wx::RichTextCtrl::PaintBackground
void PaintBackground(wxDC& dc)
Paints the background.
=head2 Wx::RichTextCtrl::Paste
void Paste()
Pastes content from the clipboard to the buffer.
=head2 Wx::RichTextCtrl::PositionCaret
void PositionCaret()
Internal function to position the visible caret according to the
current caret position.
=head2 Wx::RichTextCtrl::PositionToXY
bool PositionToXY(long pos, long* x, long* y) const
Converts a text position to zero-based column and line numbers.
=head2 Wx::RichTextCtrl::PromoteList
bool PromoteList(int promoteBy, const wxRichTextRange& range, const
wxRichTextListStyleDefinition* style, int flags =
wxRICHTEXT_SETSTYLE_WITH_UNDO, int listLevel = -1)
bool PromoteList(int promoteBy, const wxRichTextRange& range, const
wxString& styleName, int flags = wxRICHTEXT_SETSTYLE_WITH_UNDO, int
listLevel = -1)
Promotes or demotes the paragraphs in the given range. A positive
promoteBy produces a smaller indent, and a negative number produces a
larger indent. Pass flags to determine how the attributes are set.
Either the style definition or the name of the style definition (in
the current sheet) can be passed.
flags is a bit list of the following:
=head2 Wx::RichTextCtrl::Redo
void Redo()
Redoes the current command.
=head2 Wx::RichTextCtrl::Remove
void Remove(long from, long to)
Removes the content in the specified range.
=head2 Wx::RichTextCtrl::Replace
void Replace(long from, long to, const wxString& value)
Replaces the content in the specified range with the string specified
by value.
=head2 Wx::RichTextCtrl::SaveFile
bool SaveFile(const wxString& file = wxEmptyString, int type =
wxRICHTEXT_TYPE_ANY)
Saves the buffer content using the given type. If the specified type
is wxRICHTEXT_TYPE_ANY, the type is deduced from the filename
extension.
share/doc/wxwidgets.pod view on Meta::CPAN
Text control size.
style
Window style. See wxTextCtrl.
validator
Window validator.
name
Window name.
Remarks
The horizontal scrollbar (wxHSCROLL style flag) will only be created
for multi-line text controls. Without a horizontal scrollbar, text
lines that don't fit in the control's size will be wrapped (but no
newline character is inserted). Single line controls don't have a
horizontal scrollbar, the text is automatically scrolled so that the
insertion point is always visible.
See also
wxTextCtrl::Create, wxValidator
=head2 Wx::TextCtrl::DESTROY
~wxTextCtrl()
Destructor, destroying the text control.
=head2 Wx::TextCtrl::AppendText
void AppendText(const wxString& text)
Appends the text to the end of the text control.
Parameters
text
Text to write to the text control.
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 programmer
should use GetInsertionPoint and SetInsertionPoint.
See also
wxTextCtrl::WriteText
=head2 Wx::TextCtrl::CanCopy
virtual bool CanCopy()
Returns true if the selection can be copied to the clipboard.
=head2 Wx::TextCtrl::CanCut
virtual bool CanCut()
Returns true if the selection can be cut to the clipboard.
=head2 Wx::TextCtrl::CanPaste
virtual bool CanPaste()
Returns true if the contents of the clipboard can be pasted into the
text control. On some platforms (Motif, GTK) this is an approximation
and returns true if the control is editable, false otherwise.
=head2 Wx::TextCtrl::CanRedo
virtual bool CanRedo()
Returns true if there is a redo facility available and the last
operation can be redone.
=head2 Wx::TextCtrl::CanUndo
virtual bool CanUndo()
Returns true if there is an undo facility available and the last
operation can be undone.
=head2 Wx::TextCtrl::Clear
virtual void Clear()
Clears the text in the control.
Note that this function will generate a wxEVT_COMMAND_TEXT_UPDATED
event.
=head2 Wx::TextCtrl::Copy
virtual void Copy()
Copies the selected text to the clipboard under Motif and MS Windows.
=head2 Wx::TextCtrl::Create
bool Create(wxWindow* parent, wxWindowID id, const wxString& value =
"", const wxPoint& pos = wxDefaultPosition, const wxSize& size =
wxDefaultSize, long style = 0, const wxValidator& validator =
wxDefaultValidator, const wxString& name = wxTextCtrlNameStr)
Creates the text control for two-step construction. Derived classes
should call or replace this function. See wxTextCtrl::wxTextCtrl for
further details.
=head2 Wx::TextCtrl::Cut
virtual void Cut()
Copies the selected text to the clipboard and removes the selection.
=head2 Wx::TextCtrl::DiscardEdits
void DiscardEdits()
Resets the internal 'modified' flag as if the current edits had been
saved.
=head2 Wx::TextCtrl::EmulateKeyPress
bool EmulateKeyPress(const wxKeyEvent& event)
This functions inserts into the control the character which would have
been inserted if the given key event had occurred in the text control.
The event object should be the same as the one passed to EVT_KEY_DOWN
handler previously by wxWidgets.
Please note that this function doesn't currently work correctly for
all keys under any platform but MSW.
Return value
true if the event resulted in a change to the control, false
otherwise.
=head2 Wx::TextCtrl::GetDefaultStyle
const wxTextAttr& GetDefaultStyle() const
Returns the style currently used for the new text.
See also
SetDefaultStyle
=head2 Wx::TextCtrl::GetInsertionPoint
virtual long GetInsertionPoint() const
Returns the insertion point. 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 is at the end of the text control, it
is equal to both GetValue().Length() and GetLastPosition().
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.
char GetCurrentChar(wxTextCtrl *tc) {
if (tc->GetInsertionPoint() == tc->GetLastPosition())
return '\0';
return tc->GetValue[tc->GetInsertionPoint()];
}
=head2 Wx::TextCtrl::GetLastPosition
virtual wxTextPos GetLastPosition() const
Returns the zero based index of the last position in the text control,
which is equal to the number of characters in the control.
share/doc/wxwidgets.pod view on Meta::CPAN
See also
IsMultiLine
=head2 Wx::TextCtrl::LoadFile
bool LoadFile(const wxString& filename, int fileType = wxTEXT_TYPE_ANY)
Loads and displays the named file, if it exists.
Parameters
filename
The filename of the file to load.
fileType
The type of file to load. This is currently ignored in wxTextCtrl.
Return value
true if successful, false otherwise.
=head2 Wx::TextCtrl::MarkDirty
void MarkDirty()
Mark text as modified (dirty).
See also
IsModified
=head2 Wx::TextCtrl::OnDropFiles
void OnDropFiles(wxDropFilesEvent& event)
This event handler function implements default drag and drop
behaviour, which is to load the first dropped file into the control.
Parameters
event
The drop files event.
Remarks
This is not implemented on non-Windows platforms.
See also
wxDropFilesEvent
=head2 Wx::TextCtrl::Paste
virtual void Paste()
Pastes text from the clipboard to the text item.
=head2 Wx::TextCtrl::PositionToXY
bool PositionToXY(long pos, long *x, long *y) const
Converts given position to a zero-based column, line number pair.
Parameters
pos
Position.
x
Receives zero based column number.
y
Receives zero based line number.
Return value
true on success, false on failure (most likely due to a too large
position parameter).
See also
wxTextCtrl::XYToPosition
wxPython note: In Python, PositionToXY() returns a tuple containing
the x and y values, so (x,y) = PositionToXY() is equivalent to the
call described above.
wxPerl note: In wxPerl this method only takes the pos parameter, and
returns a 2-element list ( x, y ).
=head2 Wx::TextCtrl::Redo
virtual void Redo()
If there is a redo facility and the last operation can be redone,
redoes the last operation. Does nothing if there is no redo facility.
=head2 Wx::TextCtrl::Remove
virtual void Remove(long from, long to)
Removes the text starting at the first given position up to (but not
including) the character at the last position.
Parameters
from
The first position.
to
The last position.