Exemplo n.º 1
0
/* DoCurROMRES()
 * =======================================================================
 * Handle the Current Driver ROM/RES flag.
 */
void
DoCurROMRES( int button )
{
    wait_up();
    if( button == CURROM )	/* ROM key pressed...  */
    {
        if( IsSelected( CURROM ) )
             deselect( tree, CURROM );
        else     
        {
           select( tree, CURROM );
           if( IsSelected( CURRES ) )
               deselect( tree, CURRES );
        }     
    }
    else			/* RESident key pressed */
    {
        if( IsSelected( CURRES ) )
            deselect( tree, CURRES );
        else
        {
           select( tree, CURRES );
           if( IsSelected( CURROM ) )
               deselect( tree, CURROM );
        }
    }

    DTYPE( xdevice ) = ' ';
    if( IsSelected( CURROM ) )
       DTYPE( xdevice  ) = 'P';
    
    if( IsSelected( CURRES ) )
       DTYPE( xdevice ) = 'R';
    SetChangeFlag();   
}
Exemplo n.º 2
0
void GuiLabel::OnResize()
{
	sCaption.Reallock();
	if (bAutoSize && sCaption.AdjustAutosize(true))
		Resize(sCaption.GetWidth(),sCaption.GetHeight());
	SetChangeFlag();
}
Exemplo n.º 3
0
/* DoCurDrivers()
 * =======================================================================
 * Display in a popup the current drivers available.
 */
void
DoCurDrivers( void )
{
   int i;
   int Item;
   int temp;

   /* if there are no drivers, don't use the popup menu */
   if( !driver_count )
       return;
          
   for( i = 0; i < driver_count; i++ )
        CurNames[i] = &drivers[i][0];

   temp = CurHotDriver;
   Item = Pop_Handle( tree, CURNAME, CurNames, driver_count, &CurHotDriver, IBM, 15 );
   if( Item != -1 )
   {
      CurHotDriver = Item;
      strcpy( DriverText, drivers[ Item ] );
      TedText( CURNAME ) = &DriverText[0];
      Objc_draw( tree, CURNAME, MAX_DEPTH, NULL );
      DNAME( xdevice ) = Item;   
   }
   if( CurHotDriver != temp )
      SetChangeFlag();   
}
Exemplo n.º 4
0
void GuiEnControl::SetEnable(PLbool value)
{
	if (bEnable != value)
	{
		bEnable = value;
		SetChangeFlag();
	}
}
Exemplo n.º 5
0
void GuiLabel::SetCaption(const string& value)
{
	if (sCaption.SetText(value))
	{
		if (bAutoSize && sCaption.AdjustAutosize())
			Resize(sCaption.GetWidth(),sCaption.GetHeight());
		SetChangeFlag();
	}
}
Exemplo n.º 6
0
void GuiCheckbox::SetChecked(PLbool is_checked)
{
	if (is_checked != bChecked)
	{
		bChecked = is_checked;
		OnChecked(is_checked);
		SetChangeFlag();
	}
}
Exemplo n.º 7
0
bool GuiCheckbox::OnMouseDown(PLfloat x, PLfloat y, PLMouseButton button)
{
	if (IsEnable())
	{
		bChecked = !bChecked;
		OnChecked(bChecked);
		SetChangeFlag();
	}
	return GuiEnControl::OnMouseDown(x, y, button);
}
Exemplo n.º 8
0
void GuiCheckbox::OnResize()
{
	FreeObj(vboCheckImg);
	sCaption.Lock();
	InitCheckImg();
	sCaption.Unlock(); // unlock do reallock
	if (sCaption.AdjustAutosize(true))
	{
		PLfloat border = sCaption.GetBorder();
		PLfloat img_size;
		GetCheckImgSize(border, img_size);
		Resize(sCaption.GetWidth()+img_size+sCaption.GetBorder(), 
				max(sCaption.GetHeight(),img_size+2*sCaption.GetBorder()));
	}
	SetChangeFlag();
}
Exemplo n.º 9
0
/* DoValuesCheck()
 * ====================================================================
 */
void
DoValuesCheck( void )
{
    long  half;
    int   extra;

    /* Speedo Character Stuff */
    ccache = atol( CharSizeText );
    if( !ccache )
        ccache = old_ccache;
    ccache = limits( ccache, MIN_CHAR_CACHE_SIZE, MAX_CACHE_SIZE );

    /* Speedo Miscellaneous Stuff */
    mcache = atol( MiscSizeText );
    if( !mcache )
        mcache = old_mcache;
    mcache = limits( mcache, MIN_CACHE_SIZE, MAX_CACHE_SIZE );

    /* Get Speedo Cache Size */
    Current.SpeedoCacheSize = ccache + mcache;

    /* Get Percent Value */
    Current.speedo_percent = 0;
    half     =  Current.SpeedoCacheSize / 2L;
    extra    =  ((( ccache * 10L ) % Current.SpeedoCacheSize) > half );
    CurPercent =  (int)(( ccache * 10L ) / Current.SpeedoCacheSize);
    Current.speedo_percent = CurPercent + extra;
    Current.speedo_percent = (int)limits( (int)Current.speedo_percent, 1L, 9L );

    /* Get BitMap Cache Size */
    Current.BitMapCacheSize = atol( BitSizeText );
    Current.BitMapCacheSize = limits( Current.BitMapCacheSize, 0L, MAX_CACHE_SIZE );

    /* A Real Change has occurred, so set change flag */
    if( ( Current.SpeedoCacheSize != OldSpeedoCache ) ||
            ( Current.speedo_percent  != OldPercent ) ||
            ( Current.BitMapCacheSize != OldBitMapSize ) )
        SetChangeFlag();
}
Exemplo n.º 10
0
/* MoveToInstalled()
 * ====================================================================
 * Move any Available fonts to the Installed List.
 * type -> 0 -> USE Available list CALLS
 *      -> 1 -> Skip available list calls
 */
void
MoveToInstalled( int flag )
{
    FON_PTR curptr;
    FON_PTR xcurptr;
    int     index;

    curptr = available_list;

    /* Try to maintain the top node displayed to remain that way if
     * at all possible.
     */
    xcurptr = Active_Slit[ 0 ];
    if( curptr && xcurptr )
    	index = Get_Findex( curptr, xcurptr );

    /* Go through the list looking for selected nodes ( AFLAG == TRUE )
     * and set their SEL() to FALSE.
     * Where SEL == TRUE means installed. and SEL == FALSE means 
     * available.
     * Set MakeWidth Tables flag if moving Outline Fonts TO INSTALLED!
     */
    while( curptr )
    {
       if( AFLAG( curptr ) )
       {
           if( FTYPE( curptr ) == SPD_FONT )
             MakeWidthFlag = TRUE;
           SEL( curptr ) = TRUE;
       }    
       curptr = FNEXT( curptr );
    }


    /* Now, fix up the linked list for both the
     * available and installed fonts.
     */
    free_arena_links();
    installed_count = build_list( &installed_list, &installed_last, ACTIVE );
    available_count = build_list( &available_list, &available_last, INACTIVE );

    /* Prompt to save SYS files */
    SetChangeFlag();

    if( !flag )
    {
       mover_setup( available_list, available_count,
		    IBASE, ISLIDER, IUP, IDOWN,
		    ILINE0, ILINE13, ILINE, index, INACTIVE_HEIGHT );

       RedrawObject( tree, IBASE );
       Objc_draw( tree, ILINE, MAX_DEPTH, NULL );
    
       if( !IsDisabled( IINSTALL ) )
          ChangeButton( ad_inactive, IINSTALL, FALSE );
    
       if( !IsDisabled( ICONFIG ) )
          ChangeButton( ad_inactive, ICONFIG, FALSE );
          
       CheckSelectAll( TRUE );
    }      
}
Exemplo n.º 11
0
/* HandlePrinter()
 * ===================================================================
 */
int
HandlePrinter( int button, WORD *msg )
{
   int     quit;
   int     dclick;

   quit   = FALSE;
   dclick = FALSE;
   
   /* Handle Double-clicking of the objects */   
   if( ( button != -1 ) && ( button & 0x8000 ) )
   {
      button &= 0x7FFF;
      dclick = TRUE;
   }


   switch( button )
   {
     case PRINTOK:  /* OK! Look through the fonts and find the active
		     * AFLAG ones. Then clear the device fonts and
		     * replace these ones instead.
		     */
		    if( PrintInternalFlag )
		    {
		       DoPrintOK();
		       SetChangeFlag();
		    }
		    
		    
     case PRINTCAN: Deselect( button );
		    ClearFnodes( print_list );

		    Reset_Tree( ad_options );     

		    free_arena_links();
		    installed_count = build_list( &installed_list, &installed_last, ACTIVE );
		    available_count = build_list( &available_list, &available_last, INACTIVE );

		    Objc_draw( tree, ROOT, MAX_DEPTH, NULL ); 
     		    break;

     case PLINE0:
     case PLINE1:
     case PLINE2:
     case PLINE3:
     case PLINE4:
     case PLINE5:
     case PLINE6:
     case PLINE7:
     case PLINE8:    BeforeCount = CountSelectedFonts( print_list, BITMAP_FONT );
       		     mover_button( button, dclick );
       		     AfterCount = CountSelectedFonts( print_list, BITMAP_FONT );
       		     if( BeforeCount != AfterCount )
       		        PrintInternalFlag = TRUE;
		     break;
		     
     case PRNTUP:
     case PRNTDOWN:
     case PRNTBASE:
     case PRNTSLDR:  mover_button( button, dclick );
     		     break;


     case PRINTCLR:  if( form_alert( 1, alertp1 ) == 1 )
     		     {
			 BeforeCount = CountSelectedFonts( print_list, BITMAP_FONT );
			 if( BeforeCount )
		 	     PrintInternalFlag = TRUE;
		         Undo_Fnodes( print_list, ( FON_PTR )NULL );
		     }    
		     XDeselect( tree, PRINTCLR );
		     break;


     default:	 if( button == -1 )
     		 {
     		   switch( msg[0] )
     		   {
     		     case WM_REDRAW: 
     		     		     break;
     			     		     
     		     case AC_CLOSE:  quit = TRUE;
     		     		     break;
     				     		     
     		     case WM_CLOSED: quit = TRUE;
     		     		     if( PrintInternalFlag )
     		     		     {
				        DoPrintOK();
				        SetChangeFlag();
				     }   
     		     		     CloseWindow();
				     break;

		     case CT_KEY:
		     		     break;
     		     default:
     		     		break;
     		   }
     		 }
     		 break;
   }
   return( quit );


}
Exemplo n.º 12
0
/* Path_Button()
 * ========================================================================
 * Handle the Button handling for the set font path tree...
 */
int
Path_Button( int button, WORD *msg )
{
  int   quit = FALSE;
  long  i;
  MRETS mk;
  int   out;
  
          
  if( ( button != -1 ) && ( button & 0x8000 ) )
     button &= 0x7FFF;      
     
  switch( button )
  {
     case PEXIT:  Deselect( PEXIT );
     		  if( strcmp( bitmap_path, backup ) )
     		  {
	            MF_Save();     
		    Scan_Message( ad_scan, TRUE );	
		    read_fonts();
		    Scan_Message( ad_scan, FALSE );
		    MF_Restore();
     		    SetChangeFlag();
     		  }  
     		  RestoreMainTree();
     		  break;
   
     case PCANCEL:  Deselect( PCANCEL );
     		    strcpy( bitmap_path, backup );
     		    RestoreMainTree();
     		    break;
     		      		
     case PLEFT:    select( tree, PLEFT );
     		    do
     		    {
     		       Graf_mkstate( &mk );
     		       if( dircount )
     		       {
     		         dircount--;
     		         strncpy( view_path, &dirpath[ dircount ], min( DIR_MAX, dirsize - dircount ) );
     		         if( dircount )
     		       	   view_path[0] = 0xAE;
     		         if((dirsize - dircount ) > DIR_MAX )
     		       	   view_path[ DIR_MAX - 1 ] = 0xAF;
     		         TedText( PBASE ) = view_path;
     		         Objc_draw( tree, PBASE, MAX_DEPTH, NULL );
     		       }  
     		    }while( mk.buttons );
     		    deselect( tree, PLEFT );
     		    break;
     		    
     case PRIGHT:   select( tree, PRIGHT );
     		    do
     		    {
     		       Graf_mkstate( &mk );
  		       if( ( dirsize > DIR_MAX ) && ((dircount + DIR_MAX ) < dirsize ))
  		       {
  		          dircount++;
  		          strncpy( view_path, &dirpath[ dircount], min( DIR_MAX, dirsize - dircount) );
  		          view_path[0] = 0xAE;
  		          if( (dirsize - dircount) > DIR_MAX )
  		          	view_path[ DIR_MAX - 1 ] = 0xAF;
  		          TedText( PBASE ) = view_path;
  		          Objc_draw( tree, PBASE, MAX_DEPTH, NULL );
  		       }	   		    
     		    }while( mk.buttons );
     		    deselect( tree, PRIGHT );
     		    break;
     		    
     case PBASE:    wait_up();
    		    strcpy( newpath, dirpath );
    		    for( i = strlen( newpath ); i && ( newpath[i] != '\\'); newpath[ i-- ] = '\0' );
     		    out = fsel_name( FALSE, newpath, "*.FNT", "Select Font Path" );
     		    if( ( ( out == A_OK ) || ( out == A_CANCEL )) && ( newpath[0] != '\0' ) )
     		    {
	     	         for( i = strlen( newpath ); i && ( newpath[i] != '\\'); newpath[ i-- ] = '\0' );
	     	         
  		         strcpy( dirpath, newpath );
  		         
  		         newpath[i] = '\0';	/* Get rid of the '\\' */
  		         strcpy( bitmap_path, newpath );
  		         
  		         strcat( dirpath, "*.FNT" );
  		         dirsize = (int)strlen( &dirpath[0] );
  		         strcpy( view_path, underbar );
  		         strncpy( view_path, dirpath, min( DIR_MAX, dirsize) );
  		         dircount = 0;
  		         if( dirsize > DIR_MAX )
  		            view_path[ DIR_MAX - 1 ] = 0xAF;
		         TedText( PBASE ) = view_path;
		         Objc_draw( tree, PBASE, MAX_DEPTH, NULL );
		    }
		    break;
     		  
     default:	if( button == -1 )
     		{
     		   switch( msg[0] )
     		   {
     		     case WM_REDRAW: 
     		     		     break;
     			     		     
     		     case AC_CLOSE:  quit = TRUE;
     		     		     break;
     				     		     
     		     case WM_CLOSED: quit = TRUE;
     		     		     if( strcmp( bitmap_path, backup ) )
     		     		     	SetChangeFlag();
     		     		     CloseWindow();
				     break;

		     case CT_KEY:    
		     		     break;

     		     default:
     		     		break;
     		   }
     		}
     		break;
     
  }
  return( quit );

}
Exemplo n.º 13
0
/* HandlePath()
 * ===================================================================
 */
int
HandlePath( int button, WORD *msg )
{
   int     quit;
   MRETS   mk;
   long    i;
   int     out;
   
   quit   = FALSE;

   
   /* Handle Double-clicking of the objects */   
   if( ( button != -1 ) && ( button & 0x8000 ) )
      button &= 0x7FFF;
   
   switch( button )
   {
     case PEXIT:    Deselect( PEXIT );
     		    if( strcmp( OutlinePath, outbackup ) )
     		    {
     		    
	              MF_Save();     
		      Scan_Message( ad_scan, TRUE );
		      /* REad the ACTIVE Fonts Only */
		      read_fonts( FALSE, TRUE );
		      Scan_Message( ad_scan, FALSE );
		      MF_Restore();
		    
     		      SetChangeFlag();
			
		      ActiveTree( ad_front );
                      mover_setup( installed_list, installed_count,
		                   FBASE, FSLIDER, FUP, FDOWN,
		  		   LINE0, LINE9, LINEBASE, 0, FRONT_HEIGHT );
		      ActiveTree( ad_options );

     		      /* Set Current.FontPath to OutlinePath */
		      strcpy( Current.FontPath, OutlinePath );
		    }
		    
		    
		    Reset_Tree( ad_options );
		    /* if the path has changed, we need to clear
		     * the total # of fonts box.
		     */
		    if( !Fonts_Loaded )
		    {
		       HideObj( OTITLE3 );
		       HideObj( OBASE );
		    }   
		    Objc_draw( tree, ROOT, MAX_DEPTH, NULL ); 
     		    break;
     		    
     case PCANCEL:  Deselect( PCANCEL );
     		    strcpy( OutlinePath, outbackup );
     		    
		    Reset_Tree( ad_options );     
		    Objc_draw( tree, ROOT, MAX_DEPTH, NULL ); 
     		    break;
     		    

     case OLEFT:    XSelect( tree, OLEFT );
     		    do
     		    {
     		       Graf_mkstate( &mk );
     		       if( outdircount )
     		       {
     		         outdircount--;
     		         strncpy( outview_path, &outdirpath[ outdircount ], min( DIR_MAX, outdirsize - outdircount ) );
     		         if( outdircount )
     		       	   outview_path[0] = 0xAE;
     		         if((outdirsize - outdircount ) > DIR_MAX )
     		       	   outview_path[ DIR_MAX - 1 ] = 0xAF;
     		         TedText( OPATHS ) = outview_path;
     		         Objc_draw( tree, OPATHS, MAX_DEPTH, NULL );
     		       }  
     		    }while( mk.buttons );
     		    XDeselect( tree, OLEFT );
     		    break;
     		    
     case ORIGHT:   XSelect( tree, ORIGHT );
     		    do
     		    {
     		       Graf_mkstate( &mk );
  		       if( ( outdirsize > DIR_MAX ) && ((outdircount + DIR_MAX ) < outdirsize ))
  		       {
  		          outdircount++;
  		          strncpy( outview_path, &outdirpath[ outdircount], min( DIR_MAX, outdirsize - outdircount) );
  		          outview_path[0] = 0xAE;
  		          if( (outdirsize - outdircount) > DIR_MAX )
  		          	outview_path[ DIR_MAX - 1 ] = 0xAF;
  		          TedText( OPATHS ) = outview_path;
  		          Objc_draw( tree, OPATHS, MAX_DEPTH, NULL );
  		       }	   		    
     		    }while( mk.buttons );
     		    XDeselect( tree, ORIGHT );
     		    break;
     		    
     case OPATHS:   XSelect( tree, OPATHS );
     		    wait_up();
    		    strcpy( outnewpath, outdirpath );
    		    for( i = strlen( outnewpath ); i && ( outnewpath[i] != '\\'); outnewpath[ i-- ] = '\0' );
     		    out = fsel_name( FALSE, outnewpath, "*.SPD", dtext );
     		    if( ( ( out == A_OK ) || ( out == A_CANCEL )) && ( outnewpath[0] != '\0' ) )
     		    {
	     	         for( i = strlen( outnewpath ); i && ( outnewpath[i] != '\\'); outnewpath[ i-- ] = '\0' );
	     	         
  		         strcpy( outdirpath, outnewpath );
  		         
  		         outnewpath[i] = '\0';	/* Get rid of the '\\' */
  		         strcpy( OutlinePath, outnewpath );
  		         
  		         strcat( outdirpath, "*.SPD" );
  		         outdirsize = (int)strlen( &outdirpath[0] );
  		         strcpy( outview_path, underbar );
  		         strncpy( outview_path, outdirpath, min( DIR_MAX, outdirsize) );
  		         outdircount = 0;
  		         if( outdirsize > DIR_MAX )
  		            outview_path[ DIR_MAX - 1 ] = 0xAF;
		         TedText( OPATHS ) = outview_path;
		    }
		    XDeselect( tree, OPATHS );
		    break;


     default:	 if( button == -1 )
     		 {
     		   switch( msg[0] )
     		   {
     		     case WM_REDRAW: 
     		     		     break;
     			     		     
     		     case AC_CLOSE:  quit = TRUE;
     		     		     break;
     				     		     
     		     case WM_CLOSED: quit = TRUE;
		     		     if( strcmp( OutlinePath, outbackup ) )
     		    		     {
     		    		     	strcpy( Current.FontPath, OutlinePath );
		     		        SetChangeFlag();
     				     }     
     		     		     CloseWindow();
				     break;

		     case CT_KEY:
		     		     break;
     		     default:
     		     		break;
     		   }
     		 }
     		 break;
   }
   return( quit );


}
Exemplo n.º 14
0
/* AddDevice()
 * =======================================================================
 * Add a new device.
 * int adevice - >   devnum to add.
 * int AHotDriver->  Index into driver list of driver for the device.
 *
 */
void
AddDevice( void )
{
     GRECT   rect;
     DEV_PTR temp_device;     
 
     wait_up();

     if( form_alert( 1, alert2 ) == 2 )
     {
        deselect( tree, EADD );
     	return;
     }	
     
     SetChangeFlag();	
          
     temp_device = AddNewDevice( adevice );
     if( temp_device )
     {
        /* found a slot and added it to the device linked list array. */
	DNAME( temp_device ) = AHotDriver;         
	if( IsSelected( AROM ) )
	    DTYPE( temp_device ) = 'P';
	
	if( IsSelected( ARES ) )
	    DTYPE( temp_device ) = 'R';    
	
	xdevice = temp_device;
	InitActiveEdit();
	

	/* re-init the inactive devices. 
	 * we only need to check for the device, not everything else.
	 */
   	 adevice = MIN_DEV;	/* Set the initial device - unless its a device...*/

   	/* Check to see if the device exists. If it does, increment and check again
    	 * until we don't have an active device.
    	 */   
   	 while( find_device( adevice ) )
   	        adevice++;
   
   	/* Set a global index number for the device editor so that we
	 * know which one is currently being displayed. Note that this is
         * for the active drivers.
    	 */   
   	/* Display the device number in text form. */              
   	 sprintf( ADeviceText, "%d", adevice );
   	 TedText( ANUM ) = &ADeviceText[0];
		
	 Objc_draw( tree, CURNUM, MAX_DEPTH, NULL );	
	 Objc_draw( tree, CURNAME, MAX_DEPTH, NULL );
	 Objc_draw( tree, CURROM, MAX_DEPTH, NULL );
	 Objc_draw( tree, CURRES, MAX_DEPTH, NULL );
	
	 Objc_draw( tree, ANUM, MAX_DEPTH, NULL );

         /* turn on/off the EDELETE button here too */
         rect = ObRect( EDELETE  );
         objc_offset( tree, EDELETE, &rect.g_x, &rect.g_y );

         rect.g_x -= 3;
         rect.g_y -= 3;
         rect.g_w += 6;
         rect.g_h += 6;
        
         if( DDEV( temp_device ) > 9 )
         {
           MakeExit( EDELETE );
           Enable( EDELETE );
         }
         else
         {
           NoExit( EDELETE );
           Disable( EDELETE );           
         }
         Deselect( EDELETE );
         Objc_draw( tree, ROOT, MAX_DEPTH, &rect );

	 device_count++;
     }

     /* Reset the driver name to NONE */
     strcpy( ADriverText, driver_null );
     TedText( ANAME ) = &ADriverText[0];
     Objc_draw( tree, ANAME, MAX_DEPTH, NULL );

     /* Set the ROM/RES flags */
     deselect( tree, AROM );
     deselect( tree, ARES );
     AHotDriver = -1;

     /* turn off the EADD button here too */
     rect = ObRect( EADD  );
     objc_offset( tree, EADD, &rect.g_x, &rect.g_y );

     rect.g_x -= 3;
     rect.g_y -= 3;
     rect.g_w += 6;
     rect.g_h += 6;
        
     NoExit( EADD );
     Disable( EADD );           
     Deselect( EADD );
     Objc_draw( tree, ROOT, MAX_DEPTH, &rect );
}
Exemplo n.º 15
0
/* DeleteDevice()
 * =======================================================================
 * Delete the Active Device in the Edit Device tree.
 */
void
DeleteDevice( void )
{
    GRECT   rect;
    DEV_PTR temp_device;
    
    wait_up();
    
    if( form_alert( 1, alert1 ) == 2 )
    {
       deselect( tree, EDELETE );
       return;
    }       
    if( device_count == 0 ) return;

    SetChangeFlag();
     
    temp_device = xdevice;
    if( DNEXT( xdevice ) )
        DPREV( DNEXT( xdevice ) ) = DPREV( xdevice );
        
    if( DPREV( xdevice ) )    
        DNEXT( DPREV( xdevice ) ) = DNEXT( xdevice );
    ClearDeviceFont( xdevice );
    
    
    /* Fix up device count */
    device_count--;
    
    /* Change display since we're looking at deleted a device 
     * We shall use xdevice - 1 if there is no device.
     */
     if( DNEXT( xdevice ) )
     	 xdevice = DNEXT( xdevice );
     else
         xdevice = DPREV( xdevice );
         
     DNEXT( temp_device ) = DPREV( temp_device ) = ( DEV_PTR )NULL;
     DDEV( temp_device ) = 0;    
         
     CurHotDriver = DNAME( xdevice );   
     NoExit( EDELETE );
     Disable( EDELETE );

     /* Display the device number in text form. */              
     sprintf( DeviceText, "%d", DDEV( xdevice ) );
     TedText( CURNUM ) = &DeviceText[0];

     /* Display the driver name in text form ( includes the .SYS ) */
     strcpy( DriverText, drivers[ DNAME( xdevice )] );
     TedText( CURNAME ) = &DriverText[0];

     /* Set the ROM/RES flags */
     Deselect( CURROM );
     Deselect( CURRES );
   
     if( DTYPE( xdevice ) == 'P' )	/* ROM driver - SCREEN.SYS */
        Select( CURROM );

     if( DTYPE( xdevice ) == 'R' )    /* Resident Driver */
   	Select( CURRES );

     Objc_draw( tree, CURNUM, MAX_DEPTH, NULL );
     Objc_draw( tree, CURNAME, MAX_DEPTH, NULL );
     Objc_draw( tree, CURROM, MAX_DEPTH, NULL );
     Objc_draw( tree, CURRES, MAX_DEPTH, NULL );

     /* turn on/off the EDELETE button here too */
     rect = ObRect( EDELETE  );
     objc_offset( tree, EDELETE, &rect.g_x, &rect.g_y );

     rect.g_x -= 3;
     rect.g_y -= 3;
     rect.g_w += 6;
     rect.g_h += 6;
        
     if( DDEV( xdevice ) > 9 )
     {
       MakeExit( EDELETE );
       Enable( EDELETE );
     }
     else
     {
       NoExit( EDELETE );
       Disable( EDELETE );           
     }
     Deselect( EDELETE );
     Objc_draw( tree, ROOT, MAX_DEPTH, &rect );
     
     /* Check if the device deleted is the current_device.
      * if so, we have to update the current_device to a new device.
      */
     if( temp_device == current_device )
     	 current_device = xdevice;
     	 
     if( temp_device == device_head )
         device_head = xdevice;	 
}
Exemplo n.º 16
0
/* InActive_Button()
 * =====================================================================
 */
int
InActive_Button( int button, WORD *msg )
{
  int default_item = -1;
  int quit = FALSE;
      
  if( ( button != -1 ) && ( button & 0x8000 ) )
     button &= 0x7FFF;      

  switch( button )
  {
     case IQUIT:    Deselect( IQUIT );
     		    RestoreMainTree();
     		    break;

     case OXUP:
     case OXDOWN:   XDeviceUpDown( button );
     		    break;
     		    
     case IMENU:   Build_InActive_Menu();
		   Item = Pop_Handle( tree, IMENU, imenu_text,
			              imenu_num, &default_item,
       			              IBM, 23 );
   		   switch( Item )
   		   {
   		      case 0: DoActiveFonts();
   		   	      break;
   		   	   
   		      case 1: RestoreMainTree();
   		   	      break;

		      case 2: if( form_alert( 1, alert9 ) == 1 )
     		              {
     		                MoveFonts();
     		                SetChangeFlag();
     		              } 
   		   	      break;

   		      default:
   		   	      break;
   		   }
     		   break;
     		         		    
     case OUP:
     case ODOWN:
     case OBASE:
     case OSLIDE:
     case OLINE0:
     case OLINE1:
     case OLINE2:
     case OLINE3:
     case OLINE4:
     case OLINE5: mover_button( button );
		  break;

     case XTRANSFR: if( form_alert( 1, alert9 ) == 1 )
     		    {
     		      MoveFonts();
     		      SetChangeFlag();
     		    }  
     		    else
     		      deselect( tree, XTRANSFR );
     		    break;
     		    		       		       
     default:	if( button == -1 )
     		{
     		   switch( msg[0] )
     		   {
     		     case WM_REDRAW: 
     		     		     break;
     			     		     
     		     case AC_CLOSE:  quit = TRUE;
     		     		     break;
     				     		     
     		     case WM_CLOSED: quit = TRUE;
     		     		     CloseWindow();
				     break;
		    
		    		     /* UNDO key restores the fonts of
		    		      * the specific driver.
		    		      */
		     case CT_KEY:    if( msg[3] == UNDO )
		     			Undo_Fnodes( hdptr );
		     		     break;
     		     default:
     		     		break;
     		   }
     		}
     		else
		  Undo_Fnodes( hdptr );
     		break;
  }
  
  return( quit );
}