-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathTab.cpp
More file actions
65 lines (50 loc) · 882 Bytes
/
Tab.cpp
File metadata and controls
65 lines (50 loc) · 882 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright 2009, Ryan Leavengood, leavengood@gmail.com
// All rights reserved.
//
// Distributed under the terms of the MIT License.
//
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#include "Tab.h"
#include <stdlib.h>
#include <string.h>
Tab::Tab(const char *title)
: BView("Tab", 0),
fTitle(NULL)
{
_InitData(title);
}
Tab::~Tab()
{
free(fTitle);
}
void
Tab::MessageReceived(BMessage *message)
{
switch (message->what) {
default:
BView::MessageReceived(message);
break;
}
}
void
Tab::SetTitle(const char *title)
{
if (fTitle != NULL) {
free(fTitle);
fTitle = NULL;
}
if (title != NULL)
fTitle = strdup(title);
}
const char *
Tab::Title() const
{
return fTitle;
}
void
Tab::_InitData(const char *title)
{
SetTitle(title);
}