Page 1 of 1

Bug with ClearGadgetItems + EditorGadget

Posted: Sun Oct 21, 2018 2:06 am
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


Re: Bug with ClearGadgetItems + EditorGadget

Posted: Sun Oct 21, 2018 5:03 am
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?

Re: Bug with ClearGadgetItems + EditorGadget

Posted: Sun Oct 21, 2018 9:07 am
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.

Re: Bug with ClearGadgetItems + EditorGadget

Posted: Mon Oct 22, 2018 1:13 am
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

Re: Bug with ClearGadgetItems + EditorGadget

Posted: Sat Feb 08, 2020 2:34 pm
by Fred
Seems OK with the current version, can anybody confirm ?

Re: Bug with ClearGadgetItems + EditorGadget

Posted: Sat Feb 08, 2020 4:27 pm
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)

Re: Bug with ClearGadgetItems + EditorGadget

Posted: Sat Feb 08, 2020 4:52 pm
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...

Re: Bug with ClearGadgetItems + EditorGadget

Posted: Sun Feb 09, 2020 1:04 pm
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.