Ticket #5525: groupView.patch

File groupView.patch, 1.9 KB (added by yourpalal, 11 years ago)

implement archiving of BGroupView class

  • headers/os/interface/GroupView.h

     
    1818                                BGroupView(const char* name,
    1919                                    enum orientation orientation = B_HORIZONTAL,
    2020                                    float spacing = 0.0f);
     21                                BGroupView(BMessage* from);
    2122    virtual                     ~BGroupView();
    2223
    2324    virtual void                SetLayout(BLayout* layout);
     25            BGroupLayout*       GroupLayout() const;
    2426
    25             BGroupLayout*       GroupLayout() const;
     27    static  BArchivable*        Instantiate(BMessage* from);
    2628};
    2729
    2830
  • src/kits/interface/GroupView.cpp

     
    11/*
     2 * Copyright 2010, Haiku, Inc.
    23 * Copyright 2006, Ingo Weinhold <bonefish@cs.tu-berlin.de>.
    34 * All rights reserved. Distributed under the terms of the MIT License.
    45 */
     
    89
    910
    1011BGroupView::BGroupView(enum orientation orientation, float spacing)
    11     : BView(NULL, 0, new BGroupLayout(orientation, spacing))
     12    :
     13    BView(NULL, 0, new BGroupLayout(orientation, spacing))
    1214{
    1315    SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
    1416}
     
    1618
    1719BGroupView::BGroupView(const char* name, enum orientation orientation,
    1820    float spacing)
    19     : BView(name, 0, new BGroupLayout(orientation, spacing))
     21    :
     22    BView(name, 0, new BGroupLayout(orientation, spacing))
    2023{
    2124    SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
    2225}
    2326
    2427
     28BGroupView::BGroupView(BMessage* from)
     29    :
     30    BView(from)
     31{
     32}
     33
     34
    2535BGroupView::~BGroupView()
    2636{
    2737}
     
    3848}
    3949
    4050
     51BArchivable*
     52BGroupView::Instantiate(BMessage* from)
     53{
     54    if (validate_instantiation(from, "BGroupView"))
     55        return new BGroupView(from);
     56    return NULL;
     57}
     58
     59
    4160BGroupLayout*
    4261BGroupView::GroupLayout() const
    4362{