PanelGadget Alignment Problem

You need some new stunning features ? Tell us here.
Blankname
Enthusiast
Enthusiast
Posts: 120
Joined: Sun Oct 14, 2012 9:11 am

PanelGadget Alignment Problem

Post by Blankname »

When gadgets are placed inside the PanelGadget, they are aligned to the right for some reason. The form designer is right, the generated code is right, so I think it's a internal PB problem.

Image: http://i45.tinypic.com/vxew3l.png

Code: Select all

Global Window_2

Global Panel_0, Frame3D_0, ProgressBar_0, ScrollArea_0

Procedure InitWindow_2()
  Window_2 = OpenWindow(#PB_Any, 0, 0, 600, 400, "", #PB_Window_SystemMenu)
  Panel_0 = PanelGadget(#PB_Any, 10, 10, 580, 380)
  AddGadgetItem(Panel_0, -1, "Tab 1")
  Frame3D_0 = Frame3DGadget(#PB_Any, 10, 8, 560, 90, "Frame")
  ProgressBar_0 = ProgressBarGadget(#PB_Any, 10, 108, 560, 20, 0, 0)
  ScrollArea_0 = ScrollAreaGadget(#PB_Any, 10, 138, 560, 210, 760, 410,1)
  CloseGadgetList()
  CloseGadgetList()
EndProcedure

Procedure Window_2_Events(event)
  Select event
    Case #PB_Event_CloseWindow
      ProcedureReturn #False

    Case #PB_Event_Gadget
      Select EventGadget()
      EndSelect
  EndSelect
  ProcedureReturn #True
EndProcedure

InitWindow_2()

Repeat
  event = WaitWindowEvent()
Until Window_2_Events(event) = #False
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Re: PanelGadget Alignment Problem

Post by Polo »

That's strange, as the code looks right like you said.
BorisTheOld
Enthusiast
Enthusiast
Posts: 542
Joined: Tue Apr 24, 2012 5:08 pm
Location: Ontario, Canada

Re: PanelGadget Alignment Problem

Post by BorisTheOld »

Looks to me as if it's doing exactly what to asked for.

Frame3D_0 = Frame3DGadget(#PB_Any, 10, 8, 560, 90, "Frame")
ProgressBar_0 = ProgressBarGadget(#PB_Any, 10, 108, 560, 20, 0, 0)
ScrollArea_0 = ScrollAreaGadget(#PB_Any, 10, 138, 560, 210, 760, 410,1)
For ten years Caesar ruled with an iron hand, then with a wooden foot, and finally with a piece of string.
~ Spike Milligan
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: PanelGadget Alignment Problem

Post by IdeasVacuum »

Measured on XP x86, the code shows an ident of 10 but PB5.00 is drawing an indent of 15.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Blankname
Enthusiast
Enthusiast
Posts: 120
Joined: Sun Oct 14, 2012 9:11 am

Re: PanelGadget Alignment Problem

Post by Blankname »

IdeasVacuum wrote:Measured on XP x86, the code shows an ident of 10 but PB5.00 is drawing an indent of 15.
On Windows 8 it's indenting to the right by exactly an extra 4px. Hopefully its only a overlooked bit of code, that can be easily reverted.

Submitted bug report here: http://purebasic.fr/english/viewtopic.php?f=4&t=52924
BorisTheOld
Enthusiast
Enthusiast
Posts: 542
Joined: Tue Apr 24, 2012 5:08 pm
Location: Ontario, Canada

Re: PanelGadget Alignment Problem

Post by BorisTheOld »

Remember that there's an area of padding inside the panel gadget. So the 0,0 origin is actually something like 4,4 relative to the outer edge of the panel.
For ten years Caesar ruled with an iron hand, then with a wooden foot, and finally with a piece of string.
~ Spike Milligan
Post Reply