Exemplo n.º 1
0
String_256 WebAddressDlg::GetFrame()  
{	
	//Get the string from the combo box
	String_256 strCombo=GetStringGadgetValue(_R(IDC_WEBADDRESS_FRAME));

	//Check the string to see if it's one we want to stop
	if (strCombo==String_256(_R(IDS_WEBADDRESS_COMBO_SELF)))
		return String_256(_R(IDS_WEBADDRESS_SHORT_SELF));

	if (strCombo==String_256(_R(IDS_WEBADDRESS_COMBO_PARENT)))
		return String_256(_R(IDS_WEBADDRESS_SHORT_PARENT));

	if (strCombo==String_256(_R(IDS_WEBADDRESS_COMBO_TOP)))
		return String_256(_R(IDS_WEBADDRESS_SHORT_TOP));

	if (strCombo==String_256(_R(IDS_WEBADDRESS_COMBO_BLANK)))
		return String_256(_R(IDS_WEBADDRESS_SHORT_BLANK));
	
	if (strCombo==String_256(_R(IDS_WEBADDRESS_COMBO_DEFAULT)))
		return String_256(_R(IDS_WEBADDRESS_SHORT_DEFAULT));

	//Otherwise, simply return the string
	return strCombo;

}
Exemplo n.º 2
0
/********************************************************************************************

  >	String_256 HTMLExportFilter::GetCloseTagString(UINT32 uiResource)

	Author:		Graham_Walmsley (Xara Group Ltd) <*****@*****.**>
	Created:	9/4/97
	Inputs:		uiResource		The resource to convert to a tag
				
	Returns:	The resource string enclosed in < and >.
	Purpose:	Gets the specified UI resource enclosed by < and >.

********************************************************************************************/
String_256 HTMLExportFilter::GetCloseTagString(UINT32 uiResource)
{
	String_256 strStart(_R(IDS_HTMLEXPORT_CLOSETAGSTART));
	strStart+=String_256(uiResource);
	strStart+=String_256(_R(IDS_HTMLEXPORT_TAGEND));

	return strStart;
}
Exemplo n.º 3
0
void WebAddressDlg::SetDialogChangedState()
{	
	
	//If the dialog is still in its initial state...
	if (fDialogIsInInitialState)
	{
		//Then we need to change some things

		//First, let's find the state of the Web Address attributes applied to the 
		//selection
		WebCommonAttributeResult aasApplied=FindCommonWebAttribute();

		//If anything at all is selected
		if (aasApplied!=WCA_NOSELECTION)
		{
			//Then we need to ungrey the Add/Change button
			EnableAdd(TRUE);

			//We also need to clear any intermediate values from the dialog

			//If the URL field says <MANY>, clear that field
			if (GetURL()==String_256(_R(IDS_WEBADDRESSDLG_MANY)))
				ShowURL();

			//If the Frame field says <MANY>, put "self" into that field
			if (GetFrame()==String_256(_R(IDS_WEBADDRESSDLG_MANY)))
				ShowFrame(String_256(_R(IDS_WEBADDRESS_COMBO_SELF)));

			//If the clickable area is indeterminate, show the
			//recommended value for the selection in the radio buttons
			if (GetClickableArea()==2)
				ShowClickableArea(SelectionConsistsOfText());
		}



		//If there is no Web Address on the selection, tell the user
		//so
		if (aasApplied==WCA_DEFAULT)
			ShowWebAddressOnSelection(FALSE);
												
		//If there is any sort of Web Address on the selection, tell the
		//user
		if (aasApplied==WCA_SINGLE || aasApplied==WCA_MANY)
			ShowWebAddressOnSelection(TRUE);
		
	}

	//The dialog is no longer in its initial state
	fDialogIsInInitialState=FALSE;
}
Exemplo n.º 4
0
PathName WebAddress::GetPathName() const
{	
	//We needn't actually do anything to remove the Scheme - we just don't
	//use it

	//First concatenate the net location and the path
	String_256 strToReturn=NetLoc;
	strToReturn+=Path;
	
	//So, does that string start with "//"?
	if (strToReturn.Sub(String_256("//"))==0)
	{
		//Yes. So remove it
		strToReturn.Split(NULL, &strToReturn, 1, TRUE);
	}

	//Convert all forward slashes to backslashes
	strToReturn.SwapChar('/', '\\');

	//Convert all | characters to colons
	strToReturn.SwapChar('|', ':');

	//Put our string into a PathName object
	PathName pthToReturn(strToReturn);

	//And return it
	return pthToReturn;

}
Exemplo n.º 5
0
/********************************************************************************************

>	static OpState OpRemoveClipView::GetState(String_256* pstrDescription, OpDescriptor* pOpDesc)

	Author:		Karim_MacDonald (Xara Group Ltd) <*****@*****.**>
	Created:	01 February 2000
	Inputs:		pstrDescription
				pOpDesc
	Outputs:	
	Returns:	
	Purpose:	
	Errors:		
	See also:	

********************************************************************************************/
OpState OpRemoveClipView::GetState(String_256* pstrDescription, OpDescriptor* pOpDesc)
{
	// default is an unticked, ungreyed, *NOT* on-menu state.
	OpState OpSt;
	OpSt.RemoveFromMenu = TRUE;

	// obtain the app's current selection.
	// we want to treat bevels/contours etc. as atomic objects.
	Range Sel(*(GetApplication()->FindSelection()));
	RangeControl rc = Sel.GetRangeControlFlags();
	rc.PromoteToParent = TRUE;
	Sel.Range::SetRangeControl(rc);

	// we only show ourself if the selection consists of one lone NodeClipViewController.
	Node* pNode = Sel.FindFirst();
	if (pNode != NULL && pNode->IsANodeClipViewController())
	{
		if (Sel.FindNext(pNode) == NULL)
		{
			OpSt.RemoveFromMenu = FALSE;

			// if it's selected inside, we gray ourself and give a reason.
			if (Sel.ContainsSelectInside())
			{
				OpSt.Greyed = TRUE;
				*pstrDescription = String_256(_R(IDS_GREY_WHEN_SELECT_INSIDE));
			}
		}
	}

	return OpSt;
}
Exemplo n.º 6
0
BOOL PlugInOpDescriptor::GetText(String_256* Description, OpTextFlags WhichText)
{
	String_256 ResourceText = m_MenuText; // ( TextID, ModuleID );
	// This string should contain various elements for each part of the apply, undo, redo text
	// each separated by a semi colon. So we will fake this up in the string using the
	// text that we will have set, which is the plug-in name on the menu, for the apply name. 
	ResourceText += ";";			// DO NOT internationlise this!
	ResourceText += m_MenuText;		// add undo text
	ResourceText += ";";			// DO NOT internationlise this!
	ResourceText += m_MenuText;		// add redo text

	TCHAR* ok = NULL;

	// The rest is the same as the main OpDescriptor...

	// Explicitly cast return value from GetDescription from a TCHAR* to a String_256
	ok = GetDescription((TCHAR*) ResourceText, WhichText);
	
	// if description is found then return true else return false
	if (ok)        
	{
		*Description = String_256(ok);
		return TRUE;
	}
	else
		return FALSE;
} 
Exemplo n.º 7
0
LiveEffectsTool::LiveEffectsTool()
{
	// No info bar or previous path by default
	m_pInfoBarOp = NULL;

	// Set the cursor pointers to null
	pNormalCursor = NULL;
	pActiveCursor = NULL;

	// Make sure that the status line text is a valid string
	StatusMsg = String_256("");

	m_pPPStack = NULL;
	m_strCurrentEffectID = String_256("");
	m_iCurrentStackPos = 0;
}
Exemplo n.º 8
0
OpState OpShowGuides::GetState(String_256* pUIDescription, OpDescriptor*)
{
	OpState OpSt;

	DocView *pDocView = DocView::GetSelected();
	if (pDocView != NULL)
		OpSt.Ticked = pDocView->GetShowGuidesState();

	Spread* pSpread = Document::GetSelectedSpread();
	if (pSpread != NULL)
	{
		// if we have a guide layer, then make the menu item available, if not, grey it 
		//	and give a reason.
		if (pSpread->FindFirstGuideLayer() != NULL)
		{
			OpSt.Greyed = FALSE;
		}
		else
		{
			OpSt.Greyed = TRUE;
			*pUIDescription = String_256 (_R(IDS_NO_GUIDES));
		}

	}	// if (pSpread != NULL)

	return OpSt;
}
Exemplo n.º 9
0
void CDECL Error::XSetErrorC()
{
	TCHAR				buf[256];
	// the error we set features a coded version of where the problem was
	CalcInternalMessage( buf, LastErrorLine, String_256( LastErrorFile ) );
	SetErrorSerious( buf );
	ResetWhere();
	return;
}
Exemplo n.º 10
0
static BOOL RunOilHelp(LPCTSTR lpcszHelpPath, UINT32 nCommand, DWORD dwData)
{
#if !defined(EXCLUDE_FROM_XARALX)
	// Firing up the help engine can take a while, so show an hour-glass cursor.
	HCURSOR hOldCursor;
	HCURSOR hBusyCursor = ::LoadCursor(NULL, _R(IDC_WAIT));
	if (hBusyCursor != NULL) hOldCursor = ::SetCursor(hBusyCursor);

	// We always pass the handle of the main-frame window as the "owning" window.
	HWND hwndInvoker = GetMainFrame()->GetSafeHwnd();
#endif

	// If we are running on a pure 32-bit platform such as Windows NT then we must fake
	// the WinHelp() function, as we want the 16-bit engine to be run, not WINHLP32.EXE.
	// The current help-file build includes references to 16-bit DLLs that seem to be
	// almost too much for the 32-bit engine.  We don't have to do this if we aren't
	// running the engine to browse a file, but simply issuing a command, such as
	// HELP_HELPONHELP.
	BOOL fOk;
	
		// Running under Chicago or Win32s, or the helpfile parameter is NULL, so run the
		// "normal" engine.  Here we should really "thunk" (translate) the 32-bit HWND
		// to a 16-bit HWND, I think?
//		TRACEUSER( "JustinF", _T("Help being invoked normally\n"));


		fOk = TRUE;
		if(nCommand != HELP_QUIT)
		{
			wxString strHelpFileName(lpcszHelpPath);
			wxString Context = _T("");
			if (dwData)
			{
				Context = PCTSTR(String_256( dwData ));
				if (_T("") != Context)
					// so that the string table contains a bit less, the ::/xarax/ and .htm
					// are here, because they are common to every HTML help path.
					strHelpFileName += _T("xarax/") + Context + _T(".htm");
			}

			CCamApp::LaunchWebBrowser( strHelpFileName );
		}

#if !defined(EXCLUDE_FROM_XARALX)
	// Get some slightly useful information if it all goes horribly wrong.
#ifdef _DEBUG
	if (!fOk) TRACEUSER( "Ollie", _T("RunOilHelp failed - last error: %lu\n"),
										(UINT32) ::GetLastError());
#endif

	// Undo the hour-glass cursor and return a success code.
	if (hBusyCursor != NULL) ::SetCursor(hOldCursor);
#endif

	return fOk;
}
Exemplo n.º 11
0
OpState	OpBreakAtPoints::GetState(String_256* UIDescription, OpDescriptor*)
{

	OpState OpSt;
	String_256 DisableReason; 

   	OpSt.Greyed = FALSE;
	BOOL FoundSelected = FALSE;

	// Go through the selection until we find a selected point

	SelRange* Selected = GetApplication()->FindSelection();
	Node* pNode = Selected->FindFirst();

	while (pNode)
	{
		if (IS_A(pNode,NodePath) || IS_A(pNode,NodeBlendPath))
		{
			NodePath* pNodePath = (NodePath*)pNode;
			INT32 NumSplinters = pNodePath->InkPath.NumSplinters();

			if (NumSplinters > 0)
			{
				// We need to ask the effected nodes if they (and their parents) can handle this node being replaced
				ObjChangeFlags cFlags;

				if (NumSplinters > 1)
					cFlags.MultiReplaceNode = TRUE;	// Node will be replaced with more than one node.
				else
					cFlags.ReplaceNode = TRUE;		// Node will be replaced with one node only.

				String_32 optokenstring(OPTOKEN_BREAKATPOINTS);
				ObjChangeParamWithToken ObjChange(OBJCHANGE_STARTING,cFlags,pNodePath,NULL,&optokenstring);

				// Will the node allow this op to happen?
				if (pNodePath->AllowOp(&ObjChange,FALSE))
				{
					FoundSelected = TRUE;
					break;
				}
			}
		}
		pNode = Selected->FindNext(pNode);
	}

	// The operation is disabled if there are no complex paths selected

	if (!FoundSelected)
	{
		OpSt.Greyed = TRUE;
		DisableReason = String_256(_R(IDS_NEEDS_SELECTED_POINT));
		*UIDescription = DisableReason;
	}
	
	return(OpSt);   
}
Exemplo n.º 12
0
/********************************************************************************************

>	static OpState OpApplyClipView::GetState(String_256* pstrDescription, OpDescriptor* pOpDesc)

	Author:		Karim_MacDonald (Xara Group Ltd) <*****@*****.**>
	Created:	01 February 2000
	Inputs:		
	Outputs:	
	Returns:	
	Purpose:	
	Errors:		
	See also:	

********************************************************************************************/
OpState OpApplyClipView::GetState(String_256* pstrDescription, OpDescriptor* pOpDesc)
{
	// default is an unticked, *GREYED*, on-menu state.
	OpState OpSt;
	OpSt.Greyed = TRUE;
	*pstrDescription = String_256(_R(IDS_CLIPVIEW_NEEDS_MULTIPLE_NODES));

	// obtain the app's current selection.
	// we want to treat bevels/contours etc. as atomic objects.
	Range Sel(*(GetApplication()->FindSelection()));
	RangeControl rc = Sel.GetRangeControlFlags();
	rc.PromoteToParent = TRUE;
	Sel.Range::SetRangeControl(rc);

	// is there actually anything in the selection?
	Node* pNode = Sel.FindFirst();
	if (pNode != NULL)
	{
		// yes - then is it only one node?
		if (Sel.FindNext(pNode) == NULL)
		{
			// yes - then if that node is a NodeClipViewController, remove ourself from the menu.
			if (pNode->IsANodeClipViewController())
			{
				OpSt.RemoveFromMenu = TRUE;
				pstrDescription->Empty();
			}
		}

		// two or more nodes - that's ok, but only if there is currently no select-inside.
		else if (Sel.ContainsSelectInside())
		{
			*pstrDescription = String_256(_R(IDS_GREY_WHEN_SELECT_INSIDE));
		}
		else
		{
			OpSt.Greyed = FALSE;
			pstrDescription->Empty();
		}
	}

	return OpSt;
}
Exemplo n.º 13
0
void OpChangeLineAttribOpDesc::OnSelectionChange(OpDescControlMsg* pSelChangedMsg, List*)
{
	// Get the relevant fields.
	DialogOp* pDlg = pSelChangedMsg->pDlgOp;									    
	CGadgetID idSetGadgetID = pSelChangedMsg->SetGadgetID;

	// Try to get the text entered (or selected) within the combo.
	BOOL fValid;
	String_256 strEntered = pDlg->GetStringGadgetValue(idSetGadgetID, &fValid, -1);
	if (!fValid)
	{
		TRACEUSER( "JustinF", _T("Invalid text in OpChangeLineAttribOpDesc::OnSelectionChange\n"));
		Beep();
		SetCurrentSelectedAttrib();
		return;
	}

	INT32 nItemIndex;
	// Compare the string to each item that was placed in the combo list.
	for (nItemIndex = 0; ; nItemIndex++)
	{
		// Ask the derived class to provide the string at the given index position.
		UINT32 nTxtID = GetItemStringID(nItemIndex);
		
		// If there are no more strings then simply reset the combo to the current value.
		// The user has entered junk!
		if (nTxtID == 0)
		{
			// This will "recalc" the current value and set it.
			Beep();
			SetCurrentSelectedAttrib();
			return;
		}

		// Compare the two strings.  If they match then break out now.
		if (strEntered == String_256(nTxtID)) break;
	}

	// Obtain the index selected in the combo and pass to the derived class, which will
	// create the appropriate attribute.
	NodeAttribute* pAttr = GetNewAttrib(nItemIndex);
	if (pAttr == NULL)
	{
		TRACEUSER( "JustinF", _T("Out of memory in OpChangeLineAttribOpDesc")
							 "::OnSelectionChange\n");
		return;
	}

	// Pass it to the attribute manager.
	AttributeManager::AttributeSelected(pAttr); 

	// Update all list-boxes.  Note we must do this even if we have just set a new
	// attribute, as a SelChanging message will not be always be broadcast.
	SetCurrentSelectedAttrib();
}
Exemplo n.º 14
0
OpState	OpColEditCommand::GetCommandState(String_256 *UIDescription, OpDescriptor *pOpDesc)
{
	if (ColourEditDlg::TheEditor != NULL)
		return(ColourEditDlg::TheEditor->GetCommandState(&pOpDesc->Token, UIDescription));

	// else return a "safe" shaded state
	OpState OpSt;
	OpSt.Greyed = TRUE;
	*UIDescription = String_256(_R(IDS_K_COLMENU_NOEDITOR));
	return (OpSt); 
}
Exemplo n.º 15
0
void WebAddress::CorrectNoNetLoc(String_256* pstrCorrect)  
{	
	//Check our parameter
	if(pstrCorrect==NULL)
	{
		ERROR2RAW("WebAddress::CorrectBackslash - NULL parameter");
		return;
	}
	
	//We already know that our string does not start with "http://"
	//But does it start with "http:/"?
	if (pstrCorrect->SubWithoutCase(String_256("http:/"))==0)
	{
		//Yes it does. So insert an extra slash
		pstrCorrect->Insert(&String_256("/"), 5);
	}
	else
	{
		//No it doesn't. So insert an extra two slashes after the HTTP
		pstrCorrect->Insert(&String_256("//"), 5);
	}
}
Exemplo n.º 16
0
BOOL WebAddress::ShouldCorrectFTP(String_256* pstrCorrect)  
{	
	//Check our parameter
	ERROR2IF(pstrCorrect==NULL, FALSE, "WebAddress::CorrectBackslash - NULL parameter");
	
	//Are the first four characters "ftp." ?
	if (pstrCorrect->SubWithoutCase(String_256("ftp."))==0)
		return TRUE;
	
	//Otherwise return FALSE
	return FALSE;

}
Exemplo n.º 17
0
/********************************************************************************************

  >	INT32 HTMLExportFilter::WriteStartOfTag(UINT32 uiResource, CCLexFile* pfileToWrite, TCHAR* pcBuffer)

	Author:		Graham_Walmsley (Xara Group Ltd) <*****@*****.**>
	Created:	18/4/97
	Inputs:		uiResource		The resource to write after the start of the tag
				pfileToWrite	The file to write to (may be NULL)
				pcBuffer		The text buffer to write to (may be NULL)
	Returns:	The number of TCHARs written
	Purpose:	Writes out a < followed by a resource (e.g. "<IMG")

********************************************************************************************/
INT32 HTMLExportFilter::WriteStartOfTag(UINT32 uiResource, CCLexFile* pfileToWrite, TCHAR* pcBuffer)
{
	//Get our start tag string
	String_256 strToWrite(_R(IDS_HTMLEXPORT_TAGSTART));

	//Add the resource string to the end of it
	strToWrite+=String_256(uiResource);

	//Then call our sister function to write out the string
	//making sure the write function doesn't put an EOL
	//after it
	return Write(strToWrite, pfileToWrite, pcBuffer);
}
Exemplo n.º 18
0
/********************************************************************************************

>	OpState	OpConvertToBitmap::GetState(String_256*, OpDescriptor*)

	Author:		Will_Cowling (Xara Group Ltd) <*****@*****.**>
	Created:	11/6/96
	Returns:	The state of the OpConvertToBitmap operation
	Purpose:	For finding the OpConvertToBitmap's state. 
	Errors:		-
	SeeAlso:	-

********************************************************************************************/
OpState	OpConvertToBitmap::GetState(String_256* UIDescription, OpDescriptor*)
{
	OpState OpSt;
	String_256 DisableReason;

	// Ensure that a document exists
	if (Document::GetSelected() == NULL)
	{
		// There is no selected document
		OpSt.Greyed = TRUE;

		// Load reason why operation is disabled
		DisableReason = String_256(_R(IDS_NO_DOC));
	   	*UIDescription = DisableReason;	     
	   	return OpSt;                                 
	}

	// Obtain the current selections 
	Range Sel(*(GetApplication()->FindSelection()));
	  
	// This operation is disabled if there are no nodes selected, or if none of the selected 
	// objects can become a NodePath. 

	Node* FirstSelected = Sel.FindFirst();  
	
	OpSt.Greyed = FALSE; 
	if (FirstSelected == NULL) 
	{
		OpSt.Greyed = TRUE; 
		// Load reason why operation is disabled
		DisableReason = String_256(_R(IDS_NO_OBJECTS_SELECTED));
	   	*UIDescription = DisableReason;	        
	}
	
	return(OpSt);   
}
Exemplo n.º 19
0
String_256 ArrowRec::GetStockArrowName(StockArrow ArrowType)
{
	String_256 ArrowName = String_256(_R(IDS_K_ARROWS_DEFAULTARROW));

	switch (ArrowType)
	{
		case SA_STRAIGHTARROW:
			ArrowName.Load(_R(IDS_K_ARROWS_STRAIGHTARROW));
			break;

		case SA_ANGLEDARROW:
			ArrowName.Load(_R(IDS_K_ARROWS_ANGLEDARROW));
			break;

		case SA_ROUNDEDARROW:
			ArrowName.Load(_R(IDS_K_ARROWS_ROUNDEDARROW));
			break;

		case SA_SPOT:
			ArrowName.Load(_R(IDS_K_ARROWS_SPOT));
			break;

		case SA_DIAMOND:
			ArrowName.Load(_R(IDS_K_ARROWS_DIAMOND));
			break;

		case SA_ARROWFEATHER:
			ArrowName.Load(_R(IDS_K_ARROWS_ARROWFEATHER));
			break;

		case SA_ARROWFEATHER2:
			ArrowName.Load(_R(IDS_K_ARROWS_ARROWFEATHER2));
			break;

		case SA_HOLLOWDIAMOND:
			ArrowName.Load(_R(IDS_K_ARROWS_HOLLOWDIAMOND));
			break;

		default:
			ArrowName = "";
			break;
	}

	return ArrowName;
}
Exemplo n.º 20
0
void WebAddressDlg::ShowURL(TCHAR* pcURL)
{	
	//First set a flag to ensure we don't handle the "Text changed" message
	//that will occur when we change the edit field.
	WebAddressDlg::DontHandleNextTextMessage=TRUE;

	//Is pcURL NULL?
	if (pcURL==NULL)
		//Yes. So set a blank string in the edit field
		SetStringGadgetValue(_R(IDC_WEBADDRESS_URL), &String_256(""), FALSE, -1);
	else
	{
		//No. So set the string we have been given in the edit field
		String_256 strToSet=pcURL;
		SetStringGadgetValue(_R(IDC_WEBADDRESS_URL), &strToSet, FALSE, -1);
	}
	
}
Exemplo n.º 21
0
/********************************************************************************************

>	virtual BOOL MakeBitmapFilter::GetExportOptions(BitmapExportOptions* pOptions)

	Author:		Colin_Barfoot (Xara Group Ltd) <*****@*****.**>
	Created:	12/11/96
	Purpose:	See BaseBitmapFilter for interface details

********************************************************************************************/
BOOL MakeBitmapFilter::GetExportOptions(BitmapExportOptions* pOptions)
{
	ERROR2IF(pOptions == NULL, FALSE, "pOptions NULL");
	ERROR3IF(!pOptions->IS_KIND_OF(MakeBitmapExportOptions), "pOptions isn't");

	BOOL Ok = FALSE;

	OpDescriptor* pOpDes = OpDescriptor::FindOpDescriptor(OPTOKEN_GIFTABDLG);

	if (pOpDes != NULL)
	{
		// Graeme (18-9-00)
		// We need to ensure that the correct file type is set up. The bitmap copy filter
		// uses the PNG settings, and so it's necessary to convince the dialogue that we
		// are exporting as a PNG to avoid relics from an earlier export to confuse matters.
		BmapPrevDlg::m_pthExport.SetType ( String_256 ( "png" ) );

		// set up the data for the export options dialog
		OpParam Param((INT32)pOptions, (INT32)this);

		// invoke the dialog
		pOpDes->Invoke(&Param);

		// SMFIX
		// we have brought the dlg up so get the options from the dlg as the graphic type may have changed
		pOptions = BmapPrevDlg::m_pExportOptions;
		Ok = BmapPrevDlg::m_bClickedOnExport;
	}
	else
	{	
		ERROR3("Unable to find OPTOKEN_BMAPPREVDLG");
	} 

	// Return whether or not it worked.
	return Ok;
}
Exemplo n.º 22
0
void WebAddressDlg::ShowFrame(TCHAR* pcFrame)
{	
	//Is pcFrame NULL?
	if (pcFrame==NULL)
		//Yes. So set a blank string in the frame field
		SetStringGadgetValue(_R(IDC_WEBADDRESS_FRAME), &String_256(""), FALSE, -1);
	else
	{
		//No.

		//First put the string into one of Camelot's string classes
		String_256 strFrame=pcFrame;

		//And check to see if the string is one of our short strings
		//This if/else statement is basically a large switch statement
					
		if (strFrame==String_256(_R(IDS_WEBADDRESS_SHORT_SELF)))
			SetSelectedValueIndex(_R(IDC_WEBADDRESS_FRAME), 0);

		else if (strFrame==String_256(_R(IDS_WEBADDRESS_SHORT_PARENT)))
			SetSelectedValueIndex(_R(IDC_WEBADDRESS_FRAME), 1);

		else if (strFrame==String_256(_R(IDS_WEBADDRESS_SHORT_TOP)))
			SetSelectedValueIndex(_R(IDC_WEBADDRESS_FRAME), 2);

		else if (strFrame==String_256(_R(IDS_WEBADDRESS_SHORT_BLANK)))
			SetSelectedValueIndex(_R(IDC_WEBADDRESS_FRAME), 3);

		else if (strFrame==String_256(_R(IDS_WEBADDRESS_SHORT_DEFAULT)))
			SetSelectedValueIndex(_R(IDC_WEBADDRESS_FRAME), 4);

		else
			//Otherwise, set the string in the edit field
			SetStringGadgetValue(_R(IDC_WEBADDRESS_FRAME), &strFrame, FALSE, -1);
		
	}
		 	
}
Exemplo n.º 23
0
void OpChangeLayerColour::GetOpName(String_256* OpName)
{
	*OpName = String_256(UndoIDS);
}
Exemplo n.º 24
0
BOOL BitmapExportDocument::Init(KernelBitmap* pBitmap, const DocRect& RectToExport)
{
	// Don't attach any CCamDoc.
	if (!Document::Init(0)) return(FALSE);

	Node *pSpread = FindFirstSpread();
	ERROR3IF(pSpread == NULL, "No Spread in document!");

	Node *pLayer = pSpread->FindFirstChild();
	ERROR3IF(pLayer == NULL, "No Spread-child in document!");

	// Store away the rectangle
	ExportRect = RectToExport;

	// Now scan the children of the first spread until we find a layer, or run out of nodes
	while (pLayer != NULL && !pLayer->IsLayer())
		pLayer = pLayer->FindNext();

	if (pLayer == NULL)		// No Layer, so we'd better add one for ourselves
	{
		String_256 LayerID = String_256(_R(IDS_K_CLIPINT_LAYERNAME));
		pLayer = new Layer(pSpread, LASTCHILD, LayerID);
		if (pLayer == NULL)
			return(InitFailed());
	}

	// Create a new NodeRect
	NodeRect* pRectNode = new NodeRect(pLayer, FIRSTCHILD);

	// Failed so cleanup and exit
	if (pRectNode == NULL)
		return(InitFailed());

	// Initilaise the node
	if (!pRectNode->SetUpPath(6,6))
		return(InitFailed());

	// Create the rectangle
	pRectNode->CreateShape(ExportRect);

	// Give the rectangle a line colour
#if 0
	// This memory leaks a StrokeColourAttribute
	StrokeColourAttribute* pAttrValue = new StrokeColourAttribute(DocColour(COLOUR_TRANS));
	if (pAttrValue == NULL)
		return(InitFailed());
	
	NodeAttribute* pAttr = pAttrValue->MakeNode();
	if (pAttr == NULL)
		return(InitFailed());

	// Attach the attribute to the rectangle
	pAttr->AttachNode(pRectNode, FIRSTCHILD);
#else
	// Do what ApplyDefaultBitmapAttrs does
	Node* pLineColAttr = new AttrStrokeColour();
	if (pLineColAttr == NULL)
		return(InitFailed());

	DocColour none(COLOUR_NONE);
	((AttrFillGeometry*)pLineColAttr)->SetStartColour(&none);
	pLineColAttr->AttachNode(pRectNode, FIRSTCHILD);
#endif

	// Create a NodeBitmap (don't attach it to the tree straight away 'cos we
	// have to put the attributes on it first)

	pBitmapNode = new NodeBitmap();
	if (pBitmapNode == NULL)
		return(InitFailed());

	if (!pBitmapNode->SetUpPath(6,6))
		return(InitFailed());

	pBitmapNode->CreateShape(ExportRect);

	if (!SetBitmap(pBitmap))
		return(InitFailed());

	// Set the bitmap's attributes
	// This must be done before the NodeBitmap is inserted into the tree
	if (!pBitmapNode->ApplyDefaultBitmapAttrs(NULL))
		return(InitFailed());

	// Attach it to the tree as the next sibling of the rectangle
	pBitmapNode->AttachNode(pRectNode, NEXT);

	// Success...
	return(TRUE);
}
Exemplo n.º 25
0
BOOL DragTarget::GetStatusLineText(String_256 * TheText)
{
	ERROR2IF(TheText==NULL,FALSE,"NULL string in GetStatusLineText()");
 	* TheText = String_256(_R(IDS_DROPSTATUSLINETEXT));
	return TRUE;
}
Exemplo n.º 26
0
/********************************************************************************************

>	virtual void OpRemoveClipView::GetOpName(String_256* pstrOpName)

	Author:		Karim_MacDonald (Xara Group Ltd) <*****@*****.**>
	Created:	01 February 2000
	Inputs:		
	Outputs:	
	Returns:	
	Purpose:	
	Errors:		
	See also:	

********************************************************************************************/
void OpRemoveClipView::GetOpName(String_256* pstrOpName)
{
	*pstrOpName = String_256("Remove ClipView");
}
Exemplo n.º 27
0
/********************************************************************************************

>	virtual void OpApplyClipView::GetOpName(String_256* pstrOpName)

	Author:		Karim_MacDonald (Xara Group Ltd) <*****@*****.**>
	Created:	01 February 2000
	Inputs:		
	Outputs:	
	Returns:	
	Purpose:	
	Errors:		
	See also:	

********************************************************************************************/
void OpApplyClipView::GetOpName(String_256* pstrOpName)
{
	*pstrOpName = String_256("ClipView Object(s)");
}
Exemplo n.º 28
0
void OpFillNudge::GetOpName(String_256* OpName) 
{ 
	*OpName = String_256(NudgeUndoIDS);
}  
Exemplo n.º 29
0
void OpNudge::GetOpName(String_256* OpName)
{
    *OpName = String_256(_R(IDS_UNDO_NUDGE));
}
Exemplo n.º 30
0
/********************************************************************************************

>	virtual BOOL DragInformation::GetStatusLineText(String_256 * TheText, DragTarget* pDragTarget)
	Author:		Chris_Snook (Xara Group Ltd) <*****@*****.**>
	Created:	15/1/95
	Returns:	Whether string is valid
	Purpose:	provide status line text for this drag
   
********************************************************************************************/
BOOL DragInformation::GetStatusLineText(String_256 * TheText, DragTarget* pDragTarget)
{
	ERROR2IF(TheText==NULL,FALSE,"NULL string in GetStatusLineText()");
 	* TheText = String_256(_R(IDS_DRAGSTATUSLINETEXT));
	return TRUE;
}