Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members

chmlistctrl.h

00001 /*
00002 
00003   Copyright (C) 2003  Razvan Cojocaru <razvanco@gmx.net>
00004   ListDirty() patch contributed by Iulian Dragos
00005   <dragosiulian@users.sourceforge.net>
00006  
00007   This program is free software; you can redistribute it and/or modify
00008   it under the terms of the GNU General Public License as published by
00009   the Free Software Foundation; either version 2 of the License, or
00010   (at your option) any later version.
00011   
00012   This program is distributed in the hope that it will be useful,
00013   but WITHOUT ANY WARRANTY; without even the implied warranty of
00014   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015   GNU General Public License for more details.
00016   
00017   You should have received a copy of the GNU General Public License
00018   along with this program; if not, write to the Free Software
00019   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00020 
00021 */
00022 
00023 
00024 #ifndef __CHMLISTCTRL_H_
00025 #define __CHMLISTCTRL_H_
00026 
00027 #include <wx/listbox.h>
00028 #include <wx/listctrl.h>
00029 #include <wx/string.h>
00030 #include <wx/dynarray.h>
00031 
00032 
00033 // Forward declarations.
00034 class CHMHtmlWindow;
00035 
00036 
00038 struct CHMListPairItem {
00040         CHMListPairItem(const wxString& title, const wxString& url)
00041                 : _title(title), _url(url) {}
00042 
00044         wxString _title;
00046         wxString _url;
00047 };
00048 
00049 
00051 WX_DEFINE_SORTED_ARRAY(CHMListPairItem *, ItemPairArray);
00052 
00054 int CompareItemPairs(CHMListPairItem *item1, CHMListPairItem *item2);
00055 
00056 
00063 
00064 class CHMListCtrl : public wxListCtrl {
00065 
00066 public:
00075         CHMListCtrl(wxWindow *parent, CHMHtmlWindow *html,
00076                     wxWindowID id = -1);
00077 
00079         ~CHMListCtrl();
00080 
00081 public:
00083         void Reset();
00084 
00092         void AddPairItem(const wxString& title, const wxString& url);
00093         
00095         void LoadSelected();
00096 
00098         void UpdateUI();
00099   
00104         void FindBestMatch(const wxString& title);
00105 
00106 protected:
00108         void OnSize(wxSizeEvent& event);
00109 
00111         wxString OnGetItemText(long item, long column) const;
00112 
00113 private:
00115         void ResetItems();
00116         
00117 private:
00118         ItemPairArray _items;
00119         CHMHtmlWindow *_html;
00120         int _currentSize;
00121 
00122 private:
00123         DECLARE_EVENT_TABLE()
00124 };
00125 
00126 
00127 #endif // __CHMLISTCTRL_H_
00128 
00129 
00130 /*
00131   Local Variables:
00132   mode: c++
00133   c-basic-offset: 8
00134   tab-width: 8
00135   c-indent-comments-syntactically-p: t
00136   c-tab-always-indent: t
00137   indent-tabs-mode: t
00138   End:
00139 */
00140 
00141 // vim:shiftwidth=8:autoindent:tabstop=8:noexpandtab:softtabstop=8
00142 

Generated on Mon May 22 12:43:42 2006 for xCHM by  doxygen 1.4.4