File: wx77.htm

package info (click to toggle)
wxwin2-doc 2.01-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 6,540 kB
  • ctags: 5,968
  • sloc: cpp: 15,157; makefile: 434; sh: 6
file content (71 lines) | stat: -rw-r--r-- 2,926 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<HTML>
<head><title>wxDocParentFrame</title></head>

<BODY BGCOLOR=#FFFFFF>
<A NAME="wxdocparentframe"></A><CENTER>
<A HREF="wx.htm"><img align=center src="contents.gif" BORDER=0 ALT="Contents"></A> <A HREF="wx22.htm#classref"><img align=center src="up.gif" BORDER=0 ALT="Up"></A> <A HREF="wx76.htm#wxdocmdiparentframe"><img align=center src="back.gif" BORDER=0 ALT="Previous"></A> <A HREF="wx78.htm#wxdoctemplate"><img align=center src="forward.gif" BORDER=0 ALT="Next"></A> </CENTER><HR>

<H2>wxDocParentFrame</H2>
<P>
The wxDocParentFrame 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.<P>
It cooperates with the <A HREF="wx258.htm#wxview">wxView</A>, <A HREF="wx79.htm#wxdocument">wxDocument</A>,
<A HREF="wx74.htm#wxdocmanager">wxDocManager</A> and <A HREF="wx78.htm#wxdoctemplate">wxDocTemplates</A> classes.<P>
See the example application in <TT>samples/docview</TT>.<P>
<B><FONT COLOR="#FF0000">Derived from</FONT></B><P>
<A HREF="wx104.htm#wxframe">wxFrame</A><BR>

<A HREF="wx260.htm#wxwindow">wxWindow</A><BR>

<A HREF="wx85.htm#wxevthandler">wxEvtHandler</A><BR>

<A HREF="wx158.htm#wxobject">wxObject</A><P>
<B><FONT COLOR="#FF0000">Include files</FONT></B><P>
&lt;wx/docview.h&gt;<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx298.htm#docviewoverview">Document/view overview</A>, <A HREF="wx104.htm#wxframe">wxFrame</A><P>
<B><FONT COLOR="#FF0000">Members</FONT></B><P>
<A HREF="#topic262">wxDocParentFrame::wxDocParentFrame</A><BR>
<A HREF="#topic263">wxDocParentFrame::~wxDocParentFrame</A><BR>
<A HREF="#topic264">wxDocParentFrame::OnCloseWindow</A><BR>
<P>

<HR>
<A NAME="topic262"></A>
<H3>wxDocParentFrame::wxDocParentFrame</H3>
<P>
<B></B> <B>wxDocParentFrame</B>(<B>wxDocManager*</B><I> manager</I>, <B>wxFrame *</B><I>parent</I>, <B>wxWindowID</B><I> id</I>,
 <B>const wxString&amp; </B><I>title</I>, <B>const wxPoint&amp;</B><I> pos = wxDefaultPosition</I>,
 <B>const wxSize&amp;</B><I> size = wxDefaultSize</I>,
 <B>long</B><I> style = wxDEFAULT_FRAME_STYLE</I>, <B>const wxString&amp; </B><I>name = "frame"</I>)<P>
Constructor.<P>

<HR>
<A NAME="topic263"></A>
<H3>wxDocParentFrame::~wxDocParentFrame</H3>
<P>
<B></B> <B>~wxDocParentFrame</B>()<P>
Destructor.<P>

<HR>
<A NAME="topic264"></A>
<H3>wxDocParentFrame::OnCloseWindow</H3>
<P>
<B>void</B> <B>OnCloseWindow</B>(<B>wxCloseEvent&amp;</B><I> event</I>)<P>
Deletes all views and documents. If no user input cancelled the
operation, the frame will be destroyed and the application will exit.<P>
Since understanding how document/view clean-up takes place can be difficult,
the implementation of this function is shown below.<P>
<PRE>
void wxDocParentFrame::OnCloseWindow(wxCloseEvent& event)
{
  if (m_docManager-&gt;Clear(!event.CanVeto()))
  {
    this-&gt;Destroy();
  }
  else
    event.Veto();
}
</PRE>

</BODY></HTML>