EditorGadget vs ComboBoxGadget - Bug (Mouse pointer disappears)

Post bugreports for the Windows version here
User avatar
ccode_new
User
User
Posts: 21
Joined: Sat Jul 30, 2022 10:39 am

EditorGadget vs ComboBoxGadget - Bug (Mouse pointer disappears)

Post by ccode_new »

When the ComboBoxGadget() is open, the mouse pointer over the gadget disappears. Error occurs with all ComboBoxGadget().

Example:

Code: Select all

Procedure AlertThread(Parameter)

  Repeat
  If IsGadget(0)
    AddGadgetItem(0, -1, "Zeile "+Str(Date())) : 
    Delay(300)
  EndIf  
  ForEver

EndProcedure

If OpenWindow(0, 0, 0, 322, 250, "EditorGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  EditorGadget(0, 8, 8, 306, 133)
  ComboBoxGadget(1, 20, 200, 100, 20)
  AddGadgetItem(1, -1, "add 1")
  AddGadgetItem(1, -1, "add 2")
  CreateThread(@AlertThread(), 0)
  Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
This error occurs under version 5.73 or 6.xx.
It works with version 5.72.

Post in German forum: https://www.purebasic.fr/german/viewtopic.php?t=32919
BarryG
Addict
Addict
Posts: 4168
Joined: Thu Apr 18, 2019 8:17 am

Re: EditorGadget vs ComboBoxGadget - Bug (Mouse pointer disappears)

Post by BarryG »

Confirmed. It also happens without using a thread:

Code: Select all

If OpenWindow(0, 400, 300, 322, 250, "EditorGadget", #PB_Window_SystemMenu)
  EditorGadget(0, 8, 8, 306, 133)
  ComboBoxGadget(1, 20, 200, 100, 20)
  AddGadgetItem(1, -1, "add 1")
  AddGadgetItem(1, -1, "add 2")
  AddWindowTimer(0, 0, 300)
  Repeat
    ev = WaitWindowEvent()
    If ev = #PB_Event_Timer
      AddGadgetItem(0, -1, "Zeile "+Str(Date()))
    EndIf
  Until ev = #PB_Event_CloseWindow
EndIf
User avatar
STARGÅTE
Addict
Addict
Posts: 2228
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: EditorGadget vs ComboBoxGadget - Bug (Mouse pointer disappears)

Post by STARGÅTE »

Here the code without thread:

Code: Select all

If OpenWindow(0, 0, 0, 322, 250, "EditorGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  AddWindowTimer(0, 0, 300)
  EditorGadget(0, 8, 8, 306, 133)
  ComboBoxGadget(1, 20, 200, 100, 20)
  AddGadgetItem(1, -1, "add 1")
  AddGadgetItem(1, -1, "add 2")
  Repeat
  	Select WaitWindowEvent()
  		Case #PB_Event_CloseWindow
  			Break
  		Case #PB_Event_Timer
  			AddGadgetItem(0, -1, "Zeile "+Str(Date()))
  	EndSelect
  ForEver 
EndIf
I'm not sure if this is a bug.
It is a normal feature of the editor gadget that the mouse cursor disappears when you type text into it.
It is same in classic applications like MS Word.
When you send text with AddGadgetItem() this has the same effect.
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
BarryG
Addict
Addict
Posts: 4168
Joined: Thu Apr 18, 2019 8:17 am

Re: EditorGadget vs ComboBoxGadget - Bug (Mouse pointer disappears)

Post by BarryG »

Beat you to it, StarGate! Hehe.
User avatar
ccode_new
User
User
Posts: 21
Joined: Sat Jul 30, 2022 10:39 am

Re: EditorGadget vs ComboBoxGadget - Bug (Mouse pointer disappears)

Post by ccode_new »

STARGÅTE wrote: Sat Feb 25, 2023 8:39 am I'm not sure if this is a bug.
It is a normal feature of the editor gadget that the mouse cursor disappears when you type text into it.
It is same in classic applications like MS Word.
When you send text with AddGadgetItem() this has the same effect.
But that is no explanation why it works in older PureBasic versions and also on other operating systems using "Wine/ CrossOver".

>>
It also seems to work on Windows 7.

Only under Windows 10/11 there seems to be problems.

Could these problems be related to a newer system library? (for example "msftedit.dll")

>>
Oddly enough, that works too.
->

Code: Select all

#CHANGE_DELAY = 1000

Procedure AddGadgetItem2(id.i, txt.s)
  Static txt2.s
  txt2 + txt + ~"\n"
  SetGadgetText(id, txt2)
EndProcedure

If OpenWindow(0, 0, 0, 322, 250, "EditorGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  AddWindowTimer(0, 0, #CHANGE_DELAY)
  EditorGadget(0, 8, 8, 306, 133)
  ComboBoxGadget(1, 20, 200, 100, 20)
  AddGadgetItem(1, -1, "add 1")
  AddGadgetItem(1, -1, "add 2")
  Repeat
  	Select WaitWindowEvent()
  		Case #PB_Event_CloseWindow
  			Break
  		Case #PB_Event_Timer
  		  ;AddGadgetItem(0, -1, "Zeile "+Str(Date()))
  		  AddGadgetItem2(0, "Zeile "+Str(Date())) 
  	EndSelect
  ForEver 
EndIf
Post Reply