home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CDPD Public Domain Collection for CDTV 3
/
CDPDIII.bin
/
pd
/
programming
/
utils
/
dialoglib
/
examples.lha
/
test03.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-03-09
|
3KB
|
119 lines
#include <exec/nodes.h>
#include <exec/lists.h>
#include <libraries/gadtools.h>
#include <utility/tagitem.h>
#include <proto/exec.h>
#include <proto/gadtools.h>
#include <proto/intuition.h>
#include <proto/utility.h>
#include <dialog/dialog.h>
struct Screen *myScreen;
APTR myVisualInfo;
VOID dialog( VOID )
{
DialogElement root, vstack, hstack1, hstack, hspring, ok, hstack2, *termination;
DialogElement listview1, listview2, listview3, listview4;
ULONG error = 0;
initDialogElement( &root, NULL, dispatchRoot, &error,
DA_Screen, myScreen,
DA_Member, &vstack,
WA_Activate, TRUE,
WA_DragBar, TRUE,
TAG_DONE );
initDialogElement( &vstack, &root, dispatchVStack, &error,
DA_Member, &hstack1,
DA_Member, &hstack,
DA_Member, &hstack2,
TAG_DONE );
initDialogElement( &hstack, &root, dispatchHStack, &error,
DA_Member, &hspring,
DA_Member, &ok,
DA_Member, &hspring,
TAG_DONE );
initDialogElement( &hspring, &root, dispatchHSpring, &error, TAG_DONE );
initDialogElement( &ok, &root, dispatchButton, &error,
NGDA_TextAttr, myScreen->Font,
NGDA_VisualInfo, myVisualInfo,
NGDA_GadgetText, "_Ok",
GT_Underscore, '_',
DA_EquivalentKey, 'O',
DA_Termination, TRUE,
TAG_DONE );
initDialogElement( &hstack1, &root, dispatchHStack, &error,
DA_Member, &listview1,
DA_Member, &listview4,
TAG_DONE );
initDialogElement( &hstack2, &root, dispatchHStack, &error,
DA_Member, &listview3,
DA_Member, &listview2,
TAG_DONE );
initDialogElement( &listview1, &root, dispatchListView, &error,
NGDA_TextAttr, myScreen->Font,
NGDA_VisualInfo, myVisualInfo,
NGDA_GadgetText, "placement left",
NGDA_Flags, PLACETEXT_LEFT,
TAG_DONE );
initDialogElement( &listview2, &root, dispatchListView, &error,
NGDA_TextAttr, myScreen->Font,
NGDA_VisualInfo, myVisualInfo,
NGDA_GadgetText, "placement right",
NGDA_Flags, PLACETEXT_RIGHT,
TAG_DONE );
initDialogElement( &listview3, &root, dispatchListView, &error,
NGDA_TextAttr, myScreen->Font,
NGDA_VisualInfo, myVisualInfo,
NGDA_GadgetText, "placement above",
/* NGDA_Flags, PLACETEXT_ABOVE, *** default *** */
TAG_DONE );
initDialogElement( &listview4, &root, dispatchListView, &error,
NGDA_TextAttr, myScreen->Font,
NGDA_VisualInfo, myVisualInfo,
NGDA_GadgetText, "placement below",
NGDA_Flags, PLACETEXT_BELOW,
TAG_DONE );
if( error )
goto cleanup;
termination = runSimpleDialog( &root,
WA_Title, "Example : GadTools LISTVIEW",
WA_InnerWidth, 300,
WA_InnerHeight, 200,
TAG_DONE );
cleanup:
cleanupDialogElement( &listview1 );
cleanupDialogElement( &listview2 );
cleanupDialogElement( &listview3 );
cleanupDialogElement( &listview4 );
cleanupDialogElement( &ok );
cleanupDialogElement( &hstack );
cleanupDialogElement( &hspring );
cleanupDialogElement( &hstack1 );
cleanupDialogElement( &hstack2 );
cleanupDialogElement( &vstack );
cleanupDialogElement( &root );
}
main( int argc, char *argv[] )
{
myScreen = LockPubScreen( NULL );
if( !myScreen )
goto cleanup;
myVisualInfo = GetVisualInfo( myScreen, TAG_DONE );
if( !myVisualInfo )
goto cleanup;
dialog();
cleanup:
if( myVisualInfo )
FreeVisualInfo( myVisualInfo );
if( myScreen )
UnlockPubScreen( NULL, myScreen );
}