Page 1 of 1

Mapping of Combogadget events...

Posted: Thu May 21, 2009 9:24 pm
by DoubleDutch
Looks like the ComboGadget get events such as focus, etc - but they are not mapped.

Code: Select all

If OpenWindow(0, 0, 0, 270, 140, "ComboBoxGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    ComboBoxGadget(0, 10, 10, 250, 21, #PB_ComboBox_Editable)
      AddGadgetItem(0, -1, "ComboBox editable...")

      For a = 1 To 5
        AddGadgetItem(0, -1,"ComboBox item " + Str(a))
      Next

    SetGadgetState(0, 2)    ; set (beginning with 0) the third item as active one
    
    
    Repeat
    	event=WaitWindowEvent()
    	Select event
    		Case	#PB_Event_CloseWindow
    			quit=#True
    		Case	#PB_Event_Gadget
    			gadget=EventGadget()
    			If eventgadget=0
    				type=EventType()
    				Select type
							Case	#PB_EventType_RightClick      ; right mouse button click
								Debug("right click - is really 'select from pulldown'")
							Case	#PB_EventType_RightDoubleClick; Right mouse button double click
								Debug("right double click - is really 'focus'")
							Case	#PB_EventType_Focus           ; Get the focus.
								Debug("should be 'focus', but not with this gadget!")
							Case	#PB_EventType_LostFocus       ; Lose the focus.
								Debug("should be 'lost focus', but not with this gadget!")
							Case	#PB_EventType_Change          ; Content change.
								Debug("should be 'change', but not with this gadget!")
							Case	4
								Debug("is really 'lost focus'")
							Case	7
								Debug("is really 'display pull-down'")
							Case	8
								Debug("is really 'cancel pull-down'")
							Case	5
								Debug("is really 'change'")
								
    					Default
    						Debug("Type: "+Hex(type))
						EndSelect    			
    			EndIf
    	EndSelect
    Until quit
  EndIf
Are these events available on Mac and Linux? If so can they be mapped to PB gadget events?

Please don't kill the 'display pulldown' and 'cancel pulldown' events though as they are pretty useful. :)

Posted: Wed Jun 10, 2009 8:34 pm
by blueb
+ 1

They should mimic.....

; Combo Box Notification Codes you may look For:
; #CBN_ERRSPACE = -1
; #CBN_SELCHANGE = 1
; #CBN_DBLCLK = 2
; #CBN_SETFOCUS = 3
; #CBN_KILLFOCUS = 4
; #CBN_EDITCHANGE = 5
; #CBN_EDITUPDATE = 6
; #CBN_DROPDOWN = 7
; #CBN_CLOSEUP = 8
; #CBN_SELENDOK = 9
; #CBN_SELENDCANCEL = 10

Bug?

Posted: Thu Jun 11, 2009 7:05 pm
by USCode
Given the various #PB_EventType... events you detail are supported by the ComboGadget ... then this is really a bug, not a enhancement request?

Posted: Thu Jun 11, 2009 7:50 pm
by DoubleDutch
then this is really a bug, not a enhancement request?
I guess so, since it's posted in "Feature Requests and Wishlists" rather than "Bug Reports"! ;)

Re: Mapping of Combogadget events...

Posted: Wed Nov 25, 2009 4:05 am
by ozzie
+1 for support of PB cross-platform ComboBoxGadget EventTypes, especially for the equivalent of #CBN_SELCHANGE.