view jface/user/PopUp.d @ 147:5f508f322464

more JFace examples
author Frank Benoit <benoit@tionex.de>
date Sat, 16 Aug 2008 13:21:55 +0200
parents
children 80f47186dc48
line wrap: on
line source

module user.PopUp;
import tango.util.log.Trace;

import dwt.dwthelper.utils;
import dwt.DWT;

import dwt.layout.GridLayout;
import dwt.layout.GridData;

import dwt.graphics.Image;

import dwt.widgets.Text;
import dwt.widgets.Control;
import dwt.widgets.Composite;
import dwt.widgets.Group;
import dwt.widgets.Display;
import dwt.widgets.Shell;
import dwt.widgets.Listener;
import dwt.widgets.Event;
import dwt.widgets.Button;

import dwtx.jface.dialogs.PopupDialog;

import dwtx.jface.window.ApplicationWindow;

class App : ApplicationWindow {

    this(){
        super(null);
        setBlockOnOpen(true);
    }
    protected override Control createContents(Composite parent) {
        Composite comp = cast(Composite)super.createContents(parent);
        getShell().setText("Test PopupDialog");

        comp.setLayout(new GridLayout(1, false));


        auto btn = new Button( comp, DWT.PUSH );
        btn.addListener( DWT.Selection, dgListener( & doBtn1 ));
        btn.setText( "Btn 1" );
        return comp;
    }
    void doBtn1( Event e ){
        Trace.formatln( "btn1");
        auto pu = new PopupDialog(
            getShell(),
            PopupDialog.HOVER_SHELLSTYLE ,
            true,
            true,
            true,
            true,
            true,
            "Title",
            "Info line...");
        pu.open();
    }
    void doBtn2( Event e ){
        Trace.formatln( "btn1");
        auto pu = new PopupDialog(
            getShell(),
            PopupDialog.HOVER_SHELLSTYLE,
            false,
            true,
            true,
            true,
            true,
            "Title",
            "Text\non the other line...");
        pu.open();
    }

}



void main(){
    auto d = new Display();
    auto app = new App();
    app.open();
}