I would like to wish a additional flag to receive the absolute positions from GadgetX and GadgetY. The absolute positions are different to the relatives if you have nested gadgets inside a container. Then GadgetX and GadgetY provides you the relative position to the container and not the absolute position inside the window, which can be required to compare them with the absolute mouse position inside the window.
Maybe not a big deal for you, but very helpful for custom GUIs.
http://www.purebasic.fr/english/viewtop ... 684#218684
[Implemented] Gadget-Lib: Flag to GadgetX and GadgetY
[Implemented] Gadget-Lib: Flag to GadgetX and GadgetY
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PB4.1 - Win: MacBook black 2008 2,4 GHz, 4 GB RAM, MacOSX 10.5/VMWare/WinXP
PB4.1 - Mac: MacMini G4 1,4 GHz, 512 MB RAM, MacOSX 10.4
PB4.1 - Win: MacBook black 2008 2,4 GHz, 4 GB RAM, MacOSX 10.5/VMWare/WinXP
PB4.1 - Mac: MacMini G4 1,4 GHz, 512 MB RAM, MacOSX 10.4
Absolute coordinates?
But what yould you do, if you've got a button inside a ScrollAreagadget() ? If you scroll then, the position will be changed continiously (did I spell that word right^^).
This function would be nice, I appreciate it, although I can't think of a situaion spontaniously in which I could need it.
But what yould you do, if you've got a button inside a ScrollAreagadget() ? If you scroll then, the position will be changed continiously (did I spell that word right^^).
This function would be nice, I appreciate it, although I can't think of a situaion spontaniously in which I could need it.
PB 4.30
Code: Select all
onErrorGoto(?Fred)
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Visual designerAND51 wrote:Absolute coordinates?
This function would be nice, I appreciate it, although I can't think of a situaion spontaniously in which I could need it.

For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Sorry, I hardly use the Visual Designer. I create my GUIs manually... 

PB 4.30
Code: Select all
onErrorGoto(?Fred)
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Sorry, I didn't meant using VD, but creating a VD.AND51 wrote:Sorry, I hardly use the Visual Designer. I create my GUIs manually...
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Sorry, then I misunderstood you, gnozal.
And now: Stop the "sorrys"!
And now: Stop the "sorrys"!

PB 4.30
Code: Select all
onErrorGoto(?Fred)
@ CSAUER:
A workaround:As you see, this also works also with nested containers.
Is this what you want or do you want this natively?
A workaround:
Code: Select all
Procedure GadgetAbsX(GadgetID)
Protected pos.RECT
GetWindowRect_(GadgetID(GadgetID), @pos)
ProcedureReturn pos\left
EndProcedure
Procedure GadgetAbsY(GadgetID)
Protected pos.RECT
GetWindowRect_(GadgetID(GadgetID), @pos)
ProcedureReturn pos\top
EndProcedure
If OpenWindow(0, 0, 0, 305, 140, "ScrollAreaGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))
ScrollAreaGadget(0, 10, 10, 290,120, 375, 155, 30)
ButtonGadget (1, 10, 10, 230, 30,"Click me to get my abs. coords")
CloseGadgetList()
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
End
Case #PB_Event_Gadget
Select EventGadget()
Case 1
Debug GadgetAbsX(1)
EndSelect
EndSelect
ForEver
EndIf
Is this what you want or do you want this natively?
PB 4.30
Code: Select all
onErrorGoto(?Fred)