Page 1 of 1

Window gets horizontal scroll bar

Posted: Tue Oct 14, 2025 3:47 am
by marcoagpinto
Tested on Windows 11:

Code: Select all

#WINDOW_MAIN=1
#WINDOW_ADD_EDIT=2
#WINDOW_FLAGS_DESCRIPTION=3

OpenWindow(#WINDOW_MAIN,0,0,100,100,"Main window",#PB_Window_WindowCentered)

w=(1024-800)+(800-640)+640-10
h=200-50-20-20+100+100+200-30-30-30+10+120+10
OpenWindow(#WINDOW_ADD_EDIT,0,0,w,h,"Add a word",#PB_Window_WindowCentered,WindowID(#WINDOW_MAIN))
DisableWindow(#WINDOW_MAIN,#True)

w=WindowWidth(#WINDOW_ADD_EDIT)/2
h=WindowHeight(#WINDOW_ADD_EDIT)
x=WindowX(#WINDOW_ADD_EDIT)+w
y=WindowY(#WINDOW_ADD_EDIT)
OpenWindow(#WINDOW_FLAGS_DESCRIPTION,x,y,w,h,"Display flags description",WindowID(#WINDOW_ADD_EDIT))

Delay(10000)

Image

Re: [PB6.30b3] [bug?] Window gets horizontal scroll bar

Posted: Tue Oct 14, 2025 3:54 am
by BarryG
Confirmed here on Win 11, too. It's because of the ParentID() flag, because if you remove it then you get no horizontal scroll bar (see below).

BTW, I'm using 6.10 so it's not a new 6.30 beta bug.

Code: Select all

#WINDOW_MAIN=1
#WINDOW_ADD_EDIT=2
#WINDOW_FLAGS_DESCRIPTION=3

OpenWindow(#WINDOW_MAIN,0,0,100,100,"Main window",#PB_Window_WindowCentered)

w=(1024-800)+(800-640)+640-10
h=200-50-20-20+100+100+200-30-30-30+10+120+10
OpenWindow(#WINDOW_ADD_EDIT,0,0,w,h,"Add a word",#PB_Window_WindowCentered,WindowID(#WINDOW_MAIN))
DisableWindow(#WINDOW_MAIN,#True)

w=WindowWidth(#WINDOW_ADD_EDIT)/2
h=WindowHeight(#WINDOW_ADD_EDIT)
x=WindowX(#WINDOW_ADD_EDIT)+w
y=WindowY(#WINDOW_ADD_EDIT)
OpenWindow(#WINDOW_FLAGS_DESCRIPTION,x,y,w,h,"Display flags description");,WindowID(#WINDOW_ADD_EDIT))

Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow

Re: [PB6.30b3] [bug?] Window gets horizontal scroll bar

Posted: Tue Oct 14, 2025 4:01 am
by marcoagpinto
Buaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

and if I:

Code: Select all

  
  ; The editor gadget
  EditorGadget(#WINDOW_FLAGS_DESCRIPTION_EDITOR_GADGET,10,10,100,100,#PB_Editor_ReadOnly)
It opens in the parent window and not in the window I have just opened.

I am so sad.

:cry: :cry: :cry: :cry:

Re: [PB6.30b3] [bug?] Window gets horizontal scroll bar

Posted: Tue Oct 14, 2025 2:28 pm
by marcoagpinto
If it is a bug, could a moderator move the post to the bugs section?

Thanks!

Re: [PB6.30b3] [bug?] Window gets horizontal scroll bar

Posted: Tue Oct 14, 2025 2:57 pm
by JHPJHP
Hi marcoagpinto,

Sometimes you just need to slow down, take a breath and review your code.

You're missing the Flags parameter before the ParentID parameter.
• Also resolves your EditorGadget hiccup; don't be sad :mrgreen:

Code: Select all

#WINDOW_MAIN=1
#WINDOW_ADD_EDIT=2
#WINDOW_FLAGS_DESCRIPTION=3
#WINDOW_FLAGS_DESCRIPTION_EDITOR_GADGET=4

OpenWindow(#WINDOW_MAIN,0,0,100,100,"Main window",#PB_Window_SystemMenu|#PB_Window_WindowCentered)
w=(1024-800)+(800-640)+640-10
h=200-50-20-20+100+100+200-30-30-30+10+120+10
OpenWindow(#WINDOW_ADD_EDIT,0,0,w,h,"Add a word",#PB_Window_SystemMenu|#PB_Window_WindowCentered,WindowID(#WINDOW_MAIN))
w=WindowWidth(#WINDOW_ADD_EDIT)/2
h=WindowHeight(#WINDOW_ADD_EDIT)
x=WindowX(#WINDOW_ADD_EDIT)+w
y=WindowY(#WINDOW_ADD_EDIT)
OpenWindow(#WINDOW_FLAGS_DESCRIPTION,x,y,w,h,"Display flags description",#PB_Window_SystemMenu,WindowID(#WINDOW_ADD_EDIT))
OldGadgetList = UseGadgetList(WindowID(#WINDOW_FLAGS_DESCRIPTION))
EditorGadget(#WINDOW_FLAGS_DESCRIPTION_EDITOR_GADGET,10,10,100,100,#PB_Editor_ReadOnly)
UseGadgetList(OldGadgetList)

Repeat
  Event = WaitWindowEvent()
  
  Select Event
    Case #PB_Event_CloseWindow
      Select EventWindow()
        Case #WINDOW_MAIN : Break
        Case #WINDOW_ADD_EDIT : CloseWindow(#WINDOW_ADD_EDIT)
        Case #WINDOW_FLAGS_DESCRIPTION : CloseWindow(#WINDOW_FLAGS_DESCRIPTION)
      EndSelect
  EndSelect
ForEver

Re: [PB6.30b3] [bug?] Window gets horizontal scroll bar

Posted: Tue Oct 14, 2025 5:43 pm
by marcoagpinto
JHPJHP wrote: Tue Oct 14, 2025 2:57 pm Hi marcoagpinto,

Sometimes you just need to slow down, take a breath and review your code.

You're missing the Flags parameter before the ParentID parameter.
• Also resolves your EditorGadget hiccup; don't be sad :mrgreen:

Code: Select all

#WINDOW_MAIN=1
#WINDOW_ADD_EDIT=2
#WINDOW_FLAGS_DESCRIPTION=3
#WINDOW_FLAGS_DESCRIPTION_EDITOR_GADGET=4

OpenWindow(#WINDOW_MAIN,0,0,100,100,"Main window",#PB_Window_SystemMenu|#PB_Window_WindowCentered)
w=(1024-800)+(800-640)+640-10
h=200-50-20-20+100+100+200-30-30-30+10+120+10
OpenWindow(#WINDOW_ADD_EDIT,0,0,w,h,"Add a word",#PB_Window_SystemMenu|#PB_Window_WindowCentered,WindowID(#WINDOW_MAIN))
w=WindowWidth(#WINDOW_ADD_EDIT)/2
h=WindowHeight(#WINDOW_ADD_EDIT)
x=WindowX(#WINDOW_ADD_EDIT)+w
y=WindowY(#WINDOW_ADD_EDIT)
OpenWindow(#WINDOW_FLAGS_DESCRIPTION,x,y,w,h,"Display flags description",#PB_Window_SystemMenu,WindowID(#WINDOW_ADD_EDIT))
OldGadgetList = UseGadgetList(WindowID(#WINDOW_FLAGS_DESCRIPTION))
EditorGadget(#WINDOW_FLAGS_DESCRIPTION_EDITOR_GADGET,10,10,100,100,#PB_Editor_ReadOnly)
UseGadgetList(OldGadgetList)

Repeat
  Event = WaitWindowEvent()
  
  Select Event
    Case #PB_Event_CloseWindow
      Select EventWindow()
        Case #WINDOW_MAIN : Break
        Case #WINDOW_ADD_EDIT : CloseWindow(#WINDOW_ADD_EDIT)
        Case #WINDOW_FLAGS_DESCRIPTION : CloseWindow(#WINDOW_FLAGS_DESCRIPTION)
      EndSelect
  EndSelect
ForEver
I am always so eager, always seeking quick perfection.

:twisted:

Re: [PB6.30b3] [bug?] Window gets horizontal scroll bar

Posted: Fri Oct 17, 2025 1:56 pm
by Piero
marcoagpinto wrote: Tue Oct 14, 2025 5:43 pmI am always so eager, always seeking quick perfection.
:twisted:
Qual'è cara, fica mansinho; desde sempre, nenhuma perfeição chega de repente :twisted: :lol: