Exemplo n.º 1
0
BOOL CChromaDlg::OnInitDialog()
{
	HWND		hDlg = GetSafeHwnd();
   	int i;
   	FRMTYPEINFO TypeInfo;
   	BOOL        EnableFade;

    PreDoModal(NULL);

	bPreview = bProbePending = NO;
   	ImgGetTypeInfo(GetImage(), &TypeInfo);
   	EnableFade = TypeInfo.DataType != FDT_LINEART && TypeInfo.DataType != FDT_PALETTECOLOR;
    CenterPopup(hDlg);
	lpChromaMask = new CChromaMask(this);
    ControlEnable(hDlg, IDC_DELETEMASK, ImgGetMask(GetImage()) != NULL);
   	iCombo[0] = IDC_CHROMA_NORMAL;
	iCombo[1] = IDC_CHROMA_HSL;
	iCombo[2] = IDC_CHROMA_LUMIN;
   	nCombo    = 3;
	TableCheckComboItem(hDlg, IDC_CHROMASELECT, &iCombo[0], nCombo, lpChromaMask->ChromaColorMode, NO);
   	for (i=0; i < NUM_CHROMAMASKS; i++)
	{
    	InitDlgItemSpin(hDlg, IDC_MASKRANGE1+i, 10, NO, 0, 100);
	   	CheckDlgButton(IDC_MASKACTIVE1+i, FALSE);
	   	SetWindowLong(GetDlgItem(IDC_MASKCOLOR1+i)->GetSafeHwnd(),GWL_ACTIVE, 0);
	}
   	InitDlgItemSpin(hDlg, IDC_CHROMA_FADE, 10, NO, 0, 100);
   	CheckRadioButton(IDC_MASKMODE_REVERSE, IDC_MASKMODE_SUBTRACT, IDC_MASKMODE_ADD);
   	lpChromaMask->SetupChroma();
   	ControlEnable(hDlg, IDC_CHROMA, NO);
   	ControlEnable(hDlg, IDC_RESET, NO);
	ControlEnable( hDlg, IDC_CHROMA_FADE,EnableFade);
return(TRUE);
}
Exemplo n.º 2
0
VOID CSizeImageDlg::DoSizeInits( )
{
    HWND hDlg = GetSafeHwnd();
    LPFRAME lpFrame;
    LPIMAGE lpImage = GetImage();
    FRMDATATYPE Type = FDT_RGBCOLOR;

    ImgGetInfo(lpImage, NULL, NULL, NULL, &Type);

    /* Be careful to set all values before doing a SetDlg... with them */
    /* The Edit structure is a temorary holding area for sizing dialog boxes */
    m_Distortable = NO;
    m_MaintainSize = NO;
    m_ScaleX = m_ScaleY = 100;
    if ( lpImage )
    {
	    lpFrame = ImgGetBaseEditFrame(lpImage);
	    m_Crop.left  = m_Crop.top = 0;
	    m_Crop.right = lpImage->npix - 1;
	    m_Crop.bottom = lpImage->nlin - 1;
	    m_Resolution = m_CropResolution = m_OrigResolution =
  				          FrameResolution(lpFrame);
	    m_Depth = FrameDepth(lpFrame);
    }
    else
    {
	    m_Resolution = m_CropResolution = 75;
	    m_Depth = 1;
    }
    m_Angle = 0;
    m_Width  = FGET( CROPWIDTH(), m_CropResolution );
    m_Height = FGET( CROPHEIGHT(), m_CropResolution );

    CheckDlgButton( IDC_DISTORT, m_Distortable);
    CheckDlgButton( IDC_SMARTSIZE, m_SmartSize );
    CheckDlgButton( IDC_MAINTAINSIZE, m_MaintainSize );
 
    ControlEnable(hDlg, IDC_DISTORT, !m_MaintainSize);
    ControlEnable(hDlg, IDC_MAINTAINSIZE, !m_Distortable );
    ControlEnable( hDlg, IDC_SMARTSIZE, !m_MaintainSize && 
        !m_Distortable && CANDOTRANSPARENCY(Type));

    InitDlgItemSpinFixed( hDlg, IDC_HEIGHT, m_Height, YES, 0L, FGET(9999,1) );
    InitDlgItemSpinFixed( hDlg, IDC_WIDTH, m_Width, YES, 0L, FGET(9999,1) );
    InitDlgItemSpin( hDlg, IDC_SCALEX, m_ScaleX, YES, 1, 10000 );
    InitDlgItemSpin( hDlg, IDC_SCALEY, m_ScaleY, YES, 1, 10000 );
    InitDlgItemSpin( hDlg, IDC_RES, m_Resolution, NO, 1, 10000 );

    ImageMemory( hDlg, IDC_MEMORY, m_Width, m_Height, m_Resolution,
	    m_Depth );

    CheckComboItem(hDlg, IDC_PREF_UNITS, IDC_PREF_UNITFIRST,
	                     IDC_PREF_UNITLAST, m_Units);

    SetUnitLabels();
}
Exemplo n.º 3
0
BOOL CToneBalanceOptionsDlg::OnInitDialog()
{
	PreDoModal();
	CheckDlgButton(IDC_USE_MID_PER, m_bUseMidPer);
	CheckDlgButton(IDC_AUTO,m_bAutoPreview);
	CheckDlgButton(IDC_MAP_PERCENT, m_bPercentages);
	InitDlgItemSpin(GetSafeHwnd(), IDC_HILIGHTS_SACRIFICED, m_nHSacrifice, NO, 0, 100);
	InitDlgItemSpin(GetSafeHwnd(), IDC_SHADOWS_SACRIFICED, m_nSSacrifice, NO, 0, 100);
	return CPPModalDlg::OnInitDialog();
}
Exemplo n.º 4
0
LOCAL BOOL Flood_OnInitDialog(HWND hDlg, HWND hWndFocus, LPARAM lParam)
/************************************************************************/
{
InitDlgItemSpin( hDlg, IDC_FLOODRANGE, Fill.FloodRange, NO, 0, 100 );
InitDlgItemSpin( hDlg, IDC_FLOODFADE, Fill.FloodFade, NO, 0, 100 );
InitDlgItemSpin( hDlg, IDC_TRANSPARENT, TOPERCENT(255-Fill.FloodOpacity), NO,
	0, 99 );
CheckComboItem( hDlg, IDC_COLORMODEL, IDC_FIRST_MODEL,
	IDC_LAST_MODEL, Fill.idFillColorModel + IDC_FIRST_MODEL);
Flood_HandleEnable(hDlg, 0);
return(FALSE);
}
Exemplo n.º 5
0
BOOL CMemoryPrefPage::OnInitDialog() 
{
	HWND	hDlg = GetSafeHwnd();

 	CPPPropertyPage::OnInitDialog();
	::CheckDlgButton( hDlg, IDC_PREF_LINEART, Control.LineArtAsGray);
	::SetDlgItemText( hDlg, IDC_PREF_RAMDISK, Control.RamDisk );
	InitDlgItemSpin( hDlg, IDC_PREF_MEMMIN,    Control.MainMemMin,    NO, 0, 16384 );
	SetDlgItemSpinStep( hDlg, IDC_PREF_MEMMIN, 64L );
	InitDlgItemSpin( hDlg, IDC_PREF_MEMFACTOR, Control.MainMemFactor, NO, 1, 100 );
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
Exemplo n.º 6
0
BOOL CScratchpadPrefPage::OnInitDialog() 
{
	HWND	hDlg = GetSafeHwnd();

 	CPPPropertyPage::OnInitDialog();
	CheckComboItem(  hDlg, IDC_PREF_SCRATCHTYPE,
				IDC_PREF_SCRATCHGRAY, IDC_PREF_SCRATCHCOLOR,
				Control.IsScratchpadColor + IDC_PREF_SCRATCHGRAY);
	InitDlgItemSpin( hDlg, IDC_PREF_SCRATCHX, Control.ScratchpadWidth,  NO, 1, 500 );
	InitDlgItemSpin( hDlg, IDC_PREF_SCRATCHY, Control.ScratchpadHeight, NO, 1, 500 );
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
Exemplo n.º 7
0
LOCAL BOOL ShieldFloat_OnInitDialog(HWND hDlg, HWND hWndFocus, LPARAM lParam)
/************************************************************************/
{
    int i;
    BOOL active;
    long Color;

    RestorePopup( hDlg, "xyShield", RightPopup );
    for (i=0; i<NUM_COLORMASKS; i++)
    {
        InitDlgItemSpin( hDlg, IDC_MASKRANGE1 + i,
                         ColorMask.MaskRange[i], NO, 0, 100 );
        active = ColorMask.Mask & (1 << i);
        CheckDlgButton( hDlg, IDC_MASKACTIVE1 + i, active );
        CopyRGB(&ColorMask.MaskColor[i].rgb, &Color);
        SetWindowLong( GetDlgItem( hDlg, IDC_MASKCOLOR1+i ), GWL_ACTIVE,
                       Color );
    }
    CheckComboItem( hDlg, IDC_SHIELDSELECT, IDC_MASKINCLUDE,IDC_MASKEXCLUDE,
                    ColorMask.Include ? IDC_MASKINCLUDE : IDC_MASKEXCLUDE);
    CheckDlgButton( hDlg, IDC_SHIELD_IFHIDDEN, !ColorMask.IfHidden );
    SetupShield();
    ColorMask.On = YES;
    ControlEnable( hDlg, IDC_PREVIEW, ColorMask.Mask );
    ControlEnable( hDlg, IDC_RESET, NO );
    return(TRUE);
}
Exemplo n.º 8
0
LOCAL BOOL TintFill_OnInitDialog(HWND hDlg, HWND hWndFocus, LPARAM lParam)
/************************************************************************/
{
InitDlgItemSpin( hDlg, IDC_TRANSPARENT, TOPERCENT(255-Fill.FillOpacity), NO,
	0, 99 );
TintFill_HandleEnable(hDlg, 0);
return(FALSE);
}
Exemplo n.º 9
0
LOCAL BOOL Vignette_OnInitDialog(HWND hDlg, HWND hWndFocus, LPARAM lParam)
/************************************************************************/
{
CheckComboItem( hDlg, IDC_VIGNETTETYPE, IDC_VIGLINEAR, IDC_VIGRECTANGLE,
	Vignette.Gradient );
CheckComboItem( hDlg, IDC_COLORMODEL, IDC_FIRST_MODEL, IDC_LAST_MODEL,
	Vignette.VigColorModel+IDC_FIRST_MODEL );
InitDlgItemSpin( hDlg, IDC_VIGREPEAT, Vignette.RepeatCount, NO,
	1, 99 );
CheckComboItem( hDlg, IDC_VIGTRANSITION,
	IDC_VIGHARDTRANSITION, IDC_VIGSOFTTRANSITION,
	IDC_VIGHARDTRANSITION + Vignette.SoftTransition );
InitDlgItemSpin( hDlg, IDC_TRANSPARENT, TOPERCENT(255-Vignette.VigOpacity),
	NO, 0, 99 );
InitDlgItemSpin( hDlg, IDC_MIDPOINT, TOPERCENT(Vignette.Midpoint),
	NO, 0, 99 );
ControlEnable( hDlg, IDC_VIGTRANSITION, Vignette.RepeatCount > 1 );
Vignette_HandleEnable(hDlg, 0);
return(FALSE);
}
Exemplo n.º 10
0
LOCAL BOOL TextureFill_OnInitDialog(HWND hDlg, HWND hWndFocus, LPARAM lParam)
/************************************************************************/
{
InitExtName( hDlg, IDC_EXTNAMES, IDC_FILENAME, Texture.TextureName,
	IDN_TEXTURE );
CheckDlgButton( hDlg, IDC_TEXTUREFLIPX, Texture.fHorzFlip);
CheckDlgButton( hDlg, IDC_TEXTUREFLIPY, Texture.fVertFlip);
InitDlgItemSpin( hDlg, IDC_TRANSPARENT, TOPERCENT(255-Texture.TextureOpacity),
	NO, 0, 99 );
lstrcpy( Names.Saved, Texture.TextureName );
TextureFill_HandleEnable(hDlg, 0);
return(FALSE);
}
Exemplo n.º 11
0
LOCAL BOOL Convert_OnInitDialog(HWND hDlg, HWND hWndFocus, LPARAM lParam)
/************************************************************************/
{
ITEMID id;

CenterPopup( hDlg );
CheckComboItem( hDlg, IDC_MINITYPES, IDC_MINI256, IDC_MINICUSTOM,
	Convert.MiniType );
if (Convert.MiniType == IDC_MINI256)
	Convert.ConvertColors = 256;
else
if (Convert.MiniType == IDC_MINI16)
	Convert.ConvertColors = 16;
else
if (Convert.MiniType == IDC_MINI8)
	Convert.ConvertColors = 8;

InitDlgItemSpin( hDlg, IDC_PALETTECOLORS, Convert.ConvertColors, FALSE,
                 1, 256 );

if ( Convert.ConvertDitherType == DT_PATTERN )
	id = IDC_DITHERPATTERN;
else
if ( Convert.ConvertDitherType == DT_SCATTER )
	id = IDC_DITHERSCATTERED;
else
	id = IDC_DITHERNONE;
CheckComboItem( hDlg, IDC_DITHERTYPES, IDC_DITHERNONE,
	IDC_DITHERSCATTERED, id );
if ( Convert.ConvertType == CT_OPTIMIZED)
	id = IDC_PALETTEOPTIMIZED;
else
if ( Convert.ConvertType == CT_STANDARD)
	id = IDC_PALETTESTANDARD;
else
	id = IDC_PALETTECUSTOM;
CheckComboItem( hDlg, IDC_PALETTETYPES, IDC_PALETTEOPTIMIZED,
	IDC_PALETTECUSTOM, id );
InitExtName( hDlg, IDC_EXTNAMES, IDC_FILENAME, Convert.ConvertPalette, IDN_PALETTE );

Convert_Enable(hDlg);

return(TRUE);
}
Exemplo n.º 12
0
//************************************************************************
//		set_quarter_channel
// DESCRIPTION:
//		Makes the given channel the current channel.
//		Updates the display.
//************************************************************************
VOID CToneBalanceDlg::set_quarter_channel(WORD wChannel)
//************************************************************************
{
	LPDWORD lpHisto;
	HWND hControl;
	BOOL bInv;
	LONG lMaxEntry;
	int icons[3];
	HWND hDlg = GetSafeHwnd();
	
	
	m_lpData->lpMap = tone_activate_channel( wChannel );
	lpHisto = get_histo(m_lpData->lpHistos, wChannel, &bInv);
	
	// setup the histo control
	lMaxEntry = compute_yscale(lpHisto);
	hControl = ::GetDlgItem(hDlg, IDC_HISTOGRAM);
	Histo_Init(hControl, lpHisto, lMaxEntry, 3, bInv ? HTS_FLIPX:0);
	m_lpData->iShadow = m_lpData->lpMap->Pnt[0].x;
	m_lpData->iMidtone = m_lpData->lpMap->Pnt[1].x;
	m_lpData->iHighlight = m_lpData->lpMap->Pnt[2].x;
	if (!(m_lpData->iHighlight - m_lpData->iShadow))
		m_lpData->MidtonePer = 0;
	else
		m_lpData->MidtonePer = (m_lpData->iMidtone - m_lpData->iShadow)*255/
								(m_lpData->iHighlight - m_lpData->iShadow);
	Histo_SetMark(hControl, 0, m_lpData->lpMap->Pnt[0].x, NO);
	Histo_SetMark(hControl, 1, m_lpData->lpMap->Pnt[1].x, NO);
	Histo_SetMark(hControl, 2, m_lpData->lpMap->Pnt[2].x, NO);
	
	// some people seem to have an update problem here
    ::InvalidateRect (hControl,NULL,FALSE);

	// setup tags
	hControl = ::GetDlgItem(hDlg, IDC_TAGS);
	
	icons[0] = IDC_QUART1;
	icons[1] = IDC_QUART2;
	icons[2] = IDC_QUART3;
	Tag_Init(hControl, 3, 255, &icons[0]);
	
	Tag_SetMark(hControl, 0, m_lpData->lpMap->Pnt[0].x, NO);
	Tag_SetMark(hControl, 1, m_lpData->lpMap->Pnt[1].x, NO);
	Tag_SetMark(hControl, 2, m_lpData->lpMap->Pnt[2].x, NO);
	
	// some people seem to have an update problem here
    ::InvalidateRect (hControl,NULL,FALSE);
	
	set_gradient(IDC_HISTO_GRAD, wChannel);

	// spins
	InitDlgItemSpin(hDlg, IDC_QUART1_VALUE, TO_DISPLAY(m_lpData->lpMap->Pnt[0].x), NO, 0, MAX_SPIN);
	InitDlgItemSpin(hDlg, IDC_QUART3_VALUE, TO_DISPLAY(m_lpData->lpMap->Pnt[2].x), NO, 0, MAX_SPIN);

	if (m_bUseMidPer)
		InitDlgItemSpin(hDlg, IDC_QUART2_VALUE, m_lpData->MidtonePer*100L/255, NO, 0, MAX_SPIN );
	else
 		InitDlgItemSpin(hDlg, IDC_QUART2_VALUE, TO_DISPLAY(m_lpData->lpMap->Pnt[1].x), NO, 0, MAX_SPIN );

	InitDlgItemSpin(hDlg, IDC_MINHIGHLIGHT, TO_DISPLAY(m_lpData->lpMap->Pnt[2].y), NO, 0, MAX_SPIN);
	InitDlgItemSpin(hDlg, IDC_MAXSHADOW, TO_DISPLAY(m_lpData->lpMap->Pnt[0].y), NO, 0, MAX_SPIN);
}
Exemplo n.º 13
0
//************************************************************************
//		change_mark
// PARAMETERS:
//					int nMark- which mark (0 for highlights etc)
//					int val- New value.
//					int inval- the 'readout' value of the given mark (INT_MAX for none)
//							Currently used only for midtone
// DESCRIPTION:
//				Sets the mark, updates other marks to keep them valid.
//				Sets and redraws all appropriate controls.
//				Updates the map.
//************************************************************************
void CToneBalanceDlg::change_mark(LPQUARTERSTRUCT lpData, int nMark, int val, int inval)
//************************************************************************
{
	HWND hHisto, hTag;
	int i;
	BOOL Bool;
	int Marks[3];
	HWND hDlg = GetSafeHwnd();
	
	// set value and adjust others
	Marks[0] = lpData->iShadow;
	Marks[2] = lpData->iHighlight;
	if (m_bUseMidPer)
		Marks[1] = Marks[0] + (LONG)lpData->MidtonePer*(Marks[2]-Marks[0])/255;
	else
		Marks[1] = lpData->iMidtone;
	if (nMark == 0)
	{
		Marks[0] = lpData->iShadow = val;
		if (Marks[2] < Marks[0])
			Marks[2] = Marks[0];
		if (m_bUseMidPer)
			Marks[1] = Marks[0] + (LONG)lpData->MidtonePer*(Marks[2]-Marks[0])/255;
		else if (Marks[1] < Marks[0])
			Marks[1] = Marks[0];
	}
	else if (nMark == 2)
	{
		Marks[2] = lpData->iHighlight = val;
		if (Marks[0] > Marks[2])
			Marks[0] = Marks[2];
		if (m_bUseMidPer)
			Marks[1] = Marks[0] + (LONG)lpData->MidtonePer*(Marks[2]-Marks[0])/255;
		else if (Marks[1] > Marks[2])
			Marks[1] = Marks[2];
	}
	else if (nMark == 1)
	{
		Marks[1] = lpData->iMidtone = Bound(val, Marks[0], Marks[2]);
		if (Marks[2]-Marks[0])
			lpData->MidtonePer = (lpData->iMidtone - Marks[0])*255L/(Marks[2]-Marks[0]);
	}
	else
		return;
	
	// update anything that needs it
	// spins
	i = GetDlgItemSpin(hDlg, IDC_QUART1_VALUE, &Bool, NO);
	i = FROM_DISPLAY(i);
	if (!Bool || i != Marks[0])
		InitDlgItemSpin(hDlg, IDC_QUART1_VALUE, TO_DISPLAY(Marks[0]), NO, 0, MAX_SPIN );
	if (inval != INT_MAX  && nMark==1)
	{
	}
	else
	{
		// update percent
		if (m_bUseMidPer)
		{
			i = GetDlgItemSpin(hDlg, IDC_QUART2_VALUE, &Bool, NO);
			if (!Bool || (i*255L/100) != lpData->MidtonePer)
				InitDlgItemSpin(hDlg, IDC_QUART2_VALUE, lpData->MidtonePer*100L/255, NO, 0, MAX_SPIN );
		}
		else
		{
			i = GetDlgItemSpin(hDlg, IDC_QUART2_VALUE, &Bool, NO);
			i = FROM_DISPLAY(i);
			if (!Bool || i != Marks[1])
				InitDlgItemSpin(hDlg, IDC_QUART2_VALUE, TO_DISPLAY(Marks[1]), NO, 0, MAX_SPIN );
		}
	}

	i = GetDlgItemSpin(hDlg, IDC_QUART3_VALUE, &Bool, NO);
	i = FROM_DISPLAY(i);
	if (!Bool || i != Marks[2])
		InitDlgItemSpin(hDlg, IDC_QUART3_VALUE, TO_DISPLAY(Marks[2]), NO, 0, MAX_SPIN );
	
	// histogram
	hHisto = ::GetDlgItem(hDlg, IDC_HISTOGRAM);
	hTag = ::GetDlgItem(hDlg, IDC_TAGS);
	for (i=0;i<3;i++)
	{
		if (Marks[i] != Histo_GetMark(hHisto,i))
			Histo_SetMark(hHisto,i, Marks[i], NO);
		if (Marks[i] != Tag_GetMark(hTag,i))
			Tag_SetMark(hTag,i, Marks[i], NO);
	}
	
	lpData->lpMap->Pnt[0].x = Marks[0];
	lpData->lpMap->Pnt[1].x = Marks[1];
	lpData->lpMap->Pnt[2].x = Marks[2];
}