예제 #1
0
BOOL DoMru(HWND hWnd,WORD wId)
{
	char szFileName[128];
	OFSTRUCT of;
	BOOL fExist;

	GetMenuItem(g_qeglobals.d_lpMruMenu, wId, TRUE, szFileName, sizeof(szFileName));

	// Test if the file exists.

	fExist = OpenFile(szFileName ,&of,OF_EXIST) != HFILE_ERROR;

	if (fExist) {

		// Place the file on the top of MRU.
		AddNewItem(g_qeglobals.d_lpMruMenu,(LPSTR)szFileName);

		// Now perform opening this file !!!
		Map_LoadFile (szFileName);	
	}
	else
		// Remove the file on MRU.
		DelMenuItem(g_qeglobals.d_lpMruMenu,wId,TRUE);

	// Refresh the File menu.
	PlaceMenuMRUItem(g_qeglobals.d_lpMruMenu,GetSubMenu(GetMenu(hWnd),0),
			ID_FILE_EXIT);

	return fExist;
}
예제 #2
0
void 	RchooseDialog::setDialogState(void)
{
int i,m;
MenuHandle menuH;
short menucount;
	short		item;	
	short		iType;
	Handle		iHandle;
	Rect 		iRect;	
	
	
switch (_which) {
	case DT_TiffFile:
		if (DataFile < 0) _which = 1;
		break;
	case DT_DTP51:
		if (DTP51 < 0) _which = 1;
		break;
	case DT_XriteDTP41:
		if (DTP41 < 0) _which = 1;
		break;
	case DT_TechkonCP300:
		if (TechkonCP300 < 0) _which = 1;
		break;
	case DT_TechkonSP820:
		if (TechkonSP820 < 0) _which = 1;
		break;
	case DT_TechkonTCRCP300:
		if (TechkonTCRCP300 < 0) _which = 1;
		break;
	case DT_TechkonTCRSP820:
		if (TechkonTCRSP820 < 0) _which = 1;
		break;
	case DT_GretagHand:
		if (GretagHand < 0) _which = 1;
		break;
	case DT_GretagTable:
		if (GretagTable < 0) _which = 1;
		break;
	case DT_Xrite408:
		if (XR408 < 0) _which = 1;
		break;
	}	
	

switch (_which) {
	case (DT_DataFile):
		Disable(dialogptr,PatchFormat);
		Disable(dialogptr,DevicePort);
		menuH = GetMenu(Table_menu);
		menucount = CountMItems(menuH);

		for( i = menucount; i > 0; i-- )
			DelMenuItem(menuH,i);
			
		_which_patch = 1;
		GetDItem (dialogptr, PatchFormat, &iType, &iHandle, &iRect);
		SetCtlValue((ControlHandle)iHandle,_which_patch);
		DrawControls(dialogptr);
		break;
	case (DT_DTP51):
		Enable(dialogptr,PatchFormat);
		Enable(dialogptr,DevicePort);
		menuH = GetMenu(Table_menu);
		menucount = CountMItems(menuH);

		for( i = menucount; i > 0; i-- )
			DelMenuItem(menuH,i);
		
		m = 1;
		for (i=0; i<doc->patchset->filenum; i++)
			{
			if (doc->patchset->patches[i] != NULL)
				{
				if ( doc->patchset->patches[i]->patches.strips == 1) 
					{
					convert[m] = i;
					convert2[i] = m;
					InsMenuItem(menuH, doc->patchset->patchames[i], m++);
					}
				}
			}
			
		//_which_patch = 1;
		GetDItem (dialogptr, PatchFormat, &iType, &iHandle, &iRect);
		SetCtlValue((ControlHandle)iHandle,convert2[_which_patch]);
		GetDItem (dialogptr, DevicePort, &iType, &iHandle, &iRect);
		SetCtlValue((ControlHandle)iHandle,_which_port);
		DrawControls(dialogptr);
		break;
	case (DT_TiffFile):
		Enable(dialogptr,PatchFormat);
		Disable(dialogptr,DevicePort);
		
		menuH = GetMenu(Table_menu);
		menucount = CountMItems(menuH);

		for( i = menucount; i > 0; i-- )
			DelMenuItem(menuH,i);
		
		m = 1;
		for (i=0; i<doc->patchset->filenum; i++)
			{
			if (doc->patchset->patches[i] != NULL)
				{
				if (doc->patchset->patches[i]->patches.strips == 0) 
					{
					convert[m] = i;
					convert2[i] = m;
					InsMenuItem(menuH, doc->patchset->patchames[i], m++);
					}
				}
			}
		//_which_patch = 1;
		GetDItem (dialogptr, PatchFormat, &iType, &iHandle, &iRect);
		SetCtlValue((ControlHandle)iHandle,convert2[_which_patch]);
		GetDItem (dialogptr, DevicePort, &iType, &iHandle, &iRect);
		SetCtlValue((ControlHandle)iHandle,_which_port);
		DrawControls(dialogptr);
		break;
	case (DT_TechkonCP300):
	case (DT_TechkonSP820):
	case (DT_TechkonTCRCP300):
	case (DT_TechkonTCRSP820):
	case (DT_GretagHand):
	case (DT_GretagTable):
		Enable(dialogptr,PatchFormat);
		Enable(dialogptr,DevicePort);
		
		menuH = GetMenu(Table_menu);
		menucount = CountMItems(menuH);

		for( i = menucount; i > 0; i-- )
			DelMenuItem(menuH,i);
		
		m = 1;
		for (i=0; i<doc->patchset->filenum; i++)
			{
			if (doc->patchset->patches[i] != NULL)
				{
				if (doc->patchset->patches[i]->patches.strips == 0) 
					{
					convert[m] = i;
					convert2[i] = m;
					InsMenuItem(menuH, doc->patchset->patchames[i], m++);
					}
				}
			}
		//_which_patch = 1;
		GetDItem (dialogptr, PatchFormat, &iType, &iHandle, &iRect);
		SetCtlValue((ControlHandle)iHandle,convert2[_which_patch]);
		GetDItem (dialogptr, DevicePort, &iType, &iHandle, &iRect);
		SetCtlValue((ControlHandle)iHandle,_which_port);
		DrawControls(dialogptr);
		break;
	case (DT_Xrite408):
		Disable(dialogptr,PatchFormat);
		break;
	}
	
if ((!density) && (_which == DT_Xrite408)) Disable(dialogptr,1);
else Enable(dialogptr,1);	

}