Beispiel #1
0
CDlg_Search::CDlg_Search(CWnd* pParent /*=NULL*/)
	: CDialog(CDlg_Search::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDlg_Search)
	m_sKeyword = _T("");
	//}}AFX_DATA_INIT
	m_bInit			= FALSE;
	m_bSelfDraw		= TRUE;

	m_BackBrush.CreateSolidBrush( (COLORREF) RGB(249, 250, 253) );

	InitObjects();

	m_nCurrType = TYPE_SRCH_RCMMWORD;
	m_strLoadCount = _T("");
	m_nSrchRange = TYPE_SRCH_RANGE_ALL;
	m_bMakeInfoNSetRange = FALSE;
	m_nNodeState = TYPE_SRCH_NETWORK_STATUS_0;

	m_hThread		= NULL;
	m_nThreadTry	= 0;

	m_bSearchTime	= TRUE;

	m_nSearchTimer	= NULL;
	m_nRecommTimer	= NULL;

	m_nValidRecomm	= NULL;

	m_rgnClip.CreateRectRgn(0, 0, 0, 0);

	m_vecRcmmWordList.clear();
}
Beispiel #2
0
void World::InitWorldObjects() {
	InitTextures();
	InitImages();
	InitSounds();
	InitObjects();
	InitSprites();
}
Beispiel #3
0
static void Init(void)
{

    numObjects = 10;
    InitObjects(numObjects);
    glGetIntegerv(GL_VIEWPORT, vp);
}
Beispiel #4
0
OpenGL::OpenGL(int argc, char* argv[])
{

    InitGL(argc, argv);
    InitObjects();
    glutMainLoop();
}
/**-----------------------------------------------------------------------------
 * 프로그램 시작점
 *------------------------------------------------------------------------------
 */
INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR, INT )
{
    /// 윈도우 클래스 등록
    WNDCLASSEX wc = { sizeof(WNDCLASSEX), CS_CLASSDC, MsgProc, 0L, 0L,
                      GetModuleHandle(NULL), NULL, NULL, NULL, NULL,
                      "BasicFrame", NULL };
    RegisterClassEx( &wc );

    /// 윈도우 생성
    HWND hWnd = CreateWindow( "BasicFrame", WINDOW_TITLE,
                              WS_OVERLAPPEDWINDOW, 100, 100, WINDOW_W, WINDOW_H,
                              GetDesktopWindow(), NULL, wc.hInstance, NULL );

	g_hwnd = hWnd;

	srand( GetTickCount() );

    /// Direct3D 초기화
    if( SUCCEEDED( InitD3D( hWnd ) ) )
    {
		if( SUCCEEDED( InitObjects() ) )
		{
			if( SUCCEEDED( InitGeometry() ) )
			{

        		/// 윈도우 출력
				ShowWindow( hWnd, SW_SHOWDEFAULT );
				UpdateWindow( hWnd );

        		/// 메시지 루프
				MSG msg;
				ZeroMemory( &msg, sizeof(msg) );
				while( msg.message!=WM_QUIT )
				{
            		/// 메시지큐에 메시지가 있으면 메시지 처리
					if( PeekMessage( &msg, NULL, 0U, 0U, PM_REMOVE ) )
					{
						TranslateMessage( &msg );
						DispatchMessage( &msg );
					}
					else
					/// 처리할 메시지가 없으면 Render()함수 호출
						Render();
				}
			}
		}
    }

	DeleteObjects();
    UnregisterClass( "BasicFrame", wc.hInstance );
    return 0;
}
Beispiel #6
0
static void Init(void)
{

    numObjects = 10;
    InitObjects(numObjects);
    glGetIntegerv(GL_VIEWPORT, vp);

#if 0 /* debug - test culling */
    glCullFace(GL_BACK);
    glFrontFace(GL_CW);
    glEnable(GL_CULL_FACE);
#endif
}
int Init ( ESContext *esContext )
{
	glClearColor ( 0.0f, 0.0f, 0.0f, 0.0f );

	//Init matrix tranform coordinate from clip space to texture space (texture transform matrix)
	//...

	InitResource();
	InitObjects();
	InitFBO();
	InitFBO_();
	
	return 0;
}
Beispiel #8
0
void EnchantsDialog::Display()
{
	if (!EnchantsInitiated)
		InitEnchants();

	if (!Initiated)
		InitObjects();

	if (Initiated)
	{
		Center();
		Show(true);
	}
}
int main(int argc, char *argv[])
{
	// it's still possible to use console to print messages
	printf("Hello openGL world!");
	// the same can be done with cout / cin

	glutInit(&argc, argv);
	InitGLUTScene("freeglut template extended");
	SetCallbackFunctions();
	InitObjects();

	// start GLUT event loop. It ends when user close the window.
	glutMainLoop();

	return 0;
}
bool SceneTutorial27::Init()
{
    if (!InitObjects())
        return false;					// Function For Initializing Our Object(s)
    
    glShadeModel(GL_SMOOTH);							// Enable Smooth Shading
    glClearColor(0.0f, 0.0f, 0.0f, 0.5f);				// Black Background
    glClearDepth(1.0f);									// Depth Buffer Setup
    glClearStencil(0);									// Stencil Buffer Setup
    glEnable(GL_DEPTH_TEST);							// Enables Depth Testing
    glDepthFunc(GL_LEQUAL);								// The Type Of Depth Testing To Do
    glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);	// Really Nice Perspective Calculations
    
    glLightfv(GL_LIGHT1, GL_POSITION, LightPos);		// Set Light1 Position
    glLightfv(GL_LIGHT1, GL_AMBIENT, LightAmb);			// Set Light1 Ambience
    glLightfv(GL_LIGHT1, GL_DIFFUSE, LightDif);			// Set Light1 Diffuse
    glLightfv(GL_LIGHT1, GL_SPECULAR, LightSpc);		// Set Light1 Specular
    glEnable(GL_LIGHT1);								// Enable Light1
    glEnable(GL_LIGHTING);								// Enable Lighting
    
    glMaterialfv(GL_FRONT, GL_AMBIENT, MatAmb);			// Set Material Ambience
    glMaterialfv(GL_FRONT, GL_DIFFUSE, MatDif);			// Set Material Diffuse
    glMaterialfv(GL_FRONT, GL_SPECULAR, MatSpc);		// Set Material Specular
    glMaterialfv(GL_FRONT, GL_SHININESS, MatShn);		// Set Material Shininess
    
    glCullFace(GL_BACK);								// Set Culling Face To Back Face
    glEnable(GL_CULL_FACE);								// Enable Culling
    glClearColor(0.1f, 1.0f, 0.5f, 1.0f);				// Set Clear Color (Greenish Color)
    
    q = gluNewQuadric();								// Initialize Quadratic
    gluQuadricNormals(q, GL_SMOOTH);					// Enable Smooth Normal Generation
    gluQuadricTexture(q, GL_FALSE);						// Disable Auto Texture Coords

    
    _cameraPosition.Set(0, 0, 2);
    _cameraScale.Set(1.0f, 1.0f, 1.0f);
    

    return true;
}
Beispiel #11
0
// the entry point for any Windows program
int WINAPI WinMain(HINSTANCE hInstance,
                   HINSTANCE hPrevInstance,
                   LPSTR lpCmdLine,
                   int nCmdShow)
{
	EngineConfig config;
	// TODO:
	// Load this from a file.
	ZeroMemory(&config, sizeof(EngineConfig));
	config.screen_width = 800;
	config.screen_height = 600;
	config.min_world_coords = D3DXVECTOR3(-5000.0f, -5000.0f, -5000.0f);
	config.max_world_coords = D3DXVECTOR3(5000.0f, 5000.0f, 5000.0f);
	config.num_octree_levels = 4;
	config.near_clip = 0.1f;
	config.far_clip = 5000.0f;
	config.fov = 45.0f;
	config.ambient_color = D3DXVECTOR3(0.1f, 0.1f, 0.1f);
	config.background_color = D3DXCOLOR(0.0f, 0.0f, 0.0f, 0.0f);
	config.camera_speed = 0.06f;
	config.mouse_sensitivity = 0.01f;

	config.hInstance = hInstance;
	config.hPrevInstance = hPrevInstance;
	config.lpCmdLine = lpCmdLine;
	config.nCmdShow = nCmdShow;
	config.draw_debug_objects = false;

	config.window_class_name = "GameWindow";
	config.window_caption = "Hi, this is 3D, coming to you in 2D(where available)";

	g_engine = new Engine(config);
	InitObjects();
	WPARAM main_loop_result = Engine::instance->MainLoop();

	return main_loop_result;
}
static void Init(void)
{
	numObjects = 10;
	InitObjects(numObjects);
}
Beispiel #13
0
void Display::Init()
{
	InitDisplay();
	InitObjects();
}
//
// Init GL
//
int InitGL(GLvoid)					// All Setup For OpenGL Goes Here
{
    // seed rand generator
    srand((unsigned int)time(NULL));

    // Load the key codes --
    LoadKeyCodes();

    // enable all the goodies
    Super_LoadGlobals();

    Load_ConfigFile();
    Super_FireAnts();

    Create_Col_List();
    Create_Wall_List();


    //
    // loading sound library
    printf("Loading sound library, make sure 'music apps' are closed\n");
    Load_Audio();


    glShadeModel(GL_SMOOTH);					// Enable Smooth Shading
    glClearColor(0.0f, 0.0f, 0.0f, 0.0f);				// Black Background
    glClearDepth(1.0f);						// Depth Buffer Setup


    glEnable(GL_NORMALIZE);
    glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);

    glShadeModel(GL_SMOOTH);


    glEnable(GL_DEPTH_TEST);				// Enables Depth Testing
    glDepthFunc(GL_LEQUAL);					// The Type Of Depth Testing To Do
    glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);	// Really Nice Perspective Calculations


    // have to load the quadrice to be used
    quadric=gluNewQuadric();			// Create A Pointer To The Quadric Object (NEW)
    gluQuadricNormals(quadric, GLU_SMOOTH);		// Create Smooth Normals (NEW)
    gluQuadricTexture(quadric, GL_TRUE);		// Create Texture Coords (NEW)


    GenerateFireAnts();

    CreateWorld();

    LoadCameras();

    // Load the objects
    InitObjects();
    GenerateLights();

    InitGlobals();

    Build_ParticleSet();
    Reset_FontID();

    // Load the title screen text
    Load_Titles();

    // load the text library
    Super_MainText();

    CreateWalls();

    //
    // Load the collsion test for the walll
    //

    // front wall
    InsertColSegment(world_ptr->x_min, world_ptr->y_max,
                     world_ptr->x_max, world_ptr->y_max);

    // right wall
    InsertColSegment(world_ptr->x_max, world_ptr->y_min,
                     world_ptr->x_max, world_ptr->y_max);

    // back wall
    InsertColSegment(world_ptr->x_min, world_ptr->y_min,
                     world_ptr->x_max, world_ptr->y_min);

    // left wall
    InsertColSegment(world_ptr->x_min, world_ptr->y_min,
                     world_ptr->x_min, world_ptr->y_max);

    //
    // for the network save
    // the number of bots incase it is changed
    MAX_SAVED_BOTS = MAX_FIRE_ANTS;


    // end of insertion

    Super_InitNetwork();

    //
    // begin in paused mode
    //
    Super_BeginPaused();

    mSuper_Loaded = LOADED_TRUE;


    return true;			// Initialization Went OK

} // end of the function
//
// Init GL
//
int InitGL(GLvoid)										// All Setup For OpenGL Goes Here
{
	// seed rand generator
	srand(getclock());

#if 0
	QueryPerformanceFrequency(&timerFrequency);
	QueryPerformanceCounter(&lastTime);
#endif

	// use the mouse only
	// for camera movement
	// disable the cursor 
	ShowCursor(FALSE);

	Super_LoadGlobals();

	Load_ConfigFile();

	// Now load main variables
	Super_LoadBots();	
	Super_FireAnts();
	
	Create_Col_List();

	Create_Wall_List();

	// enable all the goodies
	//glEnable(GL_TEXTURE_2D);		   // enable texture mapping
	
	glShadeModel(GL_SMOOTH);							// Enable Smooth Shading
	glClearColor(0.0f, 0.0f, 0.0f, 0.5f);				// Black Background
	glClearDepth(1.0f);									// Depth Buffer Setup


	glEnable(GL_NORMALIZE);
	glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);

	glShadeModel(GL_SMOOTH);


	glEnable(GL_DEPTH_TEST);							// Enables Depth Testing
	glDepthFunc(GL_LEQUAL);								// The Type Of Depth Testing To Do
	glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);	// Really Nice Perspective Calculations


	// have to load the quadrice to be used
	quadric=gluNewQuadric();							// Create A Pointer To The Quadric Object (Return 0 If No Memory) (NEW)
	gluQuadricNormals(quadric, GLU_SMOOTH);			// Create Smooth Normals (NEW)
	gluQuadricTexture(quadric, GL_TRUE);				// Create Texture Coords (NEW)


#if ENABLE_LIGHTS
//	InitMaterial();
#endif


	GenerateBots();

	GenerateFireAnts();			// a new breed of warrior

	CreateWorld();

	LoadCameras();

	BuildFont();										// Build The Font

	// Load the objects
	InitObjects();

	GenerateLights();

	InitGlobals();		// for printing data, etc

	// generate the nest objects
	nest.generate();
	garden.generate();

	trail_set.generate();

	// give the ant food
	InitFood();

	Build_ParticleSet();

	Reset_FontID();


	// load the title screen text
	Load_Titles();

	// the text library
	Super_MainText();

	CreateWalls();

	//
	// Load the collision test for the wall
	// very easy test
	// 4 different walls
	//

	// front wall
	InsertColSegment(world_ptr->x_min, world_ptr->y_max, 
		world_ptr->x_max, world_ptr->y_max);

	// right wall
	InsertColSegment(world_ptr->x_max, world_ptr->y_min, 
		world_ptr->x_max, world_ptr->y_max);

	// back wall (top)
	InsertColSegment(world_ptr->x_min, world_ptr->y_min, 
		world_ptr->x_max, world_ptr->y_min);

	// left wall 
	InsertColSegment(world_ptr->x_min, world_ptr->y_min, 
		world_ptr->x_min, world_ptr->y_max);

	// end insertion --


	//
	// The first thing to do is begin in paused mode
	//
	Super_BeginPaused();



	mSuper_Loaded  = LOADED_TRUE;

	return TRUE;			// Initialization Went OK

} // end of the function
Beispiel #16
0
/* MAIN()
 * ================================================================
 */
VOID
main( VOID )
{
	WORD    button;
	BOOLEAN done;
	OBJECT  *tree;
       

	appl_init();

	phys_handle = graf_handle( &gl_wchar, &gl_hchar, &gl_wbox, &gl_hbox );

	open_vwork();
	
        graf_mouse( ARROW, 0L );
        
        rsrc_load( "DEMO.RSC" );

        rsrc_gaddr( 0, MENUBAR, &ad_menubar );
        rsrc_gaddr( 0, ATREE, &ad_tree );
	rsrc_gaddr( 0, FONTTREE, &ad_fonts );
	rsrc_gaddr( 0, STREE, &ad_style );
	rsrc_gaddr( 0, POSTREE, &ad_position );
	rsrc_gaddr( 0, CTREE, &ad_color );
        rsrc_gaddr( 0, PTREE, &ad_pattern );
	rsrc_gaddr( 0, MTREE, &ad_modem );

	rsrc_gaddr( 0, BAUDRATE, &ad_baudrate );
	rsrc_gaddr( 0, PARTREE, &ad_parity );
	rsrc_gaddr( 0, BITTREE, &ad_bittree );
	rsrc_gaddr( 0, STOPTREE, &ad_stoptree );
	rsrc_gaddr( 0, PORTTREE, &ad_porttree );
	rsrc_gaddr( 0, FLOWTREE, &ad_flowtree );

	rsrc_gaddr( 0, LTREE, &ad_list );
	rsrc_gaddr( 0, TOOLBOX, &ad_tools );
	rsrc_gaddr( 0, BLANK, &ad_blank );
	rsrc_gaddr( 0, TOOLBOX2, &ad_box2 );
	rsrc_gaddr( 0, TOOLBAR, &ad_box3 );

	rsrc_gaddr( 0, FONT2, &ad_font2 );


	/* Attach all Submenus that are being attached */
	AttachMenus();


	/* CheckMark the Current Menu Items in their respective menus */
	menu_icheck( ad_baudrate, CurBaudRate, 1 );
	menu_icheck( ad_parity, CurParity, 1 );
	menu_icheck( ad_bittree, CurBits, 1 );
	menu_icheck( ad_stoptree, CurStopBits, 1 );
	menu_icheck( ad_porttree, CurPort, 1 );
	menu_icheck( ad_flowtree, CurFlow, 1 );

	menu_icheck( ad_style, CurStyle, 1 );
	menu_icheck( ad_position, CurPos, 1 );
	menu_icheck( ad_fonts, CurFonts, 1 );
	menu_icheck( ad_font2, CurFont2, 1 );

        /* display menubar stuff here */
        menu_bar( ad_menubar, TRUE );

	/* initialize windows */
        wind_get( 0, WF_FULLXYWH, &desk.g_x, &desk.g_y, &desk.g_w, &desk.g_h );
	cur_tree = ad_tools;
	menu_flag = TRUE;			/* Set Toggle Flags */
	SubFlag   = TRUE;
	ToolFlag  = TRUE;

	CurRect.g_x = desk.g_x;
	CurRect.g_y = desk.g_y;
	CurRect.g_w = 320;
	CurRect.g_h = 200;

	InitObjects();

	InitWindow();
	menu_ienable( ad_menubar, FOPEN, 0 );
	menu_ienable( ad_menubar, FCLOSE, 1 );



        done = FALSE;
	do
	{

	    evnt_mesag( msg );
	    
	    wind_update( BEG_UPDATE );

	    if( msg[0] == MN_SELECTED )
	    {
		/* msg[7] is the parent of FQUIT - which the user can't know */
		ptr = ( OBJECT **)&msg[5];
	if( *ptr == ad_menubar )
		{
		   switch( msg[4] )
		   {
		      case FQUIT:
				  button = form_alert( 1, "[1][ |  EXIT PROGRAM? ][OK|Cancel]");
				  if( button == 1 )
		 		      done = TRUE;
		       		  break;

		      case ABOUTX: execform( ad_tree, 0 );
				   break;

		      case PHONE: do_modem();
				  break;

		      case TABOUT: /* Enable, Disable About PLUS change TEXT */
				   menu_flag ^= 1;
				   menu_ienable( ad_menubar, ABOUTX, menu_flag );
				   menu_text( ad_menubar, TABOUT, TextAbout[ menu_flag ] );

				  if( menu_flag )
				    menu_text( ad_menubar, ABOUTX, "  About Demo...     " );
				  else
				    menu_text( ad_menubar, ABOUTX, "  Disabled...       " );
				  break;

		       case TSUB: /* Enable/Disable all Submenus */
				  SubFlag ^= 1;
				  menu_text( ad_menubar, TSUB, TextSubMenu[ SubFlag ] );
				  if( SubFlag )
				    AttachMenus();
				  else
				    DetachMenus();
				  break;

		       case SLISTS: DoList();			/* Do A Drop Down List Dialog */
				    break;

		       case TOOLFLAG: /* Enable/Disable ToolBox */
				      ToolFlag ^= 1;
				      menu_text( ad_menubar, TOOLFLAG, TextToolBox[ ToolFlag ] );
				      if( ToolFlag )
				      {
					*( (LONG *)&tree_data[0] ) = ( LONG )cur_tree;
					wind_set( wid, WF_TOOLBAR, tree_data[0], tree_data[1], dummy, dummy );
				      }
				      else
					wind_set( wid, WF_TOOLBAR, 0, 0, dummy, dummy );
				      break;

		        case SWITCH: /* Switch ToolBoxes */
					if( cur_tree == ad_tools )
					   cur_tree = ad_box2;
					else if( cur_tree == ad_box2 ) {
					         cur_tree = ad_box3;

					         ActiveTree( ad_fonts );
      						 textptr = ObString( CurFonts );
						 strncpy( &tbuff[0], &textptr[1], 28 );

      						 ActiveTree( ad_box3 );
      						 TedText( FBUTT1 ) = &tbuff[0];
					     }
					     else
					       cur_tree = ad_tools;
					*( (LONG *)&tree_data[0] ) = ( LONG )cur_tree;
					ToolFlag = TRUE;
	  	    		        menu_text( ad_menubar, TOOLFLAG, TextToolBox[ ToolFlag ] );
					wind_set( wid, WF_TOOLBAR, tree_data[0], tree_data[1], dummy, dummy );
				     break;

			case FCLOSE: /* close Window */
				     if( wid ) {
					wind_get( wid, WF_CURRXYWH,
						  &CurRect.g_x, &CurRect.g_y,
						  &CurRect.g_w, &CurRect.g_h );
			                wind_close( wid );
			                wind_delete( wid );
			                wid = 0;
					menu_ienable( ad_menubar, FCLOSE, 0 );
					menu_ienable( ad_menubar, FOPEN, 1 );
				     }
				     break;

			case FOPEN:  /* open Window */
				     if( !wid ) {
					InitWindow();
					menu_ienable( ad_menubar, FOPEN, 0 );
					menu_ienable( ad_menubar, FCLOSE, 1 );
				     }				 
				     break;

		      default:
				   break;
		   }
		}

		
		/* MENU SELECTED -> Font Style Menu Clicked on as a SUBMENU from the Menubar*/
		if( *ptr == ad_style )
		{
		   menu_icheck( ad_style, CurStyle, 0 );	/* Turn OFF Old Checkmark */
		   menu_icheck( ad_style, msg[4], 1 );		/* Turn ON New CheckMark  */
		   CurStyle = msg[4];				/* Update Current Var     */
		   menu_istart( 1, ad_style, ROOT, CurStyle );	/* Reset Starting Position*/
		}


		/* MENU SELECTED -> Font Position Clicked on as a SUBMENU from the menubar */
		if( *ptr == ad_position )
		{
		   menu_icheck( ad_position, CurPos, 0 );
		   menu_icheck( ad_position, msg[4], 1 );
		   CurPos = msg[4];
		   menu_istart( 1, ad_position, ROOT, CurPos );
		}


		/* MENU SELECTED -> Fonts Menu Clicked on as a SUBMENU from the menubar */
		if( *ptr == ad_fonts )
		{
		   menu_icheck( ad_fonts, CurFonts, 0 );
		   menu_icheck( ad_fonts, msg[4], 1 );
		   CurFonts = msg[4];
		   menu_istart( 1, ad_fonts, ROOT, CurFonts );
		}

		menu_tnormal( ad_menubar, msg[3], TRUE );
            }

	    if( msg[0] != MN_SELECTED ) {
		switch( msg[0] ) {
		   case WM_FULLED:
			DoFull( msg[3] );
			break;

		   case WM_REDRAW:
			 DoRedraw( msg );
			 break;

		   case WM_ARROWED:
		   case WM_HSLID:
		   case WM_VSLID:
			 break;

		   case WM_MOVED:
			 if( msg[3] == wid ) {
			    wind_set( wid, WF_CURRXYWH, msg[4],
				      msg[5], msg[6], msg[7] );
			 }
			 break;

		   case WM_TOPPED:
			 if( msg[3] == wid ) {
			    wind_set( wid, WF_TOP );
			 }
			 break;

		   case WM_CLOSED:
			 if( msg[3] == wid ) {
			    wind_get( wid, WF_CURRXYWH,
				      &CurRect.g_x, &CurRect.g_y,
				      &CurRect.g_w, &CurRect.g_h );

			    wind_close( wid );
			    wind_delete( wid );
			    wid = 0;
			    menu_ienable( ad_menubar, FCLOSE, 0 );
			    menu_ienable( ad_menubar, FOPEN, 1 );
			 }
			 break;

		   case WM_SIZED:
			DoSizer( msg );
			break;

		   case WM_TOOLBAR:
			if( msg[3] == wid ) {
			      /* Button Handling for ToolBox #1 */
			      if( cur_tree == ad_tools ) {
			        switch( msg[4] ) {
			           case T1B1:  button = B1B1;
				        break;
			           case T1B2:  button = B1B2;
				        break;
			           case T1B3:  button = B1B3;
				        break;
			           case T1B4:  button = B1B4;
				        break;
			           case T1B5:  button = B1B5;
				        break;
				}
			      }

			      /* Button Handling for TOOLBOX 2 */
			      if( cur_tree == ad_box2 ) {
			        switch( msg[4] ) {
			           case T2I1:  button = T2B1;
				        break;
			           case T2I2:  button = T2B2;
				        break;
			           case T2I3:  button = T2B3;
				        break;
			           case T2I4:  button = T2B4;
				        break;
			           case T2I5:  button = T2B5;
				        break;
				}
			      }

			      /* Word Processing Tree */
			      if( cur_tree == ad_box3 ) {
				switch( msg[4] ) {
				   case FBUTT1:
				   case FBUTT2: DoFonts();
						break;

				   default:
					    break;
				}
			      }



			   if( cur_tree != ad_box3 ) {
			     if( cur_tree[ button ].ob_state & SELECTED )
			       cur_tree[ button ].ob_state &= ~SELECTED;
			     else
			       cur_tree[ button ].ob_state |= SELECTED;

			     objc_offset( cur_tree, button, &r.g_x, &r.g_y );
			     r.g_x -= 2;
			     r.g_y -= 2;
			     r.g_w = cur_tree[ button ].ob_width + 4;
			     r.g_h = cur_tree[ button ].ob_height + 4;
			     do_redraw( cur_tree, button, &r );
			   }

			}  /* end of msg[3] == wid */
			break;

			case WM_ICONIFY:
			     if( msg[3] == wid )
			       wind_set( msg[3], WF_ICONIFY, msg[4], msg[5], msg[6], msg[7] );
			     break;

			case WM_UNICONIFY:
			     if( msg[3] == wid )
			       wind_set( msg[3], WF_UNICONIFY, msg[4], msg[5], msg[6], msg[7] );
			     break;

		   default:
			break;
		}  /* end of switch */
	    }
	    wind_update( END_UPDATE );
	    	    
	}while( !done );
	if( wid > 0 )
	   wind_delete( wid );

        menu_bar( ad_menubar, FALSE );
	
	graf_mouse( ARROW, 0L );	
	
        rsrc_free();

       	close_vwork();
	appl_exit();
}