Window gets horizontal scroll bar

Just starting out? Need help? Post your questions and find answers here.
User avatar
marcoagpinto
Addict
Addict
Posts: 1076
Joined: Sun Mar 10, 2013 3:01 pm
Location: Portugal
Contact:

Window gets horizontal scroll bar

Post 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
BarryG
Addict
Addict
Posts: 4218
Joined: Thu Apr 18, 2019 8:17 am

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

Post 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
User avatar
marcoagpinto
Addict
Addict
Posts: 1076
Joined: Sun Mar 10, 2013 3:01 pm
Location: Portugal
Contact:

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

Post 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:
User avatar
marcoagpinto
Addict
Addict
Posts: 1076
Joined: Sun Mar 10, 2013 3:01 pm
Location: Portugal
Contact:

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

Post by marcoagpinto »

If it is a bug, could a moderator move the post to the bugs section?

Thanks!
User avatar
JHPJHP
Addict
Addict
Posts: 2265
Joined: Sat Oct 09, 2010 3:47 am

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

Post 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

If you're not investing in yourself, you're falling behind.

My PureBasic StuffFREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
User avatar
marcoagpinto
Addict
Addict
Posts: 1076
Joined: Sun Mar 10, 2013 3:01 pm
Location: Portugal
Contact:

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

Post 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:
User avatar
Piero
Addict
Addict
Posts: 1040
Joined: Sat Apr 29, 2023 6:04 pm
Location: Italy

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

Post 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:
Post Reply