SOL9 2.0 Sample: IPAddressField

SOL9 2.0 Samples

1 Screenshot


2 Source code

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


// SOL++2000
// 2000.02.18

#include <sol\ApplicationView.h>
#include <sol\IPAddressField.h>
#include <sol\FlowLayout.h>
#include <sol\Static.h>

namespace SOL {

class AppView :public ApplicationView {
private:
    FlowLayout    flowLayout;
    Static        label;
    IPAddressField    addressField;

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

        Args ar;
        label.create(this, _T("IPAddress"), ar);
        add(label);

        ar.reset();
        ar.set(XmNwidth, 200);
        ar.set(XmNheight, 24);
        addressField.create(this, NULL, ar);

        Dimension dim(200, 24);
        addressField.setPreferredSize(dim);
        addressField.setAddress(255, 255, 255, 0);
        add(addressField);

    //    addressField -> addCallback(XmNactivateCallback, this,
    //        (Callback)exec, NULL);
    }
};

}

//
void    Main(int argc, TCHAR** argv)
{
    const TCHAR* appClass = _T("IPAddressFieldApplet");
    try {
        Application applet(appClass, argc, argv);

        Args args;
        args.set(XmNbackground, (COLOR_BTNFACE+1));
        args.set(XmNwidth, 400);
        args.set(XmNheight, 120);

        AppView appView(applet, appClass, args);
        appView.realize();
        applet.run();
    } catch (...) {

    }
}


Last modified: 11 Nov 2009

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