[Implemented] SetMinMaxWindow()

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

[Implemented] SetMinMaxWindow()

Post by Flype »

Hello Fred,

One command which could be useful :
SetMinMaxWindow(#Window,MinWidth.l,MinHeight.l,MaxWidth.l,MaxHeight)


This could be realized in the same way i think than the StatusBar auto resizing implemented in PB3.90
You said that now the statusbar is resized automatically inside the windowcallback. What about doing the same for minmax ?

Code: Select all

OpenWindow(0,50,100,400,300,#PB_Window_SystemMenu|#PB_Window_SizeGadget,"Minimum Size") 
CreateStatusBar(0,WindowID()) 

Procedure MyWindowCallBack(WindowID,Message,wParam,lParam) 
  result = #PB_ProcessPureBasicEvents 
  If Message=#WM_GETMINMAXINFO 
      *pMinMax.MINMAXINFO = lParam 
      *pMinMax\ptMinTrackSize\x=100 
      *pMinMax\ptMinTrackSize\y=300 
      *pMinMax\ptMaxTrackSize\x=600 
      *pMinMax\ptMaxTrackSize\y=300 
      result = 0 
  EndIf 
  ProcedureReturn result 
EndProcedure 

SetWindowCallback(@MyWindowCallBack()) 

Repeat 
Until WaitWindowEvent() = #PB_Event_CloseWindow
Last edited by Flype on Sat May 01, 2004 5:10 pm, edited 1 time in total.
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

perhaps because this is a Windows trick and not a linux nor amiga one
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
syntax error
User
User
Posts: 93
Joined: Tue Jan 13, 2004 5:11 am
Location: Midlands , UK

Post by syntax error »

I know the Amiga has window sizing limits.
Under Amiga BlitzBasicII there is this command:

SizeLimits Min Width,Min Height,Max Width,Max Height

Not sure about Linux. I agree that such a command would be welcome.
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

Post by nco2k »

fred, any plans for this one?

c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
Post Reply