/* the application specific details */
#define DISPLAYWIDTH 237
#define ACTIONNONE 0
#define ACTIONCLEAR 1
#define ACTIONCLEARDISPLAY 2
#define ACTIONFILL 3
#define ACTIONQUIT 4
#define ACTIONCHANGECOLOR 5
#define ACTIONSCROLLBAR 8
#define ACTIONNEXTPAGE 10
#define ACTIONPREVIOUSPAGE 11
#define ACTIONENTERTEXT 20
#define ALLDISPLAYOBJECTLISTSMAX 3
displayobjectptr allDisplayObjectLists[ ALLDISPLAYOBJECTLISTSMAX ] ;
#define MENUHEAD 0
#define STATUSAREA 1
#define USERTEXTAREA 2
VOID emptyAllDisplayObjectLists ( VOID )
{ int i;
for ( i = 0 ; i < ALLDISPLAYOBJECTLISTSMAX ; i++ )
{
allDisplayObjectLists[ i ] = deletedisplayobjectList( allDisplayObjectLists[ i ] );
}
} /* end emptyAllDisplayObjectLists */
VOID showAllDisplayObjectLists ( HWND hwnd )
{ int i;
for ( i = 0 ; i < ALLDISPLAYOBJECTLISTSMAX; i++ )
{
showdisplayobjectWinGUI ( hwnd , allDisplayObjectLists[ i ] );
}
}/* end showAllDisplayObjectLists */
VOID populateAllDisplayObjectLists ( VOID )
{ int i;
displayobjectptr temp ;
displayobjectptr tail ;
for ( i = 0 ; i < ALLDISPLAYOBJECTLISTSMAX; i++ )
{
allDisplayObjectLists[ i ] = initializedisplayobject ( );
}
if( MENUHEAD >= ALLDISPLAYOBJECTLISTSMAX ||
STATUSAREA >= ALLDISPLAYOBJECTLISTSMAX ||
USERTEXTAREA >= ALLDISPLAYOBJECTLISTSMAX )
{
exit( 1 ); /* error out of array bounds */
}
wcscpy( allDisplayObjectLists[ USERTEXTAREA ]->data ,L" ");
allDisplayObjectLists[ USERTEXTAREA ] -> location.left = 0 ;
allDisplayObjectLists[ USERTEXTAREA ] -> location.top = 20 ;
allDisplayObjectLists[ USERTEXTAREA ] -> location.right = DISPLAYWIDTH ;
allDisplayObjectLists[ USERTEXTAREA ] -> location.bottom = 40 ;
allDisplayObjectLists[ USERTEXTAREA ] -> location.color = currentForegroundColor[ currentForegroundColorIndex ] ;
allDisplayObjectLists[ USERTEXTAREA ] -> actionlist [0] = ACTIONENTERTEXT ;
wcscpy( allDisplayObjectLists[ STATUSAREA ]->data ,L" STATUS");
allDisplayObjectLists[ STATUSAREA ] -> location.left = 120 ;
allDisplayObjectLists[ STATUSAREA ] -> location.top = 0 ;
allDisplayObjectLists[ STATUSAREA ] -> location.right = DISPLAYWIDTH ;
allDisplayObjectLists[ STATUSAREA ] -> location.bottom = 20 ;
allDisplayObjectLists[ STATUSAREA ] -> location.color = currentForegroundColor[ currentForegroundColorIndex ] ;
allDisplayObjectLists[ STATUSAREA ] -> actionlist [0] = ACTIONSCROLLBAR ;
displayobjectChangeData ( allDisplayObjectLists[ MENUHEAD ] , L"QUIT");
allDisplayObjectLists[ MENUHEAD ] -> location.left = 0 ;
allDisplayObjectLists[ MENUHEAD ] -> location.top = 0 ;
allDisplayObjectLists[ MENUHEAD ] -> location.right = 30 ;
allDisplayObjectLists[ MENUHEAD ] -> location.bottom = 20 ;
allDisplayObjectLists[ MENUHEAD ] -> location.color = RGB( 255 , 0 ,0 ) ;
allDisplayObjectLists[ MENUHEAD ] -> actionlist [0] = ACTIONQUIT ;
temp = initializedisplayobject( );
displayobjectChangeData ( temp , L" clear");
temp -> location.left = 30 ;
temp -> location.top = 0 ;
temp -> location.right = 60 ;
temp -> location.bottom = 20 ;
temp -> location.color = RGB( 0 ,0,0) ;
temp -> actionlist [0] = ACTIONCLEARDISPLAY ;
tail = allDisplayObjectLists[ MENUHEAD ] ;
appenddisplayobjectList( tail , temp );
tail = temp ;
temp = NULL ;
temp = initializedisplayobject( );
displayobjectChangeData ( temp , L" next");
temp -> location.left = 60 ;
temp -> location.top = 0 ;
temp -> location.right = 90 ;
temp -> location.bottom = 20 ;
temp -> location.color = RGB( 0 ,0,0) ;
temp -> actionlist [0] = ACTIONNEXTPAGE ;
appenddisplayobjectList( tail , temp );
tail = temp ;
temp = NULL ;
temp = initializedisplayobject( );
displayobjectChangeData ( temp , L" prev");
temp -> location.left = 90 ;
temp -> location.top = 0 ;
temp -> location.right = 120 ;
temp -> location.bottom = 20 ;
temp -> location.color = RGB( 0 ,0,0) ;
temp -> actionlist [0] = ACTIONPREVIOUSPAGE ;
appenddisplayobjectList( tail , temp );
tail = temp ;
temp = NULL ;
}/* end populateAllDisplayObjectLists */