Skip site navigation (1) Skip section navigation (2)

Vanishing cursor in SQL editor - propose quick and dirty fix

From: Tim Booth <tbooth(at)ceh(dot)ac(dot)uk>
To: pgadmin-hackers(at)postgresql(dot)org
Subject: Vanishing cursor in SQL editor - propose quick and dirty fix
Date: 2004-02-26 15:24:54
Message-ID: 1077809094.7845.565.camel@ivpcp044.nerc-oxford.ac.uk (view raw or flat)
Thread:
Lists: pgadmin-hackers
Hi,

I love PGAdminIII, and use it extensively on my Redhat Linux box.  I'm
currently using a CVS build as it fixes a significant crashing situation
over the stable release.  However, I find the disappearence of the
cursor/caret in the SQL editor very annoying.

An hour or so of poking has led me into the labyrinth of code which is
the wxWindows focus handling mechanism.  I really don't have the time or
inclination to debug that so here is my hacky fix:

In the file contrib/src/stc/ScintillaWX.cpp, line 637, change the left
mouse click callback as follows:

...
void ScintillaWX::DoLeftButtonDown(Point pt, unsigned int curTime, bool
shift, bool ctrl, bool alt) {
    ButtonDown(pt, curTime, shift, ctrl, alt);
                                                                                                                                   
    //Hack to try and reclaim the caret:
    if(!hasFocus) DoGainFocus();
}
...
ie - we force a focus event and hence redraw the caret.

The added line should never be called, since you should never get a left
click without getting focus, so on the plus side this patch should not
break anything if wxWindows gets fixed properly.  Also, the wxWindows
build you use has already been forked, so I don't think it would be
polluting good code to add this.

Anyway, whoever maintains this code, take it or leave it.

TIM


Responses

pgadmin-hackers by date

Next:From: Andreas PflugDate: 2004-02-26 17:37:56
Subject: Re: Vanishing cursor in SQL editor - propose quick
Previous:From: Jean-Michel POUREDate: 2004-02-26 14:57:38
Subject: New Finnish translation

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group