aswang  1.0
ListView.cpp
Go to the documentation of this file.
00001 /*
00002         Copyright 2003 Joseph Alvis
00003 
00004     This file is part of Aswang.
00005 
00006     Aswang is free software: you can redistribute it and/or modify
00007     it under the terms of the GNU Lesser General Public License as published by
00008     the Free Software Foundation, either version 3 of the License, or
00009     (at your option) any later version.
00010 
00011     Aswang is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014     GNU Lesser General Public License for more details.
00015 
00016     You should have received a copy of the GNU Lesser General Public License
00017     along with Aswang.  If not, see <http://www.gnu.org/licenses/>.
00018 */
00019 
00020 #include "ListView.h"
00021 
00022 using namespace aswang; 
00023 
00024 bool ListView::Arrange(long code) {
00025         return (SendMessage(hWnd,LVM_ARRANGE,code,0)==1);
00026 }
00027 
00028 bool ListView::DeleteAllItems() {
00029         return (SendMessage(hWnd,LVM_DELETEALLITEMS,0,0)==1);
00030 }
00031 
00032 bool ListView::DeleteItem(long id) {
00033         return (SendMessage(hWnd,LVM_DELETEITEM,id,0)==1);
00034 }
00035 
00036 long ListView::GetItemState(long index,ListViewItemStates mask) {
00037         return (long)SendMessage(hWnd,LVM_GETITEMSTATE,index,mask);
00038 }
00039 
00040 long ListView::GetNextItem(long index,ListViewNIFlags flags) {
00041         return (long)SendMessage(hWnd,LVM_GETNEXTITEM,index,MAKELPARAM((short)flags,0));
00042 }
00043 
00044 long ListView::InsertItem(LVITEM *item) {
00045         return (long)SendMessage(hWnd,LVM_INSERTITEM,0,(LPARAM)item);
00046 }
00047 
00048 bool ListView::SetItem(LVITEM *item) {
00049         return (SendMessage(hWnd,LVM_SETITEM,0,(LPARAM)item)==1);
00050 }
00051 
00052 long ListView::GetItemCount() {
00053         return (long)(SendMessage(hWnd,LVM_GETITEMCOUNT,0,0));
00054 }
00055 
00056 bool ListView::SetItemCount(long count,ListViewItemCountFlags flags) {
00057         return (SendMessage(hWnd,LVM_SETITEMCOUNT,count,(LPARAM)flags)==1);
00058 }
00059 
00060 bool ListView::SetItemPosition(long index,int x,int y) {
00061         return (SendMessage(hWnd,LVM_SETITEMPOSITION,index,MAKELPARAM(x,y))==1);
00062 }
00063 
00064 bool ListView::SetItemState(long index,LVITEM *item) {
00065         return (SendMessage(hWnd,LVM_SETITEMSTATE,index,(LPARAM)item)==1);
00066 }
00067 
00068 bool ListView::SetItemText(long index,const AswangStr &str,long subIndex) {
00069         LVITEM tmp;
00070         tmp.pszText = (_TCHAR *)str.c_str();
00071         tmp.iSubItem = subIndex;
00072         return (SendMessage(hWnd,LVM_SETITEMTEXT,index,(LPARAM)&tmp)==1);
00073 }
00074 
00075 bool ListView::SortItems(long arg,CompareFunc *cf) {
00076         return (SendMessage(hWnd,LVM_SORTITEMS,arg,(LPARAM)cf)==1);
00077 }
00078 
00079 bool ListView::SetColumn(long index,LVCOLUMN *column) {
00080         return (SendMessage(hWnd,LVM_SETCOLUMN,index,(LPARAM)column)==1);
00081 }
00082 
00083 long ListView::InsertColumn(long index,LVCOLUMN *column) {
00084         return (SendMessage(hWnd,LVM_INSERTCOLUMN,index,(LPARAM)column)==1);
00085 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines