ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
TabControl.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #pragma once
9 
10 #include <functional>
11 
13 
14 namespace cloudViewer {
15 namespace visualization {
16 namespace gui {
17 
18 class TabControl : public Widget {
19  using Super = Widget;
20 
21 public:
22  TabControl();
23  ~TabControl();
24 
25  void AddTab(const char* name, std::shared_ptr<Widget> panel);
26 
28  const Constraints& constraints) const override;
29  void Layout(const LayoutContext& context) override;
30 
31  DrawResult Draw(const DrawContext& context) override;
32 
33  void SetOnSelectedTabChanged(std::function<void(int)> on_changed);
34 
35 private:
36  struct Impl;
37  std::unique_ptr<Impl> impl_;
38 };
39 
40 } // namespace gui
41 } // namespace visualization
42 } // namespace cloudViewer
std::string name
DrawResult Draw(const DrawContext &context) override
Definition: TabControl.cpp:79
void AddTab(const char *name, std::shared_ptr< Widget > panel)
Definition: TabControl.cpp:44
void SetOnSelectedTabChanged(std::function< void(int)> on_changed)
Definition: TabControl.cpp:50
void Layout(const LayoutContext &context) override
Definition: TabControl.cpp:66
Size CalcPreferredSize(const LayoutContext &context, const Constraints &constraints) const override
Definition: TabControl.cpp:54
ImGuiContext * context
Definition: Window.cpp:76
Generic file read and write utility for python interface.