Page 1 of 1

PanelGadget Alignment Problem

Posted: Tue Jan 15, 2013 7:48 am
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

Re: PanelGadget Alignment Problem

Posted: Tue Jan 15, 2013 4:59 pm
by Polo
That's strange, as the code looks right like you said.

Re: PanelGadget Alignment Problem

Posted: Tue Jan 15, 2013 5:32 pm
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)

Re: PanelGadget Alignment Problem

Posted: Tue Jan 15, 2013 5:51 pm
by IdeasVacuum
Measured on XP x86, the code shows an ident of 10 but PB5.00 is drawing an indent of 15.

Re: PanelGadget Alignment Problem

Posted: Tue Jan 15, 2013 11:20 pm
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

Re: PanelGadget Alignment Problem

Posted: Wed Jan 16, 2013 4:25 am
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.