nobody at rubyforge.org
2007-Jan-03 01:25 UTC
[Wxruby-development] [821] trunk/wxruby2/doc/textile/texturlevent.txtl: Added info on undocumented TextUrlEVent class
<!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>[821] trunk/wxruby2/doc/textile/texturlevent.txtl: Added info on undocumented TextUrlEVent class</title> </head> <body> <div id="msg"> <dl> <dt>Revision</dt> <dd>821</dd> <dt>Author</dt> <dd>brokentoy</dd> <dt>Date</dt> <dd>2007-01-02 20:25:30 -0500 (Tue, 02 Jan 2007)</dd> </dl> <h3>Log Message</h3> <pre>Added info on undocumented TextUrlEVent class</pre> <h3>Added Paths</h3> <ul> <li><a href="#trunkwxruby2doctextiletexturleventtxtl">trunk/wxruby2/doc/textile/texturlevent.txtl</a></li> </ul> </div> <div id="patch"> <h3>Diff</h3> <a id="trunkwxruby2doctextiletexturleventtxtl"></a> <div class="addfile"><h4>Added: trunk/wxruby2/doc/textile/texturlevent.txtl (0 => 821)</h4> <pre class="diff"><span> <span class="info">--- trunk/wxruby2/doc/textile/texturlevent.txtl         (rev 0) +++ trunk/wxruby2/doc/textile/texturlevent.txtl        2007-01-03 01:25:30 UTC (rev 821) </span><span class="lines">@@ -0,0 +1,78 @@ </span><ins>+h1(#wxtexturlevent). Wx::TextUrlEvent + +This event contains information about an interaction with a highlighted +URL in a "TextCtrl":textctrl.html that has been initialised with the +style @TE_AUTO_URL@. + +h2. Derived from + +"Event":event.html, "CommandEvent":commandevent.html + +h2. Event handlers + +To process a TextUrlEvent, use the @evt_text_url@ event handler to +direct the event to a block that takes a CommandEvent argument. Pass the +id of the TextCtrl to the event handler. + +|*evt_text_url(id) { | event | ... }*|Process a text url interaction| + +h2. Different mouse events + +When an event handler is defined, *all* mouse interactions with URLs in +the TextCtrl will fire an event. This means that not only button clicks, +but mouse motion into, within and out of the URL area will trigger the +handler. While this adds flexibility, it also means that you will probably +need to determine what mouse action was taken to decide how to respond +to the event. + +This can be done by calling the +"TextUrlEvent#getmouseevent":get_mouse_event method and using the +methods defined for "MouseEvent":mouseevent.html to determine whether +the event was a mouse click, which button was clicked, and so on: + + mouse_event = event.get_mouse_event + if mouse_event.left_down + # ... + end + + +<div id="methods"> + +h2. Instance Methods + +* "TextUrlEvent#get_mouse_event":#TextUrlEvent_getmouseevent +* "TextUrlEvent#get_url":#TextUrlEvent_geturl +* "TextUrlEvent#get_url_start":#TextUrlEvent_geturlstart +* "TextUrlEvent#get_url_end":#TextUrlEvent_geturlend + +</div> + +h3(#TextUrlEvent_getmousevent). TextUrlEvent#checked + + "MouseEvent":mousevent.html *get_mouse_event*() + +Returns the "MouseEvent":mousevent.html associated with this interaction. + +h3(#TextUrlEvent_geturl). TextUrlEvent#get_url + + String *get_url*() + +Returns the text of the URL that is being interacted with. + +This is a convenience method for calling: + + get_event_object.get_value[get_url_start .. get_url_end] + +h3(#TextUrlEvent_geturlstart). TextUrlEvent#get_url_start + + Integer *get_url_start*() + +Returns the first character position of the URL string within the containing +TextCtrl''s contents. + +h3(#TextUrlEvent_geturlend). TextUrlEvent#get_url_end + + Integer *get_url_end*() + +Returns the last character position of the URL string within the containing +TextCtrl''s contents. </ins></span></pre> </div> </div> </body> </html>
Apparently Analagous Threads
- [820] trunk/wxruby2/lib/wx/classes/texturlevent.rb: Added get_url convenience method to TextUrlEvent
- [790] trunk/wxruby2/swig/classes: Added TextUrlEvent class and EvtHandler mapping
- [822] trunk/wxruby2/doc/textile: Links to the documentation on TextUrlEvent
- [ wxruby-Feature Requests-7343 ] Add TextUrlEvent
- [795] trunk/wxruby2/swig/classes/include/parents.rb: Added missing DatePickerCtrl and TextUrlEvent classes