File: table-view-column.cpp

package info (click to toggle)
higan 106-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 9,640 kB
  • sloc: cpp: 108,736; ansic: 809; makefile: 22; sh: 7
file content (153 lines) | stat: -rw-r--r-- 3,607 bytes parent folder | download
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#if defined(Hiro_TableView)

auto mTableViewColumn::allocate() -> pObject* {
  return new pTableViewColumn(*this);
}

//

auto mTableViewColumn::active() const -> bool {
  if(auto tableView = parentTableView()) return tableView->state.activeColumn == offset();
  return false;
}

auto mTableViewColumn::alignment() const -> Alignment {
  return state.alignment;
}

auto mTableViewColumn::backgroundColor() const -> Color {
  return state.backgroundColor;
}

auto mTableViewColumn::editable() const -> bool {
  return state.editable;
}

auto mTableViewColumn::expandable() const -> bool {
  return state.expandable;
}

auto mTableViewColumn::foregroundColor() const -> Color {
  return state.foregroundColor;
}

auto mTableViewColumn::horizontalAlignment() const -> float {
  return state.horizontalAlignment;
}

auto mTableViewColumn::icon() const -> image {
  return state.icon;
}

auto mTableViewColumn::remove() -> type& {
  if(auto tableView = parentTableViewHeader()) tableView->remove(*this);
  return *this;
}

auto mTableViewColumn::resizable() const -> bool {
  return state.resizable;
}

auto mTableViewColumn::setActive() -> type& {
  if(auto tableView = parentTableView()) tableView->state.activeColumn = offset();
  signal(setActive);
  return *this;
}

auto mTableViewColumn::setAlignment(Alignment alignment) -> type& {
  state.alignment = alignment;
  signal(setAlignment, alignment);
  return *this;
}

auto mTableViewColumn::setBackgroundColor(Color color) -> type& {
  state.backgroundColor = color;
  signal(setBackgroundColor, color);
  return *this;
}

auto mTableViewColumn::setEditable(bool editable) -> type& {
  state.editable = editable;
  signal(setEditable, editable);
  return *this;
}

auto mTableViewColumn::setExpandable(bool expandable) -> type& {
  state.expandable = expandable;
  signal(setExpandable, expandable);
  return *this;
}

auto mTableViewColumn::setForegroundColor(Color color) -> type& {
  state.foregroundColor = color;
  signal(setForegroundColor, color);
  return *this;
}

auto mTableViewColumn::setHorizontalAlignment(float alignment) -> type& {
  alignment = max(0.0, min(1.0, alignment));
  state.horizontalAlignment = alignment;
  signal(setHorizontalAlignment, alignment);
  return *this;
}

auto mTableViewColumn::setIcon(const image& icon) -> type& {
  state.icon = icon;
  signal(setIcon, icon);
  return *this;
}

auto mTableViewColumn::setResizable(bool resizable) -> type& {
  state.resizable = resizable;
  signal(setResizable, resizable);
  return *this;
}

auto mTableViewColumn::setSortable(bool sortable) -> type& {
  state.sortable = sortable;
  signal(setSortable, sortable);
  return *this;
}

auto mTableViewColumn::setText(const string& text) -> type& {
  state.text = text;
  signal(setText, text);
  return *this;
}

auto mTableViewColumn::setVerticalAlignment(float alignment) -> type& {
  alignment = max(0.0, min(1.0, alignment));
  state.verticalAlignment = alignment;
  signal(setVerticalAlignment, alignment);
  return *this;
}

auto mTableViewColumn::setVisible(bool visible) -> type& {
  state.visible = visible;
  signal(setVisible, visible);
  return *this;
}

auto mTableViewColumn::setWidth(float width) -> type& {
  state.width = max(0, width);
  signal(setWidth, width);
  return *this;
}

auto mTableViewColumn::sortable() const -> bool {
  return state.sortable;
}

auto mTableViewColumn::text() const -> string {
  return state.text;
}

auto mTableViewColumn::verticalAlignment() const -> float {
  return state.verticalAlignment;
}

auto mTableViewColumn::width() const -> float {
  return state.width;
}

#endif