sptk2 logo
SPTK Home Page
CTabs.h
1/*
2╔══════════════════════════════════════════════════════════════════════════════╗
3║ SIMPLY POWERFUL TOOLKIT (SPTK) ║
4╟──────────────────────────────────────────────────────────────────────────────╢
5║ copyright © 1999-2022 Alexey Parshin. All rights reserved. ║
6║ email alexeyp@gmail.com ║
7╚══════════════════════════════════════════════════════════════════════════════╝
8┌──────────────────────────────────────────────────────────────────────────────┐
9│ This library is free software; you can redistribute it and/or modify it │
10│ under the terms of the GNU Library General Public License as published by │
11│ the Free Software Foundation; either version 2 of the License, or (at your │
12│ option) any later version. │
13│ │
14│ This library is distributed in the hope that it will be useful, but │
15│ WITHOUT ANY WARRANTY; without even the implied warranty of │
16│ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library │
17│ General Public License for more details. │
18│ │
19│ You should have received a copy of the GNU Library General Public License │
20│ along with this library; if not, write to the Free Software Foundation, │
21│ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. │
22│ │
23│ Please report all bugs and problems to alexeyp@gmail.com. │
24└──────────────────────────────────────────────────────────────────────────────┘
25*/
26
27#pragma once
28
29#include <sptk5/gui/CGroup.h>
30#include <sptk5/sptk.h>
31
32namespace sptk {
33
39class CTabGroup;
40
46class SP_EXPORT CTabs
47 : public CGroup
48{
52 CTabGroup* m_tabs;
53
57 int32_t m_autoColorIndex;
58
59
63 static const Fl_Color AutoColorTable[16];
64
68 void removeEmptyLastPage();
69
70protected:
74 virtual void prepareNewPage(Fl_Group* page, bool autoColor);
75
76public:
83 CTabs(const char* label = 0L, int32_t layoutSize = 10, CLayoutAlign layoutAlign = CLayoutAlign::TOP);
84
85#ifdef __COMPATIBILITY_MODE__
94 CTabs(int x, int y, int w, int h, const char* label = 0);
95#endif
96
101
107 virtual Fl_Group* newPage(const char* label, bool autoColor);
108
114 virtual Fl_Group* newScroll(const char* label, bool autoColor);
115
119 virtual void draw();
120
126 void showTabs(bool show);
127
131 uint32_t pageCount() const;
132
136 uint32_t pageNumber() const;
137
142 void pageNumber(uint32_t pageNumber);
143
148 void remove(Fl_Group* page);
149
154 static CLayoutClient* creator(const xdoc::SNode& node);
155
159 virtual String className() const
160 {
161 return "tabs";
162 }
163};
167} // namespace sptk
SPTK group widget.
Definition: CGroup.h:50
Definition: CLayoutClient.h:82
Tabs widget.
Definition: CTabs.h:48
void remove(Fl_Group *page)
Removes a page completely.
void pageNumber(uint32_t pageNumber)
Sets selected page by number.
virtual String className() const
Returns widget class name (internal SPTK RTTI).
Definition: CTabs.h:159
CTabs(const char *label=0L, int32_t layoutSize=10, CLayoutAlign layoutAlign=CLayoutAlign::TOP)
Constructor in SPTK style.
uint32_t pageCount() const
Returns tabs count.
static CLayoutClient * creator(const xdoc::SNode &node)
Creates a widget based on the XML node information.
virtual void prepareNewPage(Fl_Group *page, bool autoColor)
void showTabs(bool show)
Show/hide tabs flag.
virtual void draw()
Custom draw method.
virtual Fl_Group * newScroll(const char *label, bool autoColor)
Creates a new CScroll page.
~CTabs()
Destructor.
virtual Fl_Group * newPage(const char *label, bool autoColor)
Creates a new CGroup page.
uint32_t pageNumber() const
Returns selected page number.
Definition: String.h:49
CLayoutAlign
Definition: CLayoutClient.h:44
@ TOP
Align to the right.

Fri Oct 14 2022 09:58:31: SPTK 5.4.1