update for HEAD-2003091401
[reactos.git] / subsys / system / explorer / Seashell / SeaShellExt / Include / Uictrl.h
1 //*******************************************************************************
2 // COPYRIGHT NOTES
3 // ---------------
4 // You may use this source code, compile or redistribute it as part of your application 
5 // for free. You cannot redistribute it as a part of a software development 
6 // library without the agreement of the author. If the sources are 
7 // distributed along with the application, you should leave the original 
8 // copyright notes in the source code without any changes.
9 // This code can be used WITHOUT ANY WARRANTIES at your own risk.
10 // 
11 // For the latest updates to this code, check this site:
12 // http://www.masmex.com 
13 // after Sept 2000
14 // 
15 // Copyright(C) 2000 Philip Oldaker <email: philip@masmex.com>
16 //*******************************************************************************
17
18 #ifndef __ODLISTCTRL_H__
19 #define __ODLISTCTRL_H__
20
21 #define NUM_BITMAPS 2
22 #define MAX_TEXT        MAX_PATH
23
24 #include "UICont.h"
25 #include "UIDropTarget.h"
26 #include "UIMessages.h"
27 #include "LocaleInfo.h"
28
29 class CInPlaceEdit;
30 class CTextProgressCtrl;
31
32 //////////////////////////////////////////////////////////
33 //CODHeaderCtrl
34 //////////////////////////////////////////////////////////
35 class CTRL_EXT_CLASS CODHeaderCtrl : public CHeaderCtrl
36 {
37 public:
38         CODHeaderCtrl();
39         ~CODHeaderCtrl();
40 public:
41         virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
42         int SetSortImage(int nCol, BOOL bAsc);
43 protected:      
44         int     m_nSortCol;
45         BOOL    m_bSortAsc;
46 };
47
48 //////////////////////////////////////////////////////////////////////////
49 // CUIODListCtrl
50 // Extension of the MFC class that enacapsulates the windows list control
51 // makes some things simpler some things harder and some things better.
52 //////////////////////////////////////////////////////////////////////////
53 class CTRL_EXT_CLASS CUIODListCtrl : public CListCtrl 
54 {
55 public:
56         enum eColTypes
57         {
58                 e_Text,
59                 e_Numeric,
60                 e_NumericFormat,
61                 e_NumericFormatComma,
62                 e_NumericFormatTime,
63                 e_Double,
64                 e_DoubleFormat,
65                 e_DoubleFormatComma,
66                 e_DoubleFormatTime,
67                 e_DateTime
68         };
69         DECLARE_SERIAL(CUIODListCtrl)
70 public:
71         CUIODListCtrl(bool bDragDrop=true);
72         virtual ~CUIODListCtrl();  
73
74 // Attributes
75         const COleDropTarget &GetDropTarget();
76
77 // Operations
78 public:
79         void RegisterDropTarget();
80         virtual void SetRowFont(int nRow,CFont *pFont);
81         virtual void SetRowBold(int nRow,BOOL bBold=TRUE);
82         virtual void SetColFont(int nRow,int nCol,CFont *pFont);
83         virtual void SetColBold(int nRow,int nCol,BOOL bBold=TRUE);
84         virtual BOOL SetColumnFormat(int nCol,int fmt);
85         virtual void Serialize(CArchive& ar);
86          
87         // called from CUIListView::OnCreate
88         virtual void ChangeStyle(UINT &dwStyle);
89         virtual void Init();
90         virtual void UpdateEvent(LPARAM lHint,CObject *pHint);
91         // Initialize the list control 
92         // The first parameter is a pointer to an array or single icon
93         // that will be added to an image list
94         // The second parameter will create the columns and add the heading
95         // but must be in this format Column1|Column2 delimited by the or sign
96         // This MUST BE CALLED first unless you use CListCtrl or API methods to add columns
97         // then you use AddTextItem to add a row passing the returned row number every time
98         virtual int InitListCtrl(const UINT *pIconIDs,LPCTSTR szHeadings,LPCTSTR pszProfile=NULL);
99         virtual int InitListCtrl(UINT IconID,LPCTSTR szHeadings,LPCTSTR pszProfile=NULL);
100         virtual int InitListCtrl(LPCTSTR szHeadings,LPCTSTR pszProfile=NULL);
101         // used to add strings after a text row has been created
102         virtual BOOL AddString(int nRow,int nCol,LPCTSTR szText,CUIODListCtrl::eColTypes type=CUIODListCtrl::e_Text);
103         virtual BOOL AddString(int nRow,int nCol,int nValue,CUIODListCtrl::eColTypes type=CUIODListCtrl::e_NumericFormatComma);
104         virtual BOOL AddString(int nRow,int nCol,double dValue,CUIODListCtrl::eColTypes type=CUIODListCtrl::e_DoubleFormatComma);
105         virtual BOOL AddString(int nRow,int nCol,COleDateTime &dtValue,CUIODListCtrl::eColTypes type=CUIODListCtrl::e_DateTime);
106         // Refreshes the row after a row has changed after a call to addstring
107         virtual void UpdateString(int nRow);
108         // add a new column will return index or -1 on failure
109         virtual void AddExtraString(int nRow,LPCTSTR pszExtraText);
110         // Adds a new column 
111         virtual int AddColumn(LPCTSTR szText);
112         // Change the the window that receives the popup command messages
113         // default is the control
114         void SetPopupWnd(CWnd *pPopupWnd);
115         // Use your own popup menu
116         void SetPopupID(UINT nPopupID);
117         // Use your own popup menu when multiple item have been selected
118         void SetMultiPopupID(UINT nMultiPopupID);
119         // find a column index by text
120         int FindColumn(LPCTSTR pszText);
121         // same as the list control
122         DWORD GetItemData(int nIndex) const;
123         // add a row with data on demand see 'GetDispInfo' method
124         int AddCallBackItem(DWORD dwData=0,int nImage=0);
125         // add a text row where you supply the string
126         int AddTextItem(int nImage=0);
127         // same as list control with extra flag
128         BOOL SetItemData(int nIndex,DWORD dwData,bool bAutoDelete=false);
129         // Sets the item data but will also delete the pointer(so make sure it is one)
130         // be careful with this one
131         BOOL SetItemDataAutoDelete(int nIndex,CObject *pObj);
132         void SetDefaultTextColor( int nRow, int nCol);
133         void SetDefaultBkColor( int nRow, int nCol);
134         // set the row color (only works with ownerdraw control)
135         void SetTextColor( int nRow, int nCol, COLORREF TextColor);
136         // set the row color (only works with ownerdraw control)
137         void SetBkColor( int nRow, int nCol, COLORREF BkColor);
138         // toggle between large and small icon
139         void SetIconSize(int nImageList);
140         // set the icon passing an ICON id from the resources
141         int SetIcon(int nRow,UINT nIconID);
142         // set the icon passing the image index into the internal image list 
143         int SetIcon(int nRow,int nImage);
144         // find an item by extension data
145         int FindItem(DWORD dwExtData);
146         // set the current selection
147         int SetCurSel(int nSelect);
148         void SetDragDrop(bool bDragDrop);
149         void SetDropFiles(bool bDropFiles);
150         void SetEditSubItems(bool bEdit);
151         // toggles the column sizing permission
152         void SetColumnSizing(bool bSet);
153         void SetToolTips(bool bSet);
154         BOOL SetGridLines(bool bSet);
155         BOOL SetTrackSelect(bool bSet);
156         BOOL SetCheckBoxes(bool bSet);
157         BOOL SetHeaderDragDrop(bool bSet);
158         void SetFullRowSel(bool bSet);
159         // changes the view type between LVS_ICON, LVS_SMALLICON, LVS_REPORT, etc
160         BOOL SetEditLabels(bool bSet);
161
162         void ToggleColumnSizing();
163         void ToggleToolTips();
164         // toggles grid lines(IE3.0 controls only)
165         BOOL ToggleGridLines();
166         // toggles hot tracking lines(IE3.0 controls only)
167         BOOL ToggleTrackSelect();
168         // toggles check boxes (IE3.0 controls only)
169         BOOL ToggleCheckBoxes();
170         // toggles between moving columns by dragging the header (IE3.0 controls only)
171         BOOL ToggleHeaderDragDrop();
172         // toggles full row selection lines(IE3.0 controls only)
173         void ToggleFullRowSel();
174         // changes the view type between LVS_ICON, LVS_SMALLICON, LVS_REPORT, etc
175         BOOL ToggleEditLabels();
176
177         BOOL SetViewType(DWORD dwViewType,UINT nFlags=0);
178         BOOL GetFullRowSel() const;
179         DWORD GetViewType() const;
180         // (IE3.0 controls only)
181         // set the extended style for the new IE3.0 common controls 
182         BOOL SetExStyle(UINT nStyle,BOOL bModify=TRUE);
183         DWORD GetExStyle();
184
185         int GetIconSize() const;
186         // call this first to get the current or first selection
187         // returns -1 if no selection
188         int GetCurSel() const;
189         // used to get multiple selection
190         // returns -1 if no selection
191         int GetNextSel(int item) const;
192         // number of rows
193         int GetCount() const;
194         // number of columns
195         int GetColumnCount() const;
196         // allow the right mouse click to toggle between icons sizes
197         void SetRCLickChangeIconSize(BOOL bSize);
198         int HitTestEx(CPoint &point, int *col) const;
199         CEdit* EditSubLabel( int nItem, int nCol );
200         CTextProgressCtrl *AddProgressBar(int nItem,int nCol,int nMin,int nMax);
201         virtual void UpdateProgressBar(int nRow,int nCol,int nPos);
202         void DeleteProgressBar(int nItem,int nCol);
203         // Add an icon to the image list and return the index into the list
204         int AddIcon(UINT nIconID);
205         int AddIcon(HICON hIcon,UINT nIconID=0);
206         int AddIcon(LPCTSTR pszIcon);
207         // set the column data type primarily for sorting
208         void SetColType(int nCol,eColTypes ColType);
209         void SetSection(LPCTSTR pszSection);
210         void SetSortHeader();
211         void SetSortColumn(int nCol,BOOL bAsc);
212
213         // sort by column
214         virtual void Sort();
215         // save our profiles
216         virtual void SaveProfile();
217         virtual void LoadProfile();
218         void DelayPaint(bool bDelay);
219         static CString StripNonNumeric(LPCTSTR pszOldNum,CUIODListCtrl::eColTypes type);
220 //////////////////
221 // Overrides
222 public:
223         virtual DROPEFFECT SelectCurrentTarget(CDD_OleDropTargetInfo *pInfo);
224         // ovwner draw
225         virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
226         // ovwner draw
227         virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItem);
228         virtual BOOL OnChildNotify(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult);
229
230 protected:
231         virtual BOOL PreTranslateMessage(MSG* pMsg);
232         virtual void ConvertToTime(CString &str);
233         virtual void AddThousandSeps(CString &str);
234         virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
235         // override if you added a callback row and fill in the structure
236         virtual PFNLVCOMPARE GetCompareFunc();
237         virtual BOOL GetDispInfo(LV_DISPINFO *pDispInfo);
238         virtual BOOL ColumnClick(NM_LISTVIEW* pNMListView);
239         virtual BOOL DoubleClick(NM_LISTVIEW* pNMListView);
240         virtual BOOL OnEnter(NM_LISTVIEW* pNMListView);
241         virtual BOOL OnEndLabelEdit(NMHDR* pNMHDR, LRESULT* pResult);
242         virtual BOOL OnSelChanged(int nItem, LRESULT* pResult);
243         // return true to delete the item from the list control
244         virtual bool DeleteKey(int nRow);
245         // called when the user has pressed ALt-Enter
246         virtual void ShowProperties(int nRow);
247         // called when the user has pressed F5
248         virtual void Refresh();
249         // called when the user has pressed the backspace key
250         virtual void GoBack(int nRow);
251         // called when the user has has finshed editing a column
252         virtual bool EndLabelEdit(int nRow,int nCol,LPCTSTR pszText);
253         virtual void PostNcDestroy();
254         virtual int OnToolHitTest(CPoint point,TOOLINFO *pTI) const;
255         virtual void PreSubclassWindow();
256         virtual int CellRectFromPoint(CPoint & point, RECT * cellrect, int * col) const;
257         virtual void AllItemsDeleted();
258         virtual void GetImageLists(CImageList **pILSmall,CImageList **pILLarge);
259         virtual void CreateImageLists();
260         // callback called when a new row is added passing the extension data and row index 
261         // not valid for AddTextItem only AddCallbackItem
262         virtual CUIListCtrlData *GetNewListCtrlData(DWORD dwData,int nItem);
263         // option to show context menu if user uses keyboard or mouse(point in client co-ords)
264         virtual void ShowPopupMenu(int nRow,int nCol,CPoint point);
265         virtual BOOL PopupMenuItem(int nItem,int nCol,CMenu *pPopup,CPoint point);
266         virtual BOOL ItemPrePaint(LPNMLVCUSTOMDRAW  lplvcd,LRESULT *pResult);
267         virtual BOOL ItemPostPaint(LPNMLVCUSTOMDRAW  lplvcd,LRESULT *pResult);
268         virtual BOOL SubItemPrePaint(LPNMLVCUSTOMDRAW lplvcd,LRESULT *pResult);
269         virtual BOOL SubItemPostPaint(LPNMLVCUSTOMDRAW lplvcd,LRESULT *pResult);
270         //WM_DROPFILES
271         virtual void OnDropFile(int nRow,LPCTSTR pszFile,UINT nFlags);
272         // OLE Drag and Drop
273         // This called when a drop source is dropped on the tree control
274         virtual bool DragDrop(CDD_OleDropTargetInfo *pInfo);
275         // This called when a drop source is currently over the tree control
276         virtual bool DragOver(CDD_OleDropTargetInfo *pInfo);
277         // This called when the user entered the window with a drop source
278         virtual bool DragEnter(CDD_OleDropTargetInfo *pInfo);
279         // This called when the user leaves the window with a drop source
280         virtual bool DragLeave(CDD_OleDropTargetInfo *pInfo);
281         // This called when the user initiates a OLE drag and drop
282         virtual DROPEFFECT DoDragDrop(int *npRows,COleDataSource *pOleDataSource);
283         virtual void Empty();
284
285         void SetNoItemsMess(const CString &strNoItemsMess);
286         CString GetNoItemsMess() const;
287         bool IsDragDrop();
288         bool IsDropFiles();
289         void OnRClickHeader(CPoint point,int nColIndex);
290         // return a pointer to an extension data object
291         CUIListCtrlData *GetListCtrlData(int nItem) const;
292
293         int GetHeaderText(CHeaderCtrl *pHeader,int nPos,CString &strText);
294         void ReplaceString(CString &rStr,LPCTSTR pszOldText,LPCTSTR pszNewText);
295         // owner draw
296         BOOL CalcStringEllipsis(HDC hdc, LPTSTR lpszString, int cchMax, UINT uColWidth);
297         // owner draw
298         void DrawItemColumn(LPDRAWITEMSTRUCT lpDrawItemStruct, int nSubItem, LPRECT prcClip);
299         LPCTSTR GetThousandSep() const;
300         LPCTSTR GetDecimalSep() const;
301         LPCTSTR GetNegativeSign() const;
302         LPCTSTR GetTimeSep() const;
303         LPCTSTR GetDateSep() const;
304         LPCTSTR GetSection() const;
305         BOOL InsertItem(LPTSTR szText,LPARAM lParam,int nImage);
306         void ChangeIconSize();
307         int GetImageIndex(UINT nIconID);
308         // owner draw
309         static LPCTSTR MakeShortString(CDC* pDC, LPCTSTR lpszLong, int nColumnLen, int nOffset);
310         void RepaintSelectedItems();
311         void DoOleDrag(NM_LISTVIEW* pNMListView,bool bRightMenu);       
312         // for sorting
313
314 protected:
315         COLORREF m_clrBkgnd;
316         COLORREF m_clrTextBk;
317         COLORREF m_clrText;
318         int m_cxClient;
319         int m_cxStateImageOffset;
320         int m_nImageList;
321         BOOL m_bFullRowSel;
322         BOOL m_bClientWidthSel;
323         BOOL m_bColumnSizing;
324         BOOL m_bHasFocus;
325         BOOL m_bRClickChangeIconSize;
326         BOOL m_bSortAscending;
327         BOOL m_bToolTips;
328         CUIObjList m_objList;
329         int m_nColClicked;
330         int m_nSortColumn;
331         int m_nImage;
332         int m_nItems;
333         int m_nSubItems;
334         int m_cxSmallIcon;
335         int m_cySmallIcon;
336         int m_cxLargeIcon;
337         int m_cyLargeIcon;
338         int *m_pColWidths;
339         int *m_pColOrder;
340         int *m_pColTypes;
341         DWORD m_dwExStyle;
342         DWORD m_dwViewType;
343         CImageList m_ImageSmall;
344         CImageList m_ImageLarge;
345         CString m_strHeadings;
346         CPoint m_PopupPoint;
347         HFONT m_hOrigFont;
348         CString m_strSection;
349         CMap<UINT,UINT,int,int> m_mapImageIndex;
350         CMap<CString,LPCTSTR,int,int> m_mapImageFile;
351         CODHeaderCtrl m_HeaderCtrl;     
352
353         afx_msg LRESULT OnGetItemText(WPARAM wParam, LPARAM lParam);
354         afx_msg LRESULT OnSetImageList(WPARAM wParam, LPARAM lParam);
355         afx_msg LRESULT OnSetTextColor(WPARAM wParam, LPARAM lParam);
356         afx_msg LRESULT OnSetTextBkColor(WPARAM wParam, LPARAM lParam);
357         afx_msg LRESULT OnSetBkColor(WPARAM wParam, LPARAM lParam);
358 ///* * Generated message map functions
359         //{{AFX_MSG(CUIODListCtrl)
360         afx_msg LRESULT OnSetColumnWidth(WPARAM wParam,LPARAM lParam);
361         afx_msg LRESULT OnDeleteAllItems(WPARAM wParam,LPARAM lParam);
362         afx_msg LRESULT OnDeleteItem(WPARAM wParam,LPARAM lParam);
363         afx_msg LRESULT OnDeleteColumn(WPARAM wParam,LPARAM lParam);
364         afx_msg LRESULT OnUpdateHeaderWidth(WPARAM wParam,LPARAM lParam);
365         afx_msg void OnInitMenuPopup(CMenu* pPopupMenu,UINT nIndex,BOOL bSysMenu);
366         afx_msg void OnContextMenu(CWnd*,CPoint point);
367         afx_msg void OnSize(UINT nType, int cx, int cy);
368         afx_msg void OnPaint();
369         afx_msg void OnSetFocus(CWnd* pOldWnd);
370         afx_msg void OnKillFocus(CWnd* pNewWnd);
371         afx_msg void OnViewLargeIcons();
372         afx_msg void OnViewSmallIcons();
373         afx_msg void OnViewDetails();
374         afx_msg void OnViewList();
375         afx_msg void OnViewFullRowSelection();
376         afx_msg void OnViewColumnOrdering();
377         afx_msg void OnViewColumnSizing();
378         afx_msg void OnViewGridlines();
379         afx_msg void OnViewCheckboxes();
380         afx_msg void OnViewTrackSelect();
381         afx_msg void OnViewEditColumn();
382         afx_msg void OnHeaderRemoveColumn();
383         afx_msg void OnHeaderEditText();
384         afx_msg void OnHeaderReset();
385         afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
386         afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
387         afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
388         afx_msg BOOL OnBegindrag(NMHDR* pNMHDR, LRESULT* pResult);
389         afx_msg BOOL OnBeginRDrag(NMHDR* pNMHDR, LRESULT* pResult);
390         afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
391         afx_msg void OnDestroy();
392         afx_msg BOOL OnToolTipText(UINT id,NMHDR *pNMHDR,LRESULT *pResult);
393         afx_msg void OnDropFiles(HDROP hDropInfo);
394         afx_msg LRESULT OnAppPropertiesKey(WPARAM wParam, LPARAM lParam );
395         afx_msg LRESULT OnAppDeleteKey(WPARAM wParam, LPARAM lParam );
396         afx_msg LRESULT OnAppRefreshKey(WPARAM wParam, LPARAM lParam );
397         afx_msg LRESULT OnAppBackspaceKey(WPARAM wParam, LPARAM lParam );
398         afx_msg LRESULT OnAppContextMenuKey(WPARAM wParam, LPARAM lParam );
399         afx_msg LRESULT OnAppEditKey(WPARAM wParam, LPARAM lParam );
400         //}}AFX_MSG
401         afx_msg LRESULT OnDragDrop(WPARAM wParam,LPARAM lParam);
402         afx_msg LRESULT OnDragOver(WPARAM wParam,LPARAM lParam);
403         afx_msg LRESULT OnDragEnter(WPARAM wParam,LPARAM lParam);
404         afx_msg LRESULT OnDragLeave(WPARAM wParam,LPARAM lParam);
405         afx_msg LRESULT OnDDDoDragDrop(WPARAM wParam,LPARAM lParam);
406         DECLARE_MESSAGE_MAP()
407 private:
408         static LPCTSTR szEntryHeadings;
409         static LPCTSTR szEntryStyle;
410         static LPCTSTR szEntryRowSel;
411         static LPCTSTR szEntryViewType;
412         static LPCTSTR szEntryColumnSizing;
413         static LPCTSTR szEntrySortColumn;
414         static LPCTSTR szEntrySubItems;
415         static LPCTSTR szEntryColOrder;
416         static LPCTSTR szEntryColWidths;
417         CListDropTarget m_OleDropTarget;
418         COleDataSource m_OleDataSource;
419         CString m_sToolTipText;
420         CString m_strNoItemsMess;
421         bool m_bDelayPaint;
422         int m_iItemDrop;
423         bool m_bDragDrop;
424         bool m_bDropFiles;
425         bool m_bEditSubItems;
426         CWnd *m_pPopupWnd;
427 protected:
428         UINT m_PopupID;
429         UINT m_MultiPopupID;
430 };
431
432 /////////////////////
433 // inlines
434 /////////////////////
435 inline void CUIODListCtrl::SetEditSubItems(bool bEdit)
436 {
437         m_bEditSubItems = bEdit;
438 }
439
440 inline void CUIODListCtrl::SetNoItemsMess(const CString &strNoItemsMess)
441 {
442         m_strNoItemsMess = strNoItemsMess;
443 }
444
445 inline CString CUIODListCtrl::GetNoItemsMess() const
446 {
447         return m_strNoItemsMess;
448 }
449
450 inline void CUIODListCtrl::SetPopupWnd(CWnd *pPopupWnd)
451 {
452         m_pPopupWnd = pPopupWnd;
453 }
454
455 inline void CUIODListCtrl::SetPopupID(UINT nPopupID)
456 {
457         m_PopupID = nPopupID;
458 }
459
460 inline void CUIODListCtrl::SetMultiPopupID(UINT nMultiPopupID)
461 {
462         m_MultiPopupID = nMultiPopupID;
463 }
464
465 inline bool CUIODListCtrl::IsDragDrop()
466 {
467         return m_bDragDrop;
468 }
469
470 inline bool CUIODListCtrl::IsDropFiles()
471 {
472         return m_bDropFiles;
473 }
474
475 inline void CUIODListCtrl::SetDragDrop(bool bDragDrop)
476 {
477         m_bDragDrop = bDragDrop;
478 }
479
480 inline void CUIODListCtrl::SetDropFiles(bool bDropFiles)
481 {
482         m_bDropFiles = bDropFiles;
483 }
484
485 inline const COleDropTarget &CUIODListCtrl::GetDropTarget()
486 {
487         return m_OleDropTarget;
488 }
489
490 inline  int CUIODListCtrl::GetIconSize() const
491 {
492         return m_nImageList;
493 }
494
495 inline  int CUIODListCtrl::GetCurSel() const
496 {
497         return GetNextItem(-1,LVNI_SELECTED);
498 }
499
500 inline  int CUIODListCtrl::GetNextSel(int item) const
501 {
502         return GetNextItem(item,LVNI_SELECTED);
503 }
504
505 inline  int CUIODListCtrl::GetCount() const
506 {
507         return GetItemCount();
508 }
509
510 inline void CUIODListCtrl::SetRCLickChangeIconSize(BOOL bSize)
511 {
512         m_bRClickChangeIconSize = bSize;
513 }
514
515 inline void CUIODListCtrl::SetColumnSizing(bool bSet)
516 {
517         m_bColumnSizing = !bSet;
518         SaveProfile();
519 }
520
521 inline void CUIODListCtrl::ToggleColumnSizing()
522 {
523         m_bColumnSizing = !m_bColumnSizing;
524         SaveProfile();
525 }
526
527 inline void CUIODListCtrl::ToggleFullRowSel()
528 {
529         SetFullRowSel(!m_bFullRowSel);
530 }
531
532 inline BOOL CUIODListCtrl::ToggleHeaderDragDrop()
533 {
534         return SetHeaderDragDrop(!(GetExStyle() & LVS_EX_HEADERDRAGDROP));
535 }
536
537 inline BOOL CUIODListCtrl::SetHeaderDragDrop(bool bSet)
538 {
539         return SetExStyle(LVS_EX_HEADERDRAGDROP,bSet);
540 }
541
542 inline BOOL CUIODListCtrl::ToggleGridLines()
543 {
544         return SetGridLines(!(GetExStyle() & LVS_EX_GRIDLINES));
545 }
546
547 inline BOOL CUIODListCtrl::SetGridLines(bool bSet)
548 {
549         return SetExStyle(LVS_EX_GRIDLINES,bSet);
550 }
551
552 inline BOOL CUIODListCtrl::ToggleTrackSelect()
553 {
554         return SetTrackSelect(!(GetExStyle() & LVS_EX_TRACKSELECT));
555 }
556
557 inline BOOL CUIODListCtrl::SetTrackSelect(bool bSet)
558 {
559         return SetExStyle(LVS_EX_TRACKSELECT,bSet);
560 }
561
562 inline BOOL CUIODListCtrl::ToggleCheckBoxes()
563 {
564         return SetCheckBoxes(!(GetExStyle() & LVS_EX_CHECKBOXES)); 
565 }
566
567 inline BOOL CUIODListCtrl::SetCheckBoxes(bool bSet)
568 {
569         return SetExStyle(LVS_EX_CHECKBOXES,bSet);
570 }
571
572 inline BOOL CUIODListCtrl::ToggleEditLabels()
573 {
574         return SetEditLabels(!(GetStyle() & LVS_EDITLABELS));
575 }
576
577 inline BOOL CUIODListCtrl::SetEditLabels(bool bSet)
578 {
579         return bSet ? ModifyStyle(0,LVS_EDITLABELS) : ModifyStyle(LVS_EDITLABELS,0);
580 }
581
582 inline void CUIODListCtrl::ToggleToolTips()
583 {
584         m_bToolTips = !m_bToolTips;
585         SetToolTips(m_bToolTips == TRUE);
586 }
587
588 inline void CUIODListCtrl::SetToolTips(bool bSet)
589 {
590         m_bToolTips = bSet;
591         EnableToolTips(m_bToolTips);
592 }
593
594 inline void CUIODListCtrl::SetColType(int nCol,eColTypes ColType)
595 {
596         ASSERT(nCol < m_nSubItems);
597         ASSERT(m_pColTypes);
598         m_pColTypes[nCol] = ColType;
599 }
600
601 inline int CUIODListCtrl::GetColumnCount() const
602 {
603         return m_nSubItems;
604 }
605
606 inline LPCTSTR CUIODListCtrl::GetDecimalSep() const
607 {
608         return CLocaleInfo::Instance()->GetDecimalSep();
609 }
610
611 inline LPCTSTR CUIODListCtrl::GetThousandSep() const
612 {
613         return CLocaleInfo::Instance()->GetThousandSep();
614 }
615
616 inline LPCTSTR CUIODListCtrl::GetNegativeSign() const
617 {
618         return CLocaleInfo::Instance()->GetNegativeSign();
619 }
620
621 inline LPCTSTR CUIODListCtrl::GetTimeSep() const
622 {
623         return CLocaleInfo::Instance()->GetTimeSep();
624 }
625
626 inline LPCTSTR CUIODListCtrl::GetDateSep() const
627 {
628         return CLocaleInfo::Instance()->GetDateSep();
629 }
630
631 inline void CUIODListCtrl::DelayPaint(bool bDelay)
632 {
633         m_bDelayPaint = bDelay;
634 }
635
636 ////////////////////////////////////////////////
637 // CChangeViewType
638 ////////////////////////////////////////////////
639 class CChangeViewType
640 {
641 public:
642         CChangeViewType(CUIODListCtrl *pLC,DWORD dwType);
643         virtual ~CChangeViewType();
644 public:
645 protected:
646 private:
647         CUIODListCtrl *m_pLC;
648         DWORD m_dwType;
649 };
650
651
652 #endif