forwarding build fix when MUIA_Scrollgroup_AutoBars is defined (NicJA).
[AROS-Contrib.git] / bgui / test / test6.c
blobd9124eb30a46a84d4fad085a2a4270806394f752
1 /*
2 ** test6.c
3 **
4 ** Bug No. 23 test code provided by Jilles Tjoelker.
5 */
7 #ifndef LIBRARIES_BGUI_H
8 #include <libraries/bgui.h>
9 #endif
11 #ifndef LIBRARIES_BGUI_MACROS_H
12 #include <libraries/bgui_macros.h>
13 #endif
15 #ifndef BGUI_PROTO_H
16 #include <proto/bgui.h>
17 #endif
19 #include <proto/intuition.h>
20 #include <proto/exec.h>
22 #include <stdio.h>
24 struct Library *BGUIBase=NULL;
25 struct IntuitionBase * IntuitionBase;
27 // In the E source, the font info objects had formatting.
28 // This is the "GUI" page.
30 #define ID_LFONT 1
31 #define ID_TFONT 1
32 #define ID_UITEM 1
33 #define ID_POPFILE 1
34 #define ID_EDIT 1
35 // For BGUI 41.8: prevents BCLR #7,8
36 #undef LISTV_Titles
37 #define LISTV_Titles TAG_IGNORE
39 // Object *w0,*w1,*w2,*i1,*i2,*i3;
40 ULONG weights[3]={15,200,300};
41 // The following are not in the E source:
42 STRPTR labels[]={"Nothing (-)","ARexx (A)",NULL};
43 ULONG umweights[]={50,7,100};
45 #define InfoMed InfoObj
47 Object *InitTest_6( void )
49 Object *win;
51 win = WindowObject,
52 WINDOW_SmartRefresh, TRUE,
53 WINDOW_AutoAspect, TRUE,
54 WINDOW_MasterGroup,
55 VGroupObject,NormalSpacing,NormalOffset,
57 StartMember,HGroupObject,NarrowSpacing,
59 StartMember,InfoMed("Message list","bbb/11",0,1),FixMinHeight,EndMember,
60 StartMember,ButtonObject,VIT_BuiltIn,BUILTIN_POPUP,GA_ID,ID_LFONT,EndObject,FixAspect(15,13),EndMember,
62 EndObject,FixMinHeight,EndMember,
63 StartMember,HGroupObject,NarrowSpacing,
65 StartMember,InfoMed("Message text","aaa/9",0,1),FixMinHeight,EndMember,
67 StartMember,ButtonObject,VIT_BuiltIn,BUILTIN_POPUP,GA_ID,ID_TFONT,EndObject,FixAspect(15,13),EndMember,
68 EndObject,FixMinHeight,EndMember,
70 EndObject,
71 EndObject;
73 return( win );
76 int main(int argc,char **argv)
78 Object *window;
80 if (NULL == (IntuitionBase = (struct IntuitionBase *)OpenLibrary("intuition.library",0)))
82 printf("Could not open Intuition.library!\n");
83 return -1;
86 if((BGUIBase=OpenLibrary(BGUINAME,BGUIVERSION)))
88 if((window=InitTest_6())!=NULL
89 && WindowOpen(window)!=NULL)
91 IPTR signal;
93 if(GetAttr(WINDOW_SigMask,window,&signal)
94 && signal!=0)
96 for(;;)
98 Wait(signal);
99 switch(HandleEvent(window))
101 case WMHI_CLOSEWINDOW:
102 break;
103 case WMHI_NOMORE:
104 default:
105 continue;
107 break;
110 DisposeObject(window);
112 CloseLibrary(BGUIBase);
114 CloseLibrary((struct Library *)IntuitionBase);
116 return 0;