use "event" signal emission hook to install idle handler for many events
[wxWidgets.git] / src / gtk / radiobox.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/gtk/radiobox.cpp
3 // Purpose:
4 // Author: Robert Roebling
5 // Id: $Id$
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10 // For compilers that support precompilation, includes "wx.h".
11 #include "wx/wxprec.h"
12
13 #if wxUSE_RADIOBOX
14
15 #include "wx/radiobox.h"
16
17 #ifndef WX_PRECOMP
18 #include "wx/log.h"
19 #include "wx/frame.h"
20 #include "wx/dialog.h"
21 #endif
22
23 #if wxUSE_TOOLTIPS
24 #include "wx/tooltip.h"
25 #endif
26
27 #include "wx/gtk/private.h"
28 #include <gdk/gdkkeysyms.h>
29
30 #include "wx/gtk/win_gtk.h"
31
32 //-----------------------------------------------------------------------------
33 // wxGTKRadioButtonInfo
34 //-----------------------------------------------------------------------------
35 // structure internally used by wxRadioBox to store its child buttons
36
37 class wxGTKRadioButtonInfo : public wxObject
38 {
39 public:
40 wxGTKRadioButtonInfo( GtkRadioButton * abutton, const wxRect & arect )
41 : button( abutton ), rect( arect ) {}
42
43 GtkRadioButton * button;
44 wxRect rect;
45 };
46
47 //-----------------------------------------------------------------------------
48 // data
49 //-----------------------------------------------------------------------------
50
51 #include "wx/listimpl.cpp"
52 WX_DEFINE_LIST( wxRadioBoxButtonsInfoList );
53
54 extern bool g_blockEventsOnDrag;
55
56 //-----------------------------------------------------------------------------
57 // "clicked"
58 //-----------------------------------------------------------------------------
59
60 extern "C" {
61 static void gtk_radiobutton_clicked_callback( GtkToggleButton *button, wxRadioBox *rb )
62 {
63 if (g_isIdle) wxapp_install_idle_handler();
64
65 if (!rb->m_hasVMT) return;
66 if (g_blockEventsOnDrag) return;
67
68 if (!button->active) return;
69
70 wxCommandEvent event( wxEVT_COMMAND_RADIOBOX_SELECTED, rb->GetId() );
71 event.SetInt( rb->GetSelection() );
72 event.SetString( rb->GetStringSelection() );
73 event.SetEventObject( rb );
74 rb->GetEventHandler()->ProcessEvent(event);
75 }
76 }
77
78 //-----------------------------------------------------------------------------
79 // "key_press_event"
80 //-----------------------------------------------------------------------------
81
82 extern "C" {
83 static gint gtk_radiobox_keypress_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxRadioBox *rb )
84 {
85 // don't need to install idle handler, its done from "event" signal
86
87 if (!rb->m_hasVMT) return FALSE;
88 if (g_blockEventsOnDrag) return FALSE;
89
90 if ( ((gdk_event->keyval == GDK_Tab) ||
91 (gdk_event->keyval == GDK_ISO_Left_Tab)) &&
92 rb->GetParent() && (rb->GetParent()->HasFlag( wxTAB_TRAVERSAL)) )
93 {
94 wxNavigationKeyEvent new_event;
95 new_event.SetEventObject( rb->GetParent() );
96 // GDK reports GDK_ISO_Left_Tab for SHIFT-TAB
97 new_event.SetDirection( (gdk_event->keyval == GDK_Tab) );
98 // CTRL-TAB changes the (parent) window, i.e. switch notebook page
99 new_event.SetWindowChange( (gdk_event->state & GDK_CONTROL_MASK) );
100 new_event.SetCurrentFocus( rb );
101 return rb->GetParent()->GetEventHandler()->ProcessEvent( new_event );
102 }
103
104 if ((gdk_event->keyval != GDK_Up) &&
105 (gdk_event->keyval != GDK_Down) &&
106 (gdk_event->keyval != GDK_Left) &&
107 (gdk_event->keyval != GDK_Right))
108 {
109 return FALSE;
110 }
111
112 wxRadioBoxButtonsInfoList::compatibility_iterator node = rb->m_buttonsInfo.GetFirst();
113 while( node && GTK_WIDGET( node->GetData()->button ) != widget )
114 {
115 node = node->GetNext();
116 }
117 if (!node)
118 {
119 return FALSE;
120 }
121
122 g_signal_stop_emission_by_name (widget, "key_press_event");
123
124 if ((gdk_event->keyval == GDK_Up) ||
125 (gdk_event->keyval == GDK_Left))
126 {
127 if (node == rb->m_buttonsInfo.GetFirst())
128 node = rb->m_buttonsInfo.GetLast();
129 else
130 node = node->GetPrevious();
131 }
132 else
133 {
134 if (node == rb->m_buttonsInfo.GetLast())
135 node = rb->m_buttonsInfo.GetFirst();
136 else
137 node = node->GetNext();
138 }
139
140 GtkWidget *button = (GtkWidget*) node->GetData()->button;
141
142 gtk_widget_grab_focus( button );
143
144 return TRUE;
145 }
146 }
147
148 extern "C" {
149 static gint gtk_radiobutton_focus_in( GtkWidget *widget,
150 GdkEvent *WXUNUSED(event),
151 wxRadioBox *win )
152 {
153 if ( win->m_lostFocus )
154 {
155 // no, we didn't really lose it
156 win->m_lostFocus = FALSE;
157 }
158 else if ( !win->m_hasFocus )
159 {
160 win->m_hasFocus = true;
161
162 wxFocusEvent event( wxEVT_SET_FOCUS, win->GetId() );
163 event.SetEventObject( win );
164
165 // never stop the signal emission, it seems to break the kbd handling
166 // inside the radiobox
167 (void)win->GetEventHandler()->ProcessEvent( event );
168 }
169
170 return FALSE;
171 }
172 }
173
174 extern "C" {
175 static gint gtk_radiobutton_focus_out( GtkWidget *widget,
176 GdkEvent *WXUNUSED(event),
177 wxRadioBox *win )
178 {
179 // wxASSERT_MSG( win->m_hasFocus, _T("got focus out without any focus in?") );
180 // Replace with a warning, else we dump core a lot!
181 // if (!win->m_hasFocus)
182 // wxLogWarning(_T("Radiobox got focus out without any focus in.") );
183
184 // we might have lost the focus, but may be not - it may have just gone to
185 // another button in the same radiobox, so we'll check for it in the next
186 // idle iteration (leave m_hasFocus == true for now)
187 win->m_lostFocus = true;
188
189 return FALSE;
190 }
191 }
192
193 extern "C" {
194 static void gtk_radiobutton_size_allocate( GtkWidget *widget,
195 GtkAllocation * alloc,
196 wxRadioBox *win )
197 {
198 unsigned int n = 0;
199 for ( wxRadioBoxButtonsInfoList::compatibility_iterator node = win->m_buttonsInfo.GetFirst();
200 node;
201 node = node->GetNext(), n++ )
202 {
203 if( widget == GTK_WIDGET(node->GetData()->button) )
204 {
205 const wxPoint origin = win->GetPosition();
206 wxRect rect = wxRect( alloc->x - origin.x, alloc->y - origin.y,
207 alloc->width, alloc->height );
208 node->GetData()->rect = rect;
209 break;
210 }
211 }
212 }
213 }
214
215
216 //-----------------------------------------------------------------------------
217 // wxRadioBox
218 //-----------------------------------------------------------------------------
219
220 IMPLEMENT_DYNAMIC_CLASS(wxRadioBox,wxControl)
221
222 void wxRadioBox::Init()
223 {
224 m_needParent = true;
225 m_acceptsFocus = true;
226
227 m_hasFocus =
228 m_lostFocus = false;
229 }
230
231 bool wxRadioBox::Create( wxWindow *parent, wxWindowID id,
232 const wxString& title,
233 const wxPoint &pos, const wxSize &size,
234 const wxArrayString& choices, int majorDim,
235 long style, const wxValidator& validator,
236 const wxString &name )
237 {
238 wxCArrayString chs(choices);
239
240 return Create( parent, id, title, pos, size, chs.GetCount(),
241 chs.GetStrings(), majorDim, style, validator, name );
242 }
243
244 bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
245 const wxPoint &pos, const wxSize &size,
246 int n, const wxString choices[], int majorDim,
247 long style, const wxValidator& validator,
248 const wxString &name )
249 {
250 if (!PreCreation( parent, pos, size ) ||
251 !CreateBase( parent, id, pos, size, style, validator, name ))
252 {
253 wxFAIL_MSG( wxT("wxRadioBox creation failed") );
254 return false;
255 }
256
257 m_widget = GTKCreateFrame(title);
258 wxControl::SetLabel(title);
259
260 // majorDim may be 0 if all trailing parameters were omitted, so don't
261 // assert here but just use the correct value for it
262 SetMajorDim(majorDim == 0 ? n : majorDim, style);
263
264
265 unsigned int num_of_cols = GetColumnCount();
266 unsigned int num_of_rows = GetRowCount();
267
268 GtkRadioButton *rbtn = (GtkRadioButton*) NULL;
269
270 GtkWidget *table = gtk_table_new( num_of_rows, num_of_cols, FALSE );
271 gtk_table_set_col_spacings( GTK_TABLE(table), 1 );
272 gtk_table_set_row_spacings( GTK_TABLE(table), 1 );
273 gtk_widget_show( table );
274 gtk_container_add( GTK_CONTAINER(m_widget), table );
275
276 wxString label;
277 GSList *radio_button_group = (GSList *) NULL;
278 for (unsigned int i = 0; i < (unsigned int)n; i++)
279 {
280 if ( i != 0 )
281 radio_button_group = gtk_radio_button_get_group( GTK_RADIO_BUTTON(rbtn) );
282
283 label.Empty();
284 for ( const wxChar *pc = choices[i]; *pc; pc++ )
285 {
286 if ( *pc != wxT('&') )
287 label += *pc;
288 }
289
290 rbtn = GTK_RADIO_BUTTON( gtk_radio_button_new_with_label( radio_button_group, wxGTK_CONV( label ) ) );
291 gtk_widget_show( GTK_WIDGET(rbtn) );
292
293 g_signal_connect (rbtn, "key_press_event",
294 G_CALLBACK (gtk_radiobox_keypress_callback), this);
295
296 m_buttonsInfo.Append( new wxGTKRadioButtonInfo( rbtn, wxRect() ) );
297
298 if (HasFlag(wxRA_SPECIFY_COLS))
299 {
300 int left = i%num_of_cols;
301 int right = (i%num_of_cols) + 1;
302 int top = i/num_of_cols;
303 int bottom = (i/num_of_cols)+1;
304 gtk_table_attach( GTK_TABLE(table), GTK_WIDGET(rbtn), left, right, top, bottom,
305 GTK_FILL, GTK_FILL, 1, 1 );
306 }
307 else
308 {
309 int left = i/num_of_rows;
310 int right = (i/num_of_rows) + 1;
311 int top = i%num_of_rows;
312 int bottom = (i%num_of_rows)+1;
313 gtk_table_attach( GTK_TABLE(table), GTK_WIDGET(rbtn), left, right, top, bottom,
314 GTK_FILL, GTK_FILL, 1, 1 );
315 }
316
317 ConnectWidget( GTK_WIDGET(rbtn) );
318
319 if (!i)
320 gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON(rbtn), TRUE );
321
322 g_signal_connect (rbtn, "clicked",
323 G_CALLBACK (gtk_radiobutton_clicked_callback), this);
324 g_signal_connect (rbtn, "focus_in_event",
325 G_CALLBACK (gtk_radiobutton_focus_in), this);
326 g_signal_connect (rbtn, "focus_out_event",
327 G_CALLBACK (gtk_radiobutton_focus_out), this);
328 g_signal_connect (rbtn, "size_allocate",
329 G_CALLBACK (gtk_radiobutton_size_allocate), this);
330 }
331
332 m_parent->DoAddChild( this );
333
334 PostCreation(size);
335
336 return true;
337 }
338
339 wxRadioBox::~wxRadioBox()
340 {
341 wxRadioBoxButtonsInfoList::compatibility_iterator node = m_buttonsInfo.GetFirst();
342 while (node)
343 {
344 GtkWidget *button = GTK_WIDGET( node->GetData()->button );
345 gtk_widget_destroy( button );
346 node = node->GetNext();
347 }
348 WX_CLEAR_LIST( wxRadioBoxButtonsInfoList, m_buttonsInfo );
349 }
350
351 bool wxRadioBox::Show( bool show )
352 {
353 wxCHECK_MSG( m_widget != NULL, false, wxT("invalid radiobox") );
354
355 if (!wxControl::Show(show))
356 {
357 // nothing to do
358 return false;
359 }
360
361 if ( HasFlag(wxNO_BORDER) )
362 gtk_widget_hide( m_widget );
363
364 wxRadioBoxButtonsInfoList::compatibility_iterator node = m_buttonsInfo.GetFirst();
365 while (node)
366 {
367 GtkWidget *button = GTK_WIDGET( node->GetData()->button );
368
369 if (show)
370 gtk_widget_show( button );
371 else
372 gtk_widget_hide( button );
373
374 node = node->GetNext();
375 }
376
377 return true;
378 }
379
380 void wxRadioBox::SetFocus()
381 {
382 wxCHECK_RET( m_widget != NULL, wxT("invalid radiobox") );
383
384 if (m_buttonsInfo.GetCount() == 0) return;
385
386 wxRadioBoxButtonsInfoList::compatibility_iterator node = m_buttonsInfo.GetFirst();
387 while (node)
388 {
389 GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->GetData()->button );
390 if (button->active)
391 {
392 gtk_widget_grab_focus( GTK_WIDGET(button) );
393 return;
394 }
395 node = node->GetNext();
396 }
397 }
398
399 void wxRadioBox::SetSelection( int n )
400 {
401 wxCHECK_RET( m_widget != NULL, wxT("invalid radiobox") );
402
403 wxRadioBoxButtonsInfoList::compatibility_iterator node = m_buttonsInfo.Item( n );
404
405 wxCHECK_RET( node, wxT("radiobox wrong index") );
406
407 GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->GetData()->button );
408
409 GtkDisableEvents();
410
411 gtk_toggle_button_set_active( button, 1 );
412
413 GtkEnableEvents();
414 }
415
416 int wxRadioBox::GetSelection(void) const
417 {
418 wxCHECK_MSG( m_widget != NULL, wxNOT_FOUND, wxT("invalid radiobox") );
419
420 int count = 0;
421
422 wxRadioBoxButtonsInfoList::compatibility_iterator node = m_buttonsInfo.GetFirst();
423 while (node)
424 {
425 GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->GetData()->button );
426 if (button->active) return count;
427 count++;
428 node = node->GetNext();
429 }
430
431 wxFAIL_MSG( wxT("wxRadioBox none selected") );
432
433 return wxNOT_FOUND;
434 }
435
436 wxString wxRadioBox::GetString(unsigned int n) const
437 {
438 wxCHECK_MSG( m_widget != NULL, wxEmptyString, wxT("invalid radiobox") );
439
440 wxRadioBoxButtonsInfoList::compatibility_iterator node = m_buttonsInfo.Item( n );
441
442 wxCHECK_MSG( node, wxEmptyString, wxT("radiobox wrong index") );
443
444 GtkLabel *label = GTK_LABEL(GTK_BIN(node->GetData()->button)->child);
445
446 wxString str( wxGTK_CONV_BACK( gtk_label_get_text(label) ) );
447
448 return str;
449 }
450
451 void wxRadioBox::SetLabel( const wxString& label )
452 {
453 wxCHECK_RET( m_widget != NULL, wxT("invalid radiobox") );
454
455 GTKSetLabelForFrame(GTK_FRAME(m_widget), label);
456 }
457
458 void wxRadioBox::SetString(unsigned int item, const wxString& label)
459 {
460 wxCHECK_RET( m_widget != NULL, wxT("invalid radiobox") );
461
462 wxRadioBoxButtonsInfoList::compatibility_iterator node = m_buttonsInfo.Item( item );
463
464 wxCHECK_RET( node, wxT("radiobox wrong index") );
465
466 GtkLabel *g_label = GTK_LABEL(GTK_BIN(node->GetData()->button)->child);
467
468 gtk_label_set_text( g_label, wxGTK_CONV( label ) );
469 }
470
471 bool wxRadioBox::Enable( bool enable )
472 {
473 if ( !wxControl::Enable( enable ) )
474 return false;
475
476 wxRadioBoxButtonsInfoList::compatibility_iterator node = m_buttonsInfo.GetFirst();
477 while (node)
478 {
479 GtkButton *button = GTK_BUTTON( node->GetData()->button );
480 GtkLabel *label = GTK_LABEL(GTK_BIN(button)->child);
481
482 gtk_widget_set_sensitive( GTK_WIDGET(button), enable );
483 gtk_widget_set_sensitive( GTK_WIDGET(label), enable );
484 node = node->GetNext();
485 }
486
487 return true;
488 }
489
490 bool wxRadioBox::Enable(unsigned int item, bool enable)
491 {
492 wxCHECK_MSG( m_widget != NULL, false, wxT("invalid radiobox") );
493
494 wxRadioBoxButtonsInfoList::compatibility_iterator node = m_buttonsInfo.Item( item );
495
496 wxCHECK_MSG( node, false, wxT("radiobox wrong index") );
497
498 GtkButton *button = GTK_BUTTON( node->GetData()->button );
499 GtkLabel *label = GTK_LABEL(GTK_BIN(button)->child);
500
501 gtk_widget_set_sensitive( GTK_WIDGET(button), enable );
502 gtk_widget_set_sensitive( GTK_WIDGET(label), enable );
503
504 return true;
505 }
506
507 bool wxRadioBox::IsItemEnabled(unsigned int item) const
508 {
509 wxCHECK_MSG( m_widget != NULL, false, wxT("invalid radiobox") );
510
511 wxRadioBoxButtonsInfoList::compatibility_iterator node = m_buttonsInfo.Item( item );
512
513 wxCHECK_MSG( node, false, wxT("radiobox wrong index") );
514
515 GtkButton *button = GTK_BUTTON( node->GetData()->button );
516
517 // don't use GTK_WIDGET_IS_SENSITIVE() here, we want to return true even if
518 // the parent radiobox is disabled
519 return GTK_WIDGET_SENSITIVE(GTK_WIDGET(button));
520 }
521
522 bool wxRadioBox::Show(unsigned int item, bool show)
523 {
524 wxCHECK_MSG( m_widget != NULL, false, wxT("invalid radiobox") );
525
526 wxRadioBoxButtonsInfoList::compatibility_iterator node = m_buttonsInfo.Item( item );
527
528 wxCHECK_MSG( node, false, wxT("radiobox wrong index") );
529
530 GtkWidget *button = GTK_WIDGET( node->GetData()->button );
531
532 if (show)
533 gtk_widget_show( button );
534 else
535 gtk_widget_hide( button );
536
537 return true;
538 }
539
540 bool wxRadioBox::IsItemShown(unsigned int item) const
541 {
542 wxCHECK_MSG( m_widget != NULL, false, wxT("invalid radiobox") );
543
544 wxRadioBoxButtonsInfoList::compatibility_iterator node = m_buttonsInfo.Item( item );
545
546 wxCHECK_MSG( node, false, wxT("radiobox wrong index") );
547
548 GtkButton *button = GTK_BUTTON( node->GetData()->button );
549
550 return GTK_WIDGET_VISIBLE(GTK_WIDGET(button));
551 }
552
553 unsigned int wxRadioBox::GetCount() const
554 {
555 return m_buttonsInfo.GetCount();
556 }
557
558 void wxRadioBox::GtkDisableEvents()
559 {
560 wxRadioBoxButtonsInfoList::compatibility_iterator node = m_buttonsInfo.GetFirst();
561 while (node)
562 {
563 g_signal_handlers_disconnect_by_func (node->GetData()->button,
564 (gpointer) gtk_radiobutton_clicked_callback,
565 this);
566
567 node = node->GetNext();
568 }
569 }
570
571 void wxRadioBox::GtkEnableEvents()
572 {
573 wxRadioBoxButtonsInfoList::compatibility_iterator node = m_buttonsInfo.GetFirst();
574 while (node)
575 {
576 g_signal_connect (node->GetData()->button, "clicked",
577 G_CALLBACK (gtk_radiobutton_clicked_callback), this);
578
579 node = node->GetNext();
580 }
581 }
582
583 void wxRadioBox::DoApplyWidgetStyle(GtkRcStyle *style)
584 {
585 GTKFrameApplyWidgetStyle(GTK_FRAME(m_widget), style);
586
587 wxRadioBoxButtonsInfoList::compatibility_iterator node = m_buttonsInfo.GetFirst();
588 while (node)
589 {
590 GtkWidget *widget = GTK_WIDGET( node->GetData()->button );
591
592 gtk_widget_modify_style( widget, style );
593 gtk_widget_modify_style(GTK_BIN(widget)->child, style);
594
595 node = node->GetNext();
596 }
597 }
598
599 bool wxRadioBox::GTKWidgetNeedsMnemonic() const
600 {
601 return true;
602 }
603
604 void wxRadioBox::GTKWidgetDoSetMnemonic(GtkWidget* w)
605 {
606 GTKFrameSetMnemonicWidget(GTK_FRAME(m_widget), w);
607 }
608
609 #if wxUSE_TOOLTIPS
610 void wxRadioBox::ApplyToolTip(GtkTooltips * WXUNUSED(tips), const wxChar *tip)
611 {
612 // set this tooltip for all radiobuttons which don't have their own tips
613 unsigned n = 0;
614 for ( wxRadioBoxButtonsInfoList::compatibility_iterator node = m_buttonsInfo.GetFirst();
615 node;
616 node = node->GetNext(), n++ )
617 {
618 if ( !GetItemToolTip(n) )
619 {
620 wxToolTip::Apply(GTK_WIDGET(node->GetData()->button),
621 wxConvCurrent->cWX2MB(tip));
622 }
623 }
624 }
625
626 void wxRadioBox::DoSetItemToolTip(unsigned int n, wxToolTip *tooltip)
627 {
628 wxCharBuffer buf;
629 if ( !tooltip )
630 tooltip = GetToolTip();
631 if ( tooltip )
632 buf = wxGTK_CONV(tooltip->GetTip());
633
634 wxToolTip::Apply(GTK_WIDGET(m_buttonsInfo[n]->button), buf);
635 }
636
637 #endif // wxUSE_TOOLTIPS
638
639 GdkWindow *wxRadioBox::GTKGetWindow(wxArrayGdkWindows& windows) const
640 {
641 windows.push_back(m_widget->window);
642
643 wxRadioBoxButtonsInfoList::compatibility_iterator node = m_buttonsInfo.GetFirst();
644 while (node)
645 {
646 GtkWidget *button = GTK_WIDGET( node->GetData()->button );
647
648 windows.push_back(button->window);
649
650 node = node->GetNext();
651 }
652
653 return NULL;
654 }
655
656 void wxRadioBox::OnInternalIdle()
657 {
658 wxControl::OnInternalIdle();
659
660 if ( m_lostFocus )
661 {
662 m_hasFocus = false;
663 m_lostFocus = false;
664
665 wxFocusEvent event( wxEVT_KILL_FOCUS, GetId() );
666 event.SetEventObject( this );
667
668 (void)GetEventHandler()->ProcessEvent( event );
669 }
670 }
671
672 // static
673 wxVisualAttributes
674 wxRadioBox::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant))
675 {
676 wxVisualAttributes attr;
677 // NB: we need toplevel window so that GTK+ can find the right style
678 GtkWidget *wnd = gtk_window_new(GTK_WINDOW_TOPLEVEL);
679 GtkWidget* widget = gtk_radio_button_new_with_label(NULL, "");
680 gtk_container_add(GTK_CONTAINER(wnd), widget);
681 attr = GetDefaultAttributesFromGTKWidget(widget);
682 gtk_widget_destroy(wnd);
683 return attr;
684 }
685
686 int wxRadioBox::GetItemFromPoint(const wxPoint& point) const
687 {
688 const wxPoint pt = ScreenToClient(point);
689 unsigned n = 0;
690 for ( wxRadioBoxButtonsInfoList::compatibility_iterator
691 node = m_buttonsInfo.GetFirst(); node; node = node->GetNext(), n++ )
692 {
693 if ( m_buttonsInfo[n]->rect.Inside(pt) )
694 return n;
695 }
696
697 return wxNOT_FOUND;
698 }
699
700 #endif // wxUSE_RADIOBOX