summaryrefslogtreecommitdiff
path: root/vcl/source/window/tabpage.cxx
diff options
context:
space:
mode:
authorSzymon Kłos <eszkadev@gmail.com>2016-06-17 23:54:00 +0200
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2016-06-27 17:51:56 +0000
commit1df394503f1e62b091453c95c05a212892ae8d58 (patch)
tree4767346ce348cc498df09985b6fa431a45f255d3 /vcl/source/window/tabpage.cxx
parent0c80b4dfd27109def7a5bdc34c3fcc5499db6c0d (diff)
GSoC notebookbar: switching tabs depending on context
+ sfx2::sidebar::EnumContext moved to the vcl module + TabPage contains vector with context values + vcl builder reads control's contexts from the "class" mark + ContextTabControl shows tabs depending on context Change-Id: I661b0d3f35d46ace2a2e8eb1d374148f0c60017d Reviewed-on: https://gerrit.libreoffice.org/26447 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'vcl/source/window/tabpage.cxx')
-rw-r--r--vcl/source/window/tabpage.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/vcl/source/window/tabpage.cxx b/vcl/source/window/tabpage.cxx
index 576d645ea820..2079ec9bdb50 100644
--- a/vcl/source/window/tabpage.cxx
+++ b/vcl/source/window/tabpage.cxx
@@ -44,6 +44,8 @@ void TabPage::ImplInit( vcl::Window* pParent, WinBits nStyle )
// otherwise they will paint with a wrong background
if( IsNativeControlSupported(ControlType::TabBody, ControlPart::Entire) && GetParent() && (GetParent()->GetType() == WINDOW_TABCONTROL) )
EnableChildTransparentMode();
+
+ maContext.push_back( vcl::EnumContext::Context::Context_Any );
}
void TabPage::ImplInitSettings()
@@ -222,4 +224,22 @@ void TabPage::SetPosPixel(const Point& rAllocPos)
}
}
+void TabPage::SetContext(const std::vector<vcl::EnumContext::Context>& aContext)
+{
+ maContext = aContext;
+}
+
+bool TabPage::HasContext( const vcl::EnumContext::Context eContext ) const
+{
+ auto aFind = std::find(maContext.begin(), maContext.end(), eContext);
+ if (aFind == maContext.end())
+ return false;
+ return true;
+}
+
+const std::vector< vcl::EnumContext::Context >& TabPage::GetContext() const
+{
+ return maContext;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */