]> git.saurik.com Git - wxWidgets.git/blame - src/mac/carbon/notebmac.cpp
BU_EXACTFIT adapted
[wxWidgets.git] / src / mac / carbon / notebmac.cpp
CommitLineData
ee6b1d97
SC
1///////////////////////////////////////////////////////////////////////////////
2// Name: notebook.cpp
3// Purpose: implementation of wxNotebook
a31a5f85 4// Author: Stefan Csomor
5aed9d50 5// Modified by:
a31a5f85 6// Created: 1998-01-01
ee6b1d97 7// RCS-ID: $Id$
a31a5f85 8// Copyright: (c) Stefan Csomor
65571936 9// Licence: wxWindows licence
ee6b1d97
SC
10///////////////////////////////////////////////////////////////////////////////
11
eb22f2a6 12#ifdef __GNUG__
e40298d5 13#pragma implementation "notebook.h"
eb22f2a6
GD
14#endif
15
ee6b1d97
SC
16// ============================================================================
17// declarations
18// ============================================================================
19
20// ----------------------------------------------------------------------------
21// headers
22// ----------------------------------------------------------------------------
799690a0 23#include "wx/app.h"
d497dca4
GD
24#include "wx/string.h"
25#include "wx/log.h"
26#include "wx/imaglist.h"
061174e3 27#include "wx/image.h"
d497dca4
GD
28#include "wx/notebook.h"
29#include "wx/mac/uma.h"
ee6b1d97
SC
30// ----------------------------------------------------------------------------
31// macros
32// ----------------------------------------------------------------------------
33
34// check that the page index is valid
19c43a77 35#define IS_VALID_PAGE(nPage) ((nPage) < GetPageCount())
ee6b1d97 36
ee6b1d97
SC
37
38// ----------------------------------------------------------------------------
39// event table
40// ----------------------------------------------------------------------------
41
5b781a67
SC
42DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED)
43DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING)
44
ee6b1d97 45BEGIN_EVENT_TABLE(wxNotebook, wxControl)
461fe6e2 46 EVT_NOTEBOOK_PAGE_CHANGED(-1, wxNotebook::OnSelChange)
e40298d5 47
461fe6e2
SC
48 EVT_SIZE(wxNotebook::OnSize)
49 EVT_SET_FOCUS(wxNotebook::OnSetFocus)
50 EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey)
ee6b1d97
SC
51END_EVENT_TABLE()
52
53IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxControl)
54IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxCommandEvent)
ee6b1d97
SC
55
56// ============================================================================
57// implementation
58// ============================================================================
59
5aed9d50
RD
60// ----------------------------------------------------------------------------
61// wxNotebook construction
62// ----------------------------------------------------------------------------
63
64// common part of all ctors
65void wxNotebook::Init()
66{
ee6b1d97
SC
67 m_nSelection = -1;
68}
69
70// default for dynamic class
71wxNotebook::wxNotebook()
72{
73 Init();
74}
75
76// the same arguments as for wxControl
77wxNotebook::wxNotebook(wxWindow *parent,
78 wxWindowID id,
79 const wxPoint& pos,
80 const wxSize& size,
81 long style,
82 const wxString& name)
83{
84 Init();
5aed9d50 85
ee6b1d97
SC
86 Create(parent, id, pos, size, style, name);
87}
88
89// Create() function
90bool wxNotebook::Create(wxWindow *parent,
91 wxWindowID id,
92 const wxPoint& pos,
93 const wxSize& size,
94 long style,
95 const wxString& name)
96{
facd6764
SC
97 m_macIsUserPane = FALSE ;
98
b45ed7a2
VZ
99 if ( !wxNotebookBase::Create(parent, id, pos, size, style, name) )
100 return false;
101
facd6764 102 Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ;
5aed9d50 103
facd6764
SC
104 if( bounds.right <= bounds.left )
105 bounds.right = bounds.left + 100 ;
106 if ( bounds.bottom <= bounds.top )
107 bounds.bottom = bounds.top + 100 ;
5aed9d50 108
facd6764 109 UInt16 tabstyle = kControlTabDirectionNorth ;
e40298d5 110 if ( HasFlag(wxNB_LEFT) )
facd6764 111 tabstyle = kControlTabDirectionWest ;
e40298d5 112 else if ( HasFlag( wxNB_RIGHT ) )
facd6764 113 tabstyle = kControlTabDirectionEast ;
e40298d5 114 else if ( HasFlag( wxNB_BOTTOM ) )
facd6764
SC
115 tabstyle = kControlTabDirectionSouth ;
116
117 ControlTabSize tabsize = kControlTabSizeLarge ;
118 if ( GetWindowVariant() == wxWINDOW_VARIANT_SMALL )
119 tabsize = kControlTabSizeSmall ;
120 else if ( GetWindowVariant() == wxWINDOW_VARIANT_MINI )
121 {
122 if (UMAGetSystemVersion() >= 0x1030 )
123 tabsize = 3 ;
124 else
125 tabsize = kControlSizeSmall;
126 }
5aed9d50 127
21fd5529 128 m_peer = new wxMacControl() ;
4c37f124 129 verify_noerr ( CreateTabsControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds ,
21fd5529
SC
130 tabsize , tabstyle, 0, NULL, *m_peer ) );
131
facd6764
SC
132
133 MacPostControlCreate(pos,size) ;
e40298d5 134 return TRUE ;
ee6b1d97
SC
135}
136
137// dtor
138wxNotebook::~wxNotebook()
139{
ee6b1d97
SC
140}
141
142// ----------------------------------------------------------------------------
143// wxNotebook accessors
144// ----------------------------------------------------------------------------
90b959ae
SC
145
146void wxNotebook::SetPadding(const wxSize& padding)
147{
63ff6f53 148 // unsupported by OS
90b959ae
SC
149}
150
151void wxNotebook::SetTabSize(const wxSize& sz)
ee6b1d97 152{
63ff6f53 153 // unsupported by OS
ee6b1d97
SC
154}
155
90b959ae 156void wxNotebook::SetPageSize(const wxSize& size)
ee6b1d97 157{
63ff6f53
SC
158 SetSize( CalcSizeFromPage( size ) );
159}
160
161wxSize wxNotebook::CalcSizeFromPage(const wxSize& sizePage) const
162{
facd6764 163 return DoGetSizeFromClientSize( sizePage ) ;
63ff6f53
SC
164}
165
166wxSize wxNotebook::DoGetBestSize() const
167{
168 // calculate the max page size
169 wxSize size(0, 0);
170
171 size_t count = GetPageCount();
172 if ( count )
173 {
174 for ( size_t n = 0; n < count; n++ )
175 {
176 wxSize sizePage = m_pages[n]->GetSize();
177
178 if ( size.x < sizePage.x )
179 size.x = sizePage.x;
180 if ( size.y < sizePage.y )
181 size.y = sizePage.y;
182 }
183 }
184 else // no pages
185 {
186 // use some arbitrary default size
187 size.x =
188 size.y = 100;
189 }
190
191 return CalcSizeFromPage(size);
ee6b1d97
SC
192}
193
8f83dfee 194int wxNotebook::SetSelection(size_t nPage)
ee6b1d97 195{
461fe6e2 196 wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, wxT("notebook page out of range") );
5aed9d50 197
461fe6e2
SC
198 if ( int(nPage) != m_nSelection )
199 {
200 wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, m_windowId);
201 event.SetSelection(nPage);
202 event.SetOldSelection(m_nSelection);
203 event.SetEventObject(this);
204 if ( !GetEventHandler()->ProcessEvent(event) || event.IsAllowed() )
205 {
206 // program allows the page change
207 event.SetEventType(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED);
208 (void)GetEventHandler()->ProcessEvent(event);
209
210 ChangePage(m_nSelection, nPage);
211 }
212 }
5aed9d50 213
ee6b1d97
SC
214 return m_nSelection;
215}
216
8f83dfee 217bool wxNotebook::SetPageText(size_t nPage, const wxString& strText)
ee6b1d97
SC
218{
219 wxASSERT( IS_VALID_PAGE(nPage) );
5aed9d50 220
90b959ae 221 wxNotebookPage *page = m_pages[nPage];
c854c7d9
GD
222 page->SetLabel(strText);
223 MacSetupTabs();
5aed9d50 224
c854c7d9 225 return true;
ee6b1d97
SC
226}
227
8f83dfee 228wxString wxNotebook::GetPageText(size_t nPage) const
ee6b1d97
SC
229{
230 wxASSERT( IS_VALID_PAGE(nPage) );
5aed9d50 231
90b959ae 232 wxNotebookPage *page = m_pages[nPage];
c854c7d9 233 return page->GetLabel();
ee6b1d97
SC
234}
235
8f83dfee 236int wxNotebook::GetPageImage(size_t nPage) const
ee6b1d97 237{
fc0daf84 238 wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, _T("invalid notebook page") );
5aed9d50 239
2b5f62a0 240 return m_images[nPage];
ee6b1d97
SC
241}
242
19c43a77 243bool wxNotebook::SetPageImage(size_t nPage, int nImage)
ee6b1d97 244{
fc0daf84 245 wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, _T("invalid notebook page") );
5aed9d50 246
fc0daf84 247 wxCHECK_MSG( m_imageList && nImage < m_imageList->GetImageCount(), FALSE,
e40298d5 248 _T("invalid image index in SetPageImage()") );
5aed9d50 249
2b5f62a0
VZ
250 if ( nImage != m_images[nPage] )
251 {
252 // if the item didn't have an icon before or, on the contrary, did have
253 // it but has lost it now, its size will change - but if the icon just
254 // changes, it won't
255 m_images[nPage] = nImage;
5aed9d50 256
e40298d5 257 MacSetupTabs() ;
2b5f62a0 258 }
5aed9d50 259
2b5f62a0 260 return TRUE;
ee6b1d97
SC
261}
262
ee6b1d97
SC
263// ----------------------------------------------------------------------------
264// wxNotebook operations
265// ----------------------------------------------------------------------------
266
90b959ae 267// remove one page from the notebook, without deleting the window
8f83dfee 268wxNotebookPage* wxNotebook::DoRemovePage(size_t nPage)
ee6b1d97 269{
90b959ae
SC
270 wxCHECK( IS_VALID_PAGE(nPage), NULL );
271 wxNotebookPage* page = m_pages[nPage] ;
3ef585df 272 m_pages.RemoveAt(nPage);
5aed9d50 273
c854c7d9 274 MacSetupTabs();
5aed9d50 275
19c43a77 276 if(m_nSelection >= (int)GetPageCount()) {
c854c7d9
GD
277 m_nSelection = GetPageCount() - 1;
278 }
279 if(m_nSelection >= 0) {
90b959ae 280 m_pages[m_nSelection]->Show(true);
c854c7d9 281 }
90b959ae 282 return page;
ee6b1d97
SC
283}
284
285// remove all pages
286bool wxNotebook::DeleteAllPages()
287{
90b959ae 288 WX_CLEAR_ARRAY(m_pages) ;
c854c7d9 289 MacSetupTabs();
061174e3 290 m_nSelection = -1 ;
ee6b1d97
SC
291 return TRUE;
292}
293
ee6b1d97
SC
294
295// same as AddPage() but does it at given position
8f83dfee 296bool wxNotebook::InsertPage(size_t nPage,
ee6b1d97
SC
297 wxNotebookPage *pPage,
298 const wxString& strText,
299 bool bSelect,
300 int imageId)
301{
19c43a77
VZ
302 if ( !wxNotebookBase::InsertPage(nPage, pPage, strText, bSelect, imageId) )
303 return false;
5aed9d50 304
461fe6e2
SC
305 wxASSERT_MSG( pPage->GetParent() == this,
306 _T("notebook pages must have notebook as parent") );
307
308 // don't show pages by default (we'll need to adjust their size first)
309 pPage->Show( false ) ;
310
c854c7d9 311 pPage->SetLabel(strText);
5aed9d50 312
2b5f62a0 313 m_images.Insert(imageId, nPage);
5aed9d50 314
c854c7d9 315 MacSetupTabs();
5aed9d50 316
63ff6f53
SC
317 wxRect rect = GetPageRect() ;
318 pPage->SetSize(rect);
c854c7d9
GD
319 if ( pPage->GetAutoLayout() ) {
320 pPage->Layout();
321 }
5aed9d50 322
461fe6e2
SC
323
324 // now deal with the selection
325 // ---------------------------
326
327 // if the inserted page is before the selected one, we must update the
328 // index of the selected page
329
330 if ( int(nPage) <= m_nSelection )
331 {
332 m_nSelection++;
333 // while this still is the same page showing, we need to update the tabs
21fd5529 334 SetControl32BitValue( *m_peer , m_nSelection + 1 ) ;
461fe6e2
SC
335 }
336
337 // some page should be selected: either this one or the first one if there
338 // is still no selection
339 int selNew = -1;
340 if ( bSelect )
341 selNew = nPage;
342 else if ( m_nSelection == -1 )
343 selNew = 0;
344
345 if ( selNew != -1 )
346 SetSelection(selNew);
347
c854c7d9
GD
348 return true;
349}
350
351/* Added by Mark Newsam
e40298d5 352* When a page is added or deleted to the notebook this function updates
21fd5529 353* information held in the control so that it matches the order
e40298d5
JS
354* the user would expect.
355*/
c854c7d9
GD
356void wxNotebook::MacSetupTabs()
357{
21fd5529 358 SetControl32BitMaximum( *m_peer , GetPageCount() ) ;
5aed9d50 359
c854c7d9
GD
360 wxNotebookPage *page;
361 ControlTabInfoRec info;
5aed9d50 362
19c43a77
VZ
363 const size_t countPages = GetPageCount();
364 for(size_t ii = 0; ii < countPages; ii++)
c854c7d9 365 {
90b959ae 366 page = m_pages[ii];
c854c7d9
GD
367 info.version = 0;
368 info.iconSuiteID = 0;
427ff662
SC
369 wxMacStringToPascal( page->GetLabel() , info.name ) ;
370
21fd5529 371 SetControlData( *m_peer, ii+1, kControlTabInfoTag,
e40298d5 372 sizeof( ControlTabInfoRec) , (char*) &info ) ;
21fd5529 373 SetTabEnabled( *m_peer , ii+1 , true ) ;
22026088 374#if TARGET_CARBON
2b5f62a0
VZ
375 if ( GetImageList() && GetPageImage(ii) >= 0 && UMAGetSystemVersion() >= 0x1020 )
376 {
e40298d5
JS
377 // tab controls only support very specific types of images, therefore we are doing an odyssee
378 // accross the icon worlds (even Apple DTS did not find a shorter path)
379 // in order not to pollute the icon registry we put every icon into (OSType) 1 and immediately
5aed9d50 380 // afterwards Unregister it (IconRef is ref counted, so it will stay on the tab even if we
e40298d5 381 // unregister it) in case this will ever lead to having the same icon everywhere add some kind
5aed9d50 382 // of static counter
69efd83d 383 const wxBitmap* bmap = GetImageList()->GetBitmap( GetPageImage(ii ) ) ;
061174e3
SC
384 if ( bmap )
385 {
386 wxBitmap scaledBitmap ;
387 if ( bmap->GetWidth() != 16 || bmap->GetHeight() != 16 )
388 {
389 scaledBitmap = wxBitmap( bmap->ConvertToImage().Scale(16,16) ) ;
390 bmap = &scaledBitmap ;
391 }
392 ControlButtonContentInfo info ;
393 wxMacCreateBitmapButton( &info , *bmap , kControlContentPictHandle) ;
394 IconFamilyHandle iconFamily = (IconFamilyHandle) NewHandle(0) ;
395 OSErr err = SetIconFamilyData( iconFamily, 'PICT' , (Handle) info.u.picture ) ;
396 wxASSERT_MSG( err == noErr , wxT("Error when adding bitmap") ) ;
397 IconRef iconRef ;
d5f7923b 398 err = RegisterIconRefFromIconFamily( 'WXNG' , (OSType) 1, iconFamily, &iconRef ) ;
061174e3
SC
399 wxASSERT_MSG( err == noErr , wxT("Error when adding bitmap") ) ;
400 info.contentType = kControlContentIconRef ;
401 info.u.iconRef = iconRef ;
21fd5529 402 SetControlData( *m_peer, ii+1,kControlTabImageContentTag,
061174e3
SC
403 sizeof( info ), (Ptr)&info );
404 wxASSERT_MSG( err == noErr , wxT("Error when setting icon on tab") ) ;
d8c59747 405 if ( UMAGetSystemVersion() < 0x1030 )
d5f7923b
SC
406 {
407 UnregisterIconRef( 'WXNG' , (OSType) 1 ) ;
408 }
409
061174e3
SC
410 ReleaseIconRef( iconRef ) ;
411 DisposeHandle( (Handle) iconFamily ) ;
412 }
2b5f62a0
VZ
413 }
414#endif
c854c7d9
GD
415 }
416 Rect bounds;
21fd5529 417 UMAGetControlBoundsInWindowCoords(*m_peer, &bounds);
facd6764 418 InvalWindowRect((WindowRef)MacGetTopLevelWindowRef(), &bounds);
ee6b1d97
SC
419}
420
63ff6f53
SC
421wxRect wxNotebook::GetPageRect() const
422{
facd6764
SC
423 wxSize size = GetClientSize() ;
424 return wxRect( 0 , 0 , size.x , size.y ) ;
63ff6f53 425}
ee6b1d97
SC
426// ----------------------------------------------------------------------------
427// wxNotebook callbacks
428// ----------------------------------------------------------------------------
429
430// @@@ OnSize() is used for setting the font when it's called for the first
431// time because doing it in ::Create() doesn't work (for unknown reasons)
432void wxNotebook::OnSize(wxSizeEvent& event)
433{
5aed9d50 434
90b959ae 435 unsigned int nCount = m_pages.Count();
63ff6f53 436 wxRect rect = GetPageRect() ;
ee6b1d97 437 for ( unsigned int nPage = 0; nPage < nCount; nPage++ ) {
90b959ae 438 wxNotebookPage *pPage = m_pages[nPage];
63ff6f53 439 pPage->SetSize(rect);
c854c7d9 440 if ( pPage->GetAutoLayout() ) {
ee6b1d97 441 pPage->Layout();
c854c7d9 442 }
ee6b1d97 443 }
5aed9d50 444
ee6b1d97
SC
445 // Processing continues to next OnSize
446 event.Skip();
447}
448
449void wxNotebook::OnSelChange(wxNotebookEvent& event)
450{
451 // is it our tab control?
452 if ( event.GetEventObject() == this )
453 ChangePage(event.GetOldSelection(), event.GetSelection());
5aed9d50 454
ee6b1d97
SC
455 // we want to give others a chance to process this message as well
456 event.Skip();
457}
458
459void wxNotebook::OnSetFocus(wxFocusEvent& event)
460{
461 // set focus to the currently selected page if any
462 if ( m_nSelection != -1 )
90b959ae 463 m_pages[m_nSelection]->SetFocus();
5aed9d50 464
ee6b1d97
SC
465 event.Skip();
466}
467
468void wxNotebook::OnNavigationKey(wxNavigationKeyEvent& event)
469{
470 if ( event.IsWindowChange() ) {
471 // change pages
472 AdvanceSelection(event.GetDirection());
473 }
474 else {
461fe6e2
SC
475 // we get this event in 2 cases
476 //
477 // a) one of our pages might have generated it because the user TABbed
478 // out from it in which case we should propagate the event upwards and
479 // our parent will take care of setting the focus to prev/next sibling
480 //
481 // or
482 //
483 // b) the parent panel wants to give the focus to us so that we
484 // forward it to our selected page. We can't deal with this in
485 // OnSetFocus() because we don't know which direction the focus came
486 // from in this case and so can't choose between setting the focus to
487 // first or last panel child
488 wxWindow *parent = GetParent();
489 // the cast is here to fic a GCC ICE
490 if ( ((wxWindow*)event.GetEventObject()) == parent )
491 {
492 // no, it doesn't come from child, case (b): forward to a page
493 if ( m_nSelection != -1 )
494 {
495 // so that the page knows that the event comes from it's parent
496 // and is being propagated downwards
497 event.SetEventObject(this);
498
499 wxWindow *page = m_pages[m_nSelection];
500 if ( !page->GetEventHandler()->ProcessEvent(event) )
501 {
502 page->SetFocus();
503 }
504 //else: page manages focus inside it itself
505 }
506 else
507 {
508 // we have no pages - still have to give focus to _something_
509 SetFocus();
510 }
511 }
512 else
513 {
514 // it comes from our child, case (a), pass to the parent
515 if ( parent ) {
516 event.SetCurrentFocus(this);
517 parent->GetEventHandler()->ProcessEvent(event);
518 }
ee6b1d97
SC
519 }
520 }
521}
522
523// ----------------------------------------------------------------------------
524// wxNotebook base class virtuals
525// ----------------------------------------------------------------------------
526
461fe6e2
SC
527#if wxUSE_CONSTRAINTS
528
ee6b1d97
SC
529// override these 2 functions to do nothing: everything is done in OnSize
530
461fe6e2 531void wxNotebook::SetConstraintSizes(bool WXUNUSED(recurse))
ee6b1d97 532{
461fe6e2
SC
533 // don't set the sizes of the pages - their correct size is not yet known
534 wxControl::SetConstraintSizes(FALSE);
ee6b1d97
SC
535}
536
461fe6e2 537bool wxNotebook::DoPhase(int WXUNUSED(nPhase))
ee6b1d97 538{
461fe6e2 539 return TRUE;
ee6b1d97
SC
540}
541
461fe6e2
SC
542#endif // wxUSE_CONSTRAINTS
543
ee6b1d97
SC
544void wxNotebook::Command(wxCommandEvent& event)
545{
427ff662 546 wxFAIL_MSG(wxT("wxNotebook::Command not implemented"));
ee6b1d97
SC
547}
548
549// ----------------------------------------------------------------------------
550// wxNotebook helper functions
551// ----------------------------------------------------------------------------
552
553// hide the currently active panel and show the new one
554void wxNotebook::ChangePage(int nOldSel, int nSel)
555{
461fe6e2
SC
556 if ( nOldSel != -1 )
557 {
558 m_pages[nOldSel]->Show(FALSE);
559 }
560
561 if ( nSel != -1 )
c854c7d9 562 {
90b959ae 563 wxNotebookPage *pPage = m_pages[nSel];
c854c7d9
GD
564 pPage->Show(TRUE);
565 pPage->SetFocus();
c854c7d9 566 }
461fe6e2 567
ee6b1d97 568 m_nSelection = nSel;
21fd5529 569 SetControl32BitValue( *m_peer , m_nSelection + 1 ) ;
ee6b1d97
SC
570}
571
4c37f124 572wxInt32 wxNotebook::MacControlHit(WXEVENTHANDLERREF WXUNUSED(handler) , WXEVENTREF WXUNUSED(event) )
799690a0 573{
4c37f124
SC
574 OSStatus status = eventNotHandledErr ;
575
21fd5529 576 SInt32 newSel = GetControl32BitValue( *m_peer ) - 1 ;
4c37f124 577 if ( newSel != m_nSelection )
e40298d5 578 {
4c37f124
SC
579 wxNotebookEvent changing(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, m_windowId,
580 newSel , m_nSelection);
581 changing.SetEventObject(this);
582 GetEventHandler()->ProcessEvent(changing);
5aed9d50 583
4c37f124 584 if(changing.IsAllowed())
e40298d5 585 {
4c37f124
SC
586 wxNotebookEvent event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, m_windowId,
587 newSel, m_nSelection);
588 event.SetEventObject(this);
5aed9d50 589
4c37f124
SC
590 GetEventHandler()->ProcessEvent(event);
591 }
592 else
593 {
21fd5529 594 SetControl32BitValue( *m_peer , m_nSelection + 1 ) ;
e40298d5 595 }
4c37f124 596 status = noErr ;
e40298d5 597 }
4c37f124 598 return status ;
ee6b1d97
SC
599}
600