News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

MiniDoc

Started by danselmi, August 07, 2014, 12:56:07 AM

Previous topic - Next topic

Jenna

I just send you a pull request with my solution for the resize-stuff.
My fork was created short before your resize-commit.

It goes a slightly different way, because I connect to the first cbStyledTextCtrl instead of the editor.
So resize-events in split-view are recognized also.

Because of your last commit, the pull-request can not be merged directly (merge-conflicts).

MortenMacFly

Another nice example that git is not always helpful... :-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

Jenna

Quote from: MortenMacFly on August 12, 2014, 11:09:19 PM
Another nice example that git is not always helpful... :-)
That has nothing to do with git, but with two developers working on the same problem ath the same time.
With svn you can not even create a pull-request.

oBFusCATed

Quote from: danselmi on August 12, 2014, 07:25:47 PM
Can you explain how to reproduce?
See default colors of the c++ theme to dark gray and light gray. Then try to open the MiniDoc panel. If it still works correctly then I can share my theme...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

danselmi

Quote from: jens on August 12, 2014, 11:07:09 PM
...
It goes a slightly different way, because I connect to the first cbStyledTextCtrl instead of the editor.
So resize-events in split-view are recognized also.
Applied your patch, thanks a lot. It is not working when the second splited view changes size (hide/show logs resizes only second view).


Quote from: jens on August 12, 2014, 08:09:02 PM
... for splitted editors ... is more broken (at least here): the actual highlighted lines (grey rectangle) get a white circle in the editors margin of the second control.
Its because the marker MiniStyledTextCtrl::GetOurMarkerNumber() is not defined as wxSCI_MARK_EMPTY. And other unused marker numbers have other visible marker settings.
A simple solution is to define all markers (0..wxSCI_MARKER_MAX] as wxSCI_MARKER_EMPTY after creation of cbStyledTextCtrl (in cbEditor). like this:
Index: cbeditor.cpp
===================================================================
--- cbeditor.cpp (revision 9855)
+++ cbeditor.cpp (working copy)
@@ -782,6 +782,7 @@
     m_pControl->SetMarginMask(C_MARKER_MARGIN,    0);
     m_pControl->SetMarginMask(C_CHANGEBAR_MARGIN, 0);
     m_pControl->SetMarginMask(C_FOLDING_MARGIN,   0);
+    InitMarker(m_pControl);

     SetEditorStyleBeforeFileOpen();
     m_IsOK = Open();
@@ -797,6 +798,13 @@
     }
     ConnectEvents(m_pControl);
}
+void cbEditor::InitMarker(cbStyledTextCtrl* control)
+{
+    if(!control)
+        return;
+    for (int marker = 0 ; marker <= wxSCI_MARKER_MAX ; ++marker)
+        control->MarkerDefine(marker, wxSCI_MARK_EMPTY);
+}

void cbEditor::NotifyPlugins(wxEventType type, int intArg, const wxString& strArg, int xArg, int yArg)
{
@@ -1095,6 +1103,7 @@

     // create the right control
     m_pControl2 = CreateEditor();
+    InitMarker(m_pControl2);

     // update controls' look'n'feel
     // do it here (before) document is attached, speeds up syntaxhighlighting


I tried to define the marker from the MiniDoc plugin, but there I don't know when a splitted view gets created. Right?


regards
spell checker plugin: [url="http://developer.berlios.de/projects/spellchecker/"]http://developer.berlios.de/projects/spellchecker/[/url]
nassi shneiderman plugin: [url="http://developer.berlios.de/projects/nassiplugin"]http://developer.berlios.de/projects/nassiplugin[/url]

danselmi

Quote from: oBFusCATed on August 13, 2014, 12:44:47 AM
Quote from: danselmi on August 12, 2014, 07:25:47 PM
Can you explain how to reproduce?
See default colors of the c++ theme to dark gray and light gray. Then try to open the MiniDoc panel. If it still works correctly then I can share my theme...
I still can't see whats wrong.
spell checker plugin: [url="http://developer.berlios.de/projects/spellchecker/"]http://developer.berlios.de/projects/spellchecker/[/url]
nassi shneiderman plugin: [url="http://developer.berlios.de/projects/nassiplugin"]http://developer.berlios.de/projects/nassiplugin[/url]

oBFusCATed

(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

danselmi

Quote from: oBFusCATed on August 13, 2014, 11:07:27 PM
This http://cmpt.benbmp.org/codeblocks/screens/minidoc.theme.png
Ahh... Thanks, now I see!

Is your theme ok when the invisible part is marked by greying out the non-visible parts? (latest sources, in config panel remove tick "inverse designator").

Can you try to patch cbEditor to init the markers ( patch from this
Quote from: danselmi on August 13, 2014, 10:31:02 AM
post)? Is it also a solution?
spell checker plugin: [url="http://developer.berlios.de/projects/spellchecker/"]http://developer.berlios.de/projects/spellchecker/[/url]
nassi shneiderman plugin: [url="http://developer.berlios.de/projects/nassiplugin"]http://developer.berlios.de/projects/nassiplugin[/url]

oBFusCATed

(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

oBFusCATed

#24
I've just tried the latest version and it seems that this error is fixed.

But there are two other errors, one minor and one more serious

serious: The last line is white, probably because you're playing with the margins. See the screenshot: http://cmpt.benbmp.org/codeblocks/screens/minidoc.line.problem.png
minor: After the plugin is loaded and then the panel is shown it is empty.
annoying: The gray area is really ugly, because of the dark greyish spaces between the lines, see the screenshot.

Edit: Notepad++ seems to have no problem with the darker spaces between the lines. See this video https://www.youtube.com/watch?v=5Y6hE0SdgsQ
Edit2: The serious problem is worsened when a line or more is deleted in the document, then multiple lines become white.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

oBFusCATed

There is another problem: When scrolling I can see the inactive lines from the minidoc drawn over the line numbers of my main editor. But I can't make a screenshot to demonstrate the artefact.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

danselmi

Quote from: oBFusCATed on August 14, 2014, 12:04:36 AM
serious: The last line is white, probably because you're playing with the margins. See the screenshot: http://cmpt.benbmp.org/codeblocks/screens/minidoc.line.problem.png
Quote from: oBFusCATed on August 14, 2014, 12:22:36 AM
There is another problem: When scrolling I can see the inactive lines from the minidoc drawn over the line numbers of my main editor. But I can't make a screenshot to demonstrate the artefact.
First, I don't play with the margins. Again, apply the mentioned patch! The reason is that a cbStyledTextControl has some of the markers configured to visible symbols and colored lines.

Quote from: oBFusCATed on August 14, 2014, 12:04:36 AM
The serious problem is worsened when a line or more is deleted in the document, then multiple lines become white.
The white lines are gone with the mentioned patch. But the grey area will still be wrong in this cases. I have to update the MiniStc more regular after typing.

Quote from: oBFusCATed on August 14, 2014, 12:04:36 AM
minor: After the plugin is loaded and then the panel is shown it is empty.
What do you expect?

Quote from: oBFusCATed on August 14, 2014, 12:04:36 AM
annoying: The gray area is really ugly, because of the dark greyish spaces between the lines, see the screenshot.
...
Edit: Notepad++ seems to have no problem with the darker spaces between the lines. See this video https://www.youtube.com/watch?v=5Y6hE0SdgsQ
That's true, I have to look into it.
spell checker plugin: [url="http://developer.berlios.de/projects/spellchecker/"]http://developer.berlios.de/projects/spellchecker/[/url]
nassi shneiderman plugin: [url="http://developer.berlios.de/projects/nassiplugin"]http://developer.berlios.de/projects/nassiplugin[/url]

oBFusCATed

Quote from: danselmi on August 14, 2014, 01:04:30 AM
Quote from: oBFusCATed on August 14, 2014, 12:04:36 AM
minor: After the plugin is loaded and then the panel is shown it is empty.
What do you expect?
To see the active editor in the minidoc panel.

The steps to reproduce the problem are:
1. Open some project or files
2. Enabled the minidoc
3. View -> MiniDoc

At step 3 the minidoc is still empty.

About the patch: I'll see if I can find time to try it.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

danselmi

Quote from: oBFusCATed on August 14, 2014, 08:47:30 AM
... To see the active editor in the minidoc panel. ...
You are right. I didn't think about loading a plugin after startup. Thanks.
I just commited the fix.
spell checker plugin: [url="http://developer.berlios.de/projects/spellchecker/"]http://developer.berlios.de/projects/spellchecker/[/url]
nassi shneiderman plugin: [url="http://developer.berlios.de/projects/nassiplugin"]http://developer.berlios.de/projects/nassiplugin[/url]

danselmi

Quote from: oBFusCATed on August 14, 2014, 12:04:36 AM
annoying: The gray area is really ugly, because of the dark greyish spaces between the lines, see the screenshot.

Edit: Notepad++ seems to have no problem with the darker spaces between the lines. See this video https://www.youtube.com/watch?v=5Y6hE0SdgsQ
It's a bug in wxScintilla, see here:
https://groups.google.com/forum/#!topic/scintilla-interest/FAI2HjSYlLk
spell checker plugin: [url="http://developer.berlios.de/projects/spellchecker/"]http://developer.berlios.de/projects/spellchecker/[/url]
nassi shneiderman plugin: [url="http://developer.berlios.de/projects/nassiplugin"]http://developer.berlios.de/projects/nassiplugin[/url]