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

Daniel Burrows dburrows@costa.debian.org
Mon, 06 Jun 2005 18:29:13 +0000


Author: dburrows
Date: Mon Jun  6 18:29:11 2005
New Revision: 3327

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/vscreen/testvscreen.cc
Log:
Update the vscreen test program.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Mon Jun  6 18:29:11 2005
@@ -1,5 +1,9 @@
 2005-06-06  Daniel Burrows  <dburrows@debian.org>
 
+	* src/vscreen/testvscreen.cc:
+
+	Update the test program to use styles instead of attributes.
+
 	* src/vscreen/vs_editline.cc, src/vscreen/vs_editline.h:
 
 	Update the line-editor widget for the new display protocol.

Modified: branches/aptitude-0.3/aptitude/src/vscreen/testvscreen.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/vscreen/testvscreen.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/vscreen/testvscreen.cc	Mon Jun  6 18:29:11 2005
@@ -46,7 +46,7 @@
 public:
   test_keyname():vs_label("")
   {
-    set_bg(get_color("EditLine"));
+    set_bg_style(get_style("EditLine"));
   }
 
   size size_request()
@@ -66,9 +66,9 @@
 class silly_block:public vscreen_widget
 {
 public:
-  silly_block(int mybkgd)
+  silly_block(const style &st)
   {
-    set_bg(mybkgd);
+    set_bg_style(st);
   }
 
   size size_request()
@@ -87,7 +87,7 @@
 public:
   silly_treeitem(string _txt):txt(_txt) {}
 
-  void paint(vs_tree *win, int y, bool hierarchical)
+  void paint(vs_tree *win, int y, bool hierarchical, const style &st)
   {
     vs_treeitem::paint(win, y, hierarchical, txt);
   }
@@ -103,7 +103,7 @@
   silly_subtree(bool expanded, string _txt)
     :vs_subtree_generic(expanded), txt(_txt) {}
 
-  void paint(vs_tree *win, int y, bool hierarchical)
+  void paint(vs_tree *win, int y, bool hierarchical, const style &st)
   {
     vs_subtree_generic::paint(win, y, hierarchical, txt);
   }
@@ -309,7 +309,7 @@
     {
       label->show();
       label->set_text(item->get_description(),
-		      get_color("ScreenStatusColor"));
+		      get_style("Status"));
     }
   else
     label->hide();
@@ -329,21 +329,21 @@
 
   vector<fragment*> v;
 
-  v.push_back(indentbox(2, 2, flowbox(fragf("%s %C%s%A %s", "A", "Error", "Christmas", 0, "Carol"))));
+  v.push_back(indentbox(2, 2, flowbox(fragf("%s %F %s", "A", style_fragment(text_fragment("Christmas"), get_style("Error")), "Carol"))));
 
   v.push_back(newline_fragment());
 
   v.push_back(flowbox(fragf("%BMarley was %s%b: to begin with.  There is %F whatever about that. The register of his burial was signed by the clergyman, the clerk, the undertaker, and the chief mourner. Scrooge signed it. And Scrooge's name was good upon 'Change, for anything he chose to put his hand to. Old Marley was as dead as a door-nail.",
 			    "dead",
-			    text_fragment("no doubt", A_BOLD))));
+			    text_fragment("no doubt", style_attrs_on(A_BOLD)))));
 
   v.push_back(newline_fragment());
 
   // Test positional arguments.
   v.push_back(fillbox(fragf("%2$F! I don't mean to say that I know, of my own knowledge, what there is particularly dead about a door-nail. I might have been inclined, myself, to regard a coffin-nail as the deadest piece of ironmongery in the trade. But the wisdom of our ancestors is in the simile; and my unhallowed hands shall not disturb it, or the Country's done for. You will therefore permit me to repeat, emphatically, that Marley was as %3$F as a %1$F.%n%n%n%nScrooge knew he was dead? Of course he did. How could it be otherwise? Scrooge and he were partners for I don't know how many years. Scrooge was his sole executor, his sole administrator, his sole assign, his sole residuary legatee, his sole friend, and sole mourner. And even Scrooge was not so dreadfully cut up by the sad event, but that he was an excellent man of business on the very day of the funeral, and solemnised it with an undoubted bargain.",
-			    text_fragment("door-nail", A_BOLD),
-			    text_fragment("Mind", A_BOLD),
-			    text_fragment("dead", A_BOLD))));
+			    text_fragment("door-nail", style_attrs_on(A_BOLD)),
+			    style_fragment(text_fragment("Mind"), style_attrs_on(A_BOLD)),
+			    text_fragment("dead", style_attrs_on(A_BOLD)))));
 
   v.push_back(newline_fragment());
 
@@ -373,7 +373,7 @@
 
   menubar->connect_key_post("Quit", &global_bindings, sigc::ptr_fun(&vscreen_exitmain));
 
-  vs_label *menu_display=new vs_label("", get_color("ScreenStatusColor"));
+  vs_label *menu_display=new vs_label("", get_style("Status"));
 
   vs_menu *menu=new vs_menu(0, 0, 0, test_file_menu);
   menubar->append_item("File", menu);