wxRuby Documentation Home

# Wx::DocParentFrame

The DocParentFrame class provides a default top-level frame for
applications using the document/view framework. This class can only be used for SDI (not MDI) parent frames.

It cooperates with the View, Document,
DocManager and DocTemplates classes.

See the example application in `samples/docview`.

## Derived from

Frame

Window

EvtHandler

Object

## See also

Document/view overview, Frame

## Methods

- DocParentFrame.new
- DocParentFrame#on_close_window

### DocParentFrame.new

DocParentFrame.new(%(arg-type)DocManager% manager, Frame parent, Integer id, String title, Point pos = DEFAULT_POSITION, Size size = DEFAULT_SIZE, Integer style = DEFAULT_FRAME_STYLE, String name = “frame”)

Constructor.

destructor()

Destructor.

### DocParentFrame#on_close_window

on_close_window(%(arg-type)CloseEvent% event)

Deletes all views and documents. If no user input cancelled the
operation, the frame will be destroyed and the application will exit.

Since understanding how document/view clean-up takes place can be difficult,
the implementation of this function is shown below.

void DocParentFrame::OnCloseWindow(CloseEvent& event) { if (m_docManager→Clear(!event.CanVeto())) { this→Destroy(); } else event.Veto(); }

[This page automatically generated from the Textile source at 2023-06-09 00:45:30 +0000]