SOL9 2.0 Class: DefaultLayout

 SOL9 C++ Class Library  SOL9 Samples  SOL9 Tutorial  SOL9 FAQ  SOL9 ClassTree 

Source code

/*
 * DefaultLayout.h 
 * Copyright (c) 2011 Antillia.com TOSHIYUKI ARAI. ALL RIGHTS RESERVED. 
 */


// SOL++2000
#pragma once

#include <sol/Composite.h>

#include <sol\LinkedList.h>

#include <sol\LayoutManager.h>

namespace SOL {

class View;

class DefaultLayout :public LayoutManager {
private:
    LinkedList list;
  
public:
    DefaultLayout()
    :list(False)
    {
    //
    }

public:
    virtual void add(View* view)
    {
        if (view) {
            list.add(view);
        }
    }

public:
    virtual void layout(int x, int y, int w, int h) 
    {

        ListEntry* ptr = list.getEntry();
        while (ptr) {
                View* view = (View*)ptr->getObject();
                if (view) {
                    view->reshape(x, y, w, h);
                }
                ptr = ptr->getNext();
        }
    }

/*    DefaultLayout();
    virtual    void add(View* view);
    virtual void layout(int x, int y, int w, int h);
    */
};

}


Last modified: 1 Feb 2012

Copyright (c) 2009-2012 Antillia.com ALL RIGHTS RESERVED.