[Aptitude-svn-commit] r3454 - in branches/aptitude-0.3/aptitude: . src/vscreen

Daniel Burrows dburrows@costa.debian.org
Sun, 26 Jun 2005 16:39:27 +0000


Author: dburrows
Date: Sun Jun 26 16:39:23 2005
New Revision: 3454

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/vscreen/vs_button.cc
   branches/aptitude-0.3/aptitude/src/vscreen/vs_button.h
Log:
Allow vs_buttons to be constructed directly from wstrings.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Sun Jun 26 16:39:23 2005
@@ -1,5 +1,9 @@
 2005-06-26  Daniel Burrows  <dburrows@debian.org>
 
+	* src/vscreen/vs_button.cc, src/vscreen/vs_button.h:
+
+	  Add a variant constructor for wstrings.
+
 	* src/vscreen/transcode.cc, src/vscreen/transcode.h:
 
 	  Add a transcode variant that changes strings from wide character

Modified: branches/aptitude-0.3/aptitude/src/vscreen/vs_button.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/vscreen/vs_button.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/vscreen/vs_button.cc	Sun Jun 26 16:39:23 2005
@@ -17,6 +17,13 @@
   unfocussed.connect(sigc::mem_fun(*this, &vs_button::lose_focus));
 }
 
+vs_button::vs_button(const std::wstring &_label)
+  :label(new fragment_cache(text_fragment(_label)))
+{
+  focussed.connect(sigc::mem_fun(*this, &vs_button::accept_focus));
+  unfocussed.connect(sigc::mem_fun(*this, &vs_button::lose_focus));
+}
+
 vs_button::vs_button(const std::string &_label)
   :label(new fragment_cache(text_fragment(_label)))
 {

Modified: branches/aptitude-0.3/aptitude/src/vscreen/vs_button.h
==============================================================================
--- branches/aptitude-0.3/aptitude/src/vscreen/vs_button.h	(original)
+++ branches/aptitude-0.3/aptitude/src/vscreen/vs_button.h	Sun Jun 26 16:39:23 2005
@@ -40,6 +40,13 @@
    *  inside a simple text_fragment.
    */
   vs_button(const std::string &_label);
+
+  /** Instantiate a vs_button.
+   *
+   *  \param _label the new label of this button; it will be placed
+   *  inside a simple text_fragment.
+   */
+  vs_button(const std::string &_label);
   ~vs_button();
 
   void paint(const style &st);