Page 1 of 1

EditorGadget vs ComboBoxGadget - Bug (Mouse pointer disappears)

Posted: Sat Feb 25, 2023 8:19 am
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

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

Posted: Sat Feb 25, 2023 8:32 am
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

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

Posted: Sat Feb 25, 2023 8:39 am
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.

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

Posted: Sat Feb 25, 2023 8:45 am
by BarryG
Beat you to it, StarGate! Hehe.

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

Posted: Sat Feb 25, 2023 10:06 am
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