SOL9 Sample: PageSetup

SOL9 2.0 Samples

1 Screenshot


2 Source code

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


// SOL++2000
// 2000.02.18

#define COMMONCONTROLS_V6

#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)
{
  ModuleFileName module(argv[0]);
  const TCHAR* name = module.getFileName();
  try {
    Application applet(name, argc, argv);

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

    applet.run();

  } catch (Exception& ex) {
    caught(ex);
  } catch (...) {
    caught(UnknownException());
  }
}


Last modified: 1 Feb 2017

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