User forums > General (but related to Code::Blocks)

A feature request about CC and BrowseTracker

<< < (4/8) > >>

ollydbg:

--- Quote from: blueshake on August 15, 2009, 05:00:27 pm ---if user move the caret position several times in a second.

--- End quote ---
Thanks for the hint.
I think a normal user can't do that, otherwise we should ignore these positions. :D

blueshake:
sleeping :D

Ceniza:

--- Quote from: ollydbg on August 15, 2009, 04:08:12 pm ---I'm carefully reading the scintilla document. For Editor_update message, here is the description:


--- Quote ---SCN_UPDATEUI
Either the text or styling of the document has changed or the selection range has changed. Now would be a good time to update any container UI elements that depend on document or view state. This was previously called SCN_CHECKBRACE because a common use is to check whether the caret is next to a brace and set highlights on this brace and its corresponding matching brace. This also replaces SCN_POSCHANGED, which is now deprecated.
--- End quote ---

Not quite understand its meaning.
--- End quote ---

That looks to me like what you are looking for, and it seems to be sent to all plugins listening for that event. What should be considered is that if the user is in one line and he/she presses and keeps pressed left up to the beginning of the document (for example), only two positions should be seen (the initial line and the beginning of the document). Recording all positions in between would not make sense.

I haven't played much with those things, so you better set up a little test for them. Use a logger to output what you are getting and see if that's what you want.

blueshake:
Ceniza's comment is right.
it is no sense to record carect position between start and end.

ollydbg:
@blueshake and Ceniza
I think your are right. I just find this message is really useful. In this scillita mail list. There is a usage of this message.

http://aspn.activestate.com/ASPN/Mail/Message/scintilla-interest/1446313


--- Quote ---Pavel Baranov:

>  A common windows practice it to show the caret line and sometimes column
>  positions in the gui status bar window.

   SciTE does this. When you want to find out how to implement a feature
SciTE is a very good source. SciTE uses SCN_UPDATEUI.

   The contributor of SCN_POSCHANGED was performing a large amount of
background processing that depended on the editor context. The intent of
SCN_POSCHANGED was to notify the container when that context changed so that
the background tasks could be aborted. This context was never well specified
and the notification never really meant that the caret position changed.

   I have removed SCN_POSCHANGED from the main documentation and added it to
the deprecated section.

   Neil


--- End quote ---


Edit
Also, In the Codeblocks's SDK, it is used to update the status bar. see the code below:
src\main.cpp line 1667


--- Code: ---void MainFrame::OnEditorUpdateUI(CodeBlocksEvent& event)
{
    if(Manager::isappShuttingDown())
    {
        event.Skip();
        return;
    }
    if (Manager::Get()->GetEditorManager() && event.GetEditor() == Manager::Get()->GetEditorManager()->GetActiveEditor())
    {
        DoUpdateStatusBar();
    }
    event.Skip();
}

--- End code ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version