Size limits on a resizable window?
Posted: Sat May 10, 2014 5:45 pm
Hi,
I have used PureResize() for a long time, but as the developer seems to have gone silent I'm having to write my own version so I can upgrade to the most recent version of PB. I have 90% of the functionality working OK, but having problems with restricting the maximum and minimum size of a standard resizable window. Can someone please nudge me in the right direction, please.
This is a skeleton of a general PB program... I would really like a platform independent method of imposing limits but if push comes to shove a Windows only solution would be better than nothing!
Thanks...
RichardL
I have used PureResize() for a long time, but as the developer seems to have gone silent I'm having to write my own version so I can upgrade to the most recent version of PB. I have 90% of the functionality working OK, but having problems with restricting the maximum and minimum size of a standard resizable window. Can someone please nudge me in the right direction, please.
This is a skeleton of a general PB program... I would really like a platform independent method of imposing limits but if push comes to shove a Windows only solution would be better than nothing!
Code: Select all
Procedure WinCallback(Win,msg,wParam,lParam)
Protected dx,dy
Select msg
Case #WM_SIZE
;
EndSelect
ProcedureReturn #PB_ProcessPureBasicEvents
EndProcedure
; Test code
OpenWindow(2,420,100,400,90,"Test2",#PB_Window_SystemMenu|#PB_Window_SizeGadget)
EditorGadget(3,5,5,190,20)
EditorGadget(4,200,5,195,20)
ButtonGadget(5,5,40,190,20,"Button 4")
ButtonGadget(6,340,70,50,20,"Hello")
SetWindowCallback(@WinCallback())
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindowRichardL