Bug with ClearGadgetItems + EditorGadget

Just starting out? Need help? Post your questions and find answers here.
SpiritCode
New User
New User
Posts: 2
Joined: Sat Oct 20, 2018 10:13 pm
Location: Montreal, Quebec, Canada

Bug with ClearGadgetItems + EditorGadget

Post by SpiritCode »

PB 5.62 (x64) tested on Win 7 & win 10

An EditorGadget is filled with enough elements to show scrolling bar. If I scroll using the bar and then erase all elements with Clear button (ClearGadgetItems) , the scrolling bar stays on
and everything is screwed-up if adding new elements with keyboard. Scrolling with the mouse wheel does not produce the problem

Code: Select all

  If OpenWindow(0, 0, 0, 260, 150, "ClearGadgetItems", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) 
    EditorGadget(0,10,10,240,100)
    For a = 1 To 50  
      AddGadgetItem (0, -1, "Element "+Str(a))
    Next    
    ButtonGadget(1, 10, 120, 200, 20, "Clear")
    Repeat
      Evenement = WaitWindowEvent()
      If Evenement = #PB_Event_Gadget
        If EventGadget() = 1
          ClearGadgetItems(0)
        EndIf
      EndIf
    Until Evenement = #PB_Event_CloseWindow
  EndIf

The following code shows my Work Around: Note the 2 lines before ClearGadgetItems,
I'm setting the focus on EditorGadget and bringing cursor at the end , it brings back scrolling bar to good position and solves the problem
Line after ClearGadgetItems is optional, it removes the cursor by setting focus on Clear button

Code: Select all

  If OpenWindow(0, 0, 0, 260, 150, "ClearGadgetItems", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) 
    EditorGadget(0,10,10,240,100)
    For a = 1 To 50  
      AddGadgetItem (0, -1, "Element "+Str(a))
    Next    
    ButtonGadget(1, 10, 120, 200, 20, "Clear")
    Repeat
      Evenement = WaitWindowEvent()
      If Evenement = #PB_Event_Gadget
        If EventGadget() = 1
          SetActiveGadget(0)
          AddGadgetItem (0, -1, "")
          ClearGadgetItems(0)
          SetActiveGadget(1)
        EndIf
      EndIf
    Until Evenement = #PB_Event_CloseWindow
  EndIf

Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

Re: Bug with ClearGadgetItems + EditorGadget

Post by Dude »

SpiritCode wrote:PB 5.62 (x64) tested on Win 7
No problem here with 5.62 (x64) on Win 7. Can you try it on another PC, to rule yours out?
User avatar
Lord
Addict
Addict
Posts: 847
Joined: Tue May 26, 2009 2:11 pm

Re: Bug with ClearGadgetItems + EditorGadget

Post by Lord »

SpiritCode wrote:PB 5.62 (x64) tested on Win 7
Tested first code here on Win7:
PB 5.62(x64) -> Scrollbar stays
PB 5.70B2(x64) -> Scrollbar disappears
PB 5.60(x64) -> Scrollbar disappears

So it seems to be an PB5.62 related problem.
Image
SpiritCode
New User
New User
Posts: 2
Joined: Sat Oct 20, 2018 10:13 pm
Location: Montreal, Quebec, Canada

Re: Bug with ClearGadgetItems + EditorGadget

Post by SpiritCode »

Dude wrote:
SpiritCode wrote:PB 5.62 (x64) tested on Win 7
No problem here with 5.62 (x64) on Win 7. Can you try it on another PC, to rule yours out?
I tried on 2 different PCs, one with Win7 and other with Win 10
You have to try it several times, I have seen 1 or 2 shots working but most of the time it does'nt
If I clear editor without moving srcollingbar it does dissapear, but everytime I scroll first, bar stays ON
I just tried with PB5.60(X64) , problem still there
Fred
Administrator
Administrator
Posts: 16619
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Bug with ClearGadgetItems + EditorGadget

Post by Fred »

Seems OK with the current version, can anybody confirm ?
User avatar
blueb
Addict
Addict
Posts: 1041
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

Re: Bug with ClearGadgetItems + EditorGadget

Post by blueb »

Using SpiritCode's first example....

If I 'DO NOT SCROLL' and press the Clear button there is no problem. (Scroll bars disappear)
But... If I scroll up and down, then press Clear... the problem shows itself. (Scroll bars remain)

HTH

Win 10 Pro 64-bit and PB 5.72 LTS Beta 1 (x64)
- It was too lonely at the top.

System : PB 6.10 Beta 9 (x64) and Win Pro 11 (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
User avatar
DK_PETER
Addict
Addict
Posts: 898
Joined: Sat Feb 19, 2011 10:06 am
Location: Denmark
Contact:

Re: Bug with ClearGadgetItems + EditorGadget

Post by DK_PETER »

Working fine here on Window 8.1 and 10 (pro) - both with all updates installed.
Tested with 5.62 and 5.71 without any hints of problems.
Edit: This is related to Windows visual performance.
If you adjust for best visual appearance (visual effects settings)
the scroll bar doesn't disappear.
If you adjust for best performance
the scrollbar disappears as expected...
Last edited by DK_PETER on Sun Feb 09, 2020 5:19 pm, edited 1 time in total.
Current configurations:
Ubuntu 20.04/64 bit - Window 10 64 bit
Intel 6800K, GeForce Gtx 1060, 32 gb ram.
Amd Ryzen 9 5950X, GeForce 3070, 128 gb ram.
User avatar
Lord
Addict
Addict
Posts: 847
Joined: Tue May 26, 2009 2:11 pm

Re: Bug with ClearGadgetItems + EditorGadget

Post by Lord »

blueb wrote:Using SpiritCode's first example....

If I 'DO NOT SCROLL' and press the Clear button there is no problem. (Scroll bars disappear)
But... If I scroll up and down, then press Clear... the problem shows itself. (Scroll bars remain)
...
Same here on Win7(x64)Ultimate with PB5.72b1(x64)
After scrolling and pressing "Clear" a ghosty scrollbar (no function) remains.
Image
Post Reply