summaryrefslogtreecommitdiff
path: root/unsorted/evas/evas_mono_table.cs
blob: e79ad7c9567c3371a7e10ec32ecd96c0e0dc4e86 (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.LoopConcrete();

        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.RectangleConcrete(canvas);
        bg.SetColor(255, 255, 255, 255);
        bg.SetSize(size);
        bg.SetVisible(true);


        evas.Table table = new evas.TableConcrete(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.RectangleConcrete(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.RectangleConcrete(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.RectangleConcrete(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.RectangleConcrete(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();
    }
}