wxNoteBook alternative on MAC

If you have a cool piece of software to share, but you are not hosting it officially yet, please dump it in here. If you have code snippets that are useful, please donate!
Post Reply
kshitij_ds
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 205
Joined: Wed Jun 25, 2008 3:37 pm

wxNoteBook alternative on MAC

Post by kshitij_ds » Fri Jun 04, 2010 9:03 pm

Hi All,
I have used wxNoteBook to create a dialog. However, the same does not look good on MAC. Under Mac, the tab control is not properly sized, aligned and fails to autoresize itself whenever the window/pane/dialog is resized.

Can anyone suggest as to which class can be used instead of this?


TIA

Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Post by Auria » Fri Jun 04, 2010 11:17 pm

Hi,

you can look at wxAuiTabBar (or whatever the name), or wxFlatNoteBook (an add-on).

However, I wonder about the issues you mentionned. Many wxmac projects use wxNotebooks and they do resize and align correctly.
"Keyboard not detected. Press F1 to continue"
-- Windows

kshitij_ds
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 205
Joined: Wed Jun 25, 2008 3:37 pm

Post by kshitij_ds » Mon Jun 07, 2010 7:37 pm

Hi Auria,
I tried using wxAuiNoteBook and it looks pretty good. However, i get an assert failure when i try to click on a tab/page of my wxAuiNoteBook.

Here is my code:

Code: Select all

wxAuiPaneManager paneManager;

  myauiNB = new wxAUINotebook( this, ID_MYAUI_NB, wxPoint( 0, 0 ), wxDefaultSize );
  paneManager.AddPane( myauiNB ,
                        wxAuiPaneInfo().Name( _T("Hello") ).Caption( _( "My View" ) ).Left().BestSize( 400, 300 ) );

for ( int wrkItem = 0; wrkItem < wrkCount; wrkItem ++ )
  {
    if ( wrkItem == wrk1 )
    {
      Wrk[wrkItem] = ueDir;
    }
    else if ( wrkItem == wrk2 )
    {
      Wrk[wrkItem] = new myControl( myauiNB , someid);
      //This class is derived from wxControl and is a custom control containing textctrl and a button
    }
    else if ( wrkItem == wrk2 )
    {

      Wrk[wrkItem] = new mySecondControl( myauiNB , someid2 );
    }
    else
    {
      Wrk[wrkItem] = new wxTreeCtrl( myauiNB , someid3, wxTR_EDIT_LABELS | wxTR_MULTIPLE | wxTR_HAS_BUTTONS, 0, 0, wxTR_DEFAULT_STYLE );
 
    }
    myauiNB ->AddPage( Wrk[wrkItem], Str[wrkItem], true );
    //Str is an array of string that will contain the label for each page/tab
  }

);


Now after the above is done, my aplpication launches, but after clicking on a tab other than tab#0, it gives me assert failure.
I tried debugging through wxAuiNoteBook class and found that m_tabs.GetPageCount() returns 1.
But when i checked the value while AddPage was called in the for...loop, it returned correct value.
I am not deleting or removing any pages in my code at all and above code is the exact code i have in my class.


Please help.

Post Reply