Zoomify plugin Forms

This forum is for programmers who have questions about the source code.
Post Reply
User avatar
wjstarck
Posts: 935
Joined: Tue Jul 31, 2007 7:18 am
Location: Keller, TX
Contact:

Zoomify plugin Forms

Post by wjstarck » Sun Nov 22, 2020 11:15 am

Zoom is pretty cool. :D

What is the best way to 'Zoomify' my plugin Forms?

I was able to scale a button that I added to FormProcEdit like so:

Code: Select all

			butLocal.Location = new System.Drawing.Point(387, 208);
			int xlocation = 387;
			int ylocation = 208;
			xlocation = sender.LayoutManager.Scale(xlocation);
			ylocation = sender.LayoutManager.Scale(ylocation);
			butLocal.Location = new System.Drawing.Point(xlocation, ylocation);
			butLocal.Size = new System.Drawing.Size(120, 24);
			butLocal.Size = sender.LayoutManager.ScaleSize(butLocal.Size);
Which works fine but I'm a little lost as to how to scale an entire Form in my plugin
Cheers,

Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA

User avatar
jordansparks
Site Admin
Posts: 5739
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Zoomify plugin Forms

Post by jordansparks » Sun Nov 22, 2020 3:42 pm

1. Inherit your form from FormODBase.
2. Add InitializeLayoutManager(); just below InitializeComponent(); in the constructor.
3. If you did any control movement or resizing in code, use the LayoutManager.Move for those lines.
4. Test by dragging to resize and by also dragging to a different monitor with different scale.
So the problem with the lines below is that you didn't use LayoutManager.Move. This means the layout manager doesn't know you moved them. The next time it goes to do a layout, it will move them back to where it thinks they need to be. Alternatively, you could set the size and position before you add the button. Then you would use LayoutManager.Add only on that line, not the lines before.
Jordan Sparks, DMD
http://www.opendental.com

User avatar
wjstarck
Posts: 935
Joined: Tue Jul 31, 2007 7:18 am
Location: Keller, TX
Contact:

Re: Zoomify plugin Forms

Post by wjstarck » Wed Nov 25, 2020 7:16 am

Thanks for that.

I have managed to 'Zoomify' all my forms, but the bottom of this one will get clipped off when I click Fit:

Image

Image

The form is 783 pixels tall, and is the tallest of all my forms. So should I just manually adjust the Zoom scale so that it fits (here it is at additional scale of 80 instead of 95)?

Image
Cheers,

Bill Starck, DDS
Big Idea Software, LLC
Developer, EASy(Electronic Anesthesia System) for Open Dental
817-807-1709
TX, USA

User avatar
jordansparks
Site Admin
Posts: 5739
Joined: Sun Jun 17, 2007 3:59 pm
Location: Salem, Oregon
Contact:

Re: Zoomify plugin Forms

Post by jordansparks » Sat Nov 28, 2020 8:47 am

90 is too much. Change your monitor scale in Windows first to be more reasonable, then add a little bit more inside of OD if necessary.
Jordan Sparks, DMD
http://www.opendental.com

Post Reply