~ubuntu-branches/ubuntu/quantal/mysql-workbench/quantal

« back to all changes in this revision

Viewing changes to library/forms/tabview.cpp

  • Committer: Package Import Robot
  • Author(s): Dmitry Smirnov
  • Date: 2012-03-01 21:57:30 UTC
  • Revision ID: package-import@ubuntu.com-20120301215730-o7y8av8y38n162ro
Tags: upstream-5.2.38+dfsg
ImportĀ upstreamĀ versionĀ 5.2.38+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* 
 
2
 * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or
 
5
 * modify it under the terms of the GNU General Public License as
 
6
 * published by the Free Software Foundation; version 2 of the
 
7
 * License.
 
8
 * 
 
9
 * This program is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 
12
 * GNU General Public License for more details.
 
13
 * 
 
14
 * You should have received a copy of the GNU General Public License
 
15
 * along with this program; if not, write to the Free Software
 
16
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 
17
 * 02110-1301  USA
 
18
 */
 
19
#include "stdafx.h"
 
20
 
 
21
using namespace mforms;
 
22
 
 
23
 
 
24
TabView::TabView(TabViewType tabType)
 
25
{
 
26
  _tabview_impl= &ControlFactory::get_instance()->_tabview_impl;
 
27
 
 
28
  _tabview_impl->create(this, tabType);
 
29
}
 
30
 
 
31
 
 
32
void TabView::set_active_tab(int index)
 
33
{
 
34
  _tabview_impl->set_active_tab(this, index);
 
35
}
 
36
 
 
37
 
 
38
int TabView::get_active_tab()
 
39
{
 
40
  return _tabview_impl->get_active_tab(this);
 
41
}
 
42
 
 
43
 
 
44
int TabView::add_page(View *page, const std::string& caption)
 
45
{
 
46
  page->retain();
 
47
  add_subview(page);
 
48
  page->set_parent(this);
 
49
  return _tabview_impl->add_page(this, page, caption);
 
50
}
 
51
 
 
52
 
 
53
void TabView::remove_page(View *page)
 
54
{
 
55
  page->set_parent(0);
 
56
  _tabview_impl->remove_page(this, page);
 
57
  remove_subview(page);
 
58
  page->release();
 
59
}
 
60
 
 
61
 
 
62
int TabView::get_page_index(View *page)
 
63
{
 
64
  return get_subview_index(page);
 
65
}
 
66
 
 
67
 
 
68
View *TabView::get_page(int index)
 
69
{
 
70
  return get_subview_at_index(index);
 
71
}
 
72
 
 
73
void TabView::set_tab_title(int page, const std::string& caption)
 
74
{
 
75
  _tabview_impl->set_tab_title(this, page, caption);
 
76
}