File: clAuiNotebook.h

package info (click to toggle)
codelite 12.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 95,112 kB
  • sloc: cpp: 424,040; ansic: 18,284; php: 9,569; lex: 4,186; yacc: 2,820; python: 2,294; sh: 312; makefile: 51; xml: 13
file content (77 lines) | stat: -rw-r--r-- 3,089 bytes parent folder | download
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
#ifndef CLAUINOTEBOOK_H
#define CLAUINOTEBOOK_H

#include "cl_defs.h"
#if USE_AUI_NOTEBOOK

#include "clTab.h"
#include "clTabHistory.h"
#include "clTabRenderer.h"
#include "codelite_exports.h"
#include <vector>
#include <wx/aui/auibook.h>

class WXDLLIMPEXP_SDK clAuiNotebook : public wxAuiNotebook
{
private:
    clTabHistory::Ptr_t m_history;
    long m_customFlags;

protected:
    void OnAuiPageChanging(wxAuiNotebookEvent& evt);
    void OnAuiPageChanged(wxAuiNotebookEvent& evt);
    void OnAuiPageClosing(wxAuiNotebookEvent& evt);
    void OnAuiPageClosed(wxAuiNotebookEvent& evt);
    void OnAuiTabContextMenu(wxAuiNotebookEvent& evt);
    void OnTabCloseButton(wxAuiNotebookEvent& evt);
    void OnTabMiddleClicked(wxAuiNotebookEvent& evt);
    void OnTabBgDClick(wxAuiNotebookEvent& evt);
    void OnNavKey(wxNavigationKeyEvent& evt);
    void OnThemeChanged(wxCommandEvent& evt);

public:
    clAuiNotebook(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition,
                  const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxEmptyString);
    ~clAuiNotebook();
    long GetCustomFlags() const { return m_customFlags; }
    
    // Backward compatiblity API
    long GetStyle() const { return GetWindowStyle(); }
    void SetStyle(size_t style) { SetWindowStyle(style); }
    void EnableStyle(NotebookStyle style, bool b)
    {
        if(b) {
            SetWindowStyle(GetWindowStyle() | style);
        } else {
            SetWindowStyle(GetWindowStyle() & ~style);
        }
    }
    int GetPageIndex(const wxString& label) const;
    int GetPageIndex(wxWindow* page) const;
    clTabHistory::Ptr_t GetHistory() { return m_history; }
    wxArrayString GetAllTabsLabels();
    void SetTabDirection(wxDirection d);
    void GetAllTabs(clTab::Vec_t& tabs);

    bool DeletePage(size_t page);
    bool RemovePage(size_t page);
    int FindPage(wxWindow* page) const;
    bool AddPage(wxWindow* page, const wxString& caption, bool select = false, const wxBitmap& bitmap = wxNullBitmap);
    bool InsertPage(size_t pageIdx, wxWindow* page, const wxString& caption, bool select = false,
                    const wxBitmap& bitmap = wxNullBitmap);
};

wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_SDK, wxEVT_BOOK_PAGE_CHANGING, wxBookCtrlEvent);
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_SDK, wxEVT_BOOK_PAGE_CHANGED, wxBookCtrlEvent);
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_SDK, wxEVT_BOOK_PAGE_CLOSING, wxBookCtrlEvent);
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_SDK, wxEVT_BOOK_PAGE_CLOSED, wxBookCtrlEvent);
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_SDK, wxEVT_BOOK_PAGE_CLOSE_BUTTON, wxBookCtrlEvent);
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_SDK, wxEVT_BOOK_TAB_DCLICKED, wxBookCtrlEvent);
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_SDK, wxEVT_BOOK_NAVIGATING, wxBookCtrlEvent);
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_SDK, wxEVT_BOOK_TABAREA_DCLICKED, wxBookCtrlEvent);
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_SDK, wxEVT_BOOK_TAB_CONTEXT_MENU, wxBookCtrlEvent);

typedef clAuiNotebook Notebook;

#endif // #if USE_AUI_NOTEBOOK
#endif // CLAUINOTEBOOK_H