Mapping of Combogadget events...

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Mapping of Combogadget events...

Post 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. :)
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
User avatar
blueb
Addict
Addict
Posts: 1111
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

Post 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
- It was too lonely at the top.

System : PB 6.21(x64) and Win 11 Pro (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
USCode
Addict
Addict
Posts: 923
Joined: Wed Mar 24, 2004 11:04 pm
Location: Seattle

Bug?

Post 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?
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post 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"! ;)
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
ozzie
Enthusiast
Enthusiast
Posts: 443
Joined: Sun Apr 06, 2008 12:54 pm
Location: Brisbane, Qld, Australia
Contact:

Re: Mapping of Combogadget events...

Post by ozzie »

+1 for support of PB cross-platform ComboBoxGadget EventTypes, especially for the equivalent of #CBN_SELCHANGE.
Post Reply