FNX_GUIComboBox::FNX_GUIComboBox(FNX_Logger *pLogger)
{
	Logger=pLogger;
	SpriteManager=new FNX_SpriteManager(Logger,100);
	
	UpBelt=SpriteManager->Add("",false);
	Button=SpriteManager->Add("",false);
	ChoosenLine=-1;
	
	ListBox= new FNX_GUIListBox(Logger);
	Add_Element(static_cast<FNX_GUIBaseElement*>(ListBox));

	//ListBox->SetOnChangeFunction(ListChange);

	

	Scale=FNX_Vector(100,100);

	DropDownCount=8;
	DropedDown=false;
	temp=false;

	Font=ListBox->GetFont();
	ListBox->SetMultiSelect(false);
};
FNX_GUIListBox::FNX_GUIListBox(FNX_Logger *pLogger)
{
	Logger=pLogger;
	SpriteManager=new FNX_SpriteManager(Logger,100);
	SpriteManager2=new FNX_SpriteManager(Logger,100);
	BackGround=SpriteManager->Add("",false);
	Choosen=SpriteManager2->Add("",false);
	Choosen->SetColor(D3DCOLOR_ARGB(128,0,0,255));
	ChoosenLine=-1;


	ScrollBar= new FNX_GUIScrollBar(Logger);
	Add_Element(static_cast<FNX_GUIBaseElement*>(ScrollBar));

	Font=new FNX_Font(Logger,12,12,false,"Lucida Console");
	
	Scale=FNX_Vector(100,100);
	MultiSelect=HaveChanged=false;
	Color=D3DCOLOR_XRGB(255,0,0);
	TT=0.0f;
};
Esempio n. 3
0
/*=========================================================================+
	Build_Return_XML:
		Build the XML block that eTrust Admin expects the program exit
		to return.

		<eTExitReturn>
			<eTExitReturnCategory></eTExitReturnCategory>
			<eTExitReturnNative></eTExitReturnNative>
			<eTExitContinue></eTExitContinue>
			<eTExitLogMsg></eTExitLogMsg>
			<eTExitCustom></eTExitCustom>
		</eTExitReturn>

	    The return XML buffer provided by eTrust Admin is over 4000 bytes
		long.  There will be no problem fitting the entire output XML
		document into this buffer unless sLogMessage or the custom_msg built
		from the return values array is very long.  Thus, this code attempts
		first to build an XML buffer with all of the provided information
		and if it is too long does the following:
			case 1:  custom_msg is provided
				--> generate a failure exit return block with no custom_msg

			case 2:  sLogMessage is provided, but no custom_msg
				--> replace the very long sLogMessage with a short one.

+=========================================================================*/
void
ExitXMLBlock::Build_Return_XML(
		STATUS_T	tStatus,
		bool		bContinueEtaExecution,
		string		sLogMessage,
		string &	sReturnXML,						// OUT
		int			iMaxReturnLength,
		bool		bObscureValue  // = false
	)
{
	int iRc;
	string	suValue;
	UTF8	pszuValue[32];
	XMLCh*	pxcValue;

	pxcValue = UTF8toUTF16(UTFEXIT_EXITRETURN);
	DOMDocument* pDocument = ExitXMLBlock::g_pImplementation->createDocument(0, pxcValue, 0);
	delete pxcValue;
	DOMElement* pRootElement = pDocument->getDocumentElement();

	// ...eTrust Admin Category.
	suValue = Convert_Status_To_Category_String(tStatus);
	iRc = Add_Element(pDocument, pRootElement, UTFEXIT_EXITRETURNCATEGORY, suValue);

	// ...Program exit return code.
	sprintf(pszuValue, "%d", tStatus);
	iRc = Add_Element(pDocument, pRootElement, UTFEXIT_EXITRETURNNATIVE, pszuValue);

	// ...Should eTrust Admin continue execution?
	suValue = (bContinueEtaExecution ? UTFEXIT_TRUE : UTFEXIT_FALSE);
	iRc = Add_Element(pDocument, pRootElement, UTFEXIT_EXITCONTINUE, suValue);

	// ...Log message.
	if (!sLogMessage.empty()) {
		iRc = Add_Element(pDocument, pRootElement, UTFEXIT_EXITLOGMSG, sLogMessage);
	}

	// ...Custom message (used for return values today; and perhaps for
	// other exit-type specific purposes in the future).
	if (m_vsReturnValues.size() > 0) {
		pxcValue = UTF8toUTF16(UTFEXIT_EXITCUSTOM);
        DOMElement* pElement = pDocument->createElement(pxcValue);
		delete pxcValue;
        pRootElement->appendChild(pElement);

		// Add each return value as <eTFuncReturn>...</eTFuncReturn>
		for (unsigned int iIndex = 0; iIndex <  m_vsReturnValues.size(); iIndex++) {
			if (bObscureValue) {	// add the obscured attribute for passwords
				Add_Element(
					pDocument,
					pElement,
					UTFEXIT_CF_FUNCRETURN,
					m_vsReturnValues[iIndex],
					"obscured",
					"yes");
			} else {
				Add_Element(
					pDocument,
					pElement,
					UTFEXIT_CF_FUNCRETURN,
					m_vsReturnValues[iIndex]);
			}
		}
	}

	// Generate the return XML string
	DOMBuilder* pBuilder;	// Parser
	DOMWriter*	pWriter;	// Serializer

	pWriter = ExitXMLBlock::g_pImplementation->createDOMWriter();
	pBuilder = ExitXMLBlock::g_pImplementation->createDOMBuilder(DOMImplementationLS::MODE_SYNCHRONOUS, 0);
	pWriter->setFeature(XMLUni::fgDOMXMLDeclaration, false);
	pBuilder->resetDocumentPool();

	const XMLCh* pxcReturnXML = pWriter->writeToString(*pRootElement);
	sReturnXML = UTF16toUTF8(pxcReturnXML);

	if (pBuilder) {
		delete pBuilder;
	}
	if (pWriter) {
		delete pWriter;
	}
	
	if (pDocument) {
		delete pDocument;
		pDocument = NULL;
	}

	// Check to make sure it isn't too long for the return buffer
	int iLength = sReturnXML.length();
	if (iLength >= iMaxReturnLength) {
		sReturnXML = "";
		sLogMessage = "ERROR: Return XML buffer too long";

		// If too long, and a custom message was provided, fail the
		// call (and consequently do not report an output value).
		if (m_vsReturnValues.size() > 0) {
			m_vsReturnValues.clear();
			tStatus = E_FAILURE;
			bContinueEtaExecution = false;
		}
	}
}