6 * (C) Copyright 1998 Manuel Lemos.
7 * (C) Copyright 1995-1996 Jaba Development.
8 * (C) Copyright 1995-1996 Jan van den Baard.
11 * This example will show the most simple form of
12 * a DragNDrop Listview. It opens a window with a
13 * single-select Listview object.
15 * The entries in the Listview can be moved in the
19 * Revision 42.1 2000/08/10 11:50:54 chodorowski
20 * Cleaned up and prettyfied the GUIs a bit.
22 * Revision 42.0 2000/05/09 22:19:53 mlemos
23 * Bumped to revision 42.0 before handing BGUI to AROS team
25 * Revision 41.11 2000/05/09 20:33:43 mlemos
26 * Bumped to revision 41.11
28 * Revision 1.2 2000/05/09 19:59:00 mlemos
29 * Merged with the branch Manuel_Lemos_fixes.
31 * Revision 1.1.2.1 1998/02/28 17:45:26 mlemos
37 /* Execute me to compile with DICE V3.0
38 dcc List.c -proto -mi -ms -mRR -lbgui
46 * Just a bunch of entries...
48 STATIC UBYTE
*entries
[] = {
77 static char *TabLabels
[] =
84 ** Cycle to Page map-list.
86 static struct TagItem Cyc2Page
[] = { { MX_Active
, PAGE_Active
, }, { TAG_END
} };
91 VOID
StartDemo( void )
93 struct Window
*window
;
94 Object
*WO_Window
, *tabs
, *page
;
100 * Build the window object tree.
102 WO_Window
= WindowObject
,
103 WINDOW_Title
, "Listview DragNDrop",
104 WINDOW_ScaleWidth
, 25,
105 WINDOW_ScaleHeight
, 20,
106 WINDOW_RMBTrap
, TRUE
,
107 WINDOW_AutoAspect
, TRUE
,
108 WINDOW_AutoKeyLabel
, TRUE
,
109 WINDOW_CloseOnEsc
, TRUE
,
111 VGroupObject
, NormalOffset
, Spacing( 0 ),
113 tabs
= Tabs(NULL
, TabLabels
, 0, 0),
116 page
= PageObject
, FRM_Type
, FRTYPE_TAB_ABOVE
,
118 VGroupObject
, WideVOffset
, WideHOffset
, NormalSpacing
,
120 InfoFixed(NULL
, ISEQ_C
"Single-Select Drag-n-Drop\nListview object.", NULL
, 2 ), FixMinHeight
,
124 * Create a draggable and droppable listview
125 * and make it show the drop-spot.
128 LISTV_EntryArray
, entries
,
129 LISTV_ShowDropSpot
, TRUE
,
136 VGroupObject
, WideVOffset
, WideHOffset
, NormalSpacing
,
138 InfoFixed( NULL
, ISEQ_C
"Multi-Select Drag-n-Drop\nListview object.", NULL
, 2 ), FixMinHeight
,
142 * Create a multi-select, draggable and
143 * droppable listview and make it show
147 LISTV_MultiSelect
, TRUE
,
148 LISTV_EntryArray
, entries
,
149 LISTV_ShowDropSpot
, TRUE
,
158 HGroupObject
, NormalOffset
, NormalSpacing
,
159 VarSpace( DEFAULT_WEIGHT
),
160 StartMember
, PrefButton( "_Quit", ID_QUIT
), EndMember
,
161 VarSpace( DEFAULT_WEIGHT
),
162 EndObject
, FixMinHeight
,
168 * Window object tree OK?
172 ** Connect the cycle to the page.
174 AddMap(tabs
, page
, Cyc2Page
);
178 if (( window
= WindowOpen( WO_Window
))) {
180 * Get signal wait mask.
182 GetAttr( WINDOW_SigMask
, WO_Window
, &signal
);
189 while (( rc
= HandleEvent( WO_Window
)) != WMHI_NOMORE
) {
191 case WMHI_CLOSEWINDOW
:
199 Tell( "Unable to open the window.\n" );
200 DisposeObject( WO_Window
);
202 Tell( "Unable to create the window object.\n" );