Padre-Plugin-WxWidgets
view release on metacpan or search on metacpan
share/doc/wxwidgets.pod view on Meta::CPAN
wxString GetFilename() const
Gets the filename associated with this document, or "" if none is
associated.
=head2 Wx::Document::GetFirstView
wxView * GetFirstView() const
A convenience function to get the first view for a document, because
in many cases a document will only have a single view.
See also: GetViews
=head2 Wx::Document::GetPrintableName
virtual void GetPrintableName(wxString& name) const
Copies a suitable document name into the supplied name buffer. The
default function uses the title, or if there is no title, uses the
filename; or if no filename, the string unnamed.
wxPerl note: In wxPerl this function must return the modified name
rather than just modifying the argument.
=head2 Wx::Document::GetTitle
wxString GetTitle() const
Gets the title for this document. The document title is used for an
associated frame (if any), and is usually constructed by the framework
from the filename.
=head2 Wx::Document::GetViews
wxList & GetViews() const
Returns the list whose elements are the views on the document.
See also: GetFirstView
=head2 Wx::Document::IsModified
virtual bool IsModified() const
Returns true if the document has been modified since the last save,
false otherwise. You may need to override this if your document view
maintains its own record of being modified (for example if using
wxTextWindow to view and edit the document).
See also Modify.
=head2 Wx::Document::LoadObject
virtual istream& LoadObject(istream& stream)
virtual wxInputStream& LoadObject(wxInputStream& stream)
Override this function and call it from your own LoadObject before
streaming your own data. LoadObject is called by the framework
automatically when the document contents need to be loaded.
Note that only one of these forms exists, depending on how wxWidgets
was configured.
=head2 Wx::Document::Modify
virtual void Modify(bool modify)
Call with true to mark the document as modified since the last save,
false otherwise. You may need to override this if your document view
maintains its own record of being modified (for example if using
wxTextWindow to view and edit the document).
See also IsModified.
=head2 Wx::Document::OnChangedViewList
virtual void OnChangedViewList()
Called when a view is added to or deleted from this document. The
default implementation saves and deletes the document if no views
exist (the last one has just been removed).
=head2 Wx::Document::OnCloseDocument
virtual bool OnCloseDocument()
The default implementation calls DeleteContents (an empty
implementation) sets the modified flag to false. Override this to
supply additional behaviour when the document is closed with Close.
=head2 Wx::Document::OnCreate
virtual bool OnCreate(const wxString& path, long flags)
Called just after the document object is created to give it a chance
to initialize itself. The default implementation uses the template
associated with the document to create an initial view. If this
function returns false, the document is deleted.
=head2 Wx::Document::OnCreateCommandProcessor
virtual wxCommandProcessor* OnCreateCommandProcessor()
Override this function if you want a different (or no) command
processor to be created when the document is created. By default, it
returns an instance of wxCommandProcessor.
See wxCommandProcessor.
=head2 Wx::Document::OnNewDocument
virtual bool OnNewDocument()
The default implementation calls OnSaveModified and DeleteContents,
makes a default title for the document, and notifies the views that
the filename (in fact, the title) has changed.
=head2 Wx::Document::OnOpenDocument
virtual bool OnOpenDocument(const wxString& filename)
Constructs an input file stream for the given filename (which must not
be empty), and calls LoadObject. If LoadObject returns true, the
document is set to unmodified; otherwise, an error message box is
displayed. The document's views are notified that the filename has
changed, to give windows an opportunity to update their titles. All of
the document's views are then updated.
=head2 Wx::Document::OnSaveDocument
virtual bool OnSaveDocument(const wxString& filename)
Constructs an output file stream for the given filename (which must
not be empty), and calls SaveObject. If SaveObject returns true, the
document is set to unmodified; otherwise, an error message box is
displayed.
=head2 Wx::Document::OnSaveModified
virtual bool OnSaveModified()
If the document has been modified, prompts the user to ask if the
changes should be changed. If the user replies Yes, the Save function
is called. If No, the document is marked as unmodified and the
function succeeds. If Cancel, the function fails.
=head2 Wx::Document::RemoveView
virtual bool RemoveView(wxView* view)
Removes the view from the document's list of views, and calls
OnChangedViewList.
=head2 Wx::Document::Save
virtual bool Save()
Saves the document by calling OnSaveDocument if there is an associated
filename, or SaveAs if there is no filename.
=head2 Wx::Document::SaveAs
virtual bool SaveAs()
Prompts the user for a file to save to, and then calls OnSaveDocument.
=head2 Wx::Document::SaveObject
virtual ostream& SaveObject(ostream& stream)
virtual wxOutputStream& SaveObject(wxOutputStream& stream)
Override this function and call it from your own SaveObject before
streaming your own data. SaveObject is called by the framework
automatically when the document contents need to be saved.
Note that only one of these forms exists, depending on how wxWidgets
was configured.
=head2 Wx::Document::SetCommandProcessor
virtual void SetCommandProcessor(wxCommandProcessor *processor)
Sets the command processor to be used for this document. The document
will then be responsible for its deletion. Normally you should not
call this; override OnCreateCommandProcessor instead.
See wxCommandProcessor.
=head2 Wx::Document::SetDocumentName
void SetDocumentName(const wxString& name)
Sets the document type name for this document. See the comment for
documentTypeName.
=head2 Wx::Document::SetDocumentTemplate
void SetDocumentTemplate(wxDocTemplate* templ)
Sets the pointer to the template that created the document. Should
only be called by the framework.
=head2 Wx::Document::SetFilename
void SetFilename(const wxString& filename, bool notifyViews = false)
Sets the filename for this document. Usually called by the framework.
If notifyViews is true, wxView::OnChangeFilename is called for all
views.
=head2 Wx::Document::SetTitle
void SetTitle(const wxString& title)
Sets the title for this document. The document title is used for an
associated frame (if any), and is usually constructed by the framework
from the filename.
=head2 Wx::Document::UpdateAllViews
void UpdateAllViews(wxView* sender = NULL, wxObject* hint = NULL)
Updates all views. If sender is non-NULL, does not update this view.
hint represents optional information to allow a view to optimize its
update.
=head1 Wx::DragImage
=head2 Wx::DragImage::new
wxDragImage()
share/doc/wxwidgets.pod view on Meta::CPAN
The parent of the toolbar must be this frame.
If you wish to manage your own toolbar (or perhaps you have more than
one), don't call this function, and instead manage your subwindows and
the MDI client window by providing an OnSize event handler. Call
wxMDIParentFrame::GetClientSize to find how much space there is for
your windows.
Note that SDI (normal) frames and MDI child windows must always have
their toolbars managed by the application.
See also
wxMDIParentFrame::GetToolBar, wxMDIParentFrame::GetClientSize
=head2 Wx::MDIParentFrame::SetWindowMenu
void SetWindowMenu(wxMenu* menu)
Call this to change the current Window menu. Ownership of the menu
object passes to the frame when you call this function.
This call is available under Windows only.
To remove the window completely, use the wxFRAME_NO_WINDOW_MENU window
style.
=head2 Wx::MDIParentFrame::Tile
void Tile(wxOrientation orient = wxHORIZONTAL)
Tiles the MDI child windows either horizontally or vertically
depending on whether orient is wxHORIZONTAL or wxVERTICAL.
Currently only implemented for MSW, does nothing under the other
platforms.
See also
wxMDIParentFrame::Cascade, wxMDIParentFrame::ArrangeIcons
=head1 Wx::MediaCtrl
=head2 Rendering media
Depending upon the backend, wxMediaCtrl can render and display pretty
much any kind of media that the native system can - such as an image,
mpeg video, or mp3 (without license restrictions - since it relies on
native system calls that may not technically have mp3 decoding
available, for example, it falls outside the realm of licensing
restrictions).
For general operation, all you need to do is call wxMediaCtrl::Load to
load the file you want to render, catch the EVT_MEDIA_LOADED event,
and then call wxMediaCtrl::Play to show the video/audio of the media
in that event.
More complex operations are generally more heavily dependant on the
capabilities of the backend. For example, QuickTime cannot set the
playback rate of certain streaming media - while DirectShow is
slightly more flexible in that regard.
=head2 Operation
When wxMediaCtrl plays a file, it plays until the stop position is
reached (currently the end of the file/stream). Right before it hits
the end of the stream, it fires off a EVT_MEDIA_STOP event to its
parent window, at which point the event handler can choose to veto the
event, preventing the stream from actually stopping.
Example:
//connect to the media event
this->Connect(wxMY_ID, wxEVT_MEDIA_STOP, (wxObjectEventFunction)
(wxEventFunction)(wxMediaEventFunction) &MyFrame::OnMediaStop);
=head2 Video size
By default, wxMediaCtrl will scale the size of the video to the
requested amount passed to either it's constructor or Create(). After
calling Load or performing an equivilant operation, you can
subsequently obtain the "real" size of the video (if there is any) by
calling GetBestSize(). Note that the actual result on the display will
be slightly different when ShowPlayerControls is activated and the
actual video size will be less then specified due to the extra
controls provided by the native toolkit. In addition, the backend may
modify GetBestSize() to include the size of the extra controls - so if
you want the real size of the video just disable ShowPlayerControls().
The idea with setting GetBestSize to the size of the video is that
GetBestSize is a wxWindow-derived function that is called when sizers
on a window recalculate. What this means is that if you use sizers by
default the video will show in it's original size without any extra
assistance needed from the user.
=head2 Player controls
Normally, when you use wxMediaCtrl it is just a window for the video
to play in. However, some toolkits have their own media player
interface. For example, QuickTime generally has a bar below the video
with a slider. A special feature available to wxMediaCtrl, you can use
the toolkit's interface instead of making your own by using the
ShowPlayerControls() function. There are several options for the flags
parameter, with the two general flags being
wxMEDIACTRLPLAYERCONTROLS_NONE which turns off the native interface,
and wxMEDIACTRLPLAYERCONTROLS_DEFAULT which lets wxMediaCtrl decide
what native controls on the interface. Be sure to review the caveats
outlined in Video size before doing so.
=head2 Choosing a backend
Generally, you should almost certainly leave this part up to
wxMediaCtrl - but if you need a certain backend for a particular
reason, such as QuickTime for playing .mov files, all you need to do
to choose a specific backend is to pass the name of the backend class
to wxMediaCtrl::Create.
The following are valid backend identifiers -
=head2 Creating a backend
( run in 0.985 second using v1.01-cache-2.11-cpan-140bd7fdf52 )