예제 #1
0
void View1TO1()
   {
   int x, y, res, ratio;
   LFIXED fixed;
   HDC hDC;
   HWND hWnd;
   LPDISPLAY lpDisplay;
   LPIMAGE lpImage;

	if (hWnd = GetActiveDoc())
      {
	   lpImage = GetImagePtr(hWnd);
	   lpDisplay = GetDisplayPtr(hWnd);
	   hDC = GetDC( PictPubApp.Get_hWndAstral() );
	   x = GetDeviceCaps( hDC, HORZRES ); // in pixels
	   ReleaseDC( PictPubApp.Get_hWndAstral(), hDC );
	   fixed = FGET( FUNITY, Control.ScreenWidth );
	   if (res = FMUL( x, fixed)) // in pixels/inch
         {
	      ratio = ( 100L * res ) / FrameResolution(ImgGetBaseEditFrame(lpImage));
	      x = ( lpDisplay->FileRect.left 
		   + lpDisplay->FileRect.right ) / 2;
	      y = ( lpDisplay->FileRect.top 
		   + lpDisplay->FileRect.bottom ) / 2;
	      Zoom( hWnd, x, y, ratio, NO, View.ZoomWindow );
         }
      }
   }
예제 #2
0
BOOL CObjectsPrefPage::OnCommand(WPARAM wParam, LPARAM lParam) 
{
	HWND   	hActiveWnd = GetActiveDoc();
	HWND	hDlg = GetSafeHwnd();
	int 	id = GET_WM_COMMAND_ID(wParam, lParam);
	UINT 	codeNotify = GET_WM_COMMAND_CMD(wParam, lParam);

	switch (id)
	{
		case IDC_PREF_OBJECTS:
			Control.MultipleObjects = !Control.MultipleObjects;
			::CheckDlgButton( hDlg, id, Control.MultipleObjects );
//			if (!Control.MultipleObjects)
//				Control.UseMaskAndObjects = FALSE;
//			::CheckDlgButton( hDlg, IDC_PREF_OBJECTMASKS, Control.UseMaskAndObjects );
			ControlEnable(  hDlg, IDC_PREF_OBJECTMASKS, Control.MultipleObjects );
			SetModified(TRUE);
		break;

		case IDC_PREF_OBJECTMASKS:
			if (!Control.MultipleObjects)
				break;
			Control.UseMaskAndObjects = !Control.UseMaskAndObjects;
			::CheckDlgButton( hDlg, id, Control.UseMaskAndObjects );
			SetModified(TRUE);
		break;

	   	default:
			return (CPPPropertyPage::OnCommand(wParam, lParam));   	
		break;
   	}
	return(TRUE);
}
예제 #3
0
void CMiscPrefPage::HandleOK()
{
	HWND hActiveWnd;
	LPIMAGE lpImage = NULL;
	if (hActiveWnd = GetActiveDoc())
		lpImage = GetImagePtr(hActiveWnd);
	if (lpImage && m_MaskTint != Control.MaskTint &&
		ImgGetViewMode(lpImage) == VM_SLIME)
	{
		RECT rRect;

		rRect = GetDisplayPtr(hActiveWnd)->DispRect;
		AstralToWindowsRect(&rRect);
		::InvalidateRect( hActiveWnd, &rRect, FALSE );
	}
	if (!Control.IndependentSettings &&
		Control.IndependentSettings != m_IndependentSettings)
		SetCommonSettings();
	if (Control.UseTablet)
    {
		Control.UseTablet = TabletStart();
        if (!Control.UseTablet)
        {
            LPSTR    lp;

            AstralStr(IDS_NOTABLET, &lp);
            ::MessageBox(PictPubApp.Get_hWndAstral(), lp, szAppName, 
               MB_ICONHAND | MB_OK | MB_TASKMODAL);
        }
    }
	CPPPropertyPage::HandleOK();
}
예제 #4
0
void CImage::EditMaskUndo()
{
LPOBJECT lpBase;
LPMASK lpMask;
RECT rUndo;

lpBase = GetBase();
if (!lpBase->AlphaDirty)
	return;
if (lpBase->fBothDirty)
	return;

AstralSetRectEmpty(&rUndo);
if (GetMask() &&
	lpBase->AlphaUndoType & (UT_CREATEMASK|UT_DELETEMASK) )
	{
	RemoveMaskMarquee(this);
	GetMaskUpdateRect(YES, NO, &rUndo);
	}

ObjEditUndo(lpBase, NO, YES);

if (lpMask = GetMask())
	{
	if (lpBase->AlphaUndoType & (UT_CREATEMASK|UT_DELETEMASK) )
		{
		RemoveMaskMarquee(this);
		GetMaskUpdateRect(YES, NO, &rUndo);
		}
	else
		rUndo = lpMask->Pixmap.UndoRect;
	}
if (rUndo.right >= rUndo.left)
	{
	OffsetRect(&rUndo, lpBase->rObject.left, lpBase->rObject.top);
	File2DispRect(GetActiveDoc(), &rUndo, &rUndo);
	AstralToWindowsRect(&rUndo);
	InvalidateRect(GetActiveDoc(), NULL, NO);
	}
}
예제 #5
0
BOOL CMemoryPrefPage::OnCommand(WPARAM wParam, LPARAM lParam) 
{
	BOOL 	Bool;
	HWND   	hActiveWnd = GetActiveDoc();
	HWND	hDlg = GetSafeHwnd();
	int 	id = GET_WM_COMMAND_ID(wParam, lParam);
	UINT 	codeNotify = GET_WM_COMMAND_CMD(wParam, lParam);

	switch (id)
	{
		case IDC_PREF_RAMDISK:
			if ( ::GetFocus() != ::GetDlgItem( hDlg, id ) )
	    		break;
			if ( codeNotify != EN_CHANGE )
	    		break;
			::GetDlgItemText( hDlg, id, Control.RamDisk,
				sizeof(Control.RamDisk));
			FixPath( Lowercase( Control.RamDisk ) );
			SetModified(TRUE);
		break;

		case IDC_PREF_MEMMIN:
			if ( ::GetFocus() != ::GetDlgItem( hDlg, id ) )
	    		break;
			if ( codeNotify != EN_CHANGE )
	    		break;
			Control.MainMemMin = ::GetDlgItemSpin( hDlg, id, &Bool, NO );
			SetModified(TRUE);
		break;

		case IDC_PREF_MEMFACTOR:
			if ( ::GetFocus() != ::GetDlgItem( hDlg, id ) )
	    		break;
			if ( codeNotify != EN_CHANGE )
	    		break;
			Control.MainMemFactor = ::GetDlgItemSpin( hDlg, id, &Bool, NO );
			SetModified(TRUE);
		break;

		case IDC_PREF_LINEART:
			Control.LineArtAsGray = !Control.LineArtAsGray;
			::CheckDlgButton( hDlg, id, Control.LineArtAsGray );
			SetModified(TRUE);
		break;

	   	default:
			return (CPPPropertyPage::OnCommand(wParam, lParam));   	
		break;
    	}
	return(TRUE);
}
예제 #6
0
BOOL CUndoPrefPage::OnCommand(WPARAM wParam, LPARAM lParam) 
{
	HWND   	hActiveWnd = GetActiveDoc();
	HWND	hDlg = GetSafeHwnd();
	int 	id = GET_WM_COMMAND_ID(wParam, lParam);
	UINT 	codeNotify = GET_WM_COMMAND_CMD(wParam, lParam);

	switch (id)
	{
		case IDC_PREF_UNDOTYPE:
//		case IDC_PREF_NOUNDO:
//		case IDC_PREF_MANUALAPPLY:
//		case IDC_PREF_AUTOAPPLY:
			if ( !(id = HandleCombo( hDlg, id, codeNotify )) )
				break;
			Control.NoUndo = (id == IDC_PREF_NOUNDO);
			Control.UseApply = (id == IDC_PREF_MANUALAPPLY);
			ControlEnable( hDlg, IDC_PREF_MASKUNDO, !Control.NoUndo );
			SetModified(TRUE);
		break;

		case IDC_PREF_UNDOMODE:
//		case IDC_PREF_IMAGEUNDO:
//		case IDC_PREF_OBJECTUNDO:
			if ( !(id = HandleCombo( hDlg, id, codeNotify )) )
				break;
			Control.UndoObjects = (id == IDC_PREF_OBJECTUNDO);
			SetModified(TRUE);
		break;

		case IDC_PREF_MASKUNDO:
			Control.UndoMasks = !Control.UndoMasks;
			::CheckDlgButton( hDlg, id, !Control.UndoMasks );
			SetModified(TRUE);
		break;

		case IDC_PREF_DISABLECMDLIST:
    		Control.DoCommandList = !Control.DoCommandList;
	    	::CheckDlgButton( hDlg, id, !Control.DoCommandList );
			SetModified(TRUE);
		break;

	   	default:
			return (CPPPropertyPage::OnCommand(wParam, lParam));   	
		break;
   	}
	return(TRUE);
}
예제 #7
0
void CObjectsPrefPage::HandleOK()
{
	HWND hActiveWnd;
	if (Control.MultipleObjects != m_bObjects)
		PictPubApp.EnableObjectMenu(AfxGetMainWnd()->GetMenu());
	LPIMAGE lpImage = NULL;
	if (hActiveWnd = GetActiveDoc())
		lpImage = GetImagePtr(hActiveWnd);
	if (!Control.UseMaskAndObjects &&
		Control.UseMaskAndObjects != m_bObjectMasks)
	{
		Control.UseMaskAndObjects = YES;
		RemoveObjectMarquee(lpImage);
		Control.UseMaskAndObjects = NO;
	}
	CPPPropertyPage::HandleOK();
}
예제 #8
0
static void ScrollStart( HWND hWnd )
/************************************************************************/
{
if ( bScrolling )
    return;
// Rely on the fact that we always get an SB_ENDSCROLL when done
if ( hWnd == GetActiveDoc() )
    DisplayBrush(0, 0, 0, OFF);
if ( lpProc = GetDisplayHook(hWnd) )
    { // Call the display hook and turn it off
    lpProc->DisplayHookProc( hWnd, Window.hDC, NULL );
    SetDisplayHook( hWnd, NULL );
    }
EnableMarquee( NO );
RemoveMarquee();
AstralUpdateWindow( hWnd );
bScrolling = YES;
}
예제 #9
0
BOOL CPluginPrefPage::OnCommand(WPARAM wParam, LPARAM lParam) 
{
	HWND   	hActiveWnd = GetActiveDoc();
	HWND	hDlg = GetSafeHwnd();
	int 	id = GET_WM_COMMAND_ID(wParam, lParam);
	UINT 	codeNotify = GET_WM_COMMAND_CMD(wParam, lParam);

	switch (id)
	{
		case IDC_PREF_USEPLUGINS:
			Control.UsePlugins = !Control.UsePlugins;
			::CheckDlgButton( hDlg, id, Control.UsePlugins );
			SetModified(TRUE);
		break;

		case IDC_PREF_PLUGINPATH1:
			if ( ::GetFocus() != ::GetDlgItem( hDlg, id ) )
	    		break;
			if ( codeNotify != EN_CHANGE )
		    	break;
			::GetDlgItemText( hDlg, id, Control.PluginPath1,
				sizeof(Control.PluginPath1));
			FixPath( Lowercase( Control.PluginPath1 ) );
			SetModified(TRUE);
		break;

		case IDC_PREF_PLUGINPATH2:
			if ( ::GetFocus() != ::GetDlgItem( hDlg, id ) )
		    	break;
			if ( codeNotify != EN_CHANGE )
		    	break;
			::GetDlgItemText( hDlg, id, Control.PluginPath2,
				sizeof(Control.PluginPath2));
			FixPath( Lowercase( Control.PluginPath2 ) );
			SetModified(TRUE);
		break;

	   	default:
			return (CPPPropertyPage::OnCommand(wParam, lParam));   	
		break;
   	}
	return(TRUE);
}
예제 #10
0
BOOL CScratchpadPrefPage::OnCommand(WPARAM wParam, LPARAM lParam) 
{
	BOOL 	Bool;
	HWND   	hActiveWnd = GetActiveDoc();
	HWND	hDlg = GetSafeHwnd();
	int 	id = GET_WM_COMMAND_ID(wParam, lParam);
	UINT 	codeNotify = GET_WM_COMMAND_CMD(wParam, lParam);

	switch (id)
	{
		case IDC_PREF_SCRATCHX:
			if ( ::GetFocus() != ::GetDlgItem( hDlg, id ) )
				break;
			if ( codeNotify != EN_CHANGE )
				break;
			Control.ScratchpadWidth = ::GetDlgItemSpin( hDlg, id, &Bool, NO );
			SetModified(TRUE);
		break;

		case IDC_PREF_SCRATCHY:
			if ( ::GetFocus() != ::GetDlgItem( hDlg, id ) )
				break;
			if ( codeNotify != EN_CHANGE )
				break;
			Control.ScratchpadHeight = ::GetDlgItemSpin( hDlg, id, &Bool, NO );
			SetModified(TRUE);
		break;

		case IDC_PREF_SCRATCHTYPE:
//		case IDC_PREF_SCRATCHGRAY:
//		case IDC_PREF_SCRATCHCOLOR:
			if ( !(id = HandleCombo( hDlg, id, codeNotify )) )
				break;
			Control.IsScratchpadColor = id - IDC_PREF_SCRATCHGRAY;
			SetModified(TRUE);
		break;

	   	default:
			return (CPPPropertyPage::OnCommand(wParam, lParam));   	
		break;
   	}
	return(TRUE);
}
예제 #11
0
afx_msg void CServerView::OnViewLast()
{
    if (STOP) return;
    RevertLastView(GetActiveDoc());
}
예제 #12
0
BOOL CMiscPrefPage::OnCommand(WPARAM wParam, LPARAM lParam) 
{
	HWND   	hActiveWnd = GetActiveDoc();
	HWND	hDlg = GetSafeHwnd();
	int 	id = GET_WM_COMMAND_ID(wParam, lParam);
	UINT 	codeNotify = GET_WM_COMMAND_CMD(wParam, lParam);

	switch (id)
	{
		case IDC_PREF_POUCH:
			if ( ::GetFocus() != ::GetDlgItem( hDlg, id ) )
	    		break;
			if ( codeNotify != EN_CHANGE )
	    		break;
			::GetDlgItemText( hDlg, id, Control.PouchPath,
				sizeof(Control.PouchPath));
			FixPath( Lowercase( Control.PouchPath ) );
			SetModified(TRUE);
		break;

		case IDC_PREF_TABLET:
//		case IDC_PREF_TABLETUNUSED:
//		case IDC_PREF_TABLETOPACITY:
//		case IDC_PREF_TABLETSIZE:
//		case IDC_PREF_TABLETBOTH:
			if ( !(id = HandleCombo( hDlg, id, codeNotify )) )
				break;
			Control.UseTablet = id-IDC_PREF_TABLETUNUSED;
			SetModified(TRUE);
		break;

		case IDC_PREF_STARTMACRO:
		   	GetExtNameN( hDlg, id, IDC_FILENAME, Names.StartMacro,
		    	IDN_MACRO, codeNotify, IDS_NONE, NO );
			SetModified(TRUE);
		break;

		case IDC_PREF_MASKTINT:
//		case IDC_PREF_MASKTINT1:
//		case IDC_PREF_MASKTINT2:
//		case IDC_PREF_MASKTINT3:
//		case IDC_PREF_MASKTINT4:
//		case IDC_PREF_MASKTINT5:
//		case IDC_PREF_MASKTINT6:
			if ( !(id = HandleCombo( hDlg, id, codeNotify )) )
				break;
			Control.MaskTint = id - IDC_PREF_MASKTINT1;
			SetModified(TRUE);
		break;

		case IDC_PREF_TOOLSETTINGS:
			Control.IndependentSettings = !Control.IndependentSettings;
			::CheckDlgButton(hDlg, id, Control.IndependentSettings);
			SetModified(TRUE);
		break;

		case IDC_CMS_ENABLED:
			Control.CMSEnabled = CMSOpen( !Control.CMSEnabled );
			::CheckDlgButton(hDlg, id, Control.CMSEnabled);
			SetModified(TRUE);
		break;

		case IDC_PREF_PASTEATREALSIZE:
			Mask.PasteAtRealSize = !Mask.PasteAtRealSize;
			::CheckDlgButton( hDlg, IDC_PREF_PASTEATREALSIZE, Mask.PasteAtRealSize);
			SetModified(TRUE);
		break;

		case IDC_PREF_USEGRAYSCALEICONS:
			Control.UseGrayScaleIcons = !Control.UseGrayScaleIcons;
			::CheckDlgButton( hDlg, IDC_PREF_USEGRAYSCALEICONS, Control.UseGrayScaleIcons);
			SetModified(TRUE);
		break;

		case IDC_PREF_DISABLEAUTOSCROLL:
			Control.DisableAutoScroll = !Control.DisableAutoScroll;
			::CheckDlgButton( hDlg, IDC_PREF_DISABLEAUTOSCROLL, Control.DisableAutoScroll);
			SetModified(TRUE);
		break;

		case IDC_PREF_DISABLEDITHER:
			Vignette.DisableDither = !Vignette.DisableDither;
			::CheckDlgButton( hDlg, IDC_PREF_DISABLEDITHER, Vignette.DisableDither);
			SetModified(TRUE);
		break;

		case IDC_PREF_FILETYPE:
    		if( Control.Retail )
    		{
	    		if (! (id = TableHandleCombo(hDlg, FileType_Table,
					    		sizeof(FileType_Table)/sizeof(ITEMID),
					    		id, codeNotify)))
            		break;
    		}
    		else
    		{
	    		if (! (id = TableHandleCombo(hDlg, FileType_TableOEM,
					    		sizeof(FileType_TableOEM)/sizeof(ITEMID),
					    		id, codeNotify)))
            		break;
    		}
			Control.DefaultFileType = AppFileType(id);
			SetModified(TRUE);
		break;

	   	default:
			return (CPPPropertyPage::OnCommand(wParam, lParam));   	
		break;
   	}
	return(TRUE);
}
예제 #13
0
BOOL CUnitsPrefPage::OnCommand(WPARAM wParam, LPARAM lParam) 
{
	BOOL 	Bool;
	LPSTR 	lpUnit;
	HWND   	hActiveWnd = GetActiveDoc();
	HWND	hDlg = GetSafeHwnd();
	int 	id = GET_WM_COMMAND_ID(wParam, lParam);
	UINT 	codeNotify = GET_WM_COMMAND_CMD(wParam, lParam);

	switch (id)
	{
		case IDC_PREF_USERULERS:
			View.UseRulers = !View.UseRulers;
			::CheckDlgButton( hDlg, id, View.UseRulers );
			SetModified(TRUE);
		break;

		case IDC_PREF_DISPLAYPIXELS:
			Control.DisplayPixelValue = !Control.DisplayPixelValue;
			::CheckDlgButton( hDlg, id, !Control.DisplayPixelValue );
			SetModified(TRUE);
		break;

		case IDC_PREF_SCREENWIDTH:
			if ( ::GetFocus() != ::GetDlgItem( hDlg, id ) )
				break;
			if ( codeNotify != EN_CHANGE )
				break;
			Control.ScreenWidth = AstralGetDlgItemFixed( hDlg, id, &Bool, NO);
			SetModified(TRUE);
		break;

		case IDC_PREF_UNITS:
//		case IDC_PREF_UNITINCHES:
//		case IDC_PREF_UNITMM:
//		case IDC_PREF_UNITCM:
//		case IDC_PREF_UNITPICAS:
//		case IDC_PREF_UNITPIXELS:
			if ( !(id = HandleCombo( hDlg, id, codeNotify )) )
				break;
			Control.Units = id;
			SetUnitInfo((UNIT_TYPE)(Control.Units-IDC_PREF_UNITINCHES), Control.UnitRes, Control.Points);
			if ( AstralStr( Control.Units-IDC_PREF_UNITINCHES+IDS_INCHES,
	     		&lpUnit ) )
				::SetDlgItemText( hDlg, IDC_WIDTHLABEL, lpUnit );
			ControlEnable( hDlg, IDC_PREF_SCREENWIDTH,
				Control.Units != IDC_PREF_UNITPIXELS );

			if ( Control.Units != IDC_PREF_UNITPIXELS )
				AstralSetDlgItemFixed( hDlg, IDC_PREF_SCREENWIDTH, Control.ScreenWidth, NO );
			else
				::SetDlgItemInt( hDlg, IDC_PREF_SCREENWIDTH, GetSystemMetrics( SM_CXSCREEN ), NO );
			SetModified(TRUE);
		break;

	   	default:
			return (CPPPropertyPage::OnCommand(wParam, lParam));   	
		break;
   	}
	return(TRUE);
}
예제 #14
0
BOOL CLocationsPrefPage::OnCommand(WPARAM wParam, LPARAM lParam) 
{
	HWND   	hActiveWnd = GetActiveDoc();
	HWND	hDlg = GetSafeHwnd();
	int 	id = GET_WM_COMMAND_ID(wParam, lParam);
	UINT 	codeNotify = GET_WM_COMMAND_CMD(wParam, lParam);

	switch (id)
	{
		case IDC_LOCATE_CLIPBITS:
			if ( ::GetFocus() != ::GetDlgItem( hDlg, id ) )
	    		break;
			if ( codeNotify != EN_CHANGE )
	    		break;
			::GetDlgItemText( hDlg, id, m_Clipbits,
				sizeof(m_Clipbits));
			FixPath( Lowercase( m_Clipbits ) );
			SetModified(TRUE);
		break;

		case IDC_LOCATE_PRNSTYLES:
			if ( ::GetFocus() != ::GetDlgItem( hDlg, id ) )
	    		break;
			if ( codeNotify != EN_CHANGE )
	    		break;
			::GetDlgItemText( hDlg, id, m_Printstyles,
				sizeof(m_Printstyles));
			FixPath( Lowercase( m_Printstyles ) );
			SetModified(TRUE);
		break;
	
		case IDC_LOCATE_BRUSHES:
			if ( ::GetFocus() != ::GetDlgItem( hDlg, id ) )
	    		break;
			if ( codeNotify != EN_CHANGE )
	    		break;
			::GetDlgItemText( hDlg, id, m_Brushes,
				sizeof(m_Brushes));
			FixPath( Lowercase( m_Brushes ) );
			SetModified(TRUE);
		break;

		case IDC_LOCATE_PALETTES:
			if ( ::GetFocus() != ::GetDlgItem( hDlg, id ) )
	    		break;
			if ( codeNotify != EN_CHANGE )
	    		break;
			::GetDlgItemText( hDlg, id,m_Palettes ,
				sizeof(m_Palettes));
			FixPath( Lowercase( m_Palettes ) );
			SetModified(TRUE);
		break;

		case IDC_LOCATE_TEXTURES:
			if ( ::GetFocus() != ::GetDlgItem( hDlg, id ) )
	    		break;
			if ( codeNotify != EN_CHANGE )
	    		break;
			::GetDlgItemText( hDlg, id,m_Textures ,
				sizeof(m_Textures));
			FixPath( Lowercase( m_Textures ) );
			SetModified(TRUE);
		break;

		case IDC_LOCATE_DEVICES:
			if ( ::GetFocus() != ::GetDlgItem( hDlg, id ) )
	    		break;
			if ( codeNotify != EN_CHANGE )
	    		break;
			::GetDlgItemText( hDlg, id,m_Devices ,
				sizeof(m_Devices));
			FixPath( Lowercase( m_Devices ) );
			SetModified(TRUE);
		break;

		case IDC_LOCATE_FILTERS:
			if ( ::GetFocus() != ::GetDlgItem( hDlg, id ) )
	    		break;
			if ( codeNotify != EN_CHANGE )
	    		break;
			::GetDlgItemText( hDlg, id,m_Effects ,
				sizeof(m_Effects));
			FixPath( Lowercase( m_Effects ) );
			SetModified(TRUE);
		break;

		case IDC_LOCATE_MACROS:
			if ( ::GetFocus() != ::GetDlgItem( hDlg, id ) )
	    		break;
			if ( codeNotify != EN_CHANGE )
	    		break;
			::GetDlgItemText( hDlg, id,m_Macros ,
				sizeof(m_Macros));
			FixPath( Lowercase( m_Macros ) );
			SetModified(TRUE);
		break;

		case IDC_LOCATE_IMPORTFILTERS:
			if ( ::GetFocus() != ::GetDlgItem( hDlg, id ) )
	    		break;
			if ( codeNotify != EN_CHANGE )
	    		break;
			::GetDlgItemText( hDlg, id,m_Importfilters ,
				sizeof(m_Importfilters));
			FixPath( Lowercase( m_Importfilters ) );
			SetModified(TRUE);
		break;

		default:
			return (CPPPropertyPage::OnCommand(wParam, lParam));   	
		break;
   	}
	return(TRUE);
}
예제 #15
0
LOCAL void ShieldFloat_OnCommand(HWND hDlg, int id, HWND hControl, UINT codeNotify)
/************************************************************************/
{
    int i;
    BOOL Bool, active;
    BYTE mask;
    long Color;
    ITEMID idLastTool;
    HWND hActiveWnd;
    char Buff[10];

    hActiveWnd = GetActiveDoc();
    switch (id)
    {
    case IDC_MAP_PROBE:
        GetWindowText(hControl, Buff, 10);
        id = atoi(Buff);
        if (id < 1 || id > 8)
            break;
        id += IDC_MASKCOLOR1 - 1;
        ShowWindow(GetDlgItem(hDlg, id), SW_SHOW);
        SetFocus(GetDlgItem(hDlg, id));
        ShowWindow(hControl, SW_HIDE);
    case IDC_MASKCOLOR1:
    case IDC_MASKCOLOR2:
    case IDC_MASKCOLOR3:
    case IDC_MASKCOLOR4:
    case IDC_MASKCOLOR5:
    case IDC_MASKCOLOR6:
    case IDC_MASKCOLOR7:
    case IDC_MASKCOLOR8:
        ColorMask.MaskShield = i = id - IDC_MASKCOLOR1;
        if ( codeNotify != 1 /*Not A DoubleClick*/ )
        {
            if ( hActiveWnd )
                bProbePending = YES;
        }
        else
        {
            bProbePending = NO;
            if ( !ColorPicker( &ColorMask.MaskColor[i], NULL ) )
                break;
            CopyRGB( &ColorMask.MaskColor[i].rgb, &Color );
            SetWindowLong( GetDlgItem( hDlg, id ), GWL_ACTIVE, Color );
            AstralControlRepaint( hDlg, IDC_MASKCOLOR1 + i );
        }
        mask = 1 << (id - IDC_MASKCOLOR1);
        if (ColorMask.Mask & mask)
        {
            SetupShield();
            break;
        }
        id = id - IDC_MASKCOLOR1 + IDC_MASKACTIVE1;

    case IDC_MASKACTIVE1:
    case IDC_MASKACTIVE2:
    case IDC_MASKACTIVE3:
    case IDC_MASKACTIVE4:
    case IDC_MASKACTIVE5:
    case IDC_MASKACTIVE6:
    case IDC_MASKACTIVE7:
    case IDC_MASKACTIVE8:
        mask = 1 << (id - IDC_MASKACTIVE1);
        ColorMask.Mask ^= mask;
        active = ColorMask.Mask & mask;
        CheckDlgButton( hDlg, id, active );
        SetupShield();
        break;

    case IDC_MASKRANGE1:
    case IDC_MASKRANGE2:
    case IDC_MASKRANGE3:
    case IDC_MASKRANGE4:
    case IDC_MASKRANGE5:
    case IDC_MASKRANGE6:
    case IDC_MASKRANGE7:
    case IDC_MASKRANGE8:
        if ( GetFocus() != GetDlgItem( hDlg, id ) )
            break;
        if ( codeNotify != EN_CHANGE )
            break;
        ColorMask.MaskRange[id-IDC_MASKRANGE1] =
            GetDlgItemSpin( hDlg, id, &Bool, NO );
        SetupShield();
        break;

    case IDC_SHIELD_IFHIDDEN:
        ColorMask.IfHidden = !ColorMask.IfHidden;
        CheckDlgButton( hDlg, id, !ColorMask.IfHidden );
        break;

    case IDC_SHIELDSELECT:
//	case IDC_MASKINCLUDE:
//	case IDC_MASKEXCLUDE:
        if ( !(id = HandleCombo( hDlg, id, codeNotify )) )
            break;
        ColorMask.Include = ( id == IDC_MASKINCLUDE );
        if ( Tool.hRibbon )
            SendMessage( Tool.hRibbon, WM_SHIELDCHANGE, 0, 0L );
        break;

    case IDC_PREVIEW:
        if (!hActiveWnd)
            break;
        idLastTool = ActivateTool(id);
        CreateProc( hActiveWnd, 0, 0, idLastTool );
        bPreview = YES;
        break;

    case IDC_RESET:
        TurnOffShieldPreview();
        break;

    default:
        break;
    }
}