On Thu, 15 Apr 2004 10:58:57 +0200 (Romance Standard Time) Xavier Nodet <[EMAIL PROTECTED]> wrote:
XN> I was thinking that when I open a folder with unread messages, or XN> hit Ctrl-U, I usually like to see what the other messages in the XN> folder, just after the selected one, look like. Very true, me too. XN> So I did hack the wxListView code to make sure that: XN> - the selected message is visible XN> - the next messages (up to 4) are also visible XN> - the previous message is visible XN> XN> The patch is attached. XN> XN> Do you like this feature? I didn't have time to test it yet but I'm already sure I like it. XN> cvs diff -u include\wx\listctrl.h (in directory U:\src\wxWindows\) XN> Index: include/wx/listctrl.h XN> =================================================================== XN> RCS file: /pack/cvsroots/wxwindows/wxWindows/include/wx/listctrl.h,v XN> retrieving revision 1.55 XN> diff -u -r1.55 listctrl.h XN> --- include/wx/listctrl.h 2004/01/15 13:48:12 1.55 XN> +++ include/wx/listctrl.h 2004/04/15 08:42:29 XN> @@ -62,6 +62,17 @@ XN> void Focus(long index) XN> { XN> SetItemState(index, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED); XN> + // Start with the selected item, then make sure it scrolls up XN> + // by (at most) 4 positions XN> + EnsureVisible(index); XN> + EnsureVisible(index+1); XN> + EnsureVisible(index+2); XN> + EnsureVisible(index+3); XN> + EnsureVisible(index+4); XN> + // Show one item above XN> + EnsureVisible(index-1); XN> + // In case we have less space than necessary to display 5 items XN> + // we must not make the selected item disappear ! XN> EnsureVisible(index); XN> } But this code should go, of course, in wxFolderView::SelectInitialMessage() as we don't want to always do it, just when opening the folder, don't we? Thanks! VZ ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Mahogany-Developers mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/mahogany-developers