1 /** 2 * Copyright (c) 2005 PCMan <pcman.tw@gmail.com> 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software Foundation, 16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 */ 18 19 #ifndef NOTEBOOK_H 20 #define NOTEBOOK_H 21 22 #ifdef __GNUG__ 23 #pragma interface "notebook.h" 24 #endif 25 26 #include <widget.h> 27 #include <string> 28 29 using namespace std; 30 31 /** 32 @author PCMan 33 */ 34 class CNotebook : public CWidget 35 { 36 public: 37 CNotebook(); 38 39 ~CNotebook(); 40 // void InsertPage(int pos, CWidget* page, string title); 41 int AddPage( CWidget* page, string title, bool icon = false); RemovePage(int pos)42 void RemovePage( int pos ){ gtk_notebook_remove_page(GTK_NOTEBOOK(m_Widget), pos); } 43 SetCurPage(int i)44 void SetCurPage(int i) 45 { gtk_notebook_set_current_page((GtkNotebook*)m_Widget, i); } 46 GetCurPage()47 int GetCurPage(){ return gtk_notebook_get_current_page((GtkNotebook*)m_Widget); } 48 GetPageCount()49 int GetPageCount() { return gtk_notebook_get_n_pages((GtkNotebook*)m_Widget); } 50 NextPage()51 void NextPage() { gtk_notebook_next_page((GtkNotebook*)m_Widget); } PrevPage()52 void PrevPage() { gtk_notebook_prev_page((GtkNotebook*)m_Widget); } 53 void SetPageTitle(CWidget* page, string title); HideTabs()54 void HideTabs() { gtk_notebook_set_show_tabs((GtkNotebook*)m_Widget, false); } ShowTabs()55 void ShowTabs() { gtk_notebook_set_show_tabs((GtkNotebook*)m_Widget, true); } 56 57 }; 58 59 #endif 60