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