OpendTect  6.6
uitabstack.h
Go to the documentation of this file.
1 #pragma once
2 
3 /*+
4 ________________________________________________________________________
5 
6  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
7  Author: A.H. Lammertink
8  Date: 17/01/2002
9  RCS: $Id$
10 ________________________________________________________________________
11 
12 -*/
13 
14 #include "uibasemod.h"
15 #include "uigroup.h"
16 
17 class uiTabBar;
18 
19 
20 /* \brief Provides a way to create tabs with associated uiGroups.
21 
22  uiTabBar provides only the tabs. uiTabStack forms a system that
23  combines such a tab-bar with uiGroups by which selection of a tab
24  automatically makes the associated uiGroup visible.
25 
26  uiGroups that are to be added to the stack, *must* use the
27  tabGroup() as a parent. Otherwise, you will get a programmer error
28  message complaining that the added group "Must be child or
29  child-of-child."
30 
31 */
32 mExpClass(uiBase) uiTabStack : public uiGroup
33 {
34 public:
35  uiTabStack(uiParent*,const char* nm,
36  bool manage=true);
37 
38  // use this as parent for groups to add
39  uiGroup* tabGroup() { return tabgrp_; }
40 
41  void addTab(uiGroup*,
44 
45  void setTabEnabled(uiGroup*,bool yn);
46  bool isTabEnabled(uiGroup*) const;
47 
48  void setTabVisible(uiGroup*,bool yn);
49  bool isTabVisible(uiGroup*) const;
50 
51  void setCurrentPage(int id);
53  void setCurrentPage(const char* grpnm);
54  void setTabIcon(int id,const char* icnnm);
55  void setTabIcon(uiGroup*,const char* icnnm);
56  void setTabsClosable(bool closable);
57  void showCloseButton(uiGroup*,bool yn,bool shrink=false);
58  int insertTab(uiGroup*, int index,
60  void setTabText(int idx, const char* nm);
61 
62  uiGroup* currentPage() const;
63  uiGroup* page(int idx) const;
64  int indexOf(uiGroup*) const;
65  int currentPageId() const;
66 
67  int size() const;
68 
72 
73 protected:
74 
77 
78  void tabSel(CallBacker* cb);
80 };
81 
uiTabStack::tabClosed
Notifier< uiTabStack > tabClosed
Definition: uitabstack.h:71
uiTabStack::page
uiGroup * page(int idx) const
uiTabStack::tabbar_
uiTabBar * tabbar_
Definition: uitabstack.h:75
uiTabStack::setCurrentPage
void setCurrentPage(const char *grpnm)
uiTabStack::setTabText
void setTabText(int idx, const char *nm)
mExpClass
#define mExpClass(module)
Definition: commondefs.h:177
uiTabStack::setTabVisible
void setTabVisible(uiGroup *, bool yn)
uiTabStack::selChange
NotifierAccess & selChange()
uiTabStack::isTabEnabled
bool isTabEnabled(uiGroup *) const
uiTabStack::setCurrentPage
void setCurrentPage(int id)
CallBacker
Inherit from this class to be able to send and/or receive CallBacks.
Definition: callback.h:185
uiTabStack::removeTab
void removeTab(uiGroup *)
uiTabStack::setTabIcon
void setTabIcon(int id, const char *icnnm)
uigroup.h
uiTabStack::tabCloseCB
void tabCloseCB(CallBacker *cb)
uiTabStack::currentPageId
int currentPageId() const
uiTabStack::showCloseButton
void showCloseButton(uiGroup *, bool yn, bool shrink=false)
uiTabStack::size
int size() const
uiGroup
Definition: uigroup.h:54
NotifierAccess
Interface class for Notifier. See comments there.
Definition: notify.h:22
uiTabStack::currentPage
uiGroup * currentPage() const
uiTabStack::setCurrentPage
void setCurrentPage(uiGroup *)
Notifier< uiTabStack >
uiTabStack::indexOf
int indexOf(uiGroup *) const
uiTabBar::uiTabStack
friend class uiTabStack
Definition: uitabbar.h:27
uiTabBar
TabBar widget only. Normally you'd want to use the uiTabStack class.
Definition: uitabbar.h:25
uiTabStack::uiTabStack
uiTabStack(uiParent *, const char *nm, bool manage=true)
uiString
String that is able to hold international (UTF-8) strings for the user interface.
Definition: uistring.h:121
uiString::emptyString
static const uiString & emptyString()
Definition: uistring.h:300
uiTabStack::setTabsClosable
void setTabsClosable(bool closable)
uiTabStack::tabGroup
uiGroup * tabGroup()
Definition: uitabstack.h:39
uiTabStack::insertTab
int insertTab(uiGroup *, int index, const uiString &=uiString::emptyString())
uiTabStack::setTabEnabled
void setTabEnabled(uiGroup *, bool yn)
uiTabStack::isTabVisible
bool isTabVisible(uiGroup *) const
uiTabStack::setTabIcon
void setTabIcon(uiGroup *, const char *icnnm)
uiParent
Definition: uiparent.h:26
uiTabStack::tabToBeClosed
CNotifier< uiTabStack, int > tabToBeClosed
Definition: uitabstack.h:70
uiTabStack::tabgrp_
uiGroup * tabgrp_
Definition: uitabstack.h:76
uiTabStack::tabSel
void tabSel(CallBacker *cb)
CNotifier< uiTabStack, int >
uiTabStack::addTab
void addTab(uiGroup *, const uiString &=uiString::emptyString())

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B.V. 1995-2021