CoCreate User Forum  

Go Back   CoCreate User Forum > Support > Customization

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 07-24-2015, 09:00 AM
Mike_Maenpaa Mike_Maenpaa is offline
Registered User
 
Join Date: Aug 2013
Posts: 14
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
Attached Files
File Type: lsp User_Interface_Toolkit_Example.lsp (13.3 KB, 349 views)
Reply With Quote
  #2  
Old 07-24-2015, 11:38 AM
tom kirkman's Avatar
tom kirkman tom kirkman is offline
Registered User
 
Join Date: Oct 2002
Location: Perrysburg, Ohio
Posts: 397
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
Reply With Quote
  #3  
Old 07-24-2015, 01:00 PM
Mike_Maenpaa Mike_Maenpaa is offline
Registered User
 
Join Date: Aug 2013
Posts: 14
Re: Open Dialog Position

Quote:
Originally Posted by tom kirkman View Post
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
Hi Tom,

See the very end of the code attached.

Thanks for looking!

Mike
Attached Files
File Type: lsp User_Interface_Toolkit_Example.lsp (13.4 KB, 344 views)
Reply With Quote
  #4  
Old 07-25-2015, 06:38 AM
Andy Poulsen Andy Poulsen is offline
Administrator
 
Join Date: Apr 2003
Location: Fort Collins, Colorado
Posts: 273
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))
and then hide and show it immediately after you show your desired dialog, i.e.:
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")
Take a look and see if this works.
__________________
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!
Reply With Quote
  #5  
Old 07-27-2015, 08:15 AM
Mike_Maenpaa Mike_Maenpaa is offline
Registered User
 
Join Date: Aug 2013
Posts: 14
Re: Open Dialog Position

Quote:
Originally Posted by Andy Poulsen View Post
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))
and then hide and show it immediately after you show your desired dialog, i.e.:
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")
Take a look and see if this works.
Thanks Andy, unfortunately that didn't help. It still opens at left top.

Mike
Reply With Quote
  #6  
Old 07-29-2015, 12:08 PM
Andy Poulsen Andy Poulsen is offline
Administrator
 
Join Date: Apr 2003
Location: Fort Collins, Colorado
Posts: 273
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!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 12:59 AM.



Hosted by SureServer    Forums   Modeling FAQ   Macro Site   Vendor/Contractors   Software Resellers   CoCreate   Gallery   Home   Board Members   Regional User Groups  By-Laws  

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.