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