Page 2 of 2

Posted: Sun Sep 30, 2007 6:50 pm
by QuimV
:D
Good job, as usual.
Very useful.
Thanks for sharing.

Posted: Sun Sep 30, 2007 8:22 pm
by srod
You're welcome QuimV. :)

Posted: Sun Sep 30, 2007 9:05 pm
by byo
Thanks, srod.
That's very useful. :mrgreen:

Posted: Sun Oct 07, 2007 6:52 pm
by Ollivier
2srod

Hi! I often download your source and I find sometimes algo I needed.

So, as I never say it :

THANKS SROD ! :D Very much.

Posted: Sun Oct 07, 2007 7:08 pm
by srod
You're welcome. :)

Posted: Sun May 18, 2008 5:04 pm
by Amnesty
Hi srod,

I ve used your great little lib for a long time, but now I ve got a little problem, and I m not sure, If I m doing something wrong.

The following code shows my problem, as you can see on the second panel, the resizing doesnt work.

Am I doing something wrong ?

regards

Amnesty

Code: Select all

XIncludeFile "nxTools_Resize.pbi"

If OpenWindow(0, 0, 0, 322, 220, "PanelGadget", #PB_Window_SizeGadget    | #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0))
  PanelGadget     (0, 8, 8, 306, 203)
  AddGadgetItem (0, -1, "Works fine!")
  ListViewGadget(1, 5, 5, 288, 163)
  AddGadgetItem (0, -1,"Hmmm....")
  ListViewGadget(2, 5, 5, 288, 163)
  CloseGadgetList()
  nxTools_SetResize(0, #nxResize_Anchorall)
  nxTools_SetResize(1, #nxResize_Anchorall)
  nxTools_SetResize(2, #nxResize_Anchorall)
  Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf


Posted: Sun May 18, 2008 5:18 pm
by srod
Ah yes, I see what is happening and I think I can guess why. Not sure I can do anything about it though.

Hang on.......

Posted: Sun May 18, 2008 5:50 pm
by srod
As soon as you issue the nxTools_SetResize() command, the library looks at the gadget in question and it's parent and records the sizes of the margins around the gadget etc.

The problem with your code is that the panel in the second tab has a zero width and height at the time you issue the nxTools_SetResize(2,...) command which causes the margins to go into 'meltdown'. :)

The fix is simple however. Force the tab to show briefly which causes PB to resize the inner panel which is the parent of the control in question - do this before using nxTools_SetResize().

Code: Select all

XIncludeFile "nxTools.pbi"


If OpenWindow(0, 0, 0, 322, 220, "PanelGadget", #PB_Window_SizeGadget    | #PB_Window_SystemMenu | #PB_Window_ScreenCentered) And CreateGadgetList(WindowID(0)) 
  PanelGadget     (0, 8, 8, 306, 203) 
  AddGadgetItem (0, -1, "Works fine!") 
  ListViewGadget(1, 5, 5, 288, 163) 
  AddGadgetItem (0, -1,"Hmmm....") 
  ListViewGadget(2, 5, 5, 288, 163) 
  CloseGadgetList() 
 
  nxTools_SetResize(0, #nxResize_Anchorall) 
  nxTools_SetResize(1, #nxResize_Anchorall) 

  SetGadgetState(0,1)
  SetGadgetState(0,0)
  nxTools_SetResize(2, #nxResize_Anchorall) 
  Repeat
  Until WaitWindowEvent() = #PB_Event_CloseWindow 
EndIf 

Posted: Sun May 18, 2008 10:20 pm
by Amnesty
Works fine.

Thank you very much for your fast help.

Posted: Mon May 19, 2008 8:50 am
by srod
You're welcome. :)