コード例 #1
0
ファイル: optsedit.cpp プロジェクト: vata/xarino
BOOL EditTab::HandleMsg(DialogMsg* Msg)
{
TRACEUSER( "Neville", _T("HandleEditMsg\n"));
	ERROR2IF(Msg == NULL,FALSE,"EditTab::Message null message received");
	ERROR2IF(pPrefsDlg == NULL,FALSE,"EditTab::HandleMsg called with no dialog pointer");

	BOOL ok = pPrefsDlg->TalkToPage(_R(IDD_OPTSTAB_EDIT));	// The edit page identifier
	if (!ok)
		return TRUE;		// no page present = handled message
	
	switch(Msg->DlgMsg)
	{
		case DIM_CREATE:	// Initialise controls
			GreyStatus = FALSE;	// we are ungreyed by default
			ok = InitSection();
			if (!ok)
				InformError();
			break;
		case DIM_SELECTION_CHANGED:
		case DIM_LFT_BN_CLICKED:
		case DIM_TEXT_CHANGED:
			OptionsTabs::SetApplyNowState(TRUE);
			break;
		default:
			break;
	}
	return TRUE;
}  
コード例 #2
0
ファイル: PackageReaderImpl.cpp プロジェクト: RAZVOR/haiku
status_t
PackageReaderImpl::Init(int fd, bool keepFD, uint32 flags)
{
	hpkg_header header;
	status_t error = inherited::Init<hpkg_header, B_HPKG_MAGIC, B_HPKG_VERSION,
		B_HPKG_MINOR_VERSION>(fd, keepFD, header, flags);
	if (error != B_OK)
		return error;
	fHeapSize = UncompressedHeapSize();

	// init package attributes section
	error = InitSection(fPackageAttributesSection, fHeapSize,
		B_BENDIAN_TO_HOST_INT32(header.attributes_length),
		kMaxPackageAttributesSize,
		B_BENDIAN_TO_HOST_INT32(header.attributes_strings_length),
		B_BENDIAN_TO_HOST_INT32(header.attributes_strings_count));
	if (error != B_OK)
		return error;

	// init TOC section
	error = InitSection(fTOCSection, fPackageAttributesSection.offset,
		B_BENDIAN_TO_HOST_INT64(header.toc_length), kMaxTOCSize,
		B_BENDIAN_TO_HOST_INT64(header.toc_strings_length),
		B_BENDIAN_TO_HOST_INT64(header.toc_strings_count));
	if (error != B_OK)
		return error;

	// prepare the sections for use
	error = PrepareSection(fTOCSection);
	if (error != B_OK)
		return error;

	error = PrepareSection(fPackageAttributesSection);
	if (error != B_OK)
		return error;

	return B_OK;
}
コード例 #3
0
ファイル: optsedit.cpp プロジェクト: vata/xarino
BOOL EditTab::UpdateSection(String_256 *DocumentName)
{
TRACEUSER( "Neville", _T("EditTab::UpdateSection\n"));
	ERROR2IF(pPrefsDlg == NULL,FALSE,"EditTab::UpdateSection called with no dialog pointer");

	BOOL ok = pPrefsDlg->TalkToPage(_R(IDD_OPTSTAB_EDIT));	// The EditTab identifier
	if (!ok)
		return TRUE;		// page not present

	// Remove any lists that we have created.
	pPrefsDlg->DeleteAllValues(_R(IDC_OPTS_ANGLECONST));

	// Call the normal init section code
	return InitSection();
}
コード例 #4
0
ファイル: optsscal.cpp プロジェクト: Amadiro/xara-cairo
BOOL ScaleTab::HandleMsg(DialogMsg* Msg)
{
TRACEUSER( "Neville", _T("HandleScaleMsg\n"));
	ERROR2IF(Msg == NULL,FALSE,"ScaleTab::Message null message received");
	ERROR2IF(pPrefsDlg == NULL,FALSE,"ScaleTab::HandleMsg called with no dialog pointer");

	BOOL ok = pPrefsDlg->TalkToPage(_R(IDD_OPTSTAB_SCALE));	// The Scale tab identifier
	if (!ok)
		return TRUE;		// page not present

	switch(Msg->DlgMsg)
	{
		case DIM_CREATE:	// Initialise controls
			GreyStatus = FALSE;	// we are ungreyed by default
			ok = InitSection();
			if (!ok)
				InformError();
			break;
		case DIM_LFT_BN_CLICKED:
			OptionsTabs::SetApplyNowState(TRUE);
			if (Msg->GadgetID == _R(IDC_OPTS_USESCALEFACTOR))
			{
				BOOL Valid;
				BOOL Active = pPrefsDlg->GetLongGadgetValue(_R(IDC_OPTS_USESCALEFACTOR),0,1,0,&Valid);
				// Grey/ungrey the editable fields accordingly 
				pPrefsDlg->EnableGadget(_R(IDC_OPTS_DRAWINGSCALE), Active);
				pPrefsDlg->EnableGadget(_R(IDC_OPTS_REALSCALE), Active);
				// Grey/ungrey the static text fields accordingly 
				pPrefsDlg->EnableGadget(_R(IDC_OPTS_SCALEEG), Active);
				pPrefsDlg->EnableGadget(_R(IDC_OPTS_REALWORLD), Active);
				pPrefsDlg->EnableGadget(_R(IDC_OPTS_DRAWING), Active);
				pPrefsDlg->EnableGadget(_R(IDC_OPTS_SCALETO), Active);
				pPrefsDlg->EnableGadget(_R(IDC_OPTS_SCALETO2), Active);
				pPrefsDlg->EnableGadget(_R(IDC_OPTS_SCALEGROUP), Active);
			}
			break; 
		case DIM_SELECTION_CHANGED:
		case DIM_TEXT_CHANGED:
			OptionsTabs::SetApplyNowState(TRUE);
			break;
		default:
			break;
	}

	return TRUE;
}  
コード例 #5
0
ファイル: prpslyrs.cpp プロジェクト: vata/xarino
BOOL LayerPropertiesTab::HandleMsg(DialogMsg* Msg)
{
TRACEUSER( "Neville", _T("LayerPropertiesTab::HandleMsg\n"));
	ERROR2IF(Msg == NULL,FALSE,"LayerPropertiesTab::Message null message received");
	ERROR2IF(pPropertiesDlg == NULL,FALSE,"LayerPropertiesTab::HandleMsg called with no dialog pointer");

	BOOL ok = pPropertiesDlg->TalkToPage(GetPageID());
	if (!ok)
		return TRUE;		// no page present = handled message
	
	switch(Msg->DlgMsg)
	{
		case DIM_CREATE:	// Initialise controls
			GreyStatus = FALSE;	// we are ungreyed by default
			ok = InitSection();
			if (!ok)
				InformError();
			break;
		case DIM_LFT_BN_CLICKED:
		{
			UpdateApplyState();
			//switch (Msg->GadgetID)
			//{
			//}
		}
		break;

		case DIM_SELECTION_CHANGED:
		case DIM_TEXT_CHANGED:
			UpdateApplyState();
			break;

		default:
			break;
	}
	return TRUE;
}  
コード例 #6
0
ファイル: prpsgds.cpp プロジェクト: Amadiro/xara-cairo
BOOL GuidesPropertiesTab::HandleMsg(DialogMsg* Msg)
{
TRACEUSER( "Neville", _T("GuidesPropertiesTab::HandleMsg\n"));
	ERROR2IF(Msg == NULL,FALSE,"GuidesPropertiesTab::Message null message received");
	ERROR2IF(pPropertiesDlg == NULL,FALSE,"GuidesPropertiesTab::HandleMsg called with no dialog pointer");

	BOOL ok = pPropertiesDlg->TalkToPage(GetPageID());
	if (!ok)
		return TRUE;		// no page present = handled message
	
	switch(Msg->DlgMsg)
	{
		case DIM_CREATE:	// Initialise controls
			GreyStatus = FALSE;	// we are ungreyed by default
			ok = InitSection();
			if (!ok)
				InformError();
			break;
		case DIM_LFT_BN_CLICKED:
			//LayerPropertyTabs::SetApplyNowState(TRUE);
			if (FALSE) {}
			else if (Msg->GadgetID == _R(IDC_GUIDETAB_HORZ))
			{
				if (GuideType != GUIDELINE_HORZ)
				{
					GuideType = GUIDELINE_HORZ;
					ShowDetails();
				}
			}
			else if (Msg->GadgetID == _R(IDC_GUIDETAB_VERT))
			{
				if (GuideType != GUIDELINE_VERT)
				{
					GuideType = GUIDELINE_VERT;
					ShowDetails();
				}
			}
			else if (Msg->GadgetID == _R(IDC_GUIDETAB_PROPERTIES))
			{
				PropertiesClicked();
				ShowDetails();
			}
			else if (Msg->GadgetID == _R(IDC_GUIDETAB_NEW))
			{
				NewClicked();
				ShowDetails();
			}
			else if (Msg->GadgetID == _R(IDC_GUIDETAB_DELETE))
			{	
				DeleteClicked();
				ShowDetails();
			}
			break;

		case DIM_SELECTION_CHANGED:
		case DIM_TEXT_CHANGED:
			//LayerPropertyTabs::SetApplyNowState(TRUE);
			if (FALSE) {}
			else if (Msg->GadgetID == _R(IDC_GUIDETAB_GUIDELINELIST))
			{
				ChangeControlStatus(!GreyStatus);
			}
			else if (Msg->GadgetID == _R(IDC_GUIDETAB_COLOURLIST))
			{
				ColourChanged(pPropertiesDlg->GetSelectedValueIndex(Msg->GadgetID));
				ShowDetails();
			}
			break;
		default:
			break;
	}
	return TRUE;
}  
コード例 #7
0
ファイル: optsplug.cpp プロジェクト: vata/xarino
BOOL PlugInsTab::HandleMsg(DialogMsg* Msg)
{
	ERROR2IF(Msg == NULL,FALSE,"PlugInsTab::Message null message received");
	ERROR2IF(pPrefsDlg == NULL,FALSE,"PlugInsTab::HandleMsg called with no dialog pointer");

	BOOL ok = pPrefsDlg->TalkToPage(_R(IDD_OPTSTAB_PLUGINS));	// The edit page identifier
	if (!ok)
		return TRUE;		// page not present
	
	switch(Msg->DlgMsg)
	{
		case DIM_CREATE:	// Initialise controls
//			GreyStatus = FALSE;	// we are ungreyed by default
			ok = InitSection();
			if (!ok)
				InformError();
			break;

	    case DIM_LFT_BN_CLICKED:
			OptionsTabs::SetApplyNowState(TRUE);
//			ERROR2IF(m_pManager == NULL,FALSE,"PlugInsTab::HandleMsg called with no plug-ins manager pointer");
			switch (Msg->GadgetID)
			{
			case _R(IDC_OPTS_BUTTON_PLUGINS_SETUP):
				BOOL bOK = XPEEditOp::EditPluginSettings();
				break;
/*				case _R(IDC_OPTS_NEWPATH):
					// Create the user a new path
					CreateNewPath();
					break;

				case _R(IDC_OPTS_BUYPLUGS):
					// The user wishes to be relieved of money by buying plug-ins
					BuyPluginsAction();
					break;

				case _R(IDC_OPTS_DELETEPATH):
					// Delete the currently selected path
					DeletePath();
					break;
				case _R(IDC_OPTS_PARSEATSTART):
				{
					BOOL Valid = FALSE;
					BOOL ParseAtStartUp = pPrefsDlg->GetLongGadgetValue(_R(IDC_OPTS_PARSEATSTART), 0, 1, 0, &Valid);
					if (Valid)
						m_pManager->SetParseAtStartUp(ParseAtStartUp);
					break;
				}
*/
			}
			break; // DIM_LFT_BN_CLICKED

		case DIM_SELECTION_CHANGED:
		{
			OptionsTabs::SetApplyNowState(TRUE);
	
/*			switch (Msg->GadgetID)
			{
				case _R(IDC_OPTS_PLUGINSLIST):
				{
					// Clicked on the list of plug-in paths
					// If its valid then ungrey the delete button
					WORD Index = 0;
					pPrefsDlg->GetValueIndex(_R(IDC_OPTS_PLUGINSLIST), &Index); 
					BOOL Valid = FALSE;
					BOOL ok = FALSE;
					String_256 Path = pPrefsDlg->GetStringGadgetValue(_R(IDC_OPTS_PLUGINSLIST), &Valid, Index);
					if (Valid && !Path.IsEmpty())
					{
						pPrefsDlg->EnableGadget(_R(IDC_OPTS_DELETEPATH), TRUE);
					}
					break;
				}
			}
*/
			break; // DIM_SELECTION_CHANGED
		}
	}

	return TRUE;
}