nobody at rubyforge.org
2006-Dec-31 11:18 UTC
[Wxruby-development] [815] trunk/wxruby2/swig/classes: Added ContextMenuEvent class plus event handling methods
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!-- #msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; } #msg dt { float: left; width: 6em; font-weight: bold; } #msg dt:after { content:'':'';} #msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; } #msg dl a { font-weight: bold} #msg dl a:link { color:#fc3; } #msg dl a:active { color:#ff0; } #msg dl a:visited { color:#cc6; } h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; } #msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; } #msg ul, pre { overflow: auto; } #header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; } #patch { width: 100%; } #patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;} #patch .propset h4, #patch .binary h4 {margin:0;} #patch pre {padding:0;line-height:1.2em;margin:0;} #patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;} #patch .propset .diff, #patch .binary .diff {padding:10px 0;} #patch span {display:block;padding:0 10px;} #patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;} #patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;} #patch .lines, .info {color:#888;background:#fff;} --></style> <title>[815] trunk/wxruby2/swig/classes: Added ContextMenuEvent class plus event handling methods</title> </head> <body> <div id="msg"> <dl> <dt>Revision</dt> <dd>815</dd> <dt>Author</dt> <dd>brokentoy</dd> <dt>Date</dt> <dd>2006-12-31 06:18:32 -0500 (Sun, 31 Dec 2006)</dd> </dl> <h3>Log Message</h3> <pre>Added ContextMenuEvent class plus event handling methods</pre> <h3>Modified Paths</h3> <ul> <li><a href="#trunkwxruby2swigclassesEvtHandleri">trunk/wxruby2/swig/classes/EvtHandler.i</a></li> </ul> <h3>Added Paths</h3> <ul> <li><a href="#trunkwxruby2swigclassesContextMenuEventi">trunk/wxruby2/swig/classes/ContextMenuEvent.i</a></li> <li><a href="#trunkwxruby2swigclassesincludewxContextMenuEventh">trunk/wxruby2/swig/classes/include/wxContextMenuEvent.h</a></li> </ul> </div> <div id="patch"> <h3>Diff</h3> <a id="trunkwxruby2swigclassesContextMenuEventi"></a> <div class="addfile"><h4>Added: trunk/wxruby2/swig/classes/ContextMenuEvent.i (0 => 815)</h4> <pre class="diff"><span> <span class="info">--- trunk/wxruby2/swig/classes/ContextMenuEvent.i         (rev 0) +++ trunk/wxruby2/swig/classes/ContextMenuEvent.i        2006-12-31 11:18:32 UTC (rev 815) </span><span class="lines">@@ -0,0 +1,12 @@ </span><ins>+# Copyright 2004-2006 by Kevin Smith +# released under the MIT-style wxruby2 license + +%include "../common.i" + +%module(directors="1") wxContextMenuEvent + +%import "include/wxObject.h" +%import "include/wxEvent.h" +%import "include/wxCommandEvent.h" + +%include "include/wxContextMenuEvent.h" </ins></span></pre></div> <a id="trunkwxruby2swigclassesEvtHandleri"></a> <div class="modfile"><h4>Modified: trunk/wxruby2/swig/classes/EvtHandler.i (814 => 815)</h4> <pre class="diff"><span> <span class="info">--- trunk/wxruby2/swig/classes/EvtHandler.i        2006-12-31 04:04:00 UTC (rev 814) +++ trunk/wxruby2/swig/classes/EvtHandler.i        2006-12-31 11:18:32 UTC (rev 815) </span><span class="lines">@@ -66,6 +66,7 @@ </span><span class="cx"> extern swig_class cWxWindowCreateEvent; </span><span class="cx"> extern swig_class cWxWindowDestroyEvent; </span><span class="cx"> extern swig_class cWxMenuEvent; </span><ins>+extern swig_class cWxContextMenuEvent; </ins><span class="cx"> #ifdef WXSCINTILLA </span><span class="cx"> extern swig_class cWxScintillaEvent; </span><span class="cx"> #endif </span><span class="lines">@@ -322,6 +323,12 @@ </span><span class="cx"> (const wxEventType *)0 </span><span class="cx"> }; </span><span class="cx"> </span><ins>+static const wxEventType *contextMenuEvents[] +{ + &wxEVT_CONTEXT_MENU, + (const wxEventType *)0 +}; + </ins><span class="cx"> #ifdef WXSCINTILLA </span><span class="cx"> static const wxEventType *scintillaEvents[] </span><span class="cx"> { </span><span class="lines">@@ -426,6 +433,8 @@ </span><span class="cx"> cEvent = cWxWindowDestroyEvent.klass; </span><span class="cx"> else if(event.IsKindOf(CLASSINFO(wxMenuEvent))) </span><span class="cx"> cEvent = cWxMenuEvent.klass; </span><ins>+ else if(event.IsKindOf(CLASSINFO(wxContextMenuEvent))) + cEvent = cWxContextMenuEvent.klass; </ins><span class="cx"> else if(event.IsKindOf(CLASSINFO(wxSashEvent))) </span><span class="cx"> cEvent = cWxSashEvent.klass; </span><span class="cx"> else if(event.IsKindOf(CLASSINFO(wxTextUrlEvent))) </span></span></pre></div> <a id="trunkwxruby2swigclassesincludewxContextMenuEventh"></a> <div class="addfile"><h4>Added: trunk/wxruby2/swig/classes/include/wxContextMenuEvent.h (0 => 815)</h4> <pre class="diff"><span> <span class="info">--- trunk/wxruby2/swig/classes/include/wxContextMenuEvent.h         (rev 0) +++ trunk/wxruby2/swig/classes/include/wxContextMenuEvent.h        2006-12-31 11:18:32 UTC (rev 815) </span><span class="lines">@@ -0,0 +1,32 @@ </span><ins>+// Copyright 2004-2006 by Kevin Smith +// released under the MIT-style wxruby2 license + +#if !defined(_wxContextMenuEvent_h_) +#define _wxContextMenuEvent_h_ + + +class wxContextMenuEvent : public wxCommandEvent +{ +public: + wxContextMenuEvent(wxEventType type = wxEVT_NULL, + wxWindowID winid = 0, + const wxPoint& pt = wxDefaultPosition) + : wxCommandEvent(type, winid), + m_pos(pt) + { } + wxContextMenuEvent(const wxContextMenuEvent & event) + : wxCommandEvent(event), + m_pos(event.m_pos) + { } + + // Position of event (in screen coordinates) + const wxPoint& GetPosition() const { return m_pos; } + void SetPosition(const wxPoint& pos) { m_pos = pos; } + + virtual wxEvent *Clone() const { return new wxContextMenuEvent(*this); } + +protected: + wxPoint m_pos; +}; + +#endif </ins></span></pre> </div> </div> </body> </html>
Reasonably Related Threads
- [1042] trunk/wxruby2: Overhaul of the event handling WxType->RubyClass mapping to make it
- [790] trunk/wxruby2/swig/classes: Added TextUrlEvent class and EvtHandler mapping
- [982] branches/wxruby2/wxwidgets_282/swig/classes/EvtHandler.i: Add EvtThunker mapping for TimerEvent (bug 10391)
- [814] trunk/wxruby2/swig/classes: Added ScrollEvent class plus event processing and handler methods
- [723] trunk/wxruby2: Added WindowCreateEvent and WindowDestroyEvent + event handlers (AF)