PureRESIZE requests

Windows specific forum
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

PureRESIZE requests

Post 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 
Last edited by eddy on Fri Sep 02, 2005 12:58 pm, edited 1 time in total.
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Maybe for next version.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Post by eddy »

great :D
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Post by eddy »

Finally, I solved my problem. You can forget this request.
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Great, because I didn't know how to merge it with the existing code.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
Falko
Enthusiast
Enthusiast
Posts: 271
Joined: Sat Oct 04, 2003 12:57 pm
Location: Germany
Contact:

Post 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
www.falko-pure.de
Win11 Pro 64-Bit, PB_6.11b1
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Do you expect something more than your code doesn't do ?
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
Falko
Enthusiast
Enthusiast
Posts: 271
Joined: Sat Oct 04, 2003 12:57 pm
Location: Germany
Contact:

Post 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
www.falko-pure.de
Win11 Pro 64-Bit, PB_6.11b1
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post 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.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Post Reply