1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200
|
/////////////////////////////////////////////////////////////////////////////
// Name: wx/os2/notebook.h
// Purpose: MSW/GTK compatible notebook (a.k.a. property sheet)
// Author: David Webster
// Modified by:
// Copyright: (c) David Webster
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _NOTEBOOK_H
#define _NOTEBOOK_H
#if wxUSE_NOTEBOOK
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/control.h"
// ----------------------------------------------------------------------------
// wxNotebook
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxNotebook : public wxNotebookBase
{
public:
//
// Ctors
// -----
// Default for dynamic class
//
wxNotebook();
//
// the same arguments as for wxControl
//
wxNotebook( wxWindow* pParent
,wxWindowID vId
,const wxPoint& rPos = wxDefaultPosition
,const wxSize& rSize = wxDefaultSize
,long lStyle = 0
,const wxString& rsName = wxNotebookNameStr
);
bool Create( wxWindow* pParent
,wxWindowID vId
,const wxPoint& rPos = wxDefaultPosition
,const wxSize& rSize = wxDefaultSize
,long lStyle = 0
,const wxString& rsName = wxNotebookNameStr
);
//
// Accessors
// ---------
// Get number of pages in the dialog
//
virtual size_t GetPageCount(void) const;
//
// Set the currently selected page, return the index of the previously
// selected one (or wxNOT_FOUND on error)
// NB: this function will _not_ generate wxEVT_NOTEBOOK_PAGE_xxx events
//
int SetSelection(size_t nPage);
// changes selected page without sending events
int ChangeSelection(size_t nPage);
//
// Set/Get the title of a page
//
bool SetPageText( size_t nPage
,const wxString& sStrText
);
wxString GetPageText(size_t nPage) const;
//
// Image list stuff: each page may have an image associated with it. All
// the images belong to an image list, so you have to
// 1) create an image list
// 2) associate it with the notebook
// 3) set for each page it's image
// associate image list with a control
//
void SetImageList(wxImageList* pImageList);
//
// Sets/returns item's image index in the current image list
//
int GetPageImage(size_t nPage) const;
bool SetPageImage( size_t nPage
,int nImage
);
//
// Currently it's always 1 because wxGTK doesn't support multi-row
// tab controls
//
int GetRowCount(void) const;
//
// control the appearance of the notebook pages
// set the size (the same for all pages)
//
void SetPageSize(const wxSize& rSize);
//
// Set the padding between tabs (in pixels)
//
void SetPadding(const wxSize& rPadding);
//
// Operations
// ----------
// Remove all pages
//
bool DeleteAllPages(void);
//
// Adds a new page to the notebook (it will be deleted ny the notebook,
// don't delete it yourself). If bSelect, this page becomes active.
//
bool AddPage( wxNotebookPage* pPage
,const wxString& rsStrText
,bool bSelect = false
,int nImageId = -1
);
//
// The same as AddPage(), but adds it at the specified position
//
bool InsertPage( size_t nPage
,wxNotebookPage* pPage
,const wxString& rsStrText
,bool bSelect = false
,int nImageId = -1
);
//
// Windows-only at present. Also, you must use the wxNB_FIXEDWIDTH
// style.
//
void SetTabSize(const wxSize& rSize);
//
// Callbacks
// ---------
//
void OnSize(wxSizeEvent& rEvent);
void OnSelChange(wxBookCtrlEvent& rEvent);
void OnSetFocus(wxFocusEvent& rEvent);
void OnNavigationKey(wxNavigationKeyEvent& rEvent);
//
// Base class virtuals
// -------------------
//
virtual bool OS2OnScroll( int nOrientation
,WXWORD wSBCode
,WXWORD wPos
,WXHWND hControl
);
virtual void SetConstraintSizes(bool bRecurse = true);
virtual bool DoPhase(int nPhase);
protected:
//
// Common part of all ctors
//
void Init(void);
//
// Translate wxWin styles to the PM ones
//
virtual WXDWORD OS2GetStyle( long lFlags
,WXDWORD* pwExstyle = NULL
) const;
//
// Remove one page from the notebook, without deleting
//
virtual wxNotebookPage* DoRemovePage(size_t nPage);
//
// Helper functions
//
private:
wxArrayLong m_alPageId;
int m_nTabSize; // holds the largest tab size
DECLARE_DYNAMIC_CLASS(wxNotebook)
DECLARE_EVENT_TABLE()
}; // end of CLASS wxNotebook
#endif // wxUSE_NOTEBOOK
#endif // _NOTEBOOK_H
|