It is currently Fri Jan 18, 2019 10:42 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Editable combo embedded in Canvas gadget
PostPosted: Wed Aug 08, 2018 4:22 pm 
Offline
PureBasic Expert
PureBasic Expert

Joined: Wed Oct 29, 2003 4:35 pm
Posts: 10489
Location: Beyond the pale...
Purebasic 5.62x86 and 5.70x64 beta 1. Win 7.

When using the #PB_Canvas_Keyboard|#PB_Canvas_Container flags for a canvas gadget, an editable combo misbehaves when you type some text into it and then left click to try and reposition the caret etc. No problem with the string gadget.

Code:
If OpenWindow(0, 0, 0, 220, 220, "Canvas container example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  CanvasGadget(0, 10, 10, 200, 200, #PB_Canvas_Keyboard|#PB_Canvas_Container)
    StringGadget(1, 10, 20, 150, 32, "ABC")
    ComboBoxGadget(2, 10, 70, 150, 32, #PB_ComboBox_Editable)
  CloseGadgetList()

  Repeat
  Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf


Problem disappears if you remove the #PB_Canvas_Keyboard flag.

_________________
I may look like a mule, but I'm not a complete ass.


Top
 Profile  
Reply with quote  
 Post subject: Re: Editable combo embedded in Canvas gadget
PostPosted: Sun Sep 30, 2018 7:16 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Oct 06, 2006 4:41 am
Posts: 648
Location: Canada
Confirmed.

-- PB 5.70 b2 on Windows 10 X64 --

_________________
"That's not a bug..." said the programmer. "...It's a feature! "
"Oh! I see..." replied the blind man.


Top
 Profile  
Reply with quote  
 Post subject: Re: Editable combo embedded in Canvas gadget
PostPosted: Sun Sep 30, 2018 11:45 am 
Offline
Enthusiast
Enthusiast

Joined: Thu Mar 09, 2006 9:24 am
Posts: 253
Location: S. Kor
... and some unnecessary canvas events occur.

Run the code, and click on the combobox gadget or the string gadget.
Firstly the canvas is focused, and immediately lose the focus, then the clicked gadget is focused.

There are no problems without #PB_Canvas_Keyboard flag.

Quote:
gadget 0 Focus
gadget 0 LostFocus
gadget 2 Focus


Code:
Procedure Callback()
  Protected eg = EventGadget()
  Protected et = EventType()
 
  Select et
    Case #PB_EventType_Focus
      Debug "gadget " + Str(eg) + " Focus"
     
    Case #PB_EventType_LostFocus
      Debug "gadget " + Str(eg) + " LostFocus"
     
  EndSelect
 
EndProcedure


If OpenWindow(0, 0, 0, 220, 220, "Canvas container example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  CanvasGadget(0, 10, 10, 200, 200, #PB_Canvas_Keyboard|#PB_Canvas_Container)
    StringGadget(1, 10, 20, 150, 32, "ABC")
    ComboBoxGadget(2, 10, 70, 150, 32, #PB_ComboBox_Editable)
  CloseGadgetList()
 
  BindGadgetEvent(0, @Callback())
  BindGadgetEvent(1, @Callback())
  BindGadgetEvent(2, @Callback())
 
  Repeat
  Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf


Top
 Profile  
Reply with quote  
 Post subject: Re: Editable combo embedded in Canvas gadget
PostPosted: Sun Sep 30, 2018 12:14 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Oct 06, 2006 4:41 am
Posts: 648
Location: Canada
@ breeze4me :
Pretty nifty detective work, breeze4me.
Bravo.
And indeed a clear demonstration that things are straightforward and problem-free once #PB_Canvas_Keyboard gets removed.

_________________
"That's not a bug..." said the programmer. "...It's a feature! "
"Oh! I see..." replied the blind man.


Top
 Profile  
Reply with quote  
 Post subject: Re: Editable combo embedded in Canvas gadget
PostPosted: Sat Jan 05, 2019 12:53 pm 
Offline
PureBasic Expert
PureBasic Expert

Joined: Wed Oct 29, 2003 4:35 pm
Posts: 10489
Location: Beyond the pale...
Encountered a problem which is related to this one and was going to post a separate report when I remembered this issue.

Double click the string gadget and the gadget then loses focus. Focus returns to the canvas gadget for some reason.

A bit disappointed to see this hasn't been fixed for the final version of PB5.70.

_________________
I may look like a mule, but I'm not a complete ass.


Top
 Profile  
Reply with quote  
 Post subject: Re: Editable combo embedded in Canvas gadget
PostPosted: Thu Jan 10, 2019 1:43 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Jan 22, 2009 3:48 am
Posts: 507
Location: china
a way:
click 'left' or 'right'

_________________
my pb for chinese:
http://ataorj.ys168.com


Top
 Profile  
Reply with quote  
 Post subject: Re: Editable combo embedded in Canvas gadget
PostPosted: Thu Jan 10, 2019 6:34 pm 
Offline
PureBasic Expert
PureBasic Expert

Joined: Wed Oct 29, 2003 4:35 pm
Posts: 10489
Location: Beyond the pale...
gurj wrote:
a way:
click 'left' or 'right'


:?:

_________________
I may look like a mule, but I'm not a complete ass.


Top
 Profile  
Reply with quote  
 Post subject: Re: Editable combo embedded in Canvas gadget
PostPosted: Thu Jan 10, 2019 10:39 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Thu Jan 22, 2009 3:48 am
Posts: 507
Location: china
@srod
for your post1.

_________________
my pb for chinese:
http://ataorj.ys168.com


Top
 Profile  
Reply with quote  
 Post subject: Re: Editable combo embedded in Canvas gadget
PostPosted: Thu Jan 10, 2019 10:51 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Dec 23, 2009 10:14 pm
Posts: 2810
Location: Boston, MA
Actually, the StringGadget is also affected by "|#PB_Canvas_Keyboard".
CanvasGadget(0, 10, 10, 200, 200, #PB_Canvas_Container) | #PB_Canvas_Keyboard)
You cannot double click its contents to select all?

Yes, using arrow keys allows cursor positioning.

_________________
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye