SOL9 2.0 Sample: PageSetup

SOL9 2.0 Samples

1 Screenshot


2 Source code

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


// SOL++2000
// 2000.02.18


#include <sol\ApplicationView.h>
#include <sol\ScrolledText.h>
#include <sol\PageSetupDialog.h>
#include "resource.h"

namespace SOL {

class Editor :public ApplicationView {
private:
    ScrolledText    text;
    PageSetupDialog  pageSetup;

private:
    void setup(Action& action)
    {
        pageSetup.popup(action);
        if(action.getResult()) {
            showMessageDialog(_T("Editor"), _T("PageSetup OK"));
        }
    }


public:
    Editor(Application& applet, const TCHAR* name, Args& args) 
    :ApplicationView(applet, name, args)
    {
        Args ar;
        ar.set(XmNexStyle, (ulong)WS_EX_ACCEPTFILES);
        text.create(this, NULL, ar);
        // 1999.09.25
        add(text);

        ar.reset();
        pageSetup.create(this, NULL, ar);
        addCallback(XmNmenuCallback, ID_OPTION_SETUP, this, 
            (Callback)&Editor::setup, NULL);

        addCallback(XmNmenuCallback, ID_FILE_EXIT, this, 
            (Callback)&Editor::exit, NULL);

        restorePlacement();
    }
};

}

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

        Args args;
        Editor editor(applet, name, args);
        editor.realize();

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

    }
}


Last modified: 11 Nov 2009

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