summaryrefslogtreecommitdiff
path: root/iup/test/frame.c
blob: 2bcd12865ce5c4d8527bd02b2af1229a7ba553c9 (plain)
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
#include <stdlib.h>
#include <stdio.h>
#include "iup.h"

void FrameTest(void)
{
  Ihandle *dlg, *frame1, *frame2;

  frame1 = IupFrame
          (
            IupVbox
            (
              IupLabel("Label1"),
              IupSetAttributes(IupLabel("Label2"), "SIZE=70x"),
              IupLabel("Label3"),
              NULL
            )
          );

  frame2 = IupFrame
          (
            IupVbox
            (
              IupSetAttributes(IupLabel("Label4"), "EXPAND=HORIZONTAL"),
              IupLabel("Label5"),
              IupLabel("Label6"),
              NULL
            )
          );

  IupSetAttribute(frame1, "TITLE", "Title Text");
//  IupSetAttribute(frame1, "FGCOLOR", "255 0 0");
//  IupSetAttribute(frame1, "BGCOLOR", "0 128 0");
  IupSetAttribute(frame2, "SUNKEN", "YES");

  IupSetAttribute(frame1, "MARGIN", "0x0");
  IupSetAttribute(frame2, "MARGIN", "0x0");
//  IupSetAttribute(frame2, "BGCOLOR", "0 128 0");
  dlg = IupDialog(IupHbox(frame1, frame2, NULL));

  IupSetAttribute(dlg, "TITLE", "IupFrame Test");
  IupSetAttribute(dlg, "MARGIN", "10x10");
  IupSetAttribute(dlg, "GAP", "5");
  IupSetAttribute(dlg, "FONTSIZE", "14");
//  IupSetAttribute(dlg, "RASTERSIZE", "300x200");
//  IupSetAttribute(dlg, "BGCOLOR", "0 128 0");

  IupShow(dlg);
  printf("RASTERSIZE(%s)\n", IupGetAttribute(frame1, "RASTERSIZE"));
  printf("CLIENTSIZE(%s)\n", IupGetAttribute(frame1, "CLIENTSIZE"));
  printf("RASTERSIZE(%s)\n", IupGetAttribute(frame2, "RASTERSIZE"));
  printf("CLIENTSIZE(%s)\n", IupGetAttribute(frame2, "CLIENTSIZE"));
}

#ifndef BIG_TEST
int main(int argc, char* argv[])
{
  IupOpen(&argc, &argv);

  FrameTest();

  IupMainLoop();

  IupClose();

  return EXIT_SUCCESS;
}
#endif