Code::Blocks  SVN r11506
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
cbAuiNotebook Class Reference

A notebook class This class is derived from wxAuiNotebook, to enhance its abilities. More...

#include <cbauibook.h>

Inheritance diagram for cbAuiNotebook:
Collaboration diagram for cbAuiNotebook:

Public Member Functions

 cbAuiNotebook (wxWindow *pParent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxAUI_NB_DEFAULT_STYLE)
 cbAuiNotebook constructor More...
 
 ~cbAuiNotebook () override
 cbAuiNotebook destructor More...
 
void AdvanceSelection (bool forward=true)
 Advances the selection. More...
 
wxString SavePerspective (const wxString projectTitle=wxEmptyString)
 Save layout of the notebook. More...
 
bool LoadPerspective (const wxString &layout, bool mergeLayouts=false)
 Loads serialized notebook layout. More...
 
int GetTabIndexFromTooltip (const wxString &text)
 Get the tab index from tooltiptext. More...
 
int GetTabPositionFromIndex (int index)
 Get the tab position. More...
 
void MinimizeFreeSpace ()
 Minmize free horizontal page. More...
 
bool DeletePage (size_t page)
 Delete Page. More...
 
bool RemovePage (size_t page)
 Remove Page. More...
 
bool MovePage (wxWindow *page, size_t new_idx)
 Move page. More...
 
bool AddPage (wxWindow *page, const wxString &caption, bool select=false, const wxBitmap &bitmap=wxNullBitmap)
 Add Page. More...
 
bool InsertPage (size_t page_idx, wxWindow *page, const wxString &caption, bool select=false, const wxBitmap &bitmap=wxNullBitmap)
 Insert Page. More...
 
void SetZoom (int zoom)
 Set zoomfactor for builtin editors. More...
 
void FocusActiveTabCtrl ()
 Set Focus on the tabCtrl belonging to the active tab. More...
 
wxAuiTabCtrl * GetTabCtrl (wxWindow *page)
 Returns a pointer to the page's tab control or nullptr. More...
 
void GetPagesInTabCtrl (std::vector< wxWindow *> &result, wxWindow *page)
 Return a vector containing all pages that are in the same tab control as the page passed as parameter. More...
 
- Public Member Functions inherited from wxAuiNotebook
 wxAuiNotebook ()
 
 wxAuiNotebook (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxAUI_NB_DEFAULT_STYLE)
 
bool AddPage (wxWindow *page, const wxString &caption, bool select=false, const wxBitmap &bitmap=wxNullBitmap)
 
virtual bool AddPage (wxWindow *page, const wxString &text, bool select, int imageId)
 
void AdvanceSelection (bool forward=true)
 
virtual int ChangeSelection (size_t n)
 
bool Create (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0)
 
virtual bool DeleteAllPages ()
 
wxAuiTabArtGetArtProvider () const
 
wxWindowGetCurrentPage () const
 
int GetHeightForPageHeight (int pageHeight)
 
wxWindowGetPage (size_t page_idx) const
 
wxBitmap GetPageBitmap (size_t page) const
 
size_t GetPageCount () const
 
int GetPageIndex (wxWindow *page_wnd) const
 
wxString GetPageText (size_t page) const
 
wxString GetPageToolTip (size_t pageIdx) const
 
int GetSelection () const
 
int GetTabCtrlHeight () const
 
bool InsertPage (size_t page_idx, wxWindow *page, const wxString &caption, bool select=false, const wxBitmap &bitmap=wxNullBitmap)
 
virtual bool InsertPage (size_t index, wxWindow *page, const wxString &text, bool select=false, int imageId=NO_IMAGE)
 
void SetArtProvider (wxAuiTabArt *art)
 
virtual bool SetFont (const wxFont &font)
 
void SetMeasuringFont (const wxFont &font)
 
void SetNormalFont (const wxFont &font)
 
bool SetPageBitmap (size_t page, const wxBitmap &bitmap)
 
virtual bool SetPageImage (size_t n, int imageId)
 
bool SetPageText (size_t page, const wxString &text)
 
bool SetPageToolTip (size_t page, const wxString &text)
 
void SetSelectedFont (const wxFont &font)
 
size_t SetSelection (size_t new_page)
 
virtual void SetTabCtrlHeight (int height)
 
bool ShowWindowMenu ()
 
virtual void SetUniformBitmapSize (const wxSize &size)
 
virtual void Split (size_t page, int direction)
 
 wxBookCtrlBase ()
 
 wxBookCtrlBase (wxWindow *parent, wxWindowID winid, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxString &name=wxEmptyString)
 
bool Create (wxWindow *parent, wxWindowID winid, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxString &name=wxEmptyString)
 
virtual void SetPageSize (const wxSize &size)
 
virtual int HitTest (const wxPoint &pt, long *flags=NULL) const
 
virtual int GetPageImage (size_t nPage) const=0
 
wxWindowGetCurrentPage () const
 
void AdvanceSelection (bool forward=true)
 
int FindPage (const wxWindow *page) const
 
wxWindowGetPage (size_t page) const
 
 wxWithImages ()
 
virtual ~wxWithImages ()
 
void AssignImageList (wxImageList *imageList)
 
virtual void SetImageList (wxImageList *imageList)
 
wxImageListGetImageList () const
 

Static Public Member Functions

static void UseToolTips (bool use=true)
 Enable or disable tabtooltips globally. More...
 
static void AllowScrolling (bool allow=true)
 Enable or disable tab-scrolling with mousewheel. More...
 
static void SetModKeys (wxString keys=_T("Strg"))
 Sets the modifier keys for scrolling. More...
 
static void UseModToAdvance (bool use=false)
 Use modkey to advance through tabs with mousewheel. More...
 
static void InvertAdvanceDirection (bool invert=false)
 Change direction of tab-advancing with mousewheel. More...
 
static void InvertMoveDirection (bool invert=false)
 Change direction of tab-moving with mousewheel. More...
 

Protected Member Functions

wxString UniqueIdFromTooltip (const wxString &text)
 Create a unique id from the tooltip-text. More...
 
void MinimizeFreeSpace (wxAuiTabCtrl *tabCtrl)
 Minmize free horizontal page of tabCtrl. More...
 
void OnNavigationKeyNotebook (wxNavigationKeyEvent &event)
 Handle the navigation key event. More...
 
void OnIdle (cb_unused wxIdleEvent &event)
 OnIdle. More...
 
void OnTabCtrlDblClick (wxMouseEvent &event)
 Catch doubleclick-events from wxTabCtrl. More...
 
void OnTabCtrlMouseWheel (wxMouseEvent &event)
 Catch mousewheel-events from wxTabCtrl. More...
 
void OnResize (wxSizeEvent &event)
 Catch resize-events and call MinimizeFreeSpace() More...
 
void OnDragDone (wxAuiNotebookEvent &event)
 Catch dragdone-events from wxTabCtrl. More...
 
void OnEnterTabCtrl (wxMouseEvent &event)
 Catch mouseenter-events from wxTabCtrl. More...
 
void OnLeaveTabCtrl (wxMouseEvent &event)
 Catch mouseleave-events from wxTabCtrl. More...
 
bool IsFocusStored (wxWindow *page)
 Checks the old focus. More...
 
void StoreFocus ()
 Save old focus. More...
 
void RestoreFocus ()
 Restore old focus. More...
 
void ResetTabCtrlEvents ()
 Reset tabctrl events. More...
 
void UpdateTabControlsArray ()
 Updates the array, that holds the wxTabCtrls. More...
 
bool CheckKeyModifier ()
 Check for pressed modifier-keys. More...
 
- Protected Member Functions inherited from wxAuiNotebook
bool HasImageList () const
 
wxIcon GetImage (int iconIndex) const
 

Protected Attributes

cbAuiTabCtrlArray m_TabCtrls
 Holds the wxTabCtrls used by the notebook. More...
 
int m_LastSelected
 Last selected tab. More...
 
long m_LastId
 Id of last focused window. More...
 
bool m_SetZoomOnIdle
 If true, zoom for all editors is set in next OnIdle-call. More...
 
bool m_MinimizeFreeSpaceOnIdle
 If true, MinimizeFreeSpace is called in next OnIdle-call. More...
 
wxSize m_TabCtrlSize
 Holds the size of a tabCtrl after a resize event. More...
 

Static Protected Attributes

static bool s_UseTabTooltips
 Enable or disable tab tooltips. More...
 
static bool s_AllowMousewheel = true
 Enable or disable scrolling tabs with mousewheel. More...
 
static cbAuiNotebookArray s_cbAuiNotebookArray
 Holds an array of all existing cbAuiNotebooks. More...
 
static wxString s_modKeys = _T("Ctrl")
 Holds the modifier keys for scrolling. More...
 
static bool s_modToAdvance = false
 Use modkey to advance through tabs with mousewheel. More...
 
static int s_moveDirection = 1
 Mousewheel move direction: negative => invert. More...
 
static int s_advanceDirection = 1
 Mouseweheel advance direction: negative => invert. More...
 

Detailed Description

A notebook class This class is derived from wxAuiNotebook, to enhance its abilities.

It adds the ability to store (and restore) the visible tab-order, because wxAuiNotebook-tabs can be reordered with drag and drop. Another added feature is the possibility to add tooltips to the tabs belonging to added panes.

Definition at line 30 of file cbauibook.h.

Constructor & Destructor Documentation

◆ cbAuiNotebook()

cbAuiNotebook::cbAuiNotebook ( wxWindow pParent,
wxWindowID  id,
const wxPoint pos = wxDefaultPosition,
const wxSize size = wxDefaultSize,
long  style = wxAUI_NB_DEFAULT_STYLE 
)

cbAuiNotebook constructor

Parameters
pParentthe parent window, usually the app-window
idthe notebook id
posthe position
sizethe size
stylethe notebook style

Definition at line 49 of file cbauibook.cpp.

References _T, Manager::Get(), Manager::GetConfigManager(), InvertAdvanceDirection(), InvertMoveDirection(), ConfigManager::Read(), ConfigManager::ReadBool(), wxToolTip::SetMaxWidth(), wxAUI_MGR_TRANSPARENT_HINT, wxAUI_MGR_VENETIAN_BLINDS_HINT, and wxNOT_FOUND.

◆ ~cbAuiNotebook()

cbAuiNotebook::~cbAuiNotebook ( )
override

cbAuiNotebook destructor

Definition at line 80 of file cbauibook.cpp.

References s_cbAuiNotebookArray.

Member Function Documentation

◆ AddPage()

bool cbAuiNotebook::AddPage ( wxWindow page,
const wxString caption,
bool  select = false,
const wxBitmap bitmap = wxNullBitmap 
)

Add Page.

Calls the base-class function and after that MinmizeFreeSpace().

Parameters
pageThe page to add
captionThe caption of the page
selectIf true the page gets selected
bitmapThe bitmap of the tab
Returns
true if successfull

Definition at line 561 of file cbauibook.cpp.

References wxAuiNotebook::AddPage(), and MinimizeFreeSpace().

Referenced by InfoPane::AddPagePrivate(), NativeParser::CreateClassBrowser(), and ProjectManagerUI::InitPane().

◆ AdvanceSelection()

void cbAuiNotebook::AdvanceSelection ( bool  forward = true)

Advances the selection.

In contrast to the base-classes function, it uses the visible tab-order, not the order of creation and jumps to the first tab, if the last is reached (and vice versa)

Parameters
forwardif false direction is backwards

Definition at line 622 of file cbauibook.cpp.

References wxAuiNotebook::GetPage(), wxAuiNotebook::GetPageCount(), wxAuiNotebook::GetPageIndex(), wxAuiNotebook::GetSelection(), and wxAuiNotebook::SetSelection().

Referenced by OnNavigationKeyNotebook(), and OnTabCtrlMouseWheel().

◆ AllowScrolling()

void cbAuiNotebook::AllowScrolling ( bool  allow = true)
static

Enable or disable tab-scrolling with mousewheel.

Parameters
allowIf true scrolling is allowed

Definition at line 1109 of file cbauibook.cpp.

References s_AllowMousewheel, and s_cbAuiNotebookArray.

Referenced by EnvironmentSettingsDlg::EndModal().

◆ CheckKeyModifier()

bool cbAuiNotebook::CheckKeyModifier ( )
protected

Check for pressed modifier-keys.

Check whether all modifier keys in keyModifier are pressed or not

Parameters
keyModifierwxSTring containing the modifier(s) to check for
Returns
true If all modifier-keys are pressed

Definition at line 85 of file cbauibook.cpp.

References wxString::Contains(), wxString::MakeUpper(), s_modKeys, wxGetKeyState(), WXK_ALT, WXK_COMMAND, WXK_CONTROL, WXK_SHIFT, and wxT.

Referenced by OnTabCtrlMouseWheel().

◆ DeletePage()

bool cbAuiNotebook::DeletePage ( size_t  page)
virtual

Delete Page.

Calls the base-class function and after that MinmizeFreeSpace(), needed to hook into the close-events. The system generated close event has to be veto'd, and Close() has to be called manually, so we can handle it ourselves.

Parameters
Theindex of the tab to be closed
Returns
true if successfull

Reimplemented from wxAuiNotebook.

Definition at line 520 of file cbauibook.cpp.

References wxAuiNotebook::DeletePage(), wxAuiNotebook::GetPage(), IsFocusStored(), m_LastId, m_LastSelected, MinimizeFreeSpace(), and wxNOT_FOUND.

Referenced by InfoPane::DeleteLogger(), and InfoPane::DeleteNonLogger().

◆ FocusActiveTabCtrl()

void cbAuiNotebook::FocusActiveTabCtrl ( )

Set Focus on the tabCtrl belonging to the active tab.

Definition at line 180 of file cbauibook.cpp.

References wxAuiNotebook::GetPage(), wxAuiNotebook::GetSelection(), m_TabCtrls, and UpdateTabControlsArray().

Referenced by MainFrame::OnFocusEditor(), and MainFrame::OnFocusManagement().

◆ GetPagesInTabCtrl()

void cbAuiNotebook::GetPagesInTabCtrl ( std::vector< wxWindow *> &  result,
wxWindow page 
)

Return a vector containing all pages that are in the same tab control as the page passed as parameter.

Definition at line 216 of file cbauibook.cpp.

References GetTabCtrl().

◆ GetTabCtrl()

wxAuiTabCtrl * cbAuiNotebook::GetTabCtrl ( wxWindow page)

Returns a pointer to the page's tab control or nullptr.

Definition at line 202 of file cbauibook.cpp.

Referenced by GetPagesInTabCtrl().

◆ GetTabIndexFromTooltip()

int cbAuiNotebook::GetTabIndexFromTooltip ( const wxString text)

Get the tab index from tooltiptext.

Parameters
textthe notebooks name
Returns
int the tab's index
Remarks
We use the name internally to store the tooltip-text. To use it in this function, we create a unique string from the relative filename and the projects title. So it should be unique even after a restart of C::B.

Definition at line 791 of file cbauibook.cpp.

References wxAuiNotebook::GetPageToolTip(), UniqueIdFromTooltip(), and wxT.

Referenced by LoadPerspective().

◆ GetTabPositionFromIndex()

int cbAuiNotebook::GetTabPositionFromIndex ( int  index)

Get the tab position.

Returns the position of the tab as it is visible. Starts with 0

Parameters
indexthe index of the tab in order of creation
Returns
int the visible position

Definition at line 582 of file cbauibook.cpp.

References wxAuiNotebook::GetPage(), wxAuiNotebook::GetPageCount(), m_TabCtrls, UpdateTabControlsArray(), wxNOT_FOUND, and wxT.

Referenced by InfoPane::UpdateEffectiveTabOrder().

◆ InsertPage()

bool cbAuiNotebook::InsertPage ( size_t  page_idx,
wxWindow page,
const wxString caption,
bool  select = false,
const wxBitmap bitmap = wxNullBitmap 
)

Insert Page.

Calls the base-class function and after that MinmizeFreeSpace().

Parameters
page_idxThe index where the page should be inserted
pageThe page to add
captionThe caption of the page
selectIf true the page gets selected
bitmapThe bitmap of the tab
Returns
true if successfull

Definition at line 571 of file cbauibook.cpp.

References wxAuiNotebook::InsertPage(), and MinimizeFreeSpace().

Referenced by InfoPane::InsertPagePrivate().

◆ InvertAdvanceDirection()

void cbAuiNotebook::InvertAdvanceDirection ( bool  invert = false)
static

Change direction of tab-advancing with mousewheel.

Parameters
invertIf true advance direction is inverted

Definition at line 1129 of file cbauibook.cpp.

References s_advanceDirection.

Referenced by cbAuiNotebook(), and EnvironmentSettingsDlg::EndModal().

◆ InvertMoveDirection()

void cbAuiNotebook::InvertMoveDirection ( bool  invert = false)
static

Change direction of tab-moving with mousewheel.

Parameters
invertIf true move direction is inverted

Definition at line 1134 of file cbauibook.cpp.

References s_moveDirection.

Referenced by cbAuiNotebook(), and EnvironmentSettingsDlg::EndModal().

◆ IsFocusStored()

bool cbAuiNotebook::IsFocusStored ( wxWindow page)
protected

Checks the old focus.

Checks whether the old focused window or one of it's parents is the same as page. If they are equal, we have to reset the stored pointer, because we get a crash otherwise.

Parameters
pageThe page to check against
Returns
bool

Definition at line 309 of file cbauibook.cpp.

References m_LastId.

Referenced by DeletePage(), and RemovePage().

◆ LoadPerspective()

bool cbAuiNotebook::LoadPerspective ( const wxString layout,
bool  mergeLayouts = false 
)

◆ MinimizeFreeSpace() [1/2]

void cbAuiNotebook::MinimizeFreeSpace ( )

Minmize free horizontal page.

Moves the active tab of all tabCtrl's to the rightmost place, to show as many tabs as possible.

Definition at line 480 of file cbauibook.cpp.

References wxAuiNotebook::GetPageCount(), and m_MinimizeFreeSpaceOnIdle.

Referenced by AddPage(), DeletePage(), InsertPage(), MovePage(), OnIdle(), OnResize(), RemovePage(), and ProjectManager::WorkspaceChanged().

◆ MinimizeFreeSpace() [2/2]

void cbAuiNotebook::MinimizeFreeSpace ( wxAuiTabCtrl *  tabCtrl)
protected

Minmize free horizontal page of tabCtrl.

Moves the active tab of tabCtrl to the rightmost place, to show as many tabs as possible.

Parameters
tabCtrlThe tabCtrl to act on

Definition at line 487 of file cbauibook.cpp.

References wxAuiNotebook::GetPage(), and IsWindowReallyShown().

◆ MovePage()

bool cbAuiNotebook::MovePage ( wxWindow page,
size_t  new_idx 
)

Move page.

Moves the tab containing page to new_idx

Parameters
pageThe page to move (e.g. cbEditor*)
new_idxThe index the page should be moved to
Returns
true if successfull

Definition at line 548 of file cbauibook.cpp.

References m_TabCtrls, MinimizeFreeSpace(), and UpdateTabControlsArray().

Referenced by InfoPane::ReorderTabs().

◆ OnDragDone()

void cbAuiNotebook::OnDragDone ( wxAuiNotebookEvent event)
protected

Catch dragdone-events from wxTabCtrl.

Definition at line 266 of file cbauibook.cpp.

References UpdateTabControlsArray().

◆ OnEnterTabCtrl()

void cbAuiNotebook::OnEnterTabCtrl ( wxMouseEvent event)
protected

Catch mouseenter-events from wxTabCtrl.

Set focus on wxTabCtrl

Parameters
eventholds the wxTabCtrl, that sends the event

Definition at line 272 of file cbauibook.cpp.

References wxApp::IsActive(), m_LastId, m_LastSelected, s_AllowMousewheel, StoreFocus(), wxNOT_FOUND, and wxTheApp.

Referenced by ResetTabCtrlEvents().

◆ OnIdle()

void cbAuiNotebook::OnIdle ( cb_unused wxIdleEvent event)
protected

◆ OnLeaveTabCtrl()

void cbAuiNotebook::OnLeaveTabCtrl ( wxMouseEvent event)
protected

Catch mouseleave-events from wxTabCtrl.

Parameters
eventholds the wxTabCtrl, that sends the event

Definition at line 294 of file cbauibook.cpp.

References wxApp::IsActive(), RestoreFocus(), and wxTheApp.

Referenced by ResetTabCtrlEvents().

◆ OnNavigationKeyNotebook()

void cbAuiNotebook::OnNavigationKeyNotebook ( wxNavigationKeyEvent event)
protected

Handle the navigation key event.

Tries to handle the navigation key-event and use "our" AdvanceSelection().

Parameters
event
Remarks
Works not reliable, due to OS/wxWidgets-limitations

Definition at line 660 of file cbauibook.cpp.

References AdvanceSelection(), wxNavigationKeyEvent::GetDirection(), and wxNavigationKeyEvent::IsWindowChange().

◆ OnResize()

void cbAuiNotebook::OnResize ( wxSizeEvent event)
protected

◆ OnTabCtrlDblClick()

void cbAuiNotebook::OnTabCtrlDblClick ( wxMouseEvent event)
protected

Catch doubleclick-events from wxTabCtrl.

Sends cbEVT_CBAUIBOOK_LEFT_DCLICK, if doubleclick was on a tab, event-Id is the notebook-Id, event-object is the pointer to the window the tab belongs to.

Parameters
eventholds the wxTabCtrl, that sends the event

Definition at line 354 of file cbauibook.cpp.

References cbEVT_CBAUIBOOK_LEFT_DCLICK, and wxMouseEvent::GetX().

Referenced by ResetTabCtrlEvents().

◆ OnTabCtrlMouseWheel()

void cbAuiNotebook::OnTabCtrlMouseWheel ( wxMouseEvent event)
protected

Catch mousewheel-events from wxTabCtrl.

Sends cbEVT_CBAUIBOOK_MOUSEWHEEL, if doubleclick was on a tab, event-Id is the notebook-Id, event-object is the pointer to the window the tab belongs to.

Parameters
eventholds the wxTabCtrl, that sends the event

Definition at line 370 of file cbauibook.cpp.

References AdvanceSelection(), CheckKeyModifier(), wxAuiNotebook::GetPage(), wxAuiNotebook::GetPageIndex(), wxAuiNotebook::GetSelection(), wxMouseEvent::GetWheelRotation(), s_advanceDirection, s_modToAdvance, s_moveDirection, and wxAuiNotebook::SetSelection().

Referenced by ResetTabCtrlEvents().

◆ RemovePage()

bool cbAuiNotebook::RemovePage ( size_t  page)
virtual

Remove Page.

Calls the base-class function and after that MinmizeFreeSpace(), needed to hook into the close-events. The system generated close event has to be veto'd, and Close() has to be called manually, so we can handle it ourselves.

Parameters
Theindex of the tab to be closed
Returns
true if successfull

Reimplemented from wxAuiNotebook.

Definition at line 534 of file cbauibook.cpp.

References wxAuiNotebook::GetPage(), IsFocusStored(), m_LastId, m_LastSelected, MinimizeFreeSpace(), wxAuiNotebook::RemovePage(), and wxNOT_FOUND.

Referenced by NativeParser::RemoveClassBrowser(), InfoPane::RemoveNonLogger(), InfoPane::ReorderTabs(), and InfoPane::Toggle().

◆ ResetTabCtrlEvents()

void cbAuiNotebook::ResetTabCtrlEvents ( )
protected

◆ RestoreFocus()

void cbAuiNotebook::RestoreFocus ( )
protected

Restore old focus.

Restore old focus or set the focus on the activated tab

Parameters
eventholds the wxTabCtrl, that sends the event

Definition at line 332 of file cbauibook.cpp.

References wxAuiNotebook::GetPage(), wxAuiNotebook::GetSelection(), m_LastId, m_LastSelected, and wxNOT_FOUND.

Referenced by OnLeaveTabCtrl().

◆ SavePerspective()

wxString cbAuiNotebook::SavePerspective ( const wxString  projectTitle = wxEmptyString)

◆ SetModKeys()

void cbAuiNotebook::SetModKeys ( wxString  keys = _T("Strg"))
static

Sets the modifier keys for scrolling.

Definition at line 1119 of file cbauibook.cpp.

References s_modKeys.

Referenced by EnvironmentSettingsDlg::EndModal().

◆ SetZoom()

void cbAuiNotebook::SetZoom ( int  zoom)

Set zoomfactor for builtin editors.

Sets the zoomfactor for all visible builtin editors.

Parameters
zoomzoomfactor to use

Definition at line 228 of file cbauibook.cpp.

References m_SetZoomOnIdle, m_TabCtrls, and UpdateTabControlsArray().

Referenced by EditorConfigurationDlg::EndModal(), OnIdle(), and cbEditor::OnZoom().

◆ StoreFocus()

void cbAuiNotebook::StoreFocus ( )
protected

Save old focus.

Save old focus and tab-selection,

Parameters
eventholds the wxTabCtrl, that sends the event

Definition at line 321 of file cbauibook.cpp.

References wxAuiNotebook::GetSelection(), m_LastId, and m_LastSelected.

Referenced by OnEnterTabCtrl().

◆ UniqueIdFromTooltip()

wxString cbAuiNotebook::UniqueIdFromTooltip ( const wxString text)
protected

Create a unique id from the tooltip-text.

Tries to create a unique id from the tooltip. Find the projectfile, geet the relative filename and put it together with the projects name. We use it to save and load the pane layout. By using the relative filename, it works even if the project gets moved to another place.

Parameters
textThe tooltip text

Definition at line 779 of file cbauibook.cpp.

References wxString::BeforeFirst(), ProjectManager::FindProjectForFile(), Manager::Get(), Manager::GetProjectManager(), CompileTargetBase::GetTitle(), ProjectFile::relativeFilename, and wxT.

Referenced by GetTabIndexFromTooltip(), LoadPerspective(), and SavePerspective().

◆ UpdateTabControlsArray()

void cbAuiNotebook::UpdateTabControlsArray ( )
protected

◆ UseModToAdvance()

void cbAuiNotebook::UseModToAdvance ( bool  use = false)
static

Use modkey to advance through tabs with mousewheel.

Definition at line 1124 of file cbauibook.cpp.

References s_modToAdvance.

Referenced by EnvironmentSettingsDlg::EndModal().

◆ UseToolTips()

static void cbAuiNotebook::UseToolTips ( bool  use = true)
static

Enable or disable tabtooltips globally.

Parameters
useIf true tooltips are allowed

Member Data Documentation

◆ m_LastId

long cbAuiNotebook::m_LastId
protected

Id of last focused window.

Used to restore the focus after a mouseleave-event on wxTabCtrl.

Definition at line 319 of file cbauibook.h.

Referenced by DeletePage(), IsFocusStored(), OnEnterTabCtrl(), RemovePage(), RestoreFocus(), and StoreFocus().

◆ m_LastSelected

int cbAuiNotebook::m_LastSelected
protected

Last selected tab.

Used to determine whether the tab-selection has changed btween mouseenter and mouseleave-event.

Definition at line 314 of file cbauibook.h.

Referenced by DeletePage(), OnEnterTabCtrl(), RemovePage(), RestoreFocus(), and StoreFocus().

◆ m_MinimizeFreeSpaceOnIdle

bool cbAuiNotebook::m_MinimizeFreeSpaceOnIdle
protected

If true, MinimizeFreeSpace is called in next OnIdle-call.

Definition at line 337 of file cbauibook.h.

Referenced by MinimizeFreeSpace(), and OnIdle().

◆ m_SetZoomOnIdle

bool cbAuiNotebook::m_SetZoomOnIdle
protected

If true, zoom for all editors is set in next OnIdle-call.

Definition at line 333 of file cbauibook.h.

Referenced by OnIdle(), and SetZoom().

◆ m_TabCtrls

cbAuiTabCtrlArray cbAuiNotebook::m_TabCtrls
protected

Holds the wxTabCtrls used by the notebook.

Remarks
Should be updated with UpdateTabControlsArray(), before it's used

Definition at line 306 of file cbauibook.h.

Referenced by FocusActiveTabCtrl(), GetTabPositionFromIndex(), LoadPerspective(), MovePage(), OnIdle(), ResetTabCtrlEvents(), SavePerspective(), SetZoom(), and UpdateTabControlsArray().

◆ m_TabCtrlSize

wxSize cbAuiNotebook::m_TabCtrlSize
protected

Holds the size of a tabCtrl after a resize event.

Needed to skip a resize event, if size did not change it gets triggered on any tab-click

Definition at line 343 of file cbauibook.h.

Referenced by OnResize().

◆ s_advanceDirection

int cbAuiNotebook::s_advanceDirection = 1
staticprotected

Mouseweheel advance direction: negative => invert.

Definition at line 394 of file cbauibook.h.

Referenced by InvertAdvanceDirection(), and OnTabCtrlMouseWheel().

◆ s_AllowMousewheel

bool cbAuiNotebook::s_AllowMousewheel = true
staticprotected

Enable or disable scrolling tabs with mousewheel.

Definition at line 379 of file cbauibook.h.

Referenced by AllowScrolling(), OnEnterTabCtrl(), and ResetTabCtrlEvents().

◆ s_cbAuiNotebookArray

cbAuiNotebookArray cbAuiNotebook::s_cbAuiNotebookArray
staticprotected

Holds an array of all existing cbAuiNotebooks.

Definition at line 382 of file cbauibook.h.

Referenced by AllowScrolling(), and ~cbAuiNotebook().

◆ s_modKeys

wxString cbAuiNotebook::s_modKeys = _T("Ctrl")
staticprotected

Holds the modifier keys for scrolling.

Definition at line 385 of file cbauibook.h.

Referenced by CheckKeyModifier(), and SetModKeys().

◆ s_modToAdvance

bool cbAuiNotebook::s_modToAdvance = false
staticprotected

Use modkey to advance through tabs with mousewheel.

Definition at line 388 of file cbauibook.h.

Referenced by OnTabCtrlMouseWheel(), and UseModToAdvance().

◆ s_moveDirection

int cbAuiNotebook::s_moveDirection = 1
staticprotected

Mousewheel move direction: negative => invert.

Definition at line 391 of file cbauibook.h.

Referenced by InvertMoveDirection(), and OnTabCtrlMouseWheel().

◆ s_UseTabTooltips

bool cbAuiNotebook::s_UseTabTooltips
staticprotected

Enable or disable tab tooltips.

Definition at line 376 of file cbauibook.h.


The documentation for this class was generated from the following files: