nobody at rubyforge.org
2007-Apr-29 16:33 UTC
[Wxruby-development] [991] branches/wxruby2/wxwidgets_282/doc/textile: Update documentation for painting methods and WindowDC subclasses
<!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>[991] branches/wxruby2/wxwidgets_282/doc/textile: Update documentation for painting methods and WindowDC subclasses</title> </head> <body> <div id="msg"> <dl> <dt>Revision</dt> <dd>991</dd> <dt>Author</dt> <dd>brokentoy</dd> <dt>Date</dt> <dd>2007-04-29 12:33:41 -0400 (Sun, 29 Apr 2007)</dd> </dl> <h3>Log Message</h3> <pre>Update documentation for painting methods and WindowDC subclasses</pre> <h3>Modified Paths</h3> <ul> <li><a href="#brancheswxruby2wxwidgets_282doctextileclientdctxtl">branches/wxruby2/wxwidgets_282/doc/textile/clientdc.txtl</a></li> <li><a href="#brancheswxruby2wxwidgets_282doctextilepaintdctxtl">branches/wxruby2/wxwidgets_282/doc/textile/paintdc.txtl</a></li> <li><a href="#brancheswxruby2wxwidgets_282doctextilewindowtxtl">branches/wxruby2/wxwidgets_282/doc/textile/window.txtl</a></li> </ul> </div> <div id="patch"> <h3>Diff</h3> <a id="brancheswxruby2wxwidgets_282doctextileclientdctxtl"></a> <div class="modfile"><h4>Modified: branches/wxruby2/wxwidgets_282/doc/textile/clientdc.txtl (990 => 991)</h4> <pre class="diff"><span> <span class="info">--- branches/wxruby2/wxwidgets_282/doc/textile/clientdc.txtl        2007-04-29 16:16:10 UTC (rev 990) +++ branches/wxruby2/wxwidgets_282/doc/textile/clientdc.txtl        2007-04-29 16:33:41 UTC (rev 991) </span><span class="lines">@@ -1,15 +1,13 @@ </span><span class="cx"> h1(#wxclientdc). Wx::ClientDC </span><span class="cx"> </span><del>-A ClientDC must be constructed if an application wishes to paint on the -client area of a window from outside an *OnPaint* event. -This should normally be constructed as a temporary stack object; don''t store -a ClientDC object. </del><ins>+This class is used to draw upon Windows outside of @evt_paint@ +handlers. It is not instantiated directly; rather, call the +"paint":window.html#Window_paint method of the Window you wish to draw +upon, and pass a block which will receive a ClientDC object. </ins><span class="cx"> </span><del>-To draw on a window from within *OnPaint*, construct a "PaintDC":paintdc.html object. </del><ins>+This class has no methods of its own; all the drawing methods are +described in the documentation for "DC":dc.html. </ins><span class="cx"> </span><del>-To draw on the whole window including decorations, construct a "WindowDC":windowdc.html object -(Windows only). - </del><span class="cx"> h2. Derived from </span><span class="cx"> </span><span class="cx"> "WindowDC":windowdc.html </span><span class="lines">@@ -19,21 +17,3 @@ </span><span class="cx"> h2. See also </span><span class="cx"> </span><span class="cx"> "DC":dc.html, "MemoryDC":memorydc.html, "PaintDC":paintdc.html, "WindowDC":windowdc.html, "ScreenDC":screendc.html </span><del>- -<div id="methods"> - -h2. Methods - -* "ClientDC.new":#ClientDC_new - -</div> - - -h3(#ClientDC_new). ClientDC.new - - *ClientDC.new*(%(arg-type)Window% window) - -Constructor. Pass a pointer to the window on which you wish to paint. - - - </del></span></pre></div> <a id="brancheswxruby2wxwidgets_282doctextilepaintdctxtl"></a> <div class="modfile"><h4>Modified: branches/wxruby2/wxwidgets_282/doc/textile/paintdc.txtl (990 => 991)</h4> <pre class="diff"><span> <span class="info">--- branches/wxruby2/wxwidgets_282/doc/textile/paintdc.txtl        2007-04-29 16:16:10 UTC (rev 990) +++ branches/wxruby2/wxwidgets_282/doc/textile/paintdc.txtl        2007-04-29 16:33:41 UTC (rev 991) </span><span class="lines">@@ -1,20 +1,17 @@ </span><span class="cx"> h1(#wxpaintdc). Wx::PaintDC </span><span class="cx"> </span><del>-A PaintDC must be constructed if an application wishes to paint on the -client area of a window from within an *OnPaint* event. -This should normally be constructed as a temporary stack object; don''t store -a PaintDC object. If you have an OnPaint handler, you _must_ create a PaintDC -object within it even if you don''t actually use it. </del><ins>+This class is used to draw upon Windows within an @evt_paint@ +handler. This is the recommended technique to draw lines, shapes and +bitmaps on the screen. </ins><span class="cx"> </span><del>-Using PaintDC within OnPaint is important because it automatically -sets the clipping area to the damaged area of the window. Attempts to draw -outside this area do not appear. </del><ins>+This class is not instantiated directly. Rather, define an @evt_paint@ +handler, and within it call the "paint":window.html#Window_paint method +of the Window you wish to draw upon. This method accepts a block, +which receives a PaintDC object upon which drawing methods can be called. </ins><span class="cx"> </span><del>-To draw on a window from outside *OnPaint*, construct a "ClientDC":clientdc.html object. </del><ins>+This class has no methods of its own; all the drawing methods are +described in the documentation for "DC":dc.html. </ins><span class="cx"> </span><del>-To draw on the whole window including decorations, construct a "WindowDC":windowdc.html object -(Windows only). - </del><span class="cx"> h2. Derived from </span><span class="cx"> </span><span class="cx"> "WindowDC":windowdc.html </span><span class="lines">@@ -25,20 +22,3 @@ </span><span class="cx"> </span><span class="cx"> "DC":dc.html, "MemoryDC":memorydc.html, "PaintDC":paintdc.html, "WindowDC":windowdc.html, "ScreenDC":screendc.html </span><span class="cx"> </span><del>-<div id="methods"> - -h2. Methods - -* "PaintDC.new":#PaintDC_new - -</div> - - -h3(#PaintDC_new). PaintDC.new - - *PaintDC.new*(%(arg-type)Window% window) - -Constructor. Pass a pointer to the window on which you wish to paint. - - - </del></span></pre></div> <a id="brancheswxruby2wxwidgets_282doctextilewindowtxtl"></a> <div class="modfile"><h4>Modified: branches/wxruby2/wxwidgets_282/doc/textile/window.txtl (990 => 991)</h4> <pre class="diff"><span> <span class="info">--- branches/wxruby2/wxwidgets_282/doc/textile/window.txtl        2007-04-29 16:16:10 UTC (rev 990) +++ branches/wxruby2/wxwidgets_282/doc/textile/window.txtl        2007-04-29 16:33:41 UTC (rev 991) </span><span class="lines">@@ -1537,11 +1537,25 @@ </span><span class="cx"> </span><span class="cx"> paint { | window_dc | ... } </span><span class="cx"> </span><del>-This method runs the block, yielding a "PaintDC":paintdc.html into it -to enable direct drawing onto a widget. This method should *only* be -used within an @on_paint@ handler. To draw at other times, create a -"ClientDC":clientdc.html object. </del><ins>+Runs a block containing code for drawing lines, shapes and bitmaps onto +the Window. The block should receive a "DC":dc.html (device context) +object which can then be used to run drawing commands. </ins><span class="cx"> </span><ins>+The preferred usage of this method is within an @evt_paint@ handler, +which is called whenever any part of the Window needs to be redrawn. In +this case, the block will receive a "PaintDC":paintdc.html object. If +@paint@ is called outside a paint event handler, it will receive a +"ClientDC":clientdc.html object. These two classes support identical methods. + +This is the correct way in wxRuby to draw directly upon, for example, +Panels. You should not attempt to instantiate a PaintDC or ClientDC +directly. This will raise an exception, as doing so can cause serious +errors on some platforms. + +Note also that it is not possible to draw directly upon some core +controls, such as "Wx::Button":button.html. Whilst this may work on some +platforms, it is not portable. + </ins><span class="cx"> h3(#Window_popeventhandler). Window#pop_event_handler </span><span class="cx"> </span><span class="cx"> "EvtHandler":evthandler.html *pop_event_handler*(%(arg-type)Boolean% deleteHandler = @false@) </span></span></pre> </div> </div> </body> </html>
Maybe Matching Threads
- [ wxruby-Bugs-20211 ] Unresolved symbol due to linkage error
- [700] trunk/wxruby2/doc/textile/window.txtl: Added paint to the method index; corrected info about the type of DC
- [984] branches/wxruby2/wxwidgets_282/lib/wx/classes/clientdc.rb: Prevent dangerous direct instantiation of ClientDC
- [983] branches/wxruby2/wxwidgets_282: Make Window#paint work both inside and outside a paint event handler,
- Compiling problem on Ubuntu 9.10 64 bit