Example #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;

}
Example #2
0
ImagemapFilterOptions ImagemapDlg::GetOptions()
{	
	//This variable will hold the imagemap filter options to return. Base these options
	//on the options we were given
	ImagemapFilterOptions ifoGet=ms_Options;

	//Get the map name
	ifoGet.m_strName=GetStringGadgetValue(_R(IDC_IMAGEMAP_MAPNAME));

	//Get the "Approximate curves with lines" drop down box
	switch (GetSelectedValueIndex(_R(IDC_IMAGEMAP_APPROX)))
	{
	case 0:
		ifoGet.m_ffApprox=FF_VERYCLOSELY;
		break;

	case 1:
		ifoGet.m_ffApprox=FF_CLOSELY;
		break;

	case 2:
		ifoGet.m_ffApprox=FF_APPROXIMATELY;
		break;

	default:
		ERROR3("ImagemapDlg::GetOptions - invalid flattening factor");

	case 3:
		ifoGet.m_ffApprox=FF_NOTATALL;
		break;

	}

	//Get the Area For Imagemap radio buttons
	if (GetLongGadgetValue(_R(IDC_IMAGEMAP_AREA_SELECTION), 0, 1)==1)
		ifoGet.m_stExportArea=SELECTION;
	else
		ifoGet.m_stExportArea=DRAWING;
													
	//Get the DPI from the Width and Height and the Area For Imagemap
	ifoGet.m_dDPI=GetDPI(ifoGet.m_stExportArea);

	//Get the "save clickable areas as rectangles"
	ifoGet.m_fAllRectangles=(GetLongGadgetValue(_R(IDC_IMAGEMAP_ALLRECTANGLES), 0, 1)==1);

	//Get the "copy imagemap to clipboard"
	ifoGet.m_fClipboard=(GetLongGadgetValue(_R(IDC_IMAGEMAP_CLIPBOARD), 0 ,1)==1);

	//And return our new set of imagemap options
	return ifoGet;
}
Example #3
0
void URLImportDlg::OnCommit()
{	
	//Get the string from the edit field
	String_256 strUser=GetStringGadgetValue(_R(IDC_URLIMPORT_URL));

	//Now we want to correct this string. To do this we
	//need to set up some correction flags
	WebCorrectFlags wcfToUse;
	wcfToUse.SetForURLImport();

	//Now make a Web Address object out of the string
	//This will correct the string appropriately
	WebAddress urlToFetch(strUser, wcfToUse);

	//And set our member variable
	ms_url=urlToFetch;


}
Example #4
0
String_256 WebAddressDlg::GetURL()
{	
	return GetStringGadgetValue(_R(IDC_WEBADDRESS_URL));
}
Example #5
0
MsgResult CBaseBrushNameDlg::Message(Msg* pMessage)
{
	// A message from the dialog or its gadgets?
	if (IS_OUR_DIALOG_MSG(pMessage))
	{
		DialogMsg* pMsg = (DialogMsg*) pMessage;
		switch (pMsg->DlgMsg)
		{
		case DIM_CREATE:
			InitGadgetText();
			break;

		case DIM_TEXT_CHANGED:
			// Disable the OK/Apply button if there's no document or entered text.
			EnableGadget(_R(IDOK), !GetStringGadgetValue(_R(IDC_EDITBRUSHNAME), 0).IsEmpty()
							&& Document::GetSelected() != 0);
			break;

		case DIM_LFT_BN_CLICKED:	// enter messages when the edit box has the focus get cast to this
			if (pMsg->GadgetID == _R(ID_CC_HELP_BUTTON))
				break;
		case DIM_COMMIT:
			{
				// Check name for validity.
				String_256 strEnter = GetStringGadgetValue(_R(IDC_EDITBRUSHNAME), 0);
				UINT32 nErrID = IsValid(strEnter);
				
				if (nErrID != 0)
				{
					// Invalid, reinitialise.
					InformError(nErrID);
					if (nErrID == _R(IDS_BRUSHNAME_INVALID))
					{
						String_32 s(strEnter);
						InitGadgetText(&s, FALSE);
					}
					else
						InitGadgetText(NULL);
					break;
				}
				else
				{
					// Entry is valid, try committing it.
					String_32 FinalString(strEnter);
					if (DoCommit(strEnter))
					{
						// Don't close, reinitialise (dialog is modeless).
						InitGadgetText();
						pMsg->DlgMsg = DIM_NONE; // stop base class closing it
						break;
					}
					else
					{
						// Close();
						// End(); - base class will close
						break;
					}
				}
						
			}
			break;
		case DIM_CANCEL:
			HandleCancel(); // base class will close
			break;
		default:
			break;
		}
	}
	

	// Has the document been switched or closed?
	else if (MESSAGE_IS_A(pMessage, DocChangingMsg))
	{
		DocChangingMsg* pMsg = (DocChangingMsg*) pMessage;
		if (pMsg->State == DocChangingMsg::SELCHANGED)
			EnableGadget(_R(IDOK), pMsg->pNewDoc != 0);
	}

	// Pass everything on to the base class . . .
	return DialogOp::Message(pMessage);
}  
Example #6
0
MsgResult ToolnameDlg::Message(Msg* Message)
{
	if (IS_OUR_DIALOG_MSG(Message))
	{

		DialogMsg* Msg = (DialogMsg*)Message; 
		BOOL EndDialog = FALSE; 
		switch (Msg->DlgMsg)
		{
			case DIM_CREATE:
			    SetKeyboardFocus (_R(IDC_EDITNEWBARNAME)) ;
				HighlightText    (_R(IDC_EDITNEWBARNAME)) ;
				break ;

			case DIM_COMMIT:
 			{
 				// Accept all changes that the user wants to make to toolbars...
 				BOOL VV;
 				String_32 NewBarName = GetStringGadgetValue(_R(IDC_EDITNEWBARNAME),&VV);
				if(NewBarName.Length()==0)
				{
				  	UINT32 Number = DialogBarOp::FindUniqueBarNumber();	
					NewBarName._MakeMsg(TEXT("Bar #1%ld"),Number); 
				}
				DialogBarOp* pNewBar = new DialogBarOp(NewBarName);
 				if (pNewBar)
 				{
 					pNewBar->SetDockBarType(DOCKBAR_FLOAT);
 					pNewBar->Create();
					// The Create function sends a message which we intercept to update
					// the list of bars in the Toolbars... dialog.
					// this is very dangerous in fact it blows up..
					// so I have removed it .. chris.
					/*	if (pNewBar)
					{
						// Find toolbar dialog and close it...
 						ToolbarDlg* pToolbarDlg = ToolbarDlg::GetToolbarDlg();
						if (pToolbarDlg)
						{
							pToolbarDlg->Close();
							pToolbarDlg->End();
						}
					}
					*/
					ToolbarDlg* pToolbarDlg = ToolbarDlg::GetToolbarDlg();
					pToolbarDlg->ShowToolbarList();
 				}
 				EndDialog = TRUE;
			
 			}
 			break;

 			case DIM_CANCEL:
 				// Cancel all changes the user wants to make to toolbars...
 				EndDialog = TRUE;
	 			break;

//			default:
		}

		if (EndDialog)	// Dialog communication over 
		{
			Close();	// Close the dialog 
			End();		// Destroy dialog 
	   	}

//		return (DLG_EAT_IF_HUNGRY(Msg)); 
	}

//	return OK; 

	// Pass everything on to the base-class . . .
	return DialogOp::Message(Message);
}