File: wx197.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 (112 lines) | stat: -rw-r--r-- 4,236 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<HTML>
<head><title>wxSashEvent</title></head>

<BODY BGCOLOR=#FFFFFF>
<A NAME="wxsashevent"></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="wx196.htm#wxregioniterator"><img align=center src="back.gif" BORDER=0 ALT="Previous"></A> <A HREF="wx198.htm#wxsashlayoutwindow"><img align=center src="forward.gif" BORDER=0 ALT="Next"></A> </CENTER><HR>

<H2>wxSashEvent</H2>
<P>
A sash event is sent when the sash of a <A HREF="wx199.htm#wxsashwindow">wxSashWindow</A> has been
dragged by the user.<P>
<B><FONT COLOR="#FF0000">Derived from</FONT></B><P>
<A HREF="wx52.htm#wxcommandevent">wxCommandEvent</A><BR>

<A HREF="wx84.htm#wxevent">wxEvent</A><BR>

<A HREF="wx158.htm#wxobject">wxObject</A><P>
<B><FONT COLOR="#FF0000">Include files</FONT></B><P>
&lt;wx/sashwin.h&gt;<P>
<B><FONT COLOR="#FF0000">Event table macros</FONT></B><P>
To process an activate event, use these event handler macros to direct input to a member
function that takes a wxSashEvent argument.<P>

<TABLE>


<TR><TD VALIGN=TOP>
<B>EVT_SASH_DRAGGED(id, func)</B>
</TD>

<TD VALIGN=TOP>
Process a wxEVT_SASH_DRAGGED event,
when the user has finished dragging a sash.
</TD></TR>


<TR><TD VALIGN=TOP>
<B>EVT_SASH_DRAGGED_RANGE(id1, id2, func)</B>
</TD>

<TD VALIGN=TOP>
Process a wxEVT_SASH_DRAGGED_RANGE event,
when the user has finished dragging a sash. The event handler is called when windows with ids in the
given range have their sashes dragged.
</TD></TR>


</TABLE>
<P>
<B><FONT COLOR="#FF0000">Data structures</FONT></B><P>
<FONT SIZE=2>
<PRE>
enum wxSashDragStatus
{
    wxSASH_STATUS_OK,
    wxSASH_STATUS_OUT_OF_RANGE
};
</PRE>
</FONT><P>
<B><FONT COLOR="#FF0000">Remarks</FONT></B><P>
When a sash belonging to a sash window is dragged by the user, and then released,
this event is sent to the window, where it may be processed by an event table
entry in a derived class, a plug-in event handler or an ancestor class.<P>
Note that the wxSashWindow doesn't change the window's size itself. It relies on the application's
event handler to do that. This is because the application may have to handle other consequences
of the resize, or it may wish to veto it altogether. The event handler should
look at the drag rectangle: see <A HREF="wx197.htm#wxsasheventgetdragrect">wxSashEvent::GetDragRect</A> to see
what the new size of the window would be if the resize were to be applied. It should
also call <A HREF="wx197.htm#wxsasheventgetdragstatus">wxSashEvent::GetDragStatus</A> to see whether the
drag was OK or out of the current allowed range.<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx199.htm#wxsashwindow">wxSashWindow</A>,
<A HREF="wx299.htm#eventhandlingoverview">Event handling overview</A><P>
<B><FONT COLOR="#FF0000">Members</FONT></B><P>
<A HREF="#topic800">wxSashEvent::wxSashEvent</A><BR>
<A HREF="#wxsasheventgetedge">wxSashEvent::GetEdge</A><BR>
<A HREF="#wxsasheventgetdragrect">wxSashEvent::GetDragRect</A><BR>
<A HREF="#wxsasheventgetdragstatus">wxSashEvent::GetDragStatus</A><BR>
<P>

<HR>
<A NAME="topic800"></A>
<H3>wxSashEvent::wxSashEvent</H3>
<P>
<B></B> <B>wxSashEvent</B>(<B>int </B><I>id = 0</I>, <B>wxSashEdgePosition</B><I> edge = wxSASH_NONE</I>)<P>
Constructor.<P>

<HR>
<A NAME="wxsasheventgetedge"></A>
<H3>wxSashEvent::GetEdge</H3>
<P>
<B>wxSashEdgePosition</B> <B>GetEdge</B>() <B>const</B><P>
Returns the dragged edge. The return value is one of wxSASH_TOP, wxSASH_RIGHT, wxSASH_BOTTOM, wxSASH_LEFT.<P>

<HR>
<A NAME="wxsasheventgetdragrect"></A>
<H3>wxSashEvent::GetDragRect</H3>
<P>
<B>wxRect</B> <B>GetDragRect</B>() <B>const</B><P>
Returns the rectangle representing the new size the window would be if the resize was applied. It is
up to the application to set the window size if required.<P>

<HR>
<A NAME="wxsasheventgetdragstatus"></A>
<H3>wxSashEvent::GetDragStatus</H3>
<P>
<B>wxSashDragStatus</B> <B>GetDragStatus</B>() <B>const</B><P>
Returns the status of the sash: one of wxSASH_STATUS_OK, wxSASH_STATUS_OUT_OF_RANGE.
If the drag caused the notional bounding box of the window to flip over, for example, the drag will be out of rage.<P>


</BODY></HTML>