#1
|
|||
|
|||
Open Dialog Position
I didn't get any bites in the CED community, so I'll try here.
I'm trying out one of the example LSP from the Help file. I made one change to the example so that the dialog opens in the right top, but it doesn't seem to work. Anyone have time to try it and explaing what"s wrong? While I'm on the subject of dialog boxes, does anyone know if it's possible to have auto-hide capability? Thanks. Mike |
#2
|
||||
|
||||
Re: Open Dialog Position
Mike
Add a comment to the location you modified the file. This will help me determine what was changed, so that I can look specifically at that section of code. Regards Tom
__________________
Tom Kirkman Creo Elements/Direct 20.1 Dell Precision 3581 https://www.o-i.com |
#3
|
|||
|
|||
Re: Open Dialog Position
Quote:
See the very end of the code attached. Thanks for looking! Mike |
#4
|
|||
|
|||
Re: Open Dialog Position
Hi Mike,
Some goofy things happen with positioning dialogs sometimes. Not sure why it works in some cases and not in others. However, one thing I discovered is that if you try to position two dialogs, the first one will get moved to the right location when showing the second. So a little trick that has worked for me is to create a dummy dialog shell at some point in your code (you only need to create it once), as follows: Code:
(sd-create-dialog-shell "dummy" :title "dummy" :close t :bottomline :none)) Code:
(sd-show-dialog-shell "UICT-TEST" :position '("TOP-MENU-TOOLBOX-TB" :righttop 10 10)) (sd-show-dialog-shell "dummy") (sd-hide-dialog-shell "dummy")
__________________
Andy Poulsen AI MAXTools: Dream. Design. Done. It's that easy! Add-ins bringing new functionality and speed to Creo Elements/Direct and CoCreate products. Now available for v17-v20+! See them in action at www.ai-maxtools.com and then try them for yourself -- FREE! |
#5
|
|||
|
|||
Re: Open Dialog Position
Quote:
Mike |
#6
|
|||
|
|||
Re: Open Dialog Position
In working with Mike, we were able to identify and fix the problem.
When trying to specify a position, the function wants a reference widget. In this case, the "TOP-MENU-TOOLBOX-TB" control. The code worked fine in version 17, but not under 18 or 19. The reason is that this control doesn't exist by default in v18+. We solved the problem by referencing the application itself by using :application rather than a control name. Perhaps this may be of use to someone else. Good luck! andy
__________________
Andy Poulsen AI MAXTools: Dream. Design. Done. It's that easy! Add-ins bringing new functionality and speed to Creo Elements/Direct and CoCreate products. Now available for v17-v20+! See them in action at www.ai-maxtools.com and then try them for yourself -- FREE! |
#7
|
||||
|
||||
Re: Open Dialog Position
Andy
Could you provide the sample code? Thanks Tom
__________________
Tom Kirkman Creo Elements/Direct 20.1 Dell Precision 3581 https://www.o-i.com |
#8
|
|||
|
|||
Re: Open Dialog Position
Hi Tom,
You betcha. The real magic is just to specify the reference object as :application, so the last function in the file becomes: Code:
(sd-show-dialog-shell "UICT-TEST" :position '(:application :righttop 10 10)) This approach will work under all earlier versions of CoCreate and Creo Elements/Direct, as :application can always be used. However, sometimes you may want to reference another object -- the key is just to make sure it exists before referencing it. I hope this helps! andy
__________________
Andy Poulsen AI MAXTools: Dream. Design. Done. It's that easy! Add-ins bringing new functionality and speed to Creo Elements/Direct and CoCreate products. Now available for v17-v20+! See them in action at www.ai-maxtools.com and then try them for yourself -- FREE! |
#9
|
|||
|
|||
Re: Open Dialog Position
Quote:
Thanks again for your help with this Andy! Also, thanks for the idea about using show/hide control to shrink the size of the dialog when not needed. Hopefully someday they will expose the auto-hide functionality. See attached. Mike |
Currently Active Users Viewing This Thread: 2 (0 members and 2 guests) | |
Thread Tools | Search this Thread |
Display Modes | Rate This Thread |
|
|