GUIFramework
1.1.0
Framework for desktop GUI applications in C++.
Loading...
Searching...
No Matches
IBaseListViewOperations.cpp
Go to the documentation of this file.
1
#include "
IBaseListViewOperations.h
"
2
3
using namespace
std;
4
5
namespace
gui_framework
6
{
7
namespace
interfaces
8
{
9
void
IBaseListViewOperations::onRemove
(
size_t
index)
10
{
11
12
}
13
14
LRESULT
IBaseListViewOperations::addItem
(
const
LVITEMW& item)
15
{
16
LRESULT result = SendMessageW(listViewHandle, LVM_INSERTITEM, NULL,
reinterpret_cast<
LPARAM
>
(&item));
17
18
if
(result != -1)
19
{
20
SendMessageW(listViewHandle, LVM_ISITEMVISIBLE, result, NULL);
21
22
listViewSize++;
23
}
24
25
return
result;
26
}
27
28
LRESULT
IBaseListViewOperations::setItem
(
const
LVITEMW& item)
29
{
30
LRESULT result = SendMessageW(listViewHandle, LVM_SETITEM, NULL,
reinterpret_cast<
LPARAM
>
(&item));
31
32
if
(result != -1)
33
{
34
SendMessageW(listViewHandle, LVM_ISITEMVISIBLE, result, NULL);
35
}
36
37
return
result;
38
}
39
40
void
IBaseListViewOperations::getItem
(LVITEMW& item)
const
41
{
42
SendMessageW(listViewHandle, LVM_GETITEMW, NULL,
reinterpret_cast<
LPARAM
>
(&item));
43
}
44
45
IBaseListViewOperations::IBaseListViewOperations
(HWND handle) :
46
listViewHandle(handle),
47
listViewSize(0)
48
{
49
50
}
51
52
bool
IBaseListViewOperations::removeItem
(
size_t
index)
53
{
54
bool
result = SendMessageW(listViewHandle, LVM_DELETEITEM, index, NULL);
55
56
if
(result)
57
{
58
listViewSize--;
59
60
this->
onRemove
(index);
61
}
62
63
return
result;
64
}
65
66
size_t
IBaseListViewOperations::size
()
const
67
{
68
return
listViewSize;
69
}
70
}
71
}
IBaseListViewOperations.h
gui_framework::interfaces::IBaseListViewOperations::getItem
virtual void getItem(LVITEMW &item) const
Definition
IBaseListViewOperations.cpp:40
gui_framework::interfaces::IBaseListViewOperations::size
virtual size_t size() const final
Definition
IBaseListViewOperations.cpp:66
gui_framework::interfaces::IBaseListViewOperations::IBaseListViewOperations
IBaseListViewOperations(HWND handle)
Definition
IBaseListViewOperations.cpp:45
gui_framework::interfaces::IBaseListViewOperations::removeItem
virtual bool removeItem(size_t index) final
Definition
IBaseListViewOperations.cpp:52
gui_framework::interfaces::IBaseListViewOperations::addItem
virtual LRESULT addItem(const LVITEMW &item)
Definition
IBaseListViewOperations.cpp:14
gui_framework::interfaces::IBaseListViewOperations::onRemove
virtual void onRemove(size_t index)
Definition
IBaseListViewOperations.cpp:9
gui_framework::interfaces::IBaseListViewOperations::setItem
virtual LRESULT setItem(const LVITEMW &item)
Definition
IBaseListViewOperations.cpp:28
gui_framework
Definition
BaseComponent.cpp:21
GUIFramework
src
Interfaces
Components
ListViews
IBaseListViewOperations.cpp
Generated by
1.12.0