Page 1 of 1

PureRESIZE requests

Posted: Fri Sep 02, 2005 12:19 pm
by eddy
previous thread : viewtopic.php?t=13349&start=15

1 - new command
PureRESIZE_HideWindowResizing(WindowNumber.l, flag.l)
- #TRUE
- #FALSE
2 - new flag for monitoring
PureRESIZE_SetWindowMonitoring( WindowNumber, #PureRESIZE_Monitoring_DontResizeIfMinimized )


Here is some infos to help you

Code: Select all

;Get state of Full-Drawing mode
Global CurrentDrawMode
Global DrawLocked
SystemParametersInfo_( #SPI_GETDRAGFULLWINDOWS, 0, @CurrentDrawMode, 0) ;-> CurrentDrawMode=1

#WM_CAPTURECHANGED=$215      

Procedure CB(Window, Message, wParam, lParam)
   Result = #PB_ProcessPureBasicEvents
    
   If Window=WindowID(0)
      Select Message
         Case #WM_NCLBUTTONDOWN
            If DrawLocked=0
               ;disable full-drawing mode 
               SystemParametersInfo_( #SPI_SETDRAGFULLWINDOWS, 0, 0, #SPIF_SENDWININICHANGE)
               Debug "disable"
               DrawLocked=1  
            EndIf
            
         Case #WM_CAPTURECHANGED
            If DrawLocked And lParam<>Window
               ;restore full-drawing mode 
               SystemParametersInfo_( #SPI_SETDRAGFULLWINDOWS, CurrentDrawMode, 0, #SPIF_SENDWININICHANGE	)           
               Debug "enable"               
               DrawLocked=0
            EndIf           
      EndSelect
   EndIf 
   
   ProcedureReturn Result 
EndProcedure
         
If OpenWindow(0,100,100,200,200,#PB_Window_SystemMenu|#PB_Window_SizeGadget,"No Drawing") And CreateGadgetList(WindowID(0))
   OpenWindow(1,400,100,200,200,#PB_Window_SystemMenu|#PB_Window_SizeGadget,"Full Drawing") And CreateGadgetList(WindowID(0))   
   SetWindowCallback(@CB())
   
   Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow
EndIf

Code: Select all


; CallBack
Procedure MyCallback(Window,Message,wParam,lParam) 
   Result = #PB_ProcessPureBasicEvents 

   If (GetWindowLong_(Window,#GWL_STYLE) & #WS_MINIMIZE) = 0
      Result = PureRESIZE_CallBack(Window, Message, wParam, lParam, Result) 
   EndIf
   
   ProcedureReturn Result 
EndProcedure 

Posted: Fri Sep 02, 2005 12:42 pm
by gnozal
Maybe for next version.

Posted: Fri Sep 02, 2005 12:56 pm
by eddy
great :D

Posted: Wed Oct 19, 2005 1:00 pm
by eddy
Finally, I solved my problem. You can forget this request.

Posted: Wed Oct 19, 2005 3:37 pm
by gnozal
Great, because I didn't know how to merge it with the existing code.

Posted: Wed Oct 24, 2007 4:23 pm
by Falko
Hello gnozal,
can you make a Function to center Windows into your lib PureResize?

Code: Select all

If OpenWindow(0, 0, 0, 270, 140, "ComboBoxGadget", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_ScreenCentered)  And CreateGadgetList(WindowID(0))
    ComboBoxGadget(0, 10, 10, 250, 100, #PB_ComboBox_Editable)
    AddGadgetItem(0, -1, "ComboBox editable...")
    ComboBoxGadget(1, 10, 40, 250, 100)
    For a = 1 To 5 : AddGadgetItem(1, -1,"ComboBox item " + Str(a)) : Next a
    SetGadgetState(1, 2)    ; wir setzen (beginnend bei 0) den dritten Eintrag als aktiven
    dummy=0
    PureRESIZE_SetWindowMaximumSize(0,500,500)
    
    Repeat
    event=WaitWindowEvent()
    ExamineDesktops()
      ResizeWindow(0,(DesktopWidth(0)-WindowWidth(0))>>1,(DesktopHeight(0)-WindowHeight(0))>>1 , #PB_Ignore, #PB_Ignore)
    Until event= #PB_Event_CloseWindow 
EndIf
Regards Falko

Posted: Wed Oct 24, 2007 5:07 pm
by gnozal
Do you expect something more than your code doesn't do ?

Posted: Wed Oct 24, 2007 5:17 pm
by Falko
My code shouldn't flicker. :roll:

[Edit]
Ok, I have found another good solution

Code: Select all

Procedure.l Callback(Window,Message,wParam,lParam)
 Result = #PB_ProcessPureBasicEvents
 Select Message
  Case  #WM_EXITSIZEMOVE
  
   ResizeWindow(0,(DesktopWidth(0)-WindowWidth(0))>>1,(DesktopHeight(0)-WindowHeight(0))>>1 , #PB_Ignore, #PB_Ignore)
   Result = 0
 EndSelect
 ProcedureReturn Result
EndProcedure

If OpenWindow(0, 0, 0, 270, 140, "ComboBoxGadget", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_ScreenCentered)  And CreateGadgetList(WindowID(0))
    ComboBoxGadget(0, 10, 10, 250, 100, #PB_ComboBox_Editable)
    AddGadgetItem(0, -1, "ComboBox editable...")
    ComboBoxGadget(1, 10, 40, 250, 100)
    For a = 1 To 5 : AddGadgetItem(1, -1,"ComboBox item " + Str(a)) : Next a
    SetGadgetState(1, 2)    ; wir setzen (beginnend bei 0) den dritten Eintrag als aktiven
    SetWindowCallback(@Callback(),0)
    PureRESIZE_SetWindowMaximumSize(0,500,500)
    
    Repeat
    event=WaitWindowEvent()
    ExamineDesktops()
     ;ResizeWindow(0,(DesktopWidth(0)-WindowWidth(0))>>1,(DesktopHeight(0)-WindowHeight(0))>>1 , #PB_Ignore, #PB_Ignore)
    Until event= #PB_Event_CloseWindow 
EndIf

Posted: Thu Oct 25, 2007 7:55 am
by gnozal
Falko wrote:My code shouldn't flicker. :roll:
Sorry, I didn't notice (I didn't try to resize the window, I thought it was about the window centering).
Falko wrote:Ok, I have found another good solution
Good.