[Wxruby-development] [781] trunk/wxruby2: Added instance class method to avoid proliferation of help windows

nobody at rubyforge.org
2006-12-12T00:13:56Z

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<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;}
-->
[781] trunk/wxruby2: Added instance class method to avoid
proliferation of help windows





Revision 781
Author brokentoy
Date 2006-12-11 19:13:56 -0500 (Mon, 11 Dec
2006)


Log Message
Added instance class method to avoid proliferation of help
windows

Modified Paths

<a
href="#trunkwxruby2doctextilehelpcontrollertxtl">trunk/wxruby2/doc/textile/helpcontroller.txtl
<a
href="#trunkwxruby2doctextilehtmlhelpcontrollertxtl">trunk/wxruby2/doc/textile/htmlhelpcontroller.txtl


Added Paths

<a
href="#trunkwxruby2libwxclasseshelpcontrollerrb">trunk/wxruby2/lib/wx/classes/helpcontroller.rb
<a
href="#trunkwxruby2libwxclasseshtmlhelpcontrollerrb">trunk/wxruby2/lib/wx/classes/htmlhelpcontroller.rb




Diff

Modified:
trunk/wxruby2/doc/textile/helpcontroller.txtl (780 => 781)

---
trunk/wxruby2/doc/textile/helpcontroller.txtl&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp2006-12-11
20:11:29 UTC (rev 780)
+++
trunk/wxruby2/doc/textile/helpcontroller.txtl&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp2006-12-12
00:13:56 UTC (rev 781)
@@ -43,9 +43,13 @@

<div
id="methods">

-h2. Methods
+h2. Class Methods

+*
"HelpController.instance":#HelpController_instance
*
"HelpController.new":#HelpController_new
+
+h2. Instance Methods
+
*
"HelpController#init":#HelpController_init
*
"HelpController#display_block":#HelpController_displayblock
*
"HelpController#display_contents":#HelpController_displaycontents
@@ -62,13 +66,29 @@



+h2(#class_methods). Class Methods

+h3(#HelpController_new). HtmlHelpController.instance
+
+  *HelpController.instance*()
+
+Returns a new HelpController if one hasn''t already been created, or
+returns the previously created one if there is such.
+
+Users typically expect only a single help window to be running for
+any particular application, with the help shown and hidden as
+required. To avoid showing multiple help windows within a single
+application, use this method in preference to
+"new":#HelpController_new .
+
h3(#HelpController_new).
HelpController.new

- *destructor*()
+ *HelpController.new*()

-Destroys the help instance, closing down the viewer if
it is running.
+Constructor.

+h2(#instance_methods). Instance Methods
+
h3(#HelpController_init).
HelpController#init

*init*(%(arg-type)String% file)


Modified:
trunk/wxruby2/doc/textile/htmlhelpcontroller.txtl (780 => 781)

---
trunk/wxruby2/doc/textile/htmlhelpcontroller.txtl&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp2006-12-11
20:11:29 UTC (rev 780)
+++
trunk/wxruby2/doc/textile/htmlhelpcontroller.txtl&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp2006-12-12
00:13:56 UTC (rev 781)
@@ -196,6 +196,7 @@

h2. Class Methods

+*
"HtmlHelpController.instance":#HtmlHelpController_instance
*
"HtmlHelpController.new":#HtmlHelpController_new

h2. Instance Methods
@@ -216,11 +217,34 @@

h2(#class_methods). Class Methods

+h3(#HtmlHelpController_instance).
HtmlHelpController.instance
+
+  *HtmlHelpController.instance*(%(arg-type)Integer% style = HF_DEFAULT_STYLE)
+
+Returns a new HtmlHelpController if one hasn''t already been created,
or
+returns the previously created one if there is such.
+
+Users typically expect only a single help window to be running for
+any particular application, with the help shown and hidden as
+required. To avoid showing multiple help windows within a single
+application, use this method in preference to
+"new":#HtmlHelpController_new .
+
+h4. Parameters
+
+_style_ defines optional styles for the help window; the options are
+described below in the "new":#HtmlHelpController_new method. Note
that
+the style argument will only be processed in the first call to this
+method - subsequent calls will return a controller with the original
+style.
+
h3(#HtmlHelpController_new).
HtmlHelpController.new


*HtmlHelpController.new*(%(arg-type)Integer% style = HF_DEFAULT_STYLE)

-Constructor.
+Constructor. To avoid a proliferation of help frames,
you may prefer
+to use the "instance":#HtmlHelpController_instance class method
instead
+to display help.

h4. Parameters



Added:
trunk/wxruby2/lib/wx/classes/helpcontroller.rb (0 => 781)

---
trunk/wxruby2/lib/wx/classes/helpcontroller.rb&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
(rev 0)
+++
trunk/wxruby2/lib/wx/classes/helpcontroller.rb&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp2006-12-12
00:13:56 UTC (rev 781)
@@ -0,0 +1,5 @@
+class Wx::HelpController
+  def self.instance(*args)
+    @instance ||= new(*args)
+  end
+end


Added:
trunk/wxruby2/lib/wx/classes/htmlhelpcontroller.rb (0 => 781)

---
trunk/wxruby2/lib/wx/classes/htmlhelpcontroller.rb&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
(rev 0)
+++
trunk/wxruby2/lib/wx/classes/htmlhelpcontroller.rb&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp2006-12-12
00:13:56 UTC (rev 781)
@@ -0,0 +1,5 @@
+class Wx::HtmlHelpController
+  def self.instance(*args)
+    @instance ||= new(*args)
+  end
+end