PureRESIZE library : gadget automatic resizing and more
Moderator: gnozal
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
New version compiled with PB4.40 BETA 1 : http://freenet-homepage.de/gnozal/PureRESIZE_440.zip
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Re: PureRESIZE library : gadget automatic resizing and more
Hi Gnozal, I think I found a bug.
Look at this code:
When I lock the SpinGadget at the right side it will get a bit smaller after resizing the window.
I hope you can fix this.
Look at this code:
Code: Select all
If OpenWindow(0, #PB_Ignore, #PB_Ignore, 100, 100, "PureRESIZE Test", #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_ScreenCentered)
SpinGadget(1, 10, 10, 80, 30, 1, 10, #PB_Spin_Numeric)
PureRESIZE_SetGadgetResize(1, 1, 1, 1, 0)
Repeat: Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
I hope you can fix this.
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: PureRESIZE library : gadget automatic resizing and more
Confirmed.c4s wrote:When I lock the SpinGadget at the right side it will get a bit smaller after resizing the window.
I hope you can fix this.
It's because GetWindowRect_() doesn't report the full width for GadgetID(SpinGadget).
Easy workaround for now : call PureRESIZE_ResizeWindowNow() once before the event-loop and it should work as expected.
Code: Select all
If OpenWindow(0, #PB_Ignore, #PB_Ignore, 100, 100, "PureRESIZE Test", #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_ScreenCentered)
SpinGadget(1, 10, 10, 80, 30, 1, 10, #PB_Spin_Numeric)
PureRESIZE_SetGadgetResize(1, 1, 1, 1, 0)
PureRESIZE_ResizeWindowNow(0)
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Re: PureRESIZE library : gadget automatic resizing and more
Ok, normally I unhide the window and then I already have the same as PureRESIZE_ResizeWindowNow().
So do you think I should make the SpinGadget a bit wider?
And by the way: I tried to use the following code to find out how much I should widen the SpinGadget but it says 80 instead of 65.
I'm confused..
So do you think I should make the SpinGadget a bit wider?
And by the way: I tried to use the following code to find out how much I should widen the SpinGadget but it says 80 instead of 65.
Code: Select all
GetWindowRect_(GadgetID(1), @r11.RECT)
GetWindowRect_(GetWindow_(GadgetID(1), #GW_HWNDNEXT), @r12.RECT)
Debug r12\right - r11\left
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: PureRESIZE library : gadget automatic resizing and more
This should work :
EDIT: I have updated PureRESIZE for PB4.40. Could you try it ?
Code: Select all
If OpenWindow(0, #PB_Ignore, #PB_Ignore, 100, 100, "PureRESIZE Test", #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_ScreenCentered)
SpinGadget(1, 10, 10, 80, 30, 1, 10, #PB_Spin_Numeric)
GetWindowRect_(GetWindow_(GadgetID(1), #GW_HWNDNEXT), @r12.RECT)
ResizeGadget(1, 10, 10, 80 + r12\right - r12\left, 30)
PureRESIZE_SetGadgetResize(1, 1, 1, 1, 0)
;
PureRESIZE_ResizeWindowNow(0)
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Re: PureRESIZE library : gadget automatic resizing and more
Looks good - thank you Gnozal!
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
-
- Enthusiast
- Posts: 157
- Joined: Tue Feb 13, 2007 6:16 pm
- Location: Romania
- Contact:
Re: PureRESIZE library : gadget automatic resizing and more
@gnozal in 4.4 beta 5 windows 7 x64 i get a polink error corrupt library pureresize_lib_6.lib
Registered user of PureBasic
Re: PureRESIZE library : gadget automatic resizing and more
You cannot use a 32-bit user-lib with a 64-bit exe.
I may look like a mule, but I'm not a complete ass.
PureRESIZE library : newby question
I have PureBasic 4.41, jaPBe 3.9.12.817 and downloaded http://freenet-homepage.de/gnozal/PureRESIZE_440.zip and installed the executable. I was hoping this would help me keep a text gadget in the center of the window while the user resizes the window. There is no mention of any "PureRESIZE_" functions in this file at all. I cannot find any file on this in my jaPBe\help folder either. Can I please get some help with some simple code that I can use to accomplish my goal.
The Include file I got (ResizeGadgets.pbi) starts out:
;info: RS_ResizeGadgets (Automatically Resize PureBasic Gadgets)
;
; To use:
; - Include this source file.
; - Call RS_Register ONCE for EACH Gadget to be resized, specifying side locks.
; - Call RS_Resize in the event loop, specifying Event ID and Event Window ID.
;
What are "side locks" and what do they do? Could you please illustrate RS_Unregister() and most importantly RS_Resize(). I don't understand what you mean by the Event ID, where do you get it from? A small working program where all I have to do is set the XIncludeFile line would be very nice and probably very informative.
The Include file I got (ResizeGadgets.pbi) starts out:
;info: RS_ResizeGadgets (Automatically Resize PureBasic Gadgets)
;
; To use:
; - Include this source file.
; - Call RS_Register ONCE for EACH Gadget to be resized, specifying side locks.
; - Call RS_Resize in the event loop, specifying Event ID and Event Window ID.
;
What are "side locks" and what do they do? Could you please illustrate RS_Unregister() and most importantly RS_Resize(). I don't understand what you mean by the Event ID, where do you get it from? A small working program where all I have to do is set the XIncludeFile line would be very nice and probably very informative.
Last edited by Magus1011 on Mon Mar 01, 2010 3:44 pm, edited 2 times in total.
--
Regards,
Magus.
Regards,
Magus.
Re: PureRESIZE library : gadget automatic resizing and more
Is there no CHM help manual included? Check your PB installation \Help folder. You will probably also find some demo programs installed somewhere in the PB installation folder.
There is some help on the appropriate webpage : http://freenet-homepage.de/gnozal/PureRESIZE_.htm
There is some help on the appropriate webpage : http://freenet-homepage.de/gnozal/PureRESIZE_.htm
I may look like a mule, but I'm not a complete ass.
RE:PureRESIZE library : newby question
It was a permissions problem on Windows 7, I think. After installing as administrator I now have a PureRESIZE.chm where I didn't have one before and the same with the PureRESIZE in PureBasic\PureLibraries\UserLibraries.srod wrote:Is there no CHM help manual included? Check your PB installation \Help folder. You will probably also find some demo programs installed somewhere in the PB installation folder.
There is some help on the appropriate webpage : http://freenet-homepage.de/gnozal/PureRESIZE_.htm
Thanks for the reply. Expect more questions as I figure this out.
--
Regards,
Magus.
Regards,
Magus.
PureRESIZE library : Another Newby question
I want the TextGadget to start in the center of the window and stay there while the user resizes the window. This is the code I have so far:
How do I fix this so it does what I want
Code: Select all
;
Flags = #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget
Flags = Flags|#PB_Window_TitleBar
#TextItem = 1
Text$ = "Hello, World"
;
OpenWindow(1,100,100,200,180,"Test1",Flags)
TextGadget(#TextItem, 0, 0, 100, 15, Text$, #PB_Text_Center|#PB_Text_Border)
PureRESIZE_CenterGadget(#TextItem, 1, 1)
;
exit = #False
While exit = #False
Event = WaitWindowEvent()
Select Event
Case #PB_Event_CloseWindow
exit = #True
Case #PB_Event_Gadget
GadgetNumber = EventGadget()
EndSelect
Wend
End
--
Regards,
Magus.
Regards,
Magus.
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: PureRESIZE library : gadget automatic resizing and more
PureRESIZE.chm -> PureRESIZE_CenterGadget() topic wrote:Syntax
PureRESIZE_CenterGadget(GadgetNumber.l, Horizontal.l, Vertical.l)
Description
Enables automatic centering for a gadget.
Parameters :
- GadgetNumber : valid Purebasic gadget number ; it may also be a valid Windows control handle, this allows to use the library with 'API gadgets' created with CreateWindowEx_().
- Horizontal : enables horizontal centering
- Vertical : enables vertical centering
Note :
This function must be called after PureRESIZE_SetGadgetResize().
Code: Select all
Enumeration
#Window_0
EndEnumeration
Enumeration
#Button_0
EndEnumeration
Procedure OpenWindow_Window_0()
If OpenWindow(#Window_0, 452, 199, 400, 400, "Window_0", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar)
ButtonGadget(#Button_0, 81, 327, 238, 48, "Gadget_0")
PureRESIZE_SetGadgetResize(#Button_0, 0, 0, 0, 1)
PureRESIZE_CenterGadget(#Button_0, 1, 0)
EndIf
EndProcedure
OpenWindow_Window_0()
Repeat
Event = WaitWindowEvent()
Select Event
Case #PB_Event_CloseWindow
EventWindow = EventWindow()
If EventWindow = #Window_0
CloseWindow(#Window_0)
Break
EndIf
EndSelect
ForEver
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Re: PureRESIZE library : Another newby question
Thanks very much Gnozal.
That example proved I had permission problems and not a bad download. I have to reinstall jaPBe after my disk crash since it depends on the Windows Registry and the %PureBasic%\Help and %PureBasic%\PureLibraries\UserLibraries which were on the disk that crashed. Being a newby I didn't realize that. I had it on another disk where I keep programs that don't use the Registry. Yes, it was on the %PATH%
Again, thanks for the help
That example proved I had permission problems and not a bad download. I have to reinstall jaPBe after my disk crash since it depends on the Windows Registry and the %PureBasic%\Help and %PureBasic%\PureLibraries\UserLibraries which were on the disk that crashed. Being a newby I didn't realize that. I had it on another disk where I keep programs that don't use the Registry. Yes, it was on the %PATH%
Again, thanks for the help
--
Regards,
Magus.
Regards,
Magus.