File: table-view-header.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 (42 lines) | stat: -rw-r--r-- 936 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
#if defined(Hiro_TableView)

namespace hiro {

auto pTableViewHeader::construct() -> void {
  _setState();
}

auto pTableViewHeader::destruct() -> void {
}

auto pTableViewHeader::append(sTableViewColumn column) -> void {
}

auto pTableViewHeader::remove(sTableViewColumn column) -> void {
}

auto pTableViewHeader::setVisible(bool visible) -> void {
  _setState();
}

auto pTableViewHeader::_parent() -> maybe<pTableView&> {
  if(auto parent = self().parentTableView()) {
    if(auto self = parent->self()) return *self;
  }
  return nothing;
}

auto pTableViewHeader::_setState() -> void {
  if(auto parent = _parent()) {
    auto style = GetWindowLong(parent->hwnd, GWL_STYLE);
    self().visible() ? style &=~ LVS_NOCOLUMNHEADER : style |= LVS_NOCOLUMNHEADER;
    SetWindowLong(parent->hwnd, GWL_STYLE, style);
    for(auto& column : state().columns) {
      if(auto self = column->self()) self->_setState();
    }
  }
}

}

#endif