示例#1
0
    public static void Main(string [] args)
    {
        Application.Init();

        Window win = new Window("EFL# Demo App");

        win.Resize(640, 480);

        Application.EE.ResizeEvent += AppResizeHandler;

        /* integrate this code in the Window class */
        Edje win_bg = new Edje(Application.EE.Get());

        win_bg.FileSet(DataConfig.DATADIR + "/data/eblocks/themes/e17.edj", "window");
        win_bg.Resize(640, 480);
        win_bg.Move(0, 0);
        win_bg.Lower();
        win_bg.Show();

        MenuItem item;
        MenuItem entry;

        MenuBar mb = new MenuBar();

        mb.Move(0, 0);
        mb.Resize(640, 35);
        mb.Spacing = 15;

        item = new MenuItem("_File");
        Menu file_menu = new Menu();

        entry = new MenuItem(file_menu.Canvas, "_Open");
        file_menu.Append(entry);
        entry = new MenuItem(file_menu.Canvas, "_Close");
        file_menu.Append(entry);
        entry = new MenuItem(file_menu.Canvas, "_Save");
        file_menu.Append(entry);

        item.SubMenu = file_menu;

        mb.Append(item);

        item = new MenuItem("_Edit");
        Menu edit_menu = new Menu();

        entry = new MenuItem(edit_menu.Canvas, "_Copy");
        edit_menu.Append(entry);
        entry = new MenuItem(edit_menu.Canvas, "_Cut");
        edit_menu.Append(entry);
        entry = new MenuItem(edit_menu.Canvas, "_Paste");
        edit_menu.Append(entry);

        item.SubMenu = edit_menu;
        mb.Append(item);

        item = new MenuItem("_About");
        //item.SubMenu = about_menu;
        mb.Append(item);

        mb.Show();

        Button button;

        HBox box_left = new HBox();

        box_left.Move(0, 37);
        box_left.Resize(70, 480 - 37);

        VBox box_icons = new VBox();

        box_icons.Spacing = 0;
        box_icons.Resize(64, 480 - 37);

        button = new Button("Tile");
        button.Resize(64, 64);
        box_icons.PackEnd(button);
        button = new Button("Stretch");
        button.Resize(64, 64);
        box_icons.PackEnd(button);
        button = new Button("Rotate");
        button.Resize(64, 64);
        box_icons.PackEnd(button);
        button = new Button("Flip");
        button.Resize(64, 64);
        box_icons.PackEnd(button);
        button = new Button("Quit");
        button.MouseUpEvent += new Enlightenment.Evas.Item.EventHandler(AppQuitButtonHandler);
        button.Resize(64, 64);
        box_icons.PackEnd(button);

        box_left.PackEnd(box_icons);

        Enlightenment.Eblocks.Line vline = new Enlightenment.Eblocks.Line(Application.EE.Get());
        vline.Vertical = true;
        vline.Resize(6, 480 - 37);

        box_left.PackEnd(vline);

        box_left.Show();

        dir = args[0];

        imageTable = new Table(Application.EE.Get(), items);

        HBox box_images = new HBox();

        box_images.Move(70, 37);
        box_images.Spacing = 0;
        box_images.Resize(640 - 70 - 2, 480 - 37 - 2);
        box_images.PackStart(imageTable);

        Application.EE.DataSet("box_images", box_images);
        Application.EE.DataSet("box_left", box_left);
        Application.EE.DataSet("box_icons", box_icons);
        Application.EE.DataSet("win_bg", win_bg);
        Application.EE.DataSet("vline", vline);
        Application.EE.DataSet("mb", mb);

        WaitCallback callback = new WaitCallback(Callback);

        ThreadPool.QueueUserWorkItem(callback);

        win.ShowAll();

        Application.Run();
    }
示例#2
0
  public static void Main(string [] args)
  {	
    Application.Init();

    Window win = new Window("EFL# Demo App");	
    win.Resize(640, 480);

    Application.EE.ResizeEvent += AppResizeHandler;

    /* integrate this code in the Window class */
    Edje win_bg = new Edje(Application.EE.Get());
    win_bg.FileSet(DataConfig.DATADIR + "/data/eblocks/themes/e17.edj","window");
    win_bg.Resize(640, 480);
    win_bg.Move(0, 0);
    win_bg.Lower();
    win_bg.Show();
    
    MenuItem item;    
    MenuItem entry;

    MenuBar mb = new MenuBar();
    mb.Move(0, 0);
    mb.Resize(640, 35);
    mb.Spacing = 15;

    item = new MenuItem("_File");
    Menu file_menu = new Menu();
    
    entry = new MenuItem(file_menu.Canvas, "_Open");
    file_menu.Append(entry);
    entry = new MenuItem(file_menu.Canvas, "_Close");
    file_menu.Append(entry);
    entry = new MenuItem(file_menu.Canvas, "_Save");
    file_menu.Append(entry);
    
    item.SubMenu = file_menu;
    
    mb.Append(item);

    item = new MenuItem("_Edit");
    Menu edit_menu = new Menu();
    
    entry = new MenuItem(edit_menu.Canvas, "_Copy");
    edit_menu.Append(entry);
    entry = new MenuItem(edit_menu.Canvas, "_Cut");
    edit_menu.Append(entry);
    entry = new MenuItem(edit_menu.Canvas, "_Paste");
    edit_menu.Append(entry);
    
    item.SubMenu = edit_menu;
    mb.Append(item);

    item = new MenuItem("_About");
    //item.SubMenu = about_menu;
    mb.Append(item);

    mb.Show();

    Button button;	

    HBox box_left = new HBox();
    box_left.Move(0, 37);
    box_left.Resize(70, 480 - 37);
	
    VBox box_icons = new VBox();
    box_icons.Spacing = 0;
    box_icons.Resize(64, 480 - 37);
	
    button = new Button("Tile");
    button.Resize(64, 64);
    box_icons.PackEnd(button);
    button = new Button("Stretch");
    button.Resize(64, 64);
    box_icons.PackEnd(button);	
    button = new Button("Rotate");
    button.Resize(64, 64);
    box_icons.PackEnd(button);	
    button = new Button("Flip");
    button.Resize(64, 64);
    box_icons.PackEnd(button);	
    button = new Button("Quit");
    button.MouseUpEvent += new Enlightenment.Evas.Item.EventHandler(AppQuitButtonHandler);
    button.Resize(64, 64);	
    box_icons.PackEnd(button);		
	
    box_left.PackEnd(box_icons);
	
    Enlightenment.Eblocks.Line vline = new Enlightenment.Eblocks.Line(Application.EE.Get());
    vline.Vertical = true;
    vline.Resize(6, 480 - 37);
	
    box_left.PackEnd(vline);
	
    box_left.Show();
	
    dir = args[0];	
	       	
    imageTable = new Table(Application.EE.Get(), items);
	
    HBox box_images = new HBox();
    box_images.Move(70, 37);
    box_images.Spacing = 0;
    box_images.Resize(640 - 70 - 2, 480 - 37 - 2);
    box_images.PackStart(imageTable);
	
    Application.EE.DataSet("box_images", box_images);
    Application.EE.DataSet("box_left", box_left);
    Application.EE.DataSet("box_icons", box_icons);
    Application.EE.DataSet("win_bg", win_bg);
    Application.EE.DataSet("vline", vline);
    Application.EE.DataSet("mb", mb);
	
    WaitCallback callback = new WaitCallback(Callback);
    ThreadPool.QueueUserWorkItem(callback);	

    win.ShowAll();
	
    Application.Run();
  }