Thank you Mary and Bjarnee for your prompt reply.
Unfortunately, your advices didn't work, perhaps because I haven't made
myself clear enough in the initial question.
This is the situation:
I have a simple application written in J-Link and the menu is placed under
the Edit main menu. Here is the code:
....
try{
Session curSession = pfcGlobal.GetProESession( );
UICommand cmd = curSession.UICreateCommand ("ShadeFiles", new
MenuButtonListener());
curSession.UIAddButton (cmd, "Edit", null, "Shadow_Files",
"Create Shadow Files for NPI", "GetRevision.txt");
}
...
Very simple and it works
Now I want to add a new button under this application, but from a DIFFERENT
application:
....
try{
Session curSession = pfcGlobal.GetProESession( );
UICommand cmd = curSession.UICreateCommand ("CreateParams", new
MenuButtonListener());
curSession.UIAddButton (cmd, "Edit","ShadeFiles", "CreateParams",
"Create Standard Parameters for the Model",
"CreateParams.txt");
}
.....
Now, the second application doesn't add anything, in spite of the fact that
the command button name "Shadefiles" is correct.
Even if I use any of the existing other buttons of the existing menu, I get
nothing. If I put "null" instead of "ShadeFiles", I do get a new button on
the menu, but if I click on it, I get the the application ShadeFiles run
instead of Createparams.... It is very frustrating because I am sure that I
am doing something trivially stupid...
Could you please open my eyes?
Thank you
Uriel
On Wed, Aug 31, 2011 at 9:02 AM, Bjarne Frandsen <->wrote:
>
> Here is how I add a menu with submenues.
> session = pfcGlobal.GetProESession();
> session.UIAddMenu("jlink", "Utilities", "beo_jlink.txt", null);
> session.UIAddMenu("pcb", "pe", "beo_jlink.txt", "jlink");
> session.UIAddMenu("nc", "pcb", "beo_jlink.txt", "jlink");
> session.UIAddMenu("op", "nc", "beo_jlink.txt", "jlink");
>
> And here is adding buttons to the submenus:
>
> UICommand m03HRNamingcommand = null;
> UICommand m03DXFExportcommand = null;
> try
> {
> m03HRNamingcommand = session.UICreateCommand("M03HRNaming", new
> M03HRNamingListener());
> session.UIAddButton(m03HRNamingcommand, "pcb", null, "M03HRNaming menu",
> "M03HRNaming help", "beo_M03HRNaming.txt");
> m03DXFExportcommand = session.UICreateCommand("M03DXFExport", new
> M03DXFExportListener());
> session.UIAddButton(m03DXFExportcommand, "pcb", null, "M03DXFEXport
> menu", "M03DXFExport help", "beo_M03DXFExport.txt");
> }
> catch (Throwable x){}
>
> Regards,
> Bjarne
>
>
> *Uriel Avron <->*
>
> 31-08-2011 06:48
> Please respond to
> Uriel Avron <->
>
> To
> <->
> cc
> Subject
> [proecus] - Adding Menu Buttons in J-Link
>
>
>
>
> Hi,
>
>
>
> It might sound a silly problem, but for some unknown reasons I can add
> buttons to existing menus only as the first button. If I add a button and
> define the neighbour of the requested button, I do not get anything.
>
> Anybody has a snippet of J-Link code that includes adding a button into a
> certain position in an existing menu, so that I can find what I am doing
> wrong?
>
> Thank you in advance
>