Page 1 of 1

Window MinWidth & MinHeight values, to go with Lock resizing

Posted: Mon Aug 31, 2015 9:08 pm
by Keya
the Lock Left/Top/Bottom/Right features are brilliant as they make it soooo easy to turn a static window into a resizable one

BUT they don't prevent the WINDOW itself from getting too small, and it seems that the best place for that code would be in the ResizeGadgets() procedure that the IDE generates when Lock gadget checkboxes are set to handle resizing - actually i dont know where else I could put code to control window size seeing as that procedure is being called to handle sizing and it gets overwritten by the IDE so i cant make changes there.

So does anyone have a workaround solution in the meantime, that would allow me to prevent the window from getting too small, but at the same time allow PB's IDE to handle gadget resizing?

my code to prevent resizing is pretty simple, I just BindEvent the resizing event for my window to a procedure, and in that i get WindowWidth() and WindowHeight() like the generated code already does, and then basically "If WindowWidth < MinWindowWidth: WindowWidth = MinWindowWidth", followed by ResizeWindow

So it seems it would be very easy to add! please? huh? please? huhhuh? :D

Re: Window MinWidth & MinHeight values, to go with Lock resi

Posted: Mon Aug 31, 2015 10:23 pm
by BasicallyPure
Hi Keya,

I would think

Code: Select all

WindowBounds(#Window, MinimumWidth, MinimumHeight, MaximumWidth, MaximumHeight)
will already do what you are asking assuming you know what MinWindowWidth is or perhaps I misunderstand what you are asking.

Re: Window MinWidth & MinHeight values, to go with Lock resi

Posted: Mon Aug 31, 2015 10:52 pm
by Keya
Ah, perfect! muchas gracias
It seems it would be a natural addition to the visual designer, but perhaps its better to leave it out/how it is for flexibility