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

Daniel Burrows dburrows at costa.debian.org
Fri Sep 23 23:30:13 UTC 2005


Author: dburrows
Date: Fri Sep 23 23:30:06 2005
New Revision: 4205

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/vscreen/vs_container.h
   branches/aptitude-0.3/aptitude/src/vscreen/vs_menubar.cc
   branches/aptitude-0.3/aptitude/src/vscreen/vs_menubar.h
   branches/aptitude-0.3/aptitude/src/vscreen/vs_passthrough.cc
   branches/aptitude-0.3/aptitude/src/vscreen/vs_passthrough.h
Log:
Add support for fetching the currently 'active' widget of a container.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Fri Sep 23 23:30:06 2005
@@ -1,5 +1,11 @@
 2005-09-23  Daniel Burrows  <dburrows at debian.org>
 
+	* src/vscreen/vs_container.h, src/vscreen/vs_menubar.cc, src/vscreen/vs_menubar.h, src/vscreen/vs_passthrough.cc, src/vscreen/vs_passthrough.h:
+
+	  Add a routine to fetch the 'active' widget of a container (where
+	  the definition of 'active' varies by widget, but is usually the
+	  widget with the interaction focus).
+
 	* src/ui.cc:
 
 	  Add shortcut characters to the Resolver menu.

Modified: branches/aptitude-0.3/aptitude/src/vscreen/vs_container.h
==============================================================================
--- branches/aptitude-0.3/aptitude/src/vscreen/vs_container.h	(original)
+++ branches/aptitude-0.3/aptitude/src/vscreen/vs_container.h	Fri Sep 23 23:30:06 2005
@@ -53,6 +53,8 @@
     rem_widget(vs_widget_ref(&w));
   }
 
+  /** Return the currently "active" child of this container, or \b NULL. */
+  virtual vs_widget_ref get_active_widget() = 0;
 
   /** Display this widget and all its subwidgets. */
   virtual void show_all()=0;

Modified: branches/aptitude-0.3/aptitude/src/vscreen/vs_menubar.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/vscreen/vs_menubar.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/vscreen/vs_menubar.cc	Fri Sep 23 23:30:06 2005
@@ -31,6 +31,11 @@
   assert(active_menus.empty());
 }
 
+vs_widget_ref vs_menubar::get_active_widget()
+{
+  return subwidget;
+}
+
 void vs_menubar::destroy()
 {
   vs_widget_ref tmpref(this);

Modified: branches/aptitude-0.3/aptitude/src/vscreen/vs_menubar.h
==============================================================================
--- branches/aptitude-0.3/aptitude/src/vscreen/vs_menubar.h	(original)
+++ branches/aptitude-0.3/aptitude/src/vscreen/vs_menubar.h	Fri Sep 23 23:30:06 2005
@@ -91,6 +91,9 @@
 
   ~vs_menubar();
 
+  /** The 'active' widget of a menubar is always its subwidget. */
+  vs_widget_ref get_active_widget();
+
   void destroy();
 
   int width_request();

Modified: branches/aptitude-0.3/aptitude/src/vscreen/vs_passthrough.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/vscreen/vs_passthrough.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/vscreen/vs_passthrough.cc	Fri Sep 23 23:30:06 2005
@@ -10,6 +10,11 @@
   unfocussed.connect(sigc::mem_fun(*this, &vs_passthrough::lost_focus));
 }
 
+vs_widget_ref vs_passthrough::get_active_widget()
+{
+  return get_focus();
+}
+
 void vs_passthrough::defocus()
 {
   lost_focus();

Modified: branches/aptitude-0.3/aptitude/src/vscreen/vs_passthrough.h
==============================================================================
--- branches/aptitude-0.3/aptitude/src/vscreen/vs_passthrough.h	(original)
+++ branches/aptitude-0.3/aptitude/src/vscreen/vs_passthrough.h	Fri Sep 23 23:30:06 2005
@@ -29,6 +29,9 @@
 public:
   // Returns the currently focussed widget, if any.
   virtual vs_widget_ref get_focus()=0;
+
+  vs_widget_ref get_active_widget();
+
   virtual void dispatch_mouse(short id, int x, int y, int z, mmask_t bstate);
 
   virtual bool focus_me();



More information about the Aptitude-svn-commit mailing list