UI Glitch When Adjusting AutoCAD Palette Size Dynamically

UI Glitch When Adjusting AutoCAD Palette Size Dynamically

santhoshr151194
Contributor Contributor
216 Views
2 Replies
Message 1 of 3

UI Glitch When Adjusting AutoCAD Palette Size Dynamically

santhoshr151194
Contributor
Contributor

I have developed a plugin for AutoCAD that displays multiple UIs using palettes. Since each UI has a different size, I am using a single palette and dynamically adjusting its size by opening and closing it as needed to optimize performance.

However, when the palette opens, there is a noticeable glitchy effect, which is not making the transition smoother.

Is there a better way to handle palette resizing dynamically without causing this visual glitch? 

0 Likes
217 Views
2 Replies
Replies (2)
Message 2 of 3

cadffm
Consultant
Consultant

Hi,

that's far away from a How to use Autocad question. Ask in specific .net (or C++?) board, next door.

For better feedback

Sebastian

0 Likes
Message 3 of 3

norman.yuan
Mentor
Mentor

Without providing details/code of how you "...dynamically adjust its size..." (is "it" meant for Palette, or PaletteSet?) and describe what "visual glitch" mean, it is really hard to suggest anything.

 

If the UI's initial size is really important, why you use PaletteSet to host you UI as palette? How about simply show the UI as modeless Window/Dialog (well, if your UI has to be modeless), so that the UI's size would not be limited in the existing PaletteSet, which can be docked/resized by user at anytime. This would save you from resizing the Palette and/or PaletteSet everytime you want to show your UI. Also, if the UI size matters, you can make it not resizeable ("Fixed border" for Win Form, "NoResize" for WPF Window.

 

If you do want to use PaletteSet, which is supposed to be an Singleton instance in AutoCAD session, then, you should add your different UIs as multiple Palette tabs into the PaletteSet (then, the PaletteSet dictates the sizes of all palettes' size to be the same). That is how PaletteSet is supposed to be used, in general.

 

So, if you choose to use PaletteSet to host multiple UIs, the UI (UserControl of Win Form or WPF) should be auto-resizeable, auto-scrollable and you better use WPF over Win Form UserControls. If the UI must keep its designed size, you might as well show it alone as modeless window/dialog (as long as you handle the modeless window/dialog correctly - treat it either as singleton instance across the AutoCAD session, or as per-document instance,...).

 

Norman Yuan

Drive CAD With Code

EESignature