SOL9 2.0 Sample: FlowLayout

SOL9 2.0 Samples

1 Screenshot


2 Source code

/*
 * FlowLayout.cpp 
 * Copyright (c) 2009 Antillia.com TOSHIYUKI ARAI. ALL RIGHTS RESERVED. 
 */



// SOL++2000 
// 2000.02.18


#include <sol\ApplicationView.h>
#include <sol\PaintDC.h>
#include <sol\FlowLayout.h>
#include <sol\PushButton.h>
#include <sol\Font.h>

namespace SOL {

class AppView :public ApplicationView {
    PushButton        buttons[5];
    FlowLayout        flowLayout;
    Font            font;

  public:
        AppView(Application& applet, const TCHAR* label, Args& args)
        :ApplicationView(applet, label, args)
    {
        setLayout(&flowLayout);

        Args ar;
        
        for(int i = 0; i<5; i++) {
            TCHAR string[128];
            _stprintf_s(string, SizeOf(string), _T("Hello Button %d"), i);
            ar.reset();
            buttons[i].create(this, string, ar);
            add(buttons[i]);
        }
    }
};

}

void    Main(int argc, TCHAR** argv)
{
    const TCHAR* name = _T("FlowLayout");
    try {
        Application applet(name, argc, argv);

        Args args;
    
        //2009/10/12
        args.set(XmNclassStyle, 0);

        AppView appview(applet, name, args);
        appview.realize();

        applet.run();
    } catch (...) {

    }
}


Last modified: 11 Nov 2009

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