cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Pro/TOOLKIT. How to in ProUIOptionmenu create a groups programmaticaly?

YaroslavSin
17-Peridot

Pro/TOOLKIT. How to in ProUIOptionmenu create a groups programmaticaly?

Hello.

In ProUIOptionmenu (Drop down ListBox) it is possible create a groups using .res file:

(Resources
        ...
        (OptionMenu1.GroupNames         "1"
                                        "2")
        (OptionMenu1.GroupLabels        "group1"
                                        "group2")
        (OptionMenu1.GroupItems         "1"
                                        "3")

 

How to create this groups from C code for TOOLKIT? Any idea?

1 ACCEPTED SOLUTION

Accepted Solutions

It seems same is not feasible with code.

I agree with you @Ketan_Lalcheta. Looks like old C TOOLKIT can't do this.

 

But PTC point me that OTK have methods for classes uifcOptionMenuGroup in uifcOptionMenu.

 

If you have an ideas - you are welcome. My res file in attachment.

I think, need to try to write res file on the fly at start up of application and then use it.

View solution in original post

13 REPLIES 13

Hi I am not getting your expected result specially groups inside option menu. Values one can set for option menu as per attached file. There is a way to do so through API as well as res file. Could you please show what is your expected result in option menu?

Hi @Ketan_Lalcheta

In Creo UI Editor (*.res) I can create a groups like in picture

ProUIOptionmenu groups.png

Looking a way to do this at runtime in C code.

It seems same is not feasible with code. Still I wanna do reverse engineering. Could you please share dummy res file for option menu with groups?

It seems same is not feasible with code.

I agree with you @Ketan_Lalcheta. Looks like old C TOOLKIT can't do this.

 

But PTC point me that OTK have methods for classes uifcOptionMenuGroup in uifcOptionMenu.

 

If you have an ideas - you are welcome. My res file in attachment.

I think, need to try to write res file on the fly at start up of application and then use it.

Yes. Correct ..I could not find any other option. One cannot create res file on the fly at start up as Creo loads resource file during launch and we are trying to create the same through coding post creo launch. I am not sure on this and if you are going to test this, do share your results.

FV
17-Peridot
17-Peridot
(To:YaroslavSin)

Hello all,

PTUDFExUDFPlacementDashboard.c has an example of how to dynamically update an option menu.

ProUIOptionmenuNamesSet and ProUIOptionmenuLabelsSet are what you are looking for - this is very similar to ProUIListNamesSet and ProUIListLabelsSet functionality.

HIH.

FV.

YaroslavSin
17-Peridot
(To:FV)

Hi. Not. ProUIOptionmenuNamesSet and ProUIOptionmenuLabelsSet only create items in the menu, but not grouping them.
FV
17-Peridot
17-Peridot
(To:YaroslavSin)

Hello all,

 

I would try to use delim separated strings in ProUIOptionmenuNameSet to relate hierarchical dependencies and to use  left-padded with spaces strings in ProUIOptionmenuLabelsSet to fake the look. 

 

Did you try to create a "C" wrapper library for OTK methods? 

 

FV. 

YaroslavSin
17-Peridot
(To:FV)

@FV Maybe it is possible to use OTK methods from C using "Task Based Application Libraries" but for my task I think this way will be very complicated.

 

To write res file on the fly - not working. As saying @Ketan_Lalcheta, Creo loads all res files on start up. Then any changes in res not updated until restart of Creo.

 

I want to show in Optionmenu a content of some library:

folders - is a groups

files in folders - is an items.

 

So, easiest way is to write separate utility (exe) to indexing a content of library and write data to res file. After adding new folders and files needed manually start the utility to index. New challenges will be shown in Optionmenu after restarting Creo.

Are you going to add folders or files while creo is running? If not, you can do following to avoid restart of Creo to get effect.

 

  • Create exe to update resource file
  • Create bat file which execute above exe first and then open Creo

Ask all users to open Creo through that bat file ONLY

Ketan_Lalcheta
19-Tanzanite
(To:FV)

FV

 

  • to use  left-padded with spaces strings in ProUIOptionmenuLabelsSet to fake the look. ---> Got it..
  • try to use delim separated strings in ProUIOptionmenuNameSet to relate hierarchical dependencies --> Not able to understand what you mean to say with this.

With this also, can we achieve grouping? I mean to say that clicking on Group1 will hide display of all sub items under that particular group?

FV
17-Peridot
17-Peridot
(To:Ketan_Lalcheta)

Ketan,

Collapsing a group is out of the question with a fake. If collapsing is required one should use a tree or maybe a list UI elements... Or make a static library with C++ compilation (/TP switch), use OTK calls to write your code to handle ProUIOptionmenu and expose wrapper extern "C" functions  to be consumed by a pure C toolkit app...

 

delim-separated item names are to 'backtrack' the 'root' node of the selected option:

let's say delim is '_' and a node is two level deep - the names of the nodes would be  "root", "root_child1" and "root_child1_child2", the labels would be "top", "    step1", "        step2" and this contraption would look like this:

top

    step1

        step2

ProUIOptionmenu is essentially one level deep creation. A user selects the node - you'll get the name of it - splitting the name by a delim will get you an approximation of tree hierarchy.  

 

HIH.

FV.

Ketan_Lalcheta
19-Tanzanite
(To:FV)

Awesome FV. Thank you for detailed explanation...!

Top Tags