PureRESIZE library : gadget automatic resizing and more

All PureFORM, JaPBe, Libs and useful code maintained by gnozal

Moderator: gnozal

gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Library update
- new function PureRESIZE_SetWindowMaximumSize()
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Library update
- fixed : in some cases, some gadgets didn't resize correctly, because some #WM_SIZE events were lost in the callback (bug ?). I have added a hack to correct this.
- new : PureRESIZE_SizeWindow() to manually resize a window.

To download, see first post of thread
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Library update

Changes :
- renamed SizeWindow() to ResizeWindowNow()
- new optional parameter ParentGadget for PureRESIZE_SetGadgetResize()
By default, the gadget is resized when his window is resized. If a parent gadget is specified, the gadget is resized when the parent gadget is resized.
This is very usefull when working with container and splitter gadgets (see example file 4).

Download :
http://people.freenet.de/gnozal/PureRESIZE.zip
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Ziltch
User
User
Posts: 59
Joined: Sun Aug 03, 2003 12:05 am
Location: Australia

A big Thanks

Post by Ziltch »

This lib is such a great time saver.

Thank you for making it and sharing it !!!

I am using it in a editor that I am writting for PB/B3D and BMax.

Keep up the wonderful work.
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

new request

Post by eddy »

My purpose is to remove a flickering source.
I need a flag #PureRESIZE_Monitoring_DontDrawContent for this command:
PureRESIZE_SetWindowMonitoring( WindowNumber, #PureRESIZE_Monitoring_DontDrawContent )
Here is some infos to help you

Code: Select all

;*******************************************
; READ ME 
;uncomment this line if you dont want to force the Full-Drawing mode :
;*******************************************
;SystemParametersInfo_( #SPI_SETDRAGFULLWINDOWS, 1, 0, #SPIF_SENDWININICHANGE)
;

;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
            Debug "capture changed"
            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



Thx in advance :wink: :wink: :wink:
Last edited by eddy on Fri Sep 02, 2005 3:38 am, edited 2 times 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:

Re: new request

Post by gnozal »

eddy wrote:My purpose is to remove a flickering source.
I need a flag #PureRESIZE_Monitoring_DontDrawContent for this command:
PureRESIZE_SetWindowMonitoring( WindowNumber, #PureRESIZE_Monitoring_DontDrawContent )
Ok, I will see what I can do ; I am not sure it is compatible with the actual library code.
About the flickering : I had to add some RedrawWindow_() and other dirty tricks in the code because in some situations the window wasn't redrawn and/or some gadgets weren't resized, at least with the older PB versions.
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

Re: new request

Post by eddy »

gnozal wrote:Ok, I will see what I can do ; I am not sure it is compatible with the actual library code.
It's true, this code should be in PureRESIZE_CallBack.
You could add a new command like this :

Code: Select all

PureRESIZE_HideWindowResizing(WindowNumber.l, flag.l
- #TRUE 
- #FALSE
)
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 »

Library update

Changes :
- fixed PureRESIZE_SetWindowMaximumSize(), wich was broken since a few updates ;
- changed resize code : removed some old useless (I hope !) code; less RedrawWindow_() calls, so hopefully less flicker.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Update

No more Callback needed
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

You should make some of your work 'donation-ware' you know, considering how many of us are using your excellent tools.

Either way, happy xmas.

{How'd you remove the callback by the way? I presume you're linking your own callback in somewhere along the line! -Just being nosey! :D }
I may look like a mule, but I'm not a complete ass.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

srod wrote:You should make some of your work 'donation-ware' you know, considering how many of us are using your excellent tools.

Either way, happy xmas.
Thanks :D
srod wrote:{How'd you remove the callback by the way? I presume you're linking your own callback in somewhere along the line! -Just being nosey! :D }
Yes. Like in the two other libs (PureCOLOR and PureLVSORT), I did a lot of subclassing. I just hope it works as before :?
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
Kiffi
Addict
Addict
Posts: 1485
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Post by Kiffi »

gnozal wrote:No more Callback needed
Great! gnozal, i love you! :D

Do you have a paypal-Account?

Greetings ... Kiffi
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Post by rsts »

Quiet - genious at work.

(Many thanks gnozal)
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Kiffi wrote:Great! gnozal, i love you! :D
Thanks :lol:
Kiffi wrote:Do you have a paypal-Account?Greetings ... Kiffi
No, I don't. I don't need to make money with programming, I am not a professional programmer, it's more a hobby.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

like always, thanks a lot Gnozal for your work 8)
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
Post Reply