Cary Sandvig 25 سال پیش
والد
کامیت
636f3abc61
2فایلهای تغییر یافته به همراه33 افزوده شده و 0 حذف شده
  1. 31 0
      panda/src/gui/guiListBox.cxx
  2. 2 0
      panda/src/gui/guiListBox.h

+ 31 - 0
panda/src/gui/guiListBox.cxx

@@ -515,6 +515,37 @@ void GuiListBox::set_priority(GuiItem* it, const GuiItem::Priority p) {
   _down_arrow->set_priority(it, p);
   _down_arrow->set_priority(it, p);
 }
 }
 
 
+int GuiListBox::set_draw_order(int v) {
+  int o = _up_arrow->set_draw_order(v);
+  o = _down_arrow->set_draw_order(o);
+
+  ItemVector::iterator i;
+  ItemDeque::iterator j;
+
+  for (i=_top_stack.begin(); i!=_top_stack.end(); ++i) {
+    if (*i == _up_arrow)
+      continue;
+    if (*i == _down_arrow)
+      continue;
+    o = (*i)->set_draw_order(o);
+  }
+  for (i=_visible.begin(); i!=_visible.end(); ++i) {
+    if (*i == _up_arrow)
+      continue;
+    if (*i == _down_arrow)
+      continue;
+    o = (*i)->set_draw_order(o);
+  }
+  for (j=_bottom_stack.begin(); j!=_bottom_stack.end(); ++j) {
+    if (*j == _up_arrow)
+      continue;
+    if (*j == _down_arrow)
+      continue;
+    o = (*j)->set_draw_order(o);
+  }
+  return GuiBehavior::set_draw_order(o);
+}
+
 void GuiListBox::output(ostream& os) const {
 void GuiListBox::output(ostream& os) const {
   GuiBehavior::output(os);
   GuiBehavior::output(os);
   os << "  Listbox data:" << endl;
   os << "  Listbox data:" << endl;

+ 2 - 0
panda/src/gui/guiListBox.h

@@ -69,6 +69,8 @@ PUBLISHED:
   virtual void stop_behavior(void);
   virtual void stop_behavior(void);
   virtual void reset_behavior(void);
   virtual void reset_behavior(void);
 
 
+  virtual int set_draw_order(int);
+
   virtual void output(ostream&) const;
   virtual void output(ostream&) const;
 public:
 public:
   // type interface
   // type interface