Notes C++ API - Modifying Form/View ActionBar Properties

Hi all,

I have a problem about Notes C++ API,

I developed an application with Notes C++ API. I want to change Form or View Action Bar properties.

I developed and when I test this application, I saw some bugs.

If View element has some action buttons, when I changed the properties of action bar, Actions’ Hide-When Formulas crashing.

I have “Invalid formula format” error. If view has not any action buttons, there is no problem about code.

Only problem occures when view has some action buttons.

Do you have any idea ?

C++ codes here:

NOTEID			NoteID;

LNForm			oForm;



LNActions		oActions;



LNColor			oActionBarBGColor;

LNColor			oActionButtonBGColor;



oActionBarBGColor.SetIsRGB (TRUE);

oActionBarBGColor.SetBlueValue(GetBValue(rgbActionBarColor));

oActionBarBGColor.SetGreenValue(GetGValue(rgbActionBarColor));

oActionBarBGColor.SetRedValue(GetRValue(rgbActionBarColor));



oActionButtonBGColor.SetIsRGB (TRUE);

oActionButtonBGColor.SetBlueValue(GetBValue(rgbActionButtonColor));

oActionButtonBGColor.SetGreenValue(GetGValue(rgbActionButtonColor));

oActionButtonBGColor.SetRedValue(GetRValue(rgbActionButtonColor));



LNSetThrowAllErrors(TRUE);



for (int i = 0; i <= NoteIDList.GetUpperBound(); i++)

{



	sscanf(NoteIDList.ElementAt(i), "%08X", &NoteID);

	

	try {

	

			oDatabase.GetForm(NoteID, &oForm);



			oForm.Open();



			oForm.GetActions (&oActions);



			oActions.SetActionBarBackgroundColor(oActionBarBGColor);



			oActions.SetActionBarButtonColor(oActionButtonBGColor);

			

			if (strFontName != "")

			{

				oActions.SetActionBarFontStyle(oFontStyle);



				oActions.SetActionBarFontColor (oActionButtonFontColor);

			}

			

			oForm.Save();



			oForm.Close();



	} catch (LNSTATUS LNError) {



		char chrErrorBuf[LNERROR_MESSAGE_LENGTH];

		

		LNGetErrorMessage(LNError, chrErrorBuf);

		

		MessageBox ( chrErrorBuf, "ERROR !", MB_OK | MB_ICONINFORMATION );



		return;

	}



}

Thank you,

Ferhat

Subject: Notes C++ API - Modifying Form/View ActionBar Properties

The structures of views are complicated, to say the least.Unless you know exactly how their inner workings are structured, you are on dangerous ground indeed.

Does it absolutely have to be a C/C++ program?

I am not sure how exposed the DXL stuff is in C++ but I do know that changing a view’s design using DXL works pretty well.

It adds an extra layer for your programming but it is really easy and well worth looking into.

Subject: RE: Notes C++ API - Modifying Form/View ActionBar Properties

My suggestion is to abandon the idea of modifying the action bar all together. It’s broken in the C++ API and using DXL will not fix the problem. You are better off creating a custom toolbar in the client itself.