nobody at rubyforge.org
2006-Dec-24 03:22 UTC
[Wxruby-development] [801] trunk/wxruby2/doc/textile: Explain how to use the block-style class methods in these classes
<!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>[801] trunk/wxruby2/doc/textile: Explain how to use the block-style class methods in these classes</title> </head> <body> <div id="msg"> <dl> <dt>Revision</dt> <dd>801</dd> <dt>Author</dt> <dd>brokentoy</dd> <dt>Date</dt> <dd>2006-12-23 22:22:34 -0500 (Sat, 23 Dec 2006)</dd> </dl> <h3>Log Message</h3> <pre>Explain how to use the block-style class methods in these classes</pre> <h3>Modified Paths</h3> <ul> <li><a href="#trunkwxruby2doctextilebusycursortxtl">trunk/wxruby2/doc/textile/busycursor.txtl</a></li> <li><a href="#trunkwxruby2doctextilebusyinfotxtl">trunk/wxruby2/doc/textile/busyinfo.txtl</a></li> <li><a href="#trunkwxruby2doctextilewindowdisablertxtl">trunk/wxruby2/doc/textile/windowdisabler.txtl</a></li> </ul> </div> <div id="patch"> <h3>Diff</h3> <a id="trunkwxruby2doctextilebusycursortxtl"></a> <div class="modfile"><h4>Modified: trunk/wxruby2/doc/textile/busycursor.txtl (800 => 801)</h4> <pre class="diff"><span> <span class="info">--- trunk/wxruby2/doc/textile/busycursor.txtl        2006-12-24 02:43:39 UTC (rev 800) +++ trunk/wxruby2/doc/textile/busycursor.txtl        2006-12-24 03:22:34 UTC (rev 801) </span><span class="lines">@@ -1,45 +1,38 @@ </span><span class="cx"> h1(#wxbusycursor). Wx::BusyCursor </span><span class="cx"> </span><del>-This class makes it easy to tell your user that the program is temporarily busy. -Just create a BusyCursor object on the stack, and within the current scope, -the hourglass will be shown. </del><ins>+This class makes it easy to tell your user that the program is +temporarily busy. Just call the class method "busy":BusyCursor_busy, +passing it a block; while the block is executed, the system''s hourglass +cursor will be displayed. </ins><span class="cx"> </span><span class="cx"> For example: </span><span class="cx"> </span><del>- - BusyCursor wait; </del><ins>+ Wx::BusyCursor.busy do + # do some lengthy operation + # ... + end </ins><span class="cx"> </span><del>- for (int i = 0; i < 100000; i++) - DoACalculation(); - - -It works by calling "BeginBusyCursor":beginbusycursor.html in the constructor, -and "EndBusyCursor":endbusycursor.html in the destructor. - </del><span class="cx"> h2. Derived from </span><span class="cx"> </span><span class="cx"> None </span><span class="cx"> </span><span class="cx"> h2. See also </span><span class="cx"> </span><del>-"BeginBusyCursor":beginbusycursor.html, "EndBusyCursor":endbusycursor.html, "WindowDisabler":windowdisabler.html </del><ins>+"BusyInfo":busyinfo.html, "WindowDisabler":windowdisabler.html </ins><span class="cx"> </span><span class="cx"> <div id="methods"> </span><span class="cx"> </span><del>-h2. Methods </del><ins>+h2. Class methods </ins><span class="cx"> </span><del>-* "BusyCursor.new":#BusyCursor_new </del><ins>+* "BusyCursor.busy":#BusyCursor_busy </ins><span class="cx"> </span><span class="cx"> </div> </span><span class="cx"> </span><span class="cx"> </span><del>-h3(#BusyCursor_new). BusyCursor.new </del><ins>+h3(#BusyCursor_busy). BusyCursor.busy </ins><span class="cx"> </span><del>- *BusyCursor.new*(%(arg-type)Cursor% cursor = HOURGLASS_CURSOR) </del><ins>+ *BusyCursor.busy*() { ... } </ins><span class="cx"> </span><del>-Constructs a busy cursor object, calling "BeginBusyCursor":beginbusycursor.html. - - *destructor*() - -Destroys the busy cursor object, calling "EndBusyCursor":endbusycursor.html. - </del><ins>+Changes the cursor into the system''s ''busy'' indicator (typically an +hourglass), calls the passed block, then returns the cursor to normal +once the block is completed. </ins></span></pre></div> <a id="trunkwxruby2doctextilebusyinfotxtl"></a> <div class="modfile"><h4>Modified: trunk/wxruby2/doc/textile/busyinfo.txtl (800 => 801)</h4> <pre class="diff"><span> <span class="info">--- trunk/wxruby2/doc/textile/busyinfo.txtl        2006-12-24 02:43:39 UTC (rev 800) +++ trunk/wxruby2/doc/textile/busyinfo.txtl        2006-12-24 03:22:34 UTC (rev 801) </span><span class="lines">@@ -1,69 +1,43 @@ </span><span class="cx"> h1(#wxbusyinfo). Wx::BusyInfo </span><span class="cx"> </span><del>-This class makes it easy to tell your user that the program is temporarily busy. -Just create a BusyInfo object on the stack, and within the current scope, -a message window will be shown. </del><ins>+This class makes it easy to tell your user that the program is +temporarily busy. Just call the class method ''busy'' and run the code +that your program is busy with within a block. A small window with an +informational message will be displayed on top of the application </ins><span class="cx"> </span><span class="cx"> For example: </span><span class="cx"> </span><del>- - BusyInfo wait("Please wait, working..."); </del><ins>+ Wx::BusyInfo.busy("Please wait, working...") do + # do some lengthy operation + # ... + end                 </ins><span class="cx"> </span><del>- for (int i = 0; i < 100000; i++) - { - DoACalculation(); - } - - -It works by creating a window in the constructor, -and deleting it in the destructor. - -You may also want to call TheApp->Yield() to refresh the window -periodically (in case it had been obscured by other windows, for -example) like this: - - - WindowDisabler disableAll; - - BusyInfo wait("Please wait, working..."); - - for (int i = 0; i < 100000; i++) - { - DoACalculation(); - - if ( !(i TheApp->Yield(); - } - - -but take care to not cause undesirable reentrancies when doing it (see -"App::Yield()":appyield.html for more details). The simplest way to do -it is to use "WindowDisabler":windowdisabler.html class as illustrated -in the above example. - </del><span class="cx"> h2. Derived from </span><span class="cx"> </span><span class="cx"> None </span><span class="cx"> </span><ins>+h2. See also + +"BusyCursor":busycursor.html, "WindowDisabler":windowdisabler.html + </ins><span class="cx"> <div id="methods"> </span><span class="cx"> </span><del>-h2. Methods </del><ins>+h2. Class Methods </ins><span class="cx"> </span><del>-* "BusyInfo.new":#BusyInfo_new </del><ins>+* "BusyInfo.busy":#BusyInfo_busy </ins><span class="cx"> </span><span class="cx"> </div> </span><span class="cx"> </span><span class="cx"> </span><del>-h3(#BusyInfo_new). BusyInfo.new </del><ins>+h3(#BusyInfo_busy). BusyInfo.busy </ins><span class="cx"> </span><del>- *BusyInfo.new*(%(arg-type)String% msg, %(arg-type)Window% parent = nil) </del><ins>+ *BusyInfo.new*(%(arg-type)String% msg, + %(arg-type)Window% parent = nil) { ... } </ins><span class="cx"> </span><del>-Constructs a busy info window as child of _parent_ and displays _msg_ -in it. </del><ins>+Displays a busy info window as child of _parent_ and displays _msg_ +in it, while running the block. When the block''s execution is completed, +the busy info window is removed from the display. </ins><span class="cx"> </span><del>-*NB:* If _parent_ is not @NULL@ you must ensure that it is not </del><ins>+*NB:* If _parent_ is not @nil@ you must ensure that it is not </ins><span class="cx"> closed while the busy info is shown. </span><span class="cx"> </span><del>- *destructor*() - -Hides and closes the window containing the information text. - </del></span></pre></div> <a id="trunkwxruby2doctextilewindowdisablertxtl"></a> <div class="modfile"><h4>Modified: trunk/wxruby2/doc/textile/windowdisabler.txtl (800 => 801)</h4> <pre class="diff"><span> <span class="info">--- trunk/wxruby2/doc/textile/windowdisabler.txtl        2006-12-24 02:43:39 UTC (rev 800) +++ trunk/wxruby2/doc/textile/windowdisabler.txtl        2006-12-24 03:22:34 UTC (rev 801) </span><span class="lines">@@ -1,35 +1,41 @@ </span><span class="cx"> h1(#wxwindowdisabler). Wx::WindowDisabler </span><span class="cx"> </span><del>-This class disables all windows of the application (may be with the exception -of one of them) in its constructor and enables them back in its destructor. -This comes in handy when you want to indicate to the user that the application -is currently busy and cannot respond to user input. </del><ins>+This class disables all windows of the application temporarily while +some code is executed. This comes in handy when you want to indicate to +the user that the application is currently busy and cannot respond to +user input. Optionally, one window may be excepted and not disabled. </ins><span class="cx"> </span><ins>+To use this, call the class method "disable":WindowDisabler_disable and +pass it a block: + + Wx::WindowDisabler.disable do + # do some lengthy operation + # ... + end + </ins><span class="cx"> h2. Derived from </span><span class="cx"> </span><span class="cx"> None </span><span class="cx"> </span><span class="cx"> h2. See also </span><span class="cx"> </span><del>-"BusyCursor":busycursor.html </del><ins>+"BusyCursor":busycursor.html, "BusyInfo":busyinfo.html </ins><span class="cx"> </span><span class="cx"> <div id="methods"> </span><span class="cx"> </span><del>-h2. Methods </del><ins>+h2. Class methods </ins><span class="cx"> </span><del>-* "WindowDisabler.new":#WindowDisabler_new </del><ins>+* "WindowDisabler.disable":#WindowDisabler_disable </ins><span class="cx"> </span><span class="cx"> </div> </span><span class="cx"> </span><span class="cx"> </span><del>-h3(#WindowDisabler_new). WindowDisabler.new </del><ins>+h3(#WindowDisabler_disable). WindowDisabler.disable </ins><span class="cx"> </span><del>- *WindowDisabler.new*(%(arg-type)Window% winToSkip = nil) </del><ins>+ *WindowDisabler.disable*(%(arg-type)Window% winToSkip = nil) { ... } </ins><span class="cx"> </span><span class="cx"> Disables all top level windows of the applications with the exception of </span><del>-_winToSkip_ if it is not @NULL@. </del><ins>+_winToSkip_ if it is not @nil@. The passed block is then executed, and +when it is completed, all windows are re-enabled. </ins><span class="cx"> </span><del>- *destructor*() </del><span class="cx"> </span><del>-Reenables back the windows disabled by the constructor. - </del></span></pre> </div> </div> </body> </html>
Reasonably Related Threads
- [803] trunk/wxruby2/Changelog: Update with recent changes
- [817] trunk/wxruby2/Changelog: Last changes of 2006!
- [ wxruby-Bugs-20211 ] Unresolved symbol due to linkage error
- [694] trunk/wxruby2/doc/textile: Added back the logging classes which were over-zealously removed when
- [781] trunk/wxruby2: Added instance class method to avoid proliferation of help windows