fix listbox insert algorithmus

svn path=/trunk/; revision=15222
This commit is contained in:
Martin Fuchs 2005-05-11 17:30:21 +00:00
parent 8ece706e06
commit 4358dbd01a
2 changed files with 7 additions and 5 deletions

View file

@ -85,7 +85,7 @@ Pane::Pane(HWND hparent, int id, int id_header, Entry* root, bool treePane, int
Entry* entry = _root; Entry* entry = _root;
if (entry) if (entry)
insert_entries(entry, -1); insert_entries(entry);
init(); init();
@ -657,12 +657,12 @@ void Pane::calc_tabbed_width(LPDRAWITEMSTRUCT dis, int col, LPCTSTR str)
// insert listbox entries after index idx // insert listbox entries after index idx
void Pane::insert_entries(Entry* dir, int idx) int Pane::insert_entries(Entry* dir, int idx)
{ {
Entry* entry = dir; Entry* entry = dir;
if (!entry) if (!entry)
return; return idx;
for(; entry; entry=entry->_next) { for(; entry; entry=entry->_next) {
#ifndef _LEFT_FILES #ifndef _LEFT_FILES
@ -685,8 +685,10 @@ void Pane::insert_entries(Entry* dir, int idx)
ListBox_InsertItemData(_hwnd, idx, entry); ListBox_InsertItemData(_hwnd, idx, entry);
if (_treePane && entry->_expanded) if (_treePane && entry->_expanded)
insert_entries(entry->_down, idx); idx = insert_entries(entry->_down, idx);
} }
return idx;
} }

View file

@ -92,7 +92,7 @@ struct Pane : public SubclassedWindow
void calc_single_width(int col); void calc_single_width(int col);
void draw_item(LPDRAWITEMSTRUCT dis, Entry* entry, int calcWidthCol=-1); void draw_item(LPDRAWITEMSTRUCT dis, Entry* entry, int calcWidthCol=-1);
void insert_entries(Entry* dir, int idx=-1); int insert_entries(Entry* dir, int idx=-1);
BOOL command(UINT cmd); BOOL command(UINT cmd);
int Notify(int id, NMHDR* pnmh); int Notify(int id, NMHDR* pnmh);