Exemplo n.º 1
0
BOOL SaveToolPreferences( int idTool)
{
LPSTR lp;
STRING szString;

#ifndef NOTCRAYOLA
	return(YES); // DON'T WRITE INTO THE INI JUST YET
#endif

if ( AstralStr( IDC_TOOLNAMESTART+idTool, &lp ) )
	lstrcpy( szString, lp );
else	szString[0] = '\0';
if ( AstralOKCancel( IDS_OKTOSAVEPREF, (LPSTR)szString ) == IDCANCEL )
	return( NO );

switch ( idTool )
   {
   case 0:
	break;
   case IDC_TRANSFORMER:
	PutDefInt( Mask.TransformImage, Mask.TransformImage-IDC_COPYIMAGE);
	PutDefInt(Mask.iTransformModes, Mask.iTransformModes ); 
	PutDefInt( Mask.PasteQuality, Mask.PasteQuality );
	PutDefInt( Mask.TransMode, Mask.TransMode-IDC_TRANSMODEFIRST );
	PutDefInt( Mask.TransformOpacity, Mask.TransformOpacity );
	PutDefInt( Mask.TransformMergeMode, Mask.TransformMergeMode );
	break;
   case IDC_PAINT:
   case IDC_CRAYON:
   case IDC_MARKER:
   case IDC_LINES:
   case IDC_SHAPES:
   case IDC_ERASER:
	HandleBrushSettings(idTool, YES);
	break;
   case IDC_FILL:
	PutDefInt( Fill.FloodRange, Fill.FloodRange );
	PutDefInt( Fill.idFillColorModel, Fill.idFillColorModel);
	PutDefInt( Fill.FloodOpacity, Fill.FloodOpacity );
	PutDefInt( Fill.FloodMergeMode, Fill.FloodMergeMode );
	PutDefInt( Fill.FillOpacity, Fill.FillOpacity );
	PutDefInt( Fill.FillMergeMode, Fill.FillMergeMode );
	PutDefInt( Vignette.Gradient, Vignette.Gradient - IDC_VIGLINEAR );
	PutDefInt( Vignette.RepeatCount, Vignette.RepeatCount );
	PutDefInt( Vignette.SoftTransition, Vignette.SoftTransition );
	PutDefInt( Vignette.VigColorModel, Vignette.VigColorModel );
	PutDefInt( Vignette.VigOpacity, Vignette.VigOpacity );
	PutDefInt( Vignette.VigMergeMode, Vignette.VigMergeMode );
	PutDefInt( Vignette.Midpoint, Vignette.Midpoint );
	PutDefStr( Texture.TextureName, Texture.TextureName );
	PutDefInt( Texture.fHorzFlip, Texture.fHorzFlip );
	PutDefInt( Texture.fVertFlip, Texture.fVertFlip );
	PutDefInt( Texture.TextureOpacity, Texture.TextureOpacity );
	PutDefInt( Texture.TextureMergeMode, Texture.TextureMergeMode );
	break;
   case IDC_CUSTOMVIEW:
	PutDefInt( View.ZoomOut, View.ZoomOut );
	PutDefInt( View.ZoomWindow, View.ZoomWindow );
	break;
   case IDC_TEXT:
	PutDefInt( Text.nFont, Text.nFont );
	PutDefInt( Text.Size, Text.Size );
	PutDefInt( Text.Italic, Text.Italic );
	PutDefInt( Text.Underline, Text.Underline );
	PutDefInt( Text.Strikeout, Text.Strikeout );
	PutDefInt( Text.Weight, Text.Weight );
	PutDefInt( Text.AntiAlias, Text.AntiAlias );
	PutDefInt( Text.AutoFill, Text.AutoFill );
	PutDefInt( Text.TextMergeMode, Text.TextMergeMode );
	PutDefInt( Text.TextOpacity, Text.TextOpacity );
	break;
   }
return( YES );
}
Exemplo n.º 2
0
void SavePreferences()
/************************************************************************/
{
PutDefInt( Control.NoUndo, Control.NoUndo );
PutDefInt( Control.Hints, Control.Hints );
PutDefInt( Control.bNoTheme, Control.bNoTheme );
#ifdef USEWAVEMIX
PutDefInt( Control.bUseWaveMix, Control.bUseWaveMix );
#endif // USEWAVEMIX
PutDefInt( Control.iAdventBrush, Control.iAdventBrush );
PutDefInt( Control.iMaxAnimations, Control.iMaxAnimations );
PutDefInt( Control.iScrnSaverTime, Control.iScrnSaverTime );

#ifdef UNUSED
AstralCursor( IDC_WAIT );

// Memory Group Preferences
PutDefStr( Control.RamDisk, Control.RamDisk );
PutDefInt( Control.MainMemMin, Control.MainMemMin );
PutDefInt( Control.MainMemFactor, Control.MainMemFactor );
PutDefInt( Control.LineArtAsGray, Control.LineArtAsGray );

// Undo Group Preferences
PutDefInt( Control.NoUndo, Control.NoUndo );
PutDefInt( Control.UseApply, Control.UseApply );
PutDefInt( Control.UndoObjects, Control.UndoObjects );
PutDefInt( Control.UndoMasks, Control.UndoMasks );

// Miscellaneous Group Preferences
PutDefStr( Control.PouchPath, Control.PouchPath );
PutDefInt( Control.UseWacom, Control.UseWacom );
PutDefInt( Control.MaskTint, Control.MaskTint );
PutDefInt( Control.IndependentSettings, Control.IndependentSettings );

// Units Group Preferences
PutDefInt( Control.Units, Control.Units - IDC_PREF_UNITINCHES );
PutDefInt( View.UseRulers, View.UseRulers );
PutDefInt( Control.DisplayPixelValue, Control.DisplayPixelValue );
PutDefFix( Control.ScreenWidth, Control.ScreenWidth );

// Object Group Preferences
PutDefInt( Control.MultipleObjects, Control.MultipleObjects );
PutDefInt( Control.UseMaskAndObjects, Control.UseMaskAndObjects );

AstralCursor( NULL );
#endif
}
Exemplo n.º 3
0
void SaveMiscPreferences()
/************************************************************************/
{
//LPSTR lp;

PutDefInt( Page.Type, Page.Type - IDC_PRINTER_IS_MONO );
PutDefInt( Page.BinaryPS, Page.BinaryPS );

#ifdef UNUSED
AstralCursor( IDC_WAIT );
if ( !szPreferenceFile[0] )
	{
	if ( !AstralStr( IDS_INIFILE, &lp ) ) lp = PRIVATE_INI;
	lstrcpy( szPreferenceFile, lp );
	GetIniPath( szPreferenceFile );
	}

// Recall List
SaveRecallList();

// Save file options
PutDefInt( Save.bSaveMask, Save.bSaveMask );
PutDefInt( Save.OKtoSavePath, Save.OKtoSavePath );
PutDefInt( Save.Compressed, Save.Compressed );

// Clipboard
PutDefInt( Control.DoPicture, Control.DoPicture );
PutDefInt( Control.DoBitmap, Control.DoBitmap );

// New Dialog
PutDefInt( Control.NewDepth, Control.NewDepth );
PutDefInt( Control.NewWidth, Control.NewWidth );
PutDefInt( Control.NewHeight, Control.NewHeight );
PutDefInt( Control.NewResolution, Control.NewResolution );

// Miscellaneous
PutDefRGB( Control.rgbBackground, Control.rgbBackground );
PutDefInt( Control.Save24BitWallpaper, Control.Save24BitWallpaper );

// Monitor Gamma Dialog
PutDefFix( BltSettings.RGamma, BltSettings.RGamma );
PutDefFix( BltSettings.GGamma, BltSettings.GGamma );
PutDefFix( BltSettings.BGamma, BltSettings.BGamma );
PutDefInt( Control.GammaLock, Control.GammaLock );

// Extended Names
PutDefStr( Names.ColorMap, Names.ColorMap );
PutDefStr( Names.Mask, Names.Mask );
PutDefStr( Names.Printer, Names.Printer );
PutDefStr( Names.PrintStyle, Names.PrintStyle );
PutDefStr( Names.Clipboard, Names.Clipboard );
PutDefStr( Names.CustomBrush, Names.CustomBrush );
PutDefStr( Names.Special, Names.Special );

// Print Dialog
PutDefInt( Page.Type, Page.Type - IDC_PRINTER_IS_MONO );
PutDefInt( Page.PrintNumeric, Page.PrintNumeric );
PutDefInt( Page.OutputType, Page.OutputType - IDC_PRINT_GRAY );
PutDefInt( Page.ScatterPrint, Page.ScatterPrint );
PutDefInt( Page.Centered, Page.Centered );
PutDefFix( Page.OffsetX, Page.OffsetX );
PutDefFix( Page.OffsetY, Page.OffsetY );
PutDefInt( Page.SepFlags, Page.SepFlags );
PutDefInt( Page.TrimMarks, Page.TrimMarks );
PutDefInt( Page.RegMarks, Page.RegMarks );
PutDefInt( Page.Labels, Page.Labels );
PutDefInt( Page.StepScale, Page.StepScale );
PutDefInt( Page.Negative, Page.Negative );
PutDefInt( Page.EmulsionDown, Page.EmulsionDown );
PutDefInt( Page.BinaryPS, Page.BinaryPS );
//PutDefInt( Page.BinaryEPS, Page.BinaryEPS );
PutDefInt( Page.UsePrinterScreening, Page.UsePrinterScreening );

// Size Dialog
PutDefInt( Edit.SmartSize, Edit.SmartSize );

// Convert settings
PutDefInt( Convert.MiniType, Convert.MiniType-IDC_MINI256);
PutDefInt( Convert.fOptimize, Convert.fOptimize );
PutDefInt( Convert.fScatter, Convert.fScatter );
PutDefInt( Convert.fDither, Convert.fDither );

// Save Common Tool Settings
PutDefInt( Common.Opacity, Common.Opacity );
PutDefInt( Common.MergeMode, Common.MergeMode );
PutDefInt( Common.BrushSize, Common.BrushSize );
AstralCursor( NULL );
#endif
}
Exemplo n.º 4
0
long DoCommand( HWND hWindow, WPARAM wParam, LPARAM lParam )
/***********************************************************************/
{
FNAME szFileName;
LPFRAME lpFrame;
LPOBJECT lpObject, lpBase;
RECT rect, rMask, rTemp, rAll;
HWND hWnd;
STRING szString;
int i, idFileType, x, y, dx, dy;
BOOL fDoZoom, bPrint, fHasZoom;
LPSTR lpszCmdLine;
HGLOBAL hMem;
ITEMID idDataType;
DWORD dwReturn;
int NewShape;
UINT wID;

SoundStartID( wParam, NO/*bLoop*/, NULL/*hInstance*/ );
/*
	WIN16:	ID          = wParam
			ctrl handle = LOWORD(lParam)
			notify code = HIWORD(lParam)

	WIN32:	ID          = LOWORD(wParam)
			ctrl handle = lParam
			notify code = HIWORD(wParam)
*/

#ifdef WIN32
	wID = LOWORD(wParam);
#else
	wID = wParam;
#endif

switch (wID)
	{
	case IDM_EXIT:
	DeactivateTool();
	PostMessage( hWndAstral, WM_CLOSE, 0, 0L);
    Delay (750);
	break;

	case IDM_CLOSE:
	DeactivateTool();
	/* Check to see if the image needs to be saved */
	if ( !ConfirmClose(NO,NO) )
		break;
	CloseImage( NO, lpImage ); // Close the active image
	break;

	case IDM_ABOUT:
	/* Bring up the modal 'About' dialog box */
	AstralDlg( NO|2, hInstAstral, hWindow, IDD_ABOUT, DlgAboutProc);
	break;

	case IDM_NEXTPAGE:
	if ( !lpImage )
		break;
	DeactivateTool();
	SendMessage( lpImage->hWnd, WM_SYSCOMMAND, SC_NEXTWINDOW, 0L );
	break;

	case IDM_NEW:
	DeactivateTool();
	SoundStartResource( "magic01", NO, NULL );
	AstralCursor( IDC_WAIT );
	New( Control.NewWidth, Control.NewHeight, Control.NewResolution,
		Control.NewDepth );
	AstralCursor( NULL );
	break;

	case IDM_OPEN:
	DeactivateTool();
	/* Bring up the modal 'File Open' box */
	if ( !(dwReturn = DoOpenDlg( hWindow, IDD_OPEN,
		Save.FileType, szFileName, NO )) )
		break;
	idFileType = LOWORD( dwReturn );
	Save.FileType = idFileType;
	PutDefaultInt( "FileType", idFileType - IDN_TIFF );
	AstralImageLoad( idFileType, szFileName, MAYBE, YES );
	break;

	case IDM_ALTOPEN:
	DeactivateTool();
	// Command line sent from a second instance prior to it closing
	/* If the caller passed in a file name, try to load it or print it */
	if ( !(lpszCmdLine = (LPSTR)lParam) )
		break;
	HandleCommandLine( hWindow, lpszCmdLine, &bPrint );
	break;

	case IDM_SAVE:
	DeactivateTool();
	HandleSaveCommand(hWindow, wID, YES);
	break;

	case IDM_SAVEAS:
	DeactivateTool();
	HandleSaveCommand(hWindow, wID, YES);
	break;

	case IDM_SAVESPECIAL:
	DeactivateTool();
	HandleSaveCommand(hWindow, wID, YES);
	break;

	case IDM_SAVEWALLPAPER:
	DeactivateTool();
	SaveWallpaper( "CRAYOLA", NO/*fTiled*/ );
	break;

	case IDM_REVERT:
	if ( !lpImage )
		break;
	DeactivateTool();
	if ( lpImage->fUntitled ) // If the picture doesn't have a name, get out
		break;
	if ( ImgChanged(lpImage) )
		{
		/* Check to see if its OK to trash changes */
		if ( AstralOKCancel(IDS_OKTOREVERT,
				(LPSTR)lpImage->CurFile) == IDCANCEL )
			break;
		}
	lstrcpy( szFileName, lpImage->CurFile );
	idFileType = lpImage->FileType;
	fDoZoom = IsZoomed(lpImage->hWnd);
	fHasZoom = Window.fHasZoom;
	CloseImage( NO, lpImage ); // Close the active image
	if ( !AstralImageLoad( idFileType, szFileName, fDoZoom, YES ) )
		break;
	break;

	case IDM_RECALLIMAGE0:
	case IDM_RECALLIMAGE1:
	case IDM_RECALLIMAGE2:
	case IDM_RECALLIMAGE3:
	case IDM_RECALLIMAGE4:
	case IDM_RECALLIMAGE5:
	case IDM_RECALLIMAGE6:
	case IDM_RECALLIMAGE7:
	case IDM_RECALLIMAGE8:
	case IDM_RECALLIMAGE9:
	DeactivateTool();
	GetMenuString( GetMenu(hWindow), wID,
		szFileName, sizeof(szFileName), MF_BYCOMMAND );
	i = 0;
	while ( szFileName[i] && szFileName[i] != ' ' )
		i++; // Skip over the numeric id in the string (3. junk.tif)
	lstrcpy(szString, &szFileName[i+1]);
	GetRecallFileName(szString);
	AstralImageLoad( NULL, szString, MAYBE, YES );
	break;

	case IDM_PRINT:
	if ( !lpImage )
		break;
	DeactivateTool();
	AstralCursor( IDC_WAIT );
	DoPrintSizeInits();
	SoundStartResource( "print", YES, NULL );
	PrintFile( hWindow, filename(lpImage->CurFile), YES, lpImage, NULL );
	SoundStop();
	AstralCursor( NULL );
	break;

	case IDM_PRINTSETUP:
	/* Bring up the setup dialog box for the active printer */
	AstralDlg( NO|2, hInstAstral, hWindow, IDD_PRINTSETUP,
		DlgPrintSetupProc);
	break;

	case IDC_SOUND:
	SoundToggle();
	break;

	case IDM_UNDO:
	if ( !lpImage )
		break;
	DeactivateTool();
	ImgEditUndo(lpImage, YES, NO);
	break;

	case IDM_CUT:
	case IDM_COPY:
	if ( !lpImage )
		break;
	DeactivateTool();

	// Create the clipboard files from the image
	ProgressBegin(1, IDS_PROGCOPY);
	if ( !ImgWriteClipOut( lpImage, NULL, NULL, &rMask, lpImage->DataType ) )
		{
		ProgressEnd();
		Message(IDS_EMEMALLOC);
		break;
		}
	ProgressEnd();

	OpenClipboard(hWindow);
	EmptyClipboard();

	// Passing a NULL data handle in SetClipboardData() means that
	// the data will be requested in a WM_RENDERFORMAT message
	hMem = ConstructObject( lpImage,
		IsRectEmpty(&rMask)? (LPRECT)NULL : (LPRECT)&rMask );
	if ( pOLE )
		{ // Any data put on before Native will become staticly copied
		SetClipboardData( pOLE->cfNative, NULL );
		SetClipboardData( pOLE->cfOwnerLink, hMem );
		}
	SetClipboardData( CF_DIB, NULL );
	if ( Control.DoPicture )
		SetClipboardData( CF_METAFILEPICT, NULL );
	if ( Control.DoBitmap )
		SetClipboardData( CF_BITMAP, NULL );
	SetClipboardData( CF_PALETTE, NULL );
	SetClipboardData( Control.cfImage, NULL );
	if ( pOLE && wID == IDM_COPY && !lpImage->fUntitled )
		{ // ObjectLink is retrieved during a Paste Link...
		SetClipboardData( pOLE->cfObjectLink, hMem );
		}
	CloseClipboard();
	if ( wID == IDM_COPY )
		break;

	// else fall through to IDM_DELETE

	case IDM_DELETE:
	if ( !lpImage )
		break;
	{
	COLORINFO ColorInfo;

	DeactivateTool();
	ColorInfo.gray   = 255;
	SetColorInfo( &ColorInfo, &ColorInfo, CS_GRAY );
	TintFill( lpImage, &ColorInfo, 255, MM_NORMAL,
		wID == IDM_CUT ? IDS_UNDOCUT : IDS_UNDODELETE );
	}
	break;

	case IDM_PASTE:
	if ( !lpImage )
		break;

	case IDM_PASTEASNEW:
	if ( !OpenClipboard(hWndAstral) )
		{
		Message( IDS_ECLIPOPEN );
		break;
		}
	if ( !IsClipboardFormatAvailable(CF_DIB) &&
	     !IsClipboardFormatAvailable(CF_BITMAP) &&
	     !IsClipboardFormatAvailable(Control.cfImage) )
		{
		Message( IDS_ECLIPOPEN );
		CloseClipboard();
		break;
		}
	CloseClipboard();

	DeactivateTool();
	// First put clipboard contents into a file(s)
	AstralCursor(IDC_WAIT);
	if ( !PasteFromClipboard( hWindow, (wID == IDM_PASTE) /*fNeedMask*/ ) )
		{
		AstralCursor(NULL);
		Message(IDS_EMEMALLOC);
		break;
		}
	if ( wID == IDM_PASTE )
		{
		ProgressBegin(1, IDS_PROGPASTECLIP);
		TransformObjectsStart( YES/*fNewObject*/ );
        if ( ImgCreateClipInObject( lpImage, NO ) )
			;
		ProgressEnd();
		}
	else
	if ( wID == IDM_PASTEASNEW )
		{
		if ( lpFrame = AstralFrameLoad( Names.PasteImageFile, -1,
			 &idDataType, &idFileType) )
			{
			if ( NewImageWindow(
				NULL,			// lpOldFrame
				NULL,			// Name
				lpFrame, 		// lpNewFrame
				idFileType,		// lpImage->FileType
				idDataType,		// lpImage->DataType
				FALSE,			// New view?
				IMG_DOCUMENT,	// lpImage->DocumentType
				NULL,			// lpImage->ImageName
				MAYBE
				) )
					lpImage->fChanged = YES;
			}
		}
	break;

	case IDM_ESCAPE:
	if (!lpImage)
		break;
	if (lpImage->hWnd == hZoomWindow)
		break;
	if ( Tool.bActive && Tool.lpToolProc )
		DestroyProc( lpImage->hWnd, 1L );
	break;

	case IDM_SIZEUP:
	case IDM_SIZEDOWN:
	if (!Retouch.hBrush)
		break;				 
	SetFocus( hWindow ); // Take focus away from any controls
	if ( Retouch.BrushShape == IDC_BRUSHCUSTOM )
		break;
	if ( wID == IDM_SIZEUP )
    {
    	if( bHexBrush && ( Retouch.BrushSize % 2 == 0 ) && ( Retouch.BrushSize > 6 ))
    		Retouch.BrushSize += 2;
        else        
    		Retouch.BrushSize++;
    }
	else	
    {
    	if( bHexBrush && ( Retouch.BrushSize % 2 == 0 ) && ( Retouch.BrushSize > 6 )) 
    		Retouch.BrushSize -= 2;
        else        
    		Retouch.BrushSize--;
    }
	if ( Retouch.BrushSize < 1 || Retouch.BrushSize > MAX_BRUSH_SIZE )
		{
		Retouch.BrushSize = bound( Retouch.BrushSize, 1,MAX_BRUSH_SIZE);
		MessageBeep(0);
		break;
		}
	if (lpImage)
		DisplayBrush(0, 0, 0, OFF);
	SetMgxBrushSize(Retouch.hBrush, Retouch.BrushSize);
	if (lpImage && Window.hCursor == Window.hNullCursor)
		DisplayBrush(lpImage->hWnd, 32767, 32767, ON);
	if ( Tool.hRibbon )
		SetSlide( Tool.hRibbon, IDC_BRUSHSIZE, Retouch.BrushSize );
	break;

	case IDM_SHAPEUP:
	case IDM_SHAPEDOWN:
	if (!Retouch.hBrush)
		break;
	SetFocus( hWindow ); // Take focus away from any controls
	NewShape = Retouch.BrushShape;
	if ( wID == IDM_SHAPEUP )
		NewShape++;
	else	NewShape--;
	if ( NewShape > IDC_BRUSHCUSTOM )
		NewShape = IDC_BRUSHCIRCLE;
	if ( NewShape < IDC_BRUSHCIRCLE )
		NewShape = IDC_BRUSHCUSTOM;
	if (lpImage)
	 	DisplayBrush(0, 0, 0, OFF);
	if (!SetMgxBrushShape(Retouch.hBrush, NewShape, Names.CustomBrush))
		{
		NewShape = IDC_BRUSHCIRCLE;
		SetMgxBrushShape(Retouch.hBrush, NewShape, Names.CustomBrush);
		}
	Retouch.BrushShape = NewShape;
	if (lpImage && Window.hCursor == Window.hNullCursor)
	 	DisplayBrush(lpImage->hWnd, 32767, 32767, ON);
	if ( Tool.hRibbon )
		{
		CheckComboItem( Tool.hRibbon, IDC_BRUSHSHAPE, IDC_BRUSHCIRCLE,
			IDC_BRUSHCUSTOMNEW, Retouch.BrushShape );
		SendMessage( Tool.hRibbon, WM_CONTROLENABLE, 0, 0L );
		}
	break;

	case IDM_MOVEUP:
	case IDM_MOVEDOWN:
	case IDM_MOVELEFT:
	case IDM_MOVERIGHT:
	if (!lpImage)
		break;
	lpBase = ImgGetBase(lpImage);
	if (ImgGetSelObject(lpImage, NULL) == lpBase)
		break;
	dx = dy = 0;
	if (wID == IDM_MOVEUP)
		--dy;
	if (wID == IDM_MOVEDOWN)
		++dy;
	if (wID == IDM_MOVELEFT)
		--dx;
	if (wID == IDM_MOVERIGHT)
		++dx;
	lpObject = NULL;
	while (lpObject = ImgGetSelObject(lpImage, lpObject))
		{
		rect = lpObject->rObject;
		OffsetRect(&rect, dx, dy);
		if (!AstralIntersectRect(&rTemp, &lpBase->rObject, &rect))
			break;
		}
	if (lpObject)
		break;
	AstralSetRectEmpty(&rAll);
	lpObject = NULL;
	while (lpObject = ImgGetSelObject(lpImage, lpObject))
		{
		rect = lpObject->rObject;
		OffsetRect(&lpObject->rObject, dx, dy);
		AstralUnionRect(&rAll, &rAll, &lpObject->rObject);
		if (!lpObject->Pixmap.fNewFrame &&
				EqualRect(&rect, &lpObject->rUndoObject))
			lpObject->rUndoObject = lpObject->rObject;
		UpdateImage(&rect, TRUE);
		UpdateImage(&lpObject->rObject, TRUE);
		}
	if (wID == IDM_MOVEUP)
		{
		x = (rAll.left + rAll.right)/2;
		y = rAll.top;
		}
	else
	if (wID == IDM_MOVEDOWN)
		{
		x = (rAll.left + rAll.right)/2;
		y = rAll.bottom;
		}
	else
	if (wID == IDM_MOVELEFT)
		{
		x = rAll.left;
		y = (rAll.top + rAll.bottom)/2;
		}
	else
	if (wID == IDM_MOVERIGHT)
		{
		x = rAll.right;
		y = (rAll.top + rAll.bottom)/2;
		}
	File2Display(&x, &y);
	AutoScroll(lpImage->hWnd, x, y);
	AstralUpdateWindow(lpImage->hWnd);
	DisplayInfo(-1, &rAll);
	break;

	case IDM_LASTTOOL:
	DeactivateTool();
	if ( Tool.idLast && (hWnd = AstralDlgGet(IDD_MAIN)) )
		SendMessage( hWnd, WM_COMMAND, Tool.idLast, 2L);
	break;

	case IDM_PREF:
	// prevent problems if running animations and they change
	// the wave mix dll setting in preferences
	StopAnimation();
	AstralDlg( NO|2, hInstAstral, hWindow, IDD_PREF, DlgPrefProc );
	break;

	case IDC_VIEWLAST: // duplicate of function in the view ribbon
	if ( !lpImage )
		break;
	RevertLastView();
	break;

//	case IDC_VIEWFULL: // duplicate of function in the view ribbon
//	if ( !lpImage )
//		break;
//	AstralDlg( NO, hInstAstral, hWindow, IDD_VIEWFULL, DlgFullScreenViewProc );
//	break;

	case IDC_VIEWALL: // duplicate of function in the view ribbon
	if ( !lpImage )
		break;
	ViewAll();
	break;

	case IDC_ZOOMIN: // duplicate of function in the view ribbon
	if ( !lpImage )
		break;

	if (!lpImage->lpDisplay)
		break;

	if (!lpImage->lpDisplay->ViewPercentage)
		break;

	x = ( lpImage->lpDisplay->FileRect.left
			+ lpImage->lpDisplay->FileRect.right ) / 2;
	y = ( lpImage->lpDisplay->FileRect.top
			+ lpImage->lpDisplay->FileRect.bottom ) / 2;
	SaveLastView();
	Zoom(x,y, +100, YES, ( View.ZoomWindow ^ CONTROL ) );
	break;

	case IDC_ZOOMOUT: // duplicate of function in the view ribbon
	if ( !lpImage )
		break;

	if (!lpImage->lpDisplay)
		break;

	if (!lpImage->lpDisplay->ViewPercentage)
		break;

	x = ( lpImage->lpDisplay->FileRect.left
			+ lpImage->lpDisplay->FileRect.right ) / 2;
	y = ( lpImage->lpDisplay->FileRect.top
			+ lpImage->lpDisplay->FileRect.bottom ) / 2;
	SaveLastView();
	Zoom(x,y, -100, YES,( View.ZoomWindow ^ CONTROL ) );
	break;

	case IDM_HELP:
	Control.Hints = !Control.Hints;
	PutDefInt (Control.Hints,Control.Hints);
	break;

	default:
	return( FALSE );
	}

return( TRUE );
}