Drop useless double initialization
[TortoiseGit.git] / src / Utils / ACListWnd.h
blobd37083cd930536b16864fa096413d44371aa5781
1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (c) 2003 by Andreas Kapust <info@akinstaller.de>; <http://www.codeproject.com/Articles/2607/AutoComplete-without-IAutoComplete>
4 // Copyright (C) 2009,2012-2013 - TortoiseGit
6 // Licensed under: The Code Project Open License (CPOL); <http://www.codeproject.com/info/cpol10.aspx>
8 #if !defined(AFX_ACWND_H__5CED9BF8_C1CB_4A74_B022_ABA25680CC42__INCLUDED_)
9 #define AFX_ACWND_H__5CED9BF8_C1CB_4A74_B022_ABA25680CC42__INCLUDED_
11 #if _MSC_VER > 1000
12 #pragma once
13 #endif // _MSC_VER > 1000
14 // ACWnd.h : Header-Datei
17 /*********************************************************************
19 * CACListWnd
20 * Copyright (c) 200 by Andreas Kapust
21 * All rights reserved.
22 * info@akinstaller.de
24 *********************************************************************/
26 #include <afxtempl.h> // CArray
27 #define ENAC_UPDATE WM_USER + 1200
28 /////////////////////////////////////////////////////////////////////////////
29 // Fenster CACListWnd
30 #define IDTimerInstall 10
31 class CACListWnd : public CWnd
33 // Konstruktion
34 public:
35 CACListWnd();
36 void Init(CWnd *pWnd);
37 bool EnsureVisible(int item,bool m_bWait);
38 bool SelectItem(int item);
39 int FindString(int nStartAfter, LPCTSTR lpszString, bool m_bDisplayOnly = false);
40 int FindStringExact( int nIndexStart, LPCTSTR lpszFind );
41 int SelectString(LPCTSTR lpszString );
42 bool GetText(int item, CString& m_Text);
43 void AddSearchString(LPCTSTR lpszString){m_SearchList.Add(lpszString);}
44 void RemoveAll(){m_SearchList.RemoveAll(); m_DisplayList.RemoveAll();}
45 CString GetString();
46 CString GetNextString(int m_iChar);
48 void CopyList();
49 void SortSearchList(){SortList(m_SearchList);}
50 // Attribute
51 public:
52 CListCtrl m_List;
53 CString m_DisplayStr;
54 TCHAR m_PrefixChar;
55 long m_lMode;
56 // Operationen
57 public:
58 CStringArray m_SearchList;
59 // Überschreibungen
60 // Vom Klassen-Assistenten generierte virtuelle Funktionsüberschreibungen
61 //{{AFX_VIRTUAL(CACListWnd)
62 //}}AFX_VIRTUAL
64 // Implementierung
65 public:
66 virtual ~CACListWnd();
67 void DrawItem(CDC* pDC,long m_lItem,long width);
69 // Generierte Nachrichtenzuordnungsfunktionen
70 protected:
71 //{{AFX_MSG(CACListWnd)
72 afx_msg void OnPaint();
73 afx_msg void OnSize(UINT nType, int cx, int cy);
74 afx_msg BOOL OnEraseBkgnd(CDC* pDC);
75 afx_msg void OnNcPaint();
76 afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
77 afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp);
78 afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
79 afx_msg void OnActivateApp(BOOL bActive, DWORD dwThreadID);
80 afx_msg LRESULT OnNcHitTest(CPoint point);
81 afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
82 afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
83 afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
84 afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
85 afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point);
86 afx_msg void OnMouseMove(UINT nFlags, CPoint point);
87 afx_msg void OnTimer(UINT_PTR nIDEvent);
88 afx_msg void OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI);
89 //}}AFX_MSG
90 DECLARE_MESSAGE_MAP()
92 CStringArray m_DisplayList;
93 CScrollBar m_VertBar, m_HoriBar;
94 CRect m_LastSize, m_ParentRect;
95 CFont *pFontDC;
96 CFont fontDC, boldFontDC;
97 CEdit *m_pEditParent;
98 LOGFONT logfont;
100 int m_nIDTimer;
101 long m_lTopIndex,m_lCount,m_ItemHeight,m_VisibleItems,m_lSelItem;
103 int HitTest(CPoint point);
104 void SetScroller();
105 void SetProp();
106 long ScrollBarWidth();
107 void InvalidateAndScroll();
108 void SortList(CStringArray& m_List);
109 static int CompareString(const void* p1, const void* p2);
112 /////////////////////////////////////////////////////////////////////////////
114 //{{AFX_INSERT_LOCATION}}
115 // Microsoft Visual C++ fügt unmittelbar vor der vorhergehenden Zeile zusätzliche Deklarationen ein.
117 #endif // AFX_ACWND_H__5CED9BF8_C1CB_4A74_B022_ABA25680CC42__INCLUDED_