Numworks Epsilon
1.4.1
Graphing Calculator Operating System
function_title_cell.cpp
Go to the documentation of this file.
1
#include "
function_title_cell.h
"
2
#include <
assert.h
>
3
4
using namespace
Shared
;
5
6
namespace
Graph
{
7
8
FunctionTitleCell::FunctionTitleCell
(
Orientation
orientation,
KDText::FontSize
size) :
9
Shared
::
FunctionTitleCell
(orientation),
10
m_bufferTextView(size, 0.5f, 0.5f)
11
{
12
}
13
14
void
FunctionTitleCell::setHighlighted
(
bool
highlight) {
15
EvenOddCell::setHighlighted
(highlight);
16
m_bufferTextView.
setHighlighted
(highlight);
17
}
18
19
void
FunctionTitleCell::setEven
(
bool
even) {
20
EvenOddCell::setEven
(even);
21
m_bufferTextView.
setEven
(even);
22
}
23
24
void
FunctionTitleCell::setColor
(
KDColor
color) {
25
Shared::FunctionTitleCell::setColor
(color);
26
m_bufferTextView.
setTextColor
(color);
27
}
28
29
void
FunctionTitleCell::setText
(
const
char
* title) {
30
m_bufferTextView.
setText
(title);
31
}
32
33
int
FunctionTitleCell::numberOfSubviews
()
const
{
34
return
1;
35
}
36
37
View
*
FunctionTitleCell::subviewAtIndex
(
int
index) {
38
assert
(index == 0);
39
return
&m_bufferTextView;
40
}
41
42
void
FunctionTitleCell::layoutSubviews
() {
43
KDRect
textFrame(0,
k_colorIndicatorThickness
,
bounds
().width(),
bounds
().height() -
k_colorIndicatorThickness
);
44
if
(
m_orientation
==
Orientation::VerticalIndicator
){
45
textFrame =
KDRect
(
k_colorIndicatorThickness
, 0,
bounds
().width() -
k_colorIndicatorThickness
,
bounds
().height()-
k_separatorThickness
);
46
}
47
m_bufferTextView.
setFrame
(textFrame);
48
}
49
50
}
Shared
Definition:
banner_view.cpp:5
Graph::FunctionTitleCell::numberOfSubviews
int numberOfSubviews() const override
Definition:
function_title_cell.cpp:33
assert
#define assert(e)
Definition:
assert.h:9
Graph::FunctionTitleCell::setEven
void setEven(bool even) override
Definition:
function_title_cell.cpp:19
EvenOddCell::setEven
virtual void setEven(bool even)
Definition:
even_odd_cell.cpp:10
View::setFrame
void setFrame(KDRect frame)
Definition:
view.cpp:125
Graph::FunctionTitleCell::setColor
void setColor(KDColor color) override
Definition:
function_title_cell.cpp:24
Shared::FunctionTitleCell::Orientation
Orientation
Definition:
function_title_cell.h:10
Shared::FunctionTitleCell::setColor
virtual void setColor(KDColor color)
Definition:
function_title_cell.cpp:12
Graph
Definition:
app.cpp:9
EvenOddBufferTextCell::setTextColor
void setTextColor(KDColor textColor)
Definition:
even_odd_buffer_text_cell.cpp:28
Shared::FunctionTitleCell::Orientation::VerticalIndicator
Shared::FunctionTitleCell::k_colorIndicatorThickness
static constexpr KDCoordinate k_colorIndicatorThickness
Definition:
function_title_cell.h:19
EvenOddBufferTextCell::setText
void setText(const char *textContent)
Definition:
even_odd_buffer_text_cell.cpp:24
Shared::FunctionTitleCell::FunctionTitleCell
FunctionTitleCell(Orientation orientation)
Definition:
function_title_cell.cpp:6
assert.h
Graph::FunctionTitleCell
Definition:
function_title_cell.h:8
EvenOddBufferTextCell::setEven
void setEven(bool even) override
Definition:
even_odd_buffer_text_cell.cpp:19
Graph::FunctionTitleCell::setText
void setText(const char *textContent)
Definition:
function_title_cell.cpp:29
Shared::FunctionTitleCell::k_separatorThickness
static constexpr KDCoordinate k_separatorThickness
Definition:
function_title_cell.h:18
Shared::FunctionTitleCell::m_orientation
Orientation m_orientation
Definition:
function_title_cell.h:20
KDRect
Definition:
rect.h:26
KDColor
Definition:
color.h:6
EvenOddBufferTextCell::setHighlighted
void setHighlighted(bool highlight) override
Definition:
even_odd_buffer_text_cell.cpp:14
Graph::FunctionTitleCell::layoutSubviews
void layoutSubviews() override
Definition:
function_title_cell.cpp:42
View
Definition:
view.h:23
HighlightCell::setHighlighted
virtual void setHighlighted(bool highlight)
Definition:
highlight_cell.cpp:9
function_title_cell.h
KDText::FontSize
FontSize
Definition:
text.h:10
Graph::FunctionTitleCell::setHighlighted
void setHighlighted(bool highlight) override
Definition:
function_title_cell.cpp:14
View::bounds
KDRect bounds() const
Definition:
view.cpp:157
Graph::FunctionTitleCell::subviewAtIndex
View * subviewAtIndex(int index) override
Definition:
function_title_cell.cpp:37
epsilon
apps
graph
function_title_cell.cpp
Generated by
1.8.14