Page 1 sur 1

ResizeWindow

Publié : lun. 27/mars/2006 23:17
par Progi1984
Bonjour (enfin Bonne nuit),

Voilà, j'ai une fenetre redimensionnable. Mais je voudrais la bloquer de facon qu'elle n'a pas en dessous d'une certaine taille. Le problème est que si la souris va vers ces tailles inférieurs non autorisés, cela fait clignoter ma fenetre. Voici le code que j'utilise pour redimensionner ma fenetre

Code : Tout sélectionner

  If WindowHeight(#Window_0) >=600 And WindowWidth(#Window_0)>=800
    ResizeWindow(#Window_0,#PB_Ignore,#PB_Ignore,WindowWidth(#Window_0),WindowHeight(#Window_0))
    ResizeGadget(#Tree_0,10,60,WindowWidth(#Window_0)-470,WindowHeight(#Window_0)-90)
    ResizeGadget(#Panel0,GadgetX(#Tree_0)+GadgetWidth(#Tree_0)+10,60,WindowWidth(#Window_0)-GadgetWidth(#Tree_0)-30,WindowHeight(#Window_0)-90)
    ResizeGadget(#Panel1,GadgetX(#Tree_0)+GadgetWidth(#Tree_0)+10,60,WindowWidth(#Window_0)-GadgetWidth(#Tree_0)-30,WindowHeight(#Window_0)-90)
  Else
    ResizeWindow(#Window_0,#PB_Ignore,#PB_Ignore,800,600)
    ResizeGadget(#Tree_0,10, 60, 330, 510)
    ResizeGadget(#Panel0,350,60,440,500)
    ResizeGadget(#Panel1,350,60,440,500)
  EndIf  
ProcedureReturn 

Publié : lun. 27/mars/2006 23:21
par Progi1984
Merci les angalis

Code : Tout sélectionner

Procedure WndProc(WindowID, Message, wParam, lParam)
Result = #PB_ProcessPureBasicEvents
*pMinMax.MINMAXINFO
If Message = #WM_GETMINMAXINFO
   *pMinMax = lParam
   *pMinMax\ptMinTrackSize\x = 200
   *pMinMax\ptMinTrackSize\y = 500
   ; Force a minimum window size for our application.
   Result = 0
   ; And clear the messages
EndIf
ProcedureReturn Result
EndProcedure

OpenWindow(0,0,0,640,480,"",#PB_Window_SystemMenu|#PB_Window_SizeGadget)
SetWindowCallback(@WndProc())
Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow

Publié : mar. 28/mars/2006 12:29
par lionel_om
Dr Dri avait fait un code à ce sujet.
De même les positions de la fenêtre peuvent être vérouillées...

Publié : mar. 28/mars/2006 14:53
par Dr. Dri
C'était à titre d'exemple sur le sous-classement si je me rapelle bien ^^

Dri ;)