]> git.saurik.com Git - wxWidgets.git/blob - src/mac/control.cpp
suppressed wrong debug error messages from SetFocus
[wxWidgets.git] / src / mac / control.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: control.cpp
3 // Purpose: wxControl class
4 // Author: AUTHOR
5 // Modified by:
6 // Created: ??/??/98
7 // RCS-ID: $Id$
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifdef __GNUG__
13 #pragma implementation "control.h"
14 #endif
15
16 #include "wx/defs.h"
17
18 #include "wx/control.h"
19 #include "wx/panel.h"
20 #include "wx/app.h"
21 #include "wx/dc.h"
22 #include "wx/dcclient.h"
23 #include "wx/notebook.h"
24 #include "wx/tabctrl.h"
25 #include "wx/radiobox.h"
26 #include "wx/spinbutt.h"
27 #include "wx/scrolbar.h"
28 #include "wx/button.h"
29 #include "wx/dialog.h"
30 #include "wx/statbox.h"
31 #include "wx/sizer.h"
32 #include "wx/stattext.h"
33
34 #if !USE_SHARED_LIBRARY
35 IMPLEMENT_ABSTRACT_CLASS(wxControl, wxWindow)
36
37 BEGIN_EVENT_TABLE(wxControl, wxWindow)
38 EVT_MOUSE_EVENTS( wxControl::OnMouseEvent )
39 EVT_CHAR( wxControl::OnKeyDown )
40 EVT_PAINT( wxControl::OnPaint )
41 END_EVENT_TABLE()
42 #endif
43
44 #include "wx/mac/uma.h"
45
46 // Item members
47
48 ControlActionUPP wxMacLiveScrollbarActionUPP = NULL ;
49
50 pascal void wxMacLiveScrollbarActionProc( ControlHandle control , ControlPartCode partCode ) ;
51 pascal void wxMacLiveScrollbarActionProc( ControlHandle control , ControlPartCode partCode )
52 {
53 if ( partCode != 0)
54 {
55 wxControl* wx = (wxControl*) GetControlReference( control ) ;
56 if ( wx )
57 {
58 wx->MacHandleControlClick( control , partCode ) ;
59 }
60 }
61 }
62
63 wxControl::wxControl()
64 {
65 m_macControl = NULL ;
66 m_macHorizontalBorder = 0 ; // additional pixels around the real control
67 m_macVerticalBorder = 0 ;
68 m_backgroundColour = *wxWHITE;
69 m_foregroundColour = *wxBLACK;
70 #if WXWIN_COMPATIBILITY
71 m_callback = 0;
72 #endif // WXWIN_COMPATIBILITY
73
74 if ( wxMacLiveScrollbarActionUPP == NULL )
75 {
76 #if defined(UNIVERSAL_INTERFACES_VERSION) && (UNIVERSAL_INTERFACES_VERSION >= 0x0340)
77 wxMacLiveScrollbarActionUPP = NewControlActionUPP( wxMacLiveScrollbarActionProc );
78 #else
79 wxMacLiveScrollbarActionUPP = NewControlActionProc( wxMacLiveScrollbarActionProc ) ;
80 #endif
81 }
82 }
83
84 bool wxControl::Create(wxWindow *parent, wxWindowID id,
85 const wxPoint& pos,
86 const wxSize& size, long style,
87 const wxValidator& validator,
88 const wxString& name)
89 {
90 m_macControl = NULL ;
91 m_macHorizontalBorder = 0 ; // additional pixels around the real control
92 m_macVerticalBorder = 0 ;
93 bool rval = wxWindow::Create(parent, id, pos, size, style, name);
94 if (rval) {
95 #if wxUSE_VALIDATORS
96 SetValidator(validator);
97 #endif
98 }
99 return rval;
100 }
101
102 wxControl::~wxControl()
103 {
104 m_isBeingDeleted = TRUE;
105 // If we delete an item, we should initialize the parent panel,
106 // because it could now be invalid.
107 wxWindow *parent = GetParent() ;
108 if ( parent )
109 {
110 if (parent->GetDefaultItem() == (wxButton*) this)
111 parent->SetDefaultItem(NULL);
112 }
113 if ( m_macControl )
114 {
115 ::DisposeControl( m_macControl ) ;
116 m_macControl = NULL ;
117 }
118 }
119
120 void wxControl::SetLabel(const wxString& title)
121 {
122 m_label = title ;
123
124 if ( m_macControl )
125 {
126 Str255 maclabel ;
127 wxString label ;
128
129 if( wxApp::s_macDefaultEncodingIsPC )
130 label = wxMacMakeMacStringFromPC( title ) ;
131 else
132 label = title ;
133
134 #if TARGET_CARBON
135 c2pstrcpy( (StringPtr) maclabel , label ) ;
136 #else
137 strcpy( (char *) maclabel , label ) ;
138 c2pstr( (char *) maclabel ) ;
139 #endif
140 ::SetControlTitle( m_macControl , maclabel ) ;
141 }
142 Refresh() ;
143 }
144
145 wxSize wxControl::DoGetBestSize() const
146 {
147 Rect bestsize = { 0 , 0 , 0 , 0 } ;
148 short baselineoffset ;
149 int bestWidth, bestHeight ;
150 ::GetBestControlRect( m_macControl , &bestsize , &baselineoffset ) ;
151
152 if ( EmptyRect( &bestsize ) )
153 {
154 baselineoffset = 0;
155 bestsize.left = bestsize.top = 0 ;
156 bestsize.right = 16 ;
157 bestsize.bottom = 16 ;
158 if ( IsKindOf( CLASSINFO( wxScrollBar ) ) )
159 {
160 bestsize.bottom = 16 ;
161 }
162 else if ( IsKindOf( CLASSINFO( wxSpinButton ) ) )
163 {
164 bestsize.bottom = 24 ;
165 }
166 }
167
168 if ( IsKindOf( CLASSINFO( wxButton ) ) )
169 {
170 bestWidth = m_label.Length() * 8 + 12 ;
171 if ( bestWidth < 70 )
172 bestWidth = 70 ;
173 }
174 else if ( IsKindOf( CLASSINFO( wxStaticText ) ) )
175 {
176 bestWidth = m_label.Length() * 8 ;
177 }
178 else
179 bestWidth = bestsize.right - bestsize.left ;
180
181 bestWidth += 2 * m_macHorizontalBorder ;
182
183 bestHeight = bestsize.bottom - bestsize.top ;
184 if ( bestHeight < 10 )
185 bestHeight = 13 ;
186
187 bestHeight += 2 * m_macVerticalBorder;
188
189
190 return wxSize(bestWidth, bestHeight);
191 }
192
193 bool wxControl::ProcessCommand (wxCommandEvent & event)
194 {
195 // Tries:
196 // 1) A callback function (to become obsolete)
197 // 2) OnCommand, starting at this window and working up parent hierarchy
198 // 3) OnCommand then calls ProcessEvent to search the event tables.
199 #if WXWIN_COMPATIBILITY
200 if ( m_callback )
201 {
202 (void)(*m_callback)(this, event);
203
204 return TRUE;
205 }
206 else
207 #endif // WXWIN_COMPATIBILITY
208 {
209 return GetEventHandler()->ProcessEvent(event);
210 }
211 }
212
213 // ------------------------
214 wxList *wxWinMacControlList = NULL;
215 wxControl *wxFindControlFromMacControl(ControlHandle inControl )
216 {
217 wxNode *node = wxWinMacControlList->Find((long)inControl);
218 if (!node)
219 return NULL;
220 return (wxControl *)node->Data();
221 }
222
223 void wxAssociateControlWithMacControl(ControlHandle inControl, wxControl *control)
224 {
225 // adding NULL WindowRef is (first) surely a result of an error and
226 // (secondly) breaks menu command processing
227 wxCHECK_RET( inControl != (ControlHandle) NULL, "attempt to add a NULL WindowRef to window list" );
228
229 if ( !wxWinMacControlList->Find((long)inControl) )
230 wxWinMacControlList->Append((long)inControl, control);
231 }
232
233 void wxRemoveMacControlAssociation(wxControl *control)
234 {
235 wxWinMacControlList->DeleteObject(control);
236 }
237
238 void wxControl::MacPreControlCreate( wxWindow *parent, wxWindowID id, wxString label ,
239 const wxPoint& pos,
240 const wxSize& size, long style,
241 const wxValidator& validator,
242 const wxString& name , Rect *outBounds , StringPtr maclabel )
243 {
244 m_label = label ;
245 SetName(name);
246 if ( &validator )
247 SetValidator(validator);
248
249 m_windowStyle = style;
250 parent->AddChild(this);
251
252 m_backgroundColour = parent->GetBackgroundColour() ;
253 m_foregroundColour = parent->GetForegroundColour() ;
254
255 if (id == -1)
256 m_windowId = NewControlId();
257 else
258 m_windowId = id;
259
260 // These sizes will be adjusted in MacPostControlCreate
261
262 m_width = size.x ;
263 m_height = size.y ;
264 m_x = pos.x ;
265 m_y = pos.y ;
266
267 outBounds->top = -10;
268 outBounds->left = -10;
269 outBounds->bottom = 0;
270 outBounds->right = 0;
271
272 char c_text[255];
273 strcpy( c_text , label ) ;
274 if( wxApp::s_macDefaultEncodingIsPC )
275 {
276 wxMacConvertFromPCForControls( c_text ) ;
277 }
278
279 #if TARGET_CARBON
280 c2pstrcpy( (StringPtr) maclabel , c_text ) ;
281 #else
282 strcpy( (char *) maclabel , c_text ) ;
283 c2pstr( (char *) maclabel ) ;
284 #endif
285 }
286
287 void wxControl::MacPostControlCreate()
288 {
289 wxASSERT_MSG( m_macControl != NULL , "No valid mac control" ) ;
290
291 if ( IsKindOf( CLASSINFO( wxScrollBar ) ) )
292 {
293 // no font
294 }
295 else if ( IsKindOf( CLASSINFO( wxStaticBox ) ) || IsKindOf( CLASSINFO( wxRadioBox ) ) || IsKindOf( CLASSINFO( wxButton ) ) )
296 {
297 ControlFontStyleRec controlstyle ;
298 controlstyle.flags = kControlUseFontMask ;
299 controlstyle.font = kControlFontSmallBoldSystemFont ;
300
301 ::SetControlFontStyle( m_macControl , &controlstyle ) ;
302 }
303 else
304 {
305 ControlFontStyleRec controlstyle ;
306 controlstyle.flags = kControlUseFontMask ;
307 controlstyle.font = kControlFontSmallSystemFont ;
308
309 ::SetControlFontStyle( m_macControl , &controlstyle ) ;
310 }
311 ControlHandle container = GetParent()->MacGetContainerForEmbedding() ;
312 wxASSERT_MSG( container != NULL , wxT("No valid mac container control") ) ;
313 ::EmbedControl( m_macControl , container ) ;
314 m_macControlIsShown = true ;
315
316 wxAssociateControlWithMacControl( m_macControl , this ) ;
317
318
319 // Adjust the controls size and position
320 wxPoint pos(m_x, m_y);
321 wxSize best_size( DoGetBestSize() );
322 wxSize new_size( m_width, m_height );
323
324 m_x = m_y = m_width = m_height = -1; // Forces SetSize to move/size the control
325
326 if (new_size.x == -1) {
327 new_size.x = best_size.x;
328 }
329 if (new_size.y == -1) {
330 new_size.y = best_size.y;
331 }
332
333 SetSize(pos.x, pos.y, new_size.x, new_size.y);
334
335 UMAShowControl( m_macControl ) ;
336 Refresh() ;
337 }
338
339 void wxControl::MacAdjustControlRect()
340 {
341 wxASSERT_MSG( m_macControl != NULL , wxT("No valid mac control") ) ;
342 if ( m_width == -1 || m_height == -1 )
343 {
344 Rect bestsize = { 0 , 0 , 0 , 0 } ;
345 short baselineoffset ;
346
347 ::GetBestControlRect( m_macControl , &bestsize , &baselineoffset ) ;
348
349 if ( EmptyRect( &bestsize ) )
350 {
351 baselineoffset = 0;
352 bestsize.left = bestsize.top = 0 ;
353 bestsize.right = 16 ;
354 bestsize.bottom = 16 ;
355 if ( IsKindOf( CLASSINFO( wxScrollBar ) ) )
356 {
357 bestsize.bottom = 16 ;
358 }
359 else if ( IsKindOf( CLASSINFO( wxSpinButton ) ) )
360 {
361 bestsize.bottom = 24 ;
362 }
363 }
364
365 if ( m_width == -1 )
366 {
367 if ( IsKindOf( CLASSINFO( wxButton ) ) )
368 {
369 m_width = m_label.Length() * 8 + 12 ;
370 if ( m_width < 70 )
371 m_width = 70 ;
372 }
373 else if ( IsKindOf( CLASSINFO( wxStaticText ) ) )
374 {
375 m_width = m_label.Length() * 8 ;
376 }
377 else
378 m_width = bestsize.right - bestsize.left ;
379
380 m_width += 2 * m_macHorizontalBorder ;
381 }
382 if ( m_height == -1 )
383 {
384 m_height = bestsize.bottom - bestsize.top ;
385 if ( m_height < 10 )
386 m_height = 13 ;
387
388 m_height += 2 * m_macVerticalBorder;
389 }
390
391 UMASizeControl( m_macControl , m_width - 2 * m_macHorizontalBorder, m_height - 2 * m_macVerticalBorder ) ;
392 }
393 }
394 ControlHandle wxControl::MacGetContainerForEmbedding()
395 {
396 if ( m_macControl )
397 return m_macControl ;
398
399 return wxWindow::MacGetContainerForEmbedding() ;
400 }
401
402 void wxControl::MacSuperChangedPosition()
403 {
404 if ( m_macControl )
405 {
406 Rect contrlRect ;
407 GetControlBounds( m_macControl , &contrlRect ) ;
408 int former_mac_x = contrlRect.left ;
409 int former_mac_y = contrlRect.top ;
410 int mac_x = m_x ;
411 int mac_y = m_y ;
412 GetParent()->MacWindowToRootWindow( & mac_x , & mac_y ) ;
413
414 WindowRef rootwindow = MacGetRootWindow() ;
415
416 if ( mac_x + m_macHorizontalBorder != former_mac_x ||
417 mac_y + m_macVerticalBorder != former_mac_y )
418 {
419 {
420 Rect inval = { former_mac_y , former_mac_x , former_mac_y + m_height , former_mac_x + m_width } ;
421 InvalWindowRect( rootwindow , &inval ) ;
422 }
423 UMAMoveControl( m_macControl , mac_x + m_macHorizontalBorder , mac_y + m_macVerticalBorder ) ;
424 {
425 Rect inval = { mac_y , mac_x , mac_y + m_height , mac_x + m_width } ;
426 InvalWindowRect( rootwindow , &inval ) ;
427 }
428 }
429 }
430
431 wxWindow::MacSuperChangedPosition() ;
432 }
433
434 void wxControl::MacSuperEnabled( bool enabled )
435 {
436 Refresh(FALSE) ;
437 wxWindow::MacSuperEnabled( enabled ) ;
438 }
439
440 void wxControl::MacSuperShown( bool show )
441 {
442 if ( m_macControl )
443 {
444 if ( !show )
445 {
446 if ( m_macControlIsShown )
447 {
448 ::UMAHideControl( m_macControl ) ;
449 m_macControlIsShown = false ;
450 }
451 }
452 else
453 {
454 if ( MacIsReallyShown() && !m_macControlIsShown )
455 {
456 ::UMAShowControl( m_macControl ) ;
457 m_macControlIsShown = true ;
458 }
459 }
460 }
461
462 wxWindow::MacSuperShown( show ) ;
463 }
464
465 void wxControl::DoSetSize(int x, int y,
466 int width, int height,
467 int sizeFlags )
468 {
469 if ( m_macControl == NULL )
470 {
471 wxWindow::DoSetSize( x , y ,width , height ,sizeFlags ) ;
472 return ;
473 }
474
475 Rect oldbounds, newbounds;
476 int new_x, new_y, new_width, new_height;
477 int mac_x, mac_y;
478
479 new_x = m_x;
480 new_y = m_y;
481 new_width = m_width;
482 new_height = m_height;
483
484 if (sizeFlags & wxSIZE_ALLOW_MINUS_ONE)
485 {
486 new_x = x;
487 new_y = y;
488 new_width = width;
489 new_height = height;
490 }
491 else
492 {
493 if (x != -1) new_x = x;
494 if (y != -1) new_y = y;
495 if (width != -1) new_width = width;
496 if (height != -1) new_height = height;
497 }
498
499 if(sizeFlags & wxSIZE_AUTO)
500 {
501 wxSize size = GetBestSize();
502 if (sizeFlags & wxSIZE_AUTO_WIDTH)
503 {
504 if (width == -1) new_width = size.x;
505 }
506 if (sizeFlags & wxSIZE_AUTO_HEIGHT)
507 {
508 if (height == -1) new_height = size.y;
509 }
510 }
511 AdjustForParentClientOrigin(new_x, new_y, sizeFlags);
512
513 mac_x = new_x;
514 mac_y = new_y;
515 if(GetParent()) {
516 GetParent()->MacWindowToRootWindow(&mac_x, &mac_y);
517 }
518 GetControlBounds(m_macControl, &oldbounds);
519 oldbounds.right = oldbounds.left + m_width;
520 oldbounds.bottom = oldbounds.top + m_height;
521
522 bool doMove = false;
523 bool doResize = false;
524
525 if ( mac_x != (oldbounds.left - m_macHorizontalBorder) ||
526 mac_y != (oldbounds.top - m_macVerticalBorder) )
527 {
528 doMove = true ;
529 }
530 if ( new_width != oldbounds.right - oldbounds.left - 2 * m_macHorizontalBorder ||
531 new_height != oldbounds.bottom - oldbounds.top - 2 * m_macVerticalBorder)
532 {
533 doResize = true ;
534 }
535
536 if ( doMove || doResize )
537 {
538 Refresh() ;
539
540 // Ensure resize is within constraints
541 if ((m_minWidth != -1) && (new_width < m_minWidth)) {
542 new_width = m_minWidth;
543 }
544 if ((m_minHeight != -1) && (new_height < m_minHeight)) {
545 new_height = m_minHeight;
546 }
547 if ((m_maxWidth != -1) && (new_width > m_maxWidth)) {
548 new_width = m_maxWidth;
549 }
550 if ((m_maxHeight != -1) && (new_height > m_maxHeight)) {
551 new_height = m_maxHeight;
552 }
553
554 if ( doMove )
555 {
556 m_x = new_x;
557 m_y = new_y;
558
559 UMAMoveControl(m_macControl,
560 mac_x + m_macHorizontalBorder, mac_y + m_macVerticalBorder);
561
562 wxMoveEvent event(wxPoint(m_x, m_y), m_windowId);
563 event.SetEventObject(this);
564 GetEventHandler()->ProcessEvent(event) ;
565 }
566 if ( doResize )
567 {
568 m_width = new_width;
569 m_height = new_height;
570
571 UMASizeControl( m_macControl,
572 m_width - 2 * m_macHorizontalBorder,
573 m_height - 2 * m_macVerticalBorder ) ;
574
575
576 wxSizeEvent event(wxSize(m_width, m_height), m_windowId);
577 event.SetEventObject(this);
578 GetEventHandler()->ProcessEvent(event);
579 }
580
581 Refresh() ;
582 }
583 }
584
585 bool wxControl::Show(bool show)
586 {
587 if ( !wxWindow::Show( show ) )
588 return FALSE ;
589
590 if ( m_macControl )
591 {
592 if ( !show )
593 {
594 if ( m_macControlIsShown )
595 {
596 ::UMAHideControl( m_macControl ) ;
597 m_macControlIsShown = false ;
598 }
599 }
600 else
601 {
602 if ( MacIsReallyShown() && !m_macControlIsShown )
603 {
604 ::UMAShowControl( m_macControl ) ;
605 m_macControlIsShown = true ;
606 }
607 }
608 }
609 return TRUE ;
610 }
611
612 bool wxControl::Enable(bool enable)
613 {
614 if ( !wxWindow::Enable(enable) )
615 return FALSE;
616
617 if ( m_macControl )
618 {
619 if ( enable )
620 UMAActivateControl( m_macControl ) ;
621 else
622 UMADeactivateControl( m_macControl ) ;
623 }
624 return TRUE ;
625 }
626
627 void wxControl::Refresh(bool eraseBack, const wxRect *rect)
628 {
629 wxWindow::Refresh( eraseBack , rect ) ;
630 }
631
632 void wxControl::MacRedrawControl()
633 {
634 if ( m_macControl && MacGetRootWindow() )
635 {
636 wxClientDC dc(this) ;
637 wxMacPortSetter helper(&dc) ;
638
639 // the controls sometimes draw outside their boundaries, this
640 // should be resolved differently but is not trivial (e.g. drop shadows)
641 // since adding them to the border would yield in enormous gaps between
642 // the controls
643 Rect r = { 0 , 0 , 32000 , 32000 } ;
644 ClipRect( &r ) ;
645 wxDC::MacSetupBackgroundForCurrentPort( MacGetBackgroundBrush() ) ;
646 UMADrawControl( m_macControl ) ;
647 }
648 }
649
650 void wxControl::OnPaint(wxPaintEvent& event)
651 {
652 if ( m_macControl )
653 {
654 wxPaintDC dc(this) ;
655 wxMacPortSetter helper(&dc) ;
656 // the controls sometimes draw outside their boundaries, this
657 // should be resolved differently but is not trivial (e.g. drop shadows)
658 // since adding them to the border would yield in enormous gaps between
659 // the controls
660 Rect r = { 0 , 0 , 32000 , 32000 } ;
661 ClipRect( &r ) ;
662
663 wxDC::MacSetupBackgroundForCurrentPort( MacGetBackgroundBrush() ) ;
664 UMADrawControl( m_macControl ) ;
665 }
666 else
667 {
668 event.Skip() ;
669 }
670 }
671 void wxControl::OnEraseBackground(wxEraseEvent& event)
672 {
673 wxWindow::OnEraseBackground( event ) ;
674 }
675
676
677 void wxControl::OnKeyDown( wxKeyEvent &event )
678 {
679 if ( m_macControl == NULL )
680 return ;
681
682 EventRecord *ev = wxTheApp->MacGetCurrentEvent() ;
683 short keycode ;
684 short keychar ;
685 keychar = short(ev->message & charCodeMask);
686 keycode = short(ev->message & keyCodeMask) >> 8 ;
687
688 ::HandleControlKey( m_macControl , keycode , keychar , ev->modifiers ) ;
689 }
690
691 void wxControl::OnMouseEvent( wxMouseEvent &event )
692 {
693 if ( m_macControl == NULL )
694 {
695 event.Skip() ;
696 return ;
697 }
698
699 if (event.GetEventType() == wxEVT_LEFT_DOWN || event.GetEventType() == wxEVT_LEFT_DCLICK )
700 {
701
702 int x = event.m_x ;
703 int y = event.m_y ;
704
705 MacClientToRootWindow( &x , &y ) ;
706
707 ControlHandle control ;
708 Point localwhere ;
709 SInt16 controlpart ;
710 WindowRef window = MacGetRootWindow() ;
711
712 localwhere.h = x ;
713 localwhere.v = y ;
714
715 short modifiers = 0;
716
717 if ( !event.m_leftDown && !event.m_rightDown )
718 modifiers |= btnState ;
719
720 if ( event.m_shiftDown )
721 modifiers |= shiftKey ;
722
723 if ( event.m_controlDown )
724 modifiers |= controlKey ;
725
726 if ( event.m_altDown )
727 modifiers |= optionKey ;
728
729 if ( event.m_metaDown )
730 modifiers |= cmdKey ;
731 /*
732 #if TARGET_CARBON
733 control = FindControlUnderMouse( localwhere , window , &controlpart ) ;
734 #else
735 controlpart = FindControl( localwhere , window , &control ) ;
736 #endif
737 */
738 {
739 /*
740 if ( AcceptsFocus() && FindFocus() != this )
741 {
742 SetFocus() ;
743 }
744 */
745 control = m_macControl ;
746 if ( control && ::IsControlActive( control ) )
747 {
748 {
749 controlpart = ::HandleControlClick( control , localwhere , modifiers , (ControlActionUPP) -1 ) ;
750 wxTheApp->s_lastMouseDown = 0 ;
751 if ( control && controlpart != kControlNoPart &&
752 ! IsKindOf( CLASSINFO( wxScrollBar ) )
753 ) // otherwise we will get the event twice for scrollbar
754 {
755 MacHandleControlClick( control , controlpart ) ;
756 }
757 }
758 }
759 }
760 }
761 }
762
763 bool wxControl::MacCanFocus() const
764 {
765 { if ( m_macControl == NULL )
766 return true ;
767 else
768 return false ;
769 }
770 }
771
772 void wxControl::MacHandleControlClick( ControlHandle control , SInt16 controlpart )
773 {
774 wxASSERT_MSG( m_macControl != NULL , "No valid mac control" ) ;
775 }
776