[haiku-commits] r37546 - in haiku/trunk: headers/os/interface src/kits/interface

  • From: ingo_weinhold@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 17 Jul 2010 02:46:40 +0200 (CEST)

Author: bonefish
Date: 2010-07-17 02:46:40 +0200 (Sat, 17 Jul 2010)
New Revision: 37546
Changeset: http://dev.haiku-os.org/changeset/37546

Modified:
   haiku/trunk/headers/os/interface/GroupView.h
   haiku/trunk/src/kits/interface/GroupView.cpp
Log:
Patch by Alex Wilson: Added archiving/unarchiving support.


Modified: haiku/trunk/headers/os/interface/GroupView.h
===================================================================
--- haiku/trunk/headers/os/interface/GroupView.h        2010-07-17 00:41:56 UTC 
(rev 37545)
+++ haiku/trunk/headers/os/interface/GroupView.h        2010-07-17 00:46:40 UTC 
(rev 37546)
@@ -18,11 +18,13 @@
                                                                
BGroupView(const char* name,
                                                                        enum 
orientation orientation = B_HORIZONTAL,
                                                                        float 
spacing = 0.0f);
+                                                               
BGroupView(BMessage* from);
        virtual                                         ~BGroupView();
 
        virtual void                            SetLayout(BLayout* layout);
+                       BGroupLayout*           GroupLayout() const;
 
-                       BGroupLayout*           GroupLayout() const;
+       static  BArchivable*            Instantiate(BMessage* from);
 };
 
 

Modified: haiku/trunk/src/kits/interface/GroupView.cpp
===================================================================
--- haiku/trunk/src/kits/interface/GroupView.cpp        2010-07-17 00:41:56 UTC 
(rev 37545)
+++ haiku/trunk/src/kits/interface/GroupView.cpp        2010-07-17 00:46:40 UTC 
(rev 37546)
@@ -1,4 +1,5 @@
 /*
+ * Copyright 2010, Haiku, Inc.
  * Copyright 2006, Ingo Weinhold <bonefish@xxxxxxxxxxxxxxx>.
  * All rights reserved. Distributed under the terms of the MIT License.
  */
@@ -8,7 +9,8 @@
 
 
 BGroupView::BGroupView(enum orientation orientation, float spacing)
-       : BView(NULL, 0, new BGroupLayout(orientation, spacing))
+       :
+       BView(NULL, 0, new BGroupLayout(orientation, spacing))
 {
        SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
 }
@@ -16,12 +18,20 @@
 
 BGroupView::BGroupView(const char* name, enum orientation orientation,
        float spacing)
-       : BView(name, 0, new BGroupLayout(orientation, spacing))
+       :
+       BView(name, 0, new BGroupLayout(orientation, spacing))
 {
        SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
 }
 
 
+BGroupView::BGroupView(BMessage* from)
+       :
+       BView(from)
+{
+}
+
+
 BGroupView::~BGroupView()
 {
 }
@@ -38,6 +48,15 @@
 }
 
 
+BArchivable*
+BGroupView::Instantiate(BMessage* from)
+{
+       if (validate_instantiation(from, "BGroupView"))
+               return new BGroupView(from);
+       return NULL;
+}
+
+
 BGroupLayout*
 BGroupView::GroupLayout() const
 {


Other related posts:

  • » [haiku-commits] r37546 - in haiku/trunk: headers/os/interface src/kits/interface - ingo_weinhold