nobody at rubyforge.org
2006-Dec-24 12:03 UTC
[Wxruby-development] [802] trunk/wxruby2/swig/classes: Add support for MenuEvent (MENU_OPEN, MENU_CLOSE, MENU_HIGHLIGHT)
<!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>[802] trunk/wxruby2/swig/classes: Add support for MenuEvent (MENU_OPEN, MENU_CLOSE, MENU_HIGHLIGHT)</title> </head> <body> <div id="msg"> <dl> <dt>Revision</dt> <dd>802</dd> <dt>Author</dt> <dd>brokentoy</dd> <dt>Date</dt> <dd>2006-12-24 07:03:48 -0500 (Sun, 24 Dec 2006)</dd> </dl> <h3>Log Message</h3> <pre>Add support for MenuEvent (MENU_OPEN, MENU_CLOSE, MENU_HIGHLIGHT)</pre> <h3>Modified Paths</h3> <ul> <li><a href="#trunkwxruby2swigclassesEvtHandleri">trunk/wxruby2/swig/classes/EvtHandler.i</a></li> <li><a href="#trunkwxruby2swigclassesincludewxMenuEventh">trunk/wxruby2/swig/classes/include/wxMenuEvent.h</a></li> </ul> <h3>Added Paths</h3> <ul> <li><a href="#trunkwxruby2swigclassesMenuEventi">trunk/wxruby2/swig/classes/MenuEvent.i</a></li> </ul> </div> <div id="patch"> <h3>Diff</h3> <a id="trunkwxruby2swigclassesEvtHandleri"></a> <div class="modfile"><h4>Modified: trunk/wxruby2/swig/classes/EvtHandler.i (801 => 802)</h4> <pre class="diff"><span> <span class="info">--- trunk/wxruby2/swig/classes/EvtHandler.i        2006-12-24 03:22:34 UTC (rev 801) +++ trunk/wxruby2/swig/classes/EvtHandler.i        2006-12-24 12:03:48 UTC (rev 802) </span><span class="lines">@@ -64,6 +64,7 @@ </span><span class="cx"> extern swig_class cWxActivateEvent; </span><span class="cx"> extern swig_class cWxWindowCreateEvent; </span><span class="cx"> extern swig_class cWxWindowDestroyEvent; </span><ins>+extern swig_class cWxMenuEvent; </ins><span class="cx"> #ifdef WXSCINTILLA </span><span class="cx"> extern swig_class cWxScintillaEvent; </span><span class="cx"> #endif </span><span class="lines">@@ -297,6 +298,14 @@ </span><span class="cx"> (const wxEventType *)0 </span><span class="cx"> }; </span><span class="cx"> </span><ins>+static const wxEventType *menuEvents[] +{ + &wxEVT_MENU_OPEN, + &wxEVT_MENU_CLOSE, + &wxEVT_MENU_HIGHLIGHT, + (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">@@ -397,6 +406,8 @@ </span><span class="cx"> cEvent = cWxWindowCreateEvent.klass; </span><span class="cx"> else if(event.IsKindOf(CLASSINFO(wxWindowDestroyEvent))) </span><span class="cx"> cEvent = cWxWindowDestroyEvent.klass; </span><ins>+ else if(event.IsKindOf(CLASSINFO(wxMenuEvent))) + cEvent = cWxMenuEvent.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 class="lines">@@ -1090,6 +1101,28 @@ </span><span class="cx"> { </span><span class="cx"> return internal_evt_no_parameters(argc, argv, self, wxEVT_DESTROY); </span><span class="cx"> } </span><ins>+ +static VALUE evt_menu_open(int argc, VALUE *argv, VALUE self) +{ + return internal_evt_no_parameters(argc, argv, self, wxEVT_MENU_OPEN); +} + +static VALUE evt_menu_close(int argc, VALUE *argv, VALUE self) +{ + return internal_evt_no_parameters(argc, argv, self, wxEVT_MENU_CLOSE); +} + +static VALUE evt_menu_highlight(int argc, VALUE *argv, VALUE self) +{ + return internal_evt_with_id(argc, argv, self, wxEVT_MENU_HIGHLIGHT); +} + +static VALUE evt_menu_highlight_all(int argc, VALUE *argv, VALUE self) +{ + return internal_evt_no_parameters(argc, argv, self, wxEVT_MENU_HIGHLIGHT_ALL); +} + + </ins><span class="cx"> // TODO: Add for ListEvent types? Is this needed? </span><span class="cx"> </span><span class="cx"> %} </span></span></pre></div> <a id="trunkwxruby2swigclassesMenuEventi"></a> <div class="addfile"><h4>Added: trunk/wxruby2/swig/classes/MenuEvent.i (0 => 802)</h4> <pre class="diff"><span> <span class="info">--- trunk/wxruby2/swig/classes/MenuEvent.i         (rev 0) +++ trunk/wxruby2/swig/classes/MenuEvent.i        2006-12-24 12:03:48 UTC (rev 802) </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") wxMenuEvent + + +%import "include/wxObject.h" +%import "include/wxEvent.h" + +%include "include/wxMenuEvent.h" </ins></span></pre></div> <a id="trunkwxruby2swigclassesincludewxMenuEventh"></a> <div class="modfile"><h4>Modified: trunk/wxruby2/swig/classes/include/wxMenuEvent.h (801 => 802)</h4> <pre class="diff"><span> <span class="info">--- trunk/wxruby2/swig/classes/include/wxMenuEvent.h        2006-12-24 03:22:34 UTC (rev 801) +++ trunk/wxruby2/swig/classes/include/wxMenuEvent.h        2006-12-24 12:03:48 UTC (rev 802) </span><span class="lines">@@ -1,35 +1,15 @@ </span><del>-// wxMenuEvent.h -// This file was automatically generated -// by extractxml.rb, part of the wxRuby project -// Do not make changes directly to this file! </del><ins>+// Copyright 2004-2006 by Kevin Smith +// released under the MIT-style wxruby2 license </ins><span class="cx"> </span><span class="cx"> #if !defined(_wxMenuEvent_h_) </span><span class="cx"> #define _wxMenuEvent_h_ </span><span class="cx"> class wxMenuEvent : public wxEvent </span><span class="cx"> { </span><span class="cx"> public: </span><del>-        /** -         * \brief Constructor. -         * \param WXTYPE -         * \param int -         * \param wxDC* -        */ - - wxMenuEvent(WXTYPE id = 0, int id = 0, wxDC* dc = NULL) ; -        /** -         * \brief Returns the menu identifier associated with the event. This method should be -only used with the events. -        */ - - int GetMenuId() const; -        /** -         * \brief Returns if the menu which is being opened or closed is a popup menu, - if it is a normal one. - -This method should be only used with the and events. -        */ - - bool IsPopup() const; </del><ins>+ wxMenuEvent(int id = 0, int menu_id = 0, wxMenu* menu = NULL); + wxMenu* GetMenu() const; + int GetMenuId() const; + bool IsPopup() const; </ins><span class="cx"> }; </span><span class="cx"> </span><span class="cx"> </span></span></pre> </div> </div> </body> </html>
Maybe Matching Threads
- [1042] trunk/wxruby2: Overhaul of the event handling WxType->RubyClass mapping to make it
- [815] trunk/wxruby2/swig/classes: Added ContextMenuEvent class plus event handling methods
- [723] trunk/wxruby2: Added WindowCreateEvent and WindowDestroyEvent + event handlers (AF)
- [814] trunk/wxruby2/swig/classes: Added ScrollEvent class plus event processing and handler methods
- [982] branches/wxruby2/wxwidgets_282/swig/classes/EvtHandler.i: Add EvtThunker mapping for TimerEvent (bug 10391)