mostafa

How can i create drop down menu in citect scada

3 posts in this topic

hi everyone

how can i create a menu like a pic that i attached to this topic?. in other word in citect scada  in run time mode i want to by clicking on the button a menu just like a pic i attached to this topic is appeared. anyone can help me how should i do?

which cicode functions  i should use for it?

can anyone has a example code for this?

menu.JPG

Edited by mostafa

Share this post


Link to post
Share on other sites

You can make them at the top of the page using the menu configuration options (at least in Citect 2015).  But do you want one to open from a button somewhere on a page?

What version of Citect are you using?  

Share this post


Link to post
Share on other sites

Hi,

Just found this, you can use the DspPopupMenu function.  You then need to use Cicode to do stuff with the menu options, but calling DspPopUpMenu(-1) will return which option was chosen.  Below is some example code taken from one of our projects.  The StrGetField function is not a built in function but it just returns an item from a comma separated list.

FUNCTION DropdownTrendMenu(STRING sDisplayNames, STRING sPavNames)

	INT i = 0;
	INT iMenuOption = 0;
	STRING sPav = "";
	OBJECT hProcessAnalyst;
	
	DspPopupMenu(0, sDisplayNames)
	iMenuOption = DspPopupMenu(-1);
	
	IF iMenuOption > 0 THEN
		sPav = StrGetField(sPavNames, iMenuOption, ",");
	
		IF sPav <> "" THEN
			IF FileExist(PathToStr("[Run]:" +"\Analyst Views\" + sPav + ".pav")) THEN
			
				PageDisplay("ProcessAnalyst");
				
				SleepMS(200);
		
				hProcessAnalyst = ObjectByName("AN206");
				CSV_PA_LoadPavFile(hProcessAnalyst, sPav);
				_ObjectCallMethod(hProcessAnalyst, "SynchroniseToNow");	
		
		    END
		END
	END
END

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now