Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X
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?
Solved! Go to Solution.
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.
In Creo UI Editor (*.res) I can create a groups like in picture
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.
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.
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.
@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.
Ask all users to open Creo through that bat file ONLY
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?
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.