Thread: IPlug - Youlean
View Single Post
Old 04-29-2018, 09:45 AM   #410
Opcode 7
Human being with feelings
 
Join Date: Mar 2017
Posts: 45
Default

How can I make it so the window cant be resized out of the bounds of the current monitor? Or make it so the plugin is resized to the max monitor width / height on load.

cuz I have 3 monitors -- and when the plugin is on the middle main monitor, and gets resized into the second monitor -- next time the plugin loads, it gets centered in the middle monitor, and the drag-arrow in the bottom right of the plugin is out of bounds and invisible on the bottom of the screen....

Wouldn't it make sense to have some sort of functionality controlling / preventing this behavior baked in?

EDIT : Oops. Doh. I just noticed a method called "SetWindowSizeLimits"....

EDIT 2 : It's not working the way I would've expected it too...assume screenHeight and screenWidth are 1080 and 960 here...

Quote:
int screenHeight, screenWidth;
GetDesktopResolution(screenWidth, screenHeight);
GetGUIResize()->SetWindowSizeLimits(0,
/* Min Width */ GUI_WIDTH / 2,
/* Min Height */ GUI_HEIGHT / 2,
/* Max Width */ screenWidth,
/* Max Height */ screenHeight
);

Last edited by Opcode 7; 04-29-2018 at 10:04 AM.
Opcode 7 is offline   Reply With Quote