summaryrefslogtreecommitdiff
path: root/unsorted/evas/evas_mono_table.cs
blob: 7dfb56b9e2744435cc123eaaf4dbc21e12b1bca4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
using System;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;

class TestMain
{
    static int WIDTH = 100;
    static int HEIGHT = 150;

    static void Main(string[] args)
    {
        Efl.All.Init();

        Efl.Loop loop = new Efl.Loop();

        EcoreEvas ecore_evas = new EcoreEvas();
        
        Eina.Size2D size = new Eina.Size2D();
        size.W = WIDTH;
        size.H = HEIGHT;

        Eina.Size2D hint = new Eina.Size2D();

        Efl.Canvas.Object canvas = ecore_evas.canvas;
        canvas.SetVisible(true);

        Efl.Object parent = canvas.GetParent();
        System.Diagnostics.Debug.Assert(parent.raw_handle != IntPtr.Zero);
        
        Efl.Canvas.Rectangle bg = new Efl.Canvas.Rectangle(canvas);
        bg.SetColor(255, 255, 255, 255);
        bg.SetSize(size);
        bg.SetVisible(true);


        evas.Table table = new evas.Table(canvas);
        table.SetHomogeneous(evas.object_table.Homogeneous_Mode.None);
        table.SetPadding(0, 0);
        table.SetSize(size);
        table.SetVisible(true);

        Efl.Canvas.Rectangle rect = new Efl.Canvas.Rectangle(canvas);
        rect.SetColor(255, 0, 0, 255);
        hint.W = 100;
        hint.H = 50;
        rect.SetHintMin(hint);
        rect.SetVisible(true);
        table.Pack(rect, 1, 1, 2, 1);
        
        rect = new Efl.Canvas.Rectangle(canvas);
        rect.SetColor(0, 255, 0, 255);
        hint.W = 50;
        hint.H = 100;
        rect.SetHintMin(hint);
        rect.SetVisible(true);
        table.Pack(rect, 1, 2, 1, 2);

        rect = new Efl.Canvas.Rectangle(canvas);
        rect.SetColor(0, 0, 255, 255);
        hint.W = 50;
        hint.H = 50;
        rect.SetHintMin(hint);
        rect.SetVisible(true);
        table.Pack(rect, 2, 2, 1, 1);

        rect = new Efl.Canvas.Rectangle(canvas);
        rect.SetColor(255, 255, 0, 255);
        rect.SetHintMin(hint);
        rect.SetVisible(true);
        table.Pack(rect, 2, 3, 1, 1);
        
        loop.Begin();

        Efl.All.Shutdown();
    }
}