Re: wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
Brian K. Clark wrote:
>
>
> Thanks Matt for all of your help so far, and sorry to be a PITA, but (no
> pun intended)... Has the wxWidgets event
> wxEVT_COMMAND_LISTBOX_DOUBLECLICKED been implemented in wxEuphoria? I
> tried:
>
> set_event_handler(itemsList, -1, wxEVT_COMMAND_LISTBOX_DOUBLECLICKED,
> routine_id( "show_item" ))
>
> which doesn't cause a runtime error, but also doesn't fire the proc.
>
It works for me. See the example below:
without warning
include wxEuphoria.e
include wxButton.e
include wxList.e
include wxGraphics.e
constant
WinFrame = create( wxFrame, {0, -1, "List", -1, -1, 200, 220} ),
Win = create( wxPanel, {WinFrame}),
List1 = create( wxListBox, {Win, -1, 10, 10, 120, 140} ),
Button1 = create( wxButton, {Win, -1, "Info...", 10, 150, 60, 32} )
procedure WinFrame_Activate( atom this, atom event_type, atom id, atom event )
add_item( List1, {"one", "two", "three", "four", "five",
"six", "seven", "eight", "nine","ten"} )
end procedure
set_event_handler( WinFrame, -1, wxEVT_ACTIVATE,
routine_id("WinFrame_Activate"))
procedure Click_Button1(atom this, atom event_type, atom id, atom event)
integer count, index
object result, string
-- get index
index = get_selection( List1 )
if index = -1 then
return
end if
count = list_count( List1 )
string = get_string_selection( List1 )
result = message_box(
sprintf( "List Count = %d \n", {count } ) &
sprintf( "Selected Item Index = %d \n", { index } ) &
sprintf( "Selected Item Text = %s ",
{ string} ),
"List Information", 0 )
end procedure
set_event_handler( List1, -1, wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, routine_id(
"Click_Button1" ) )
set_event_handler(Button1, get_id(Button1), wxEVT_COMMAND_BUTTON_CLICKED,
routine_id( "Click_Button1" ))
wxMain( WinFrame )
Matt Lewis
|
Not Categorized, Please Help
|
|