Revamped the CodeCompletion plugin, Stage 1. Reparsing after saving files is much faster now. Also, the code completion functionality is much faster due to the searchtree structure.Known issues: The Class browser is NOT updated when using the cache. WARNING: Might cause crashes if you have the cache enabled. Please disable it

Added Manager::Yield(). Use this whenever you need to call wxYield() and friends. It's safer. Updated all affected code

I actually compiled it myself. It is awesome! One behind moving the watches window out of question, what was the reasoning behind removing the watches window out of the management window? (Note: I am not complaining. I'm just curious) I do think it is definately cool.

jmccay

Logged

OS: WinXP, Win98 SE, & sometimes Linux

a little light reading from the wxWidgets 2.6.2 readme: A detailed 2000-page reference manual is supplied in HTML, PDF and Windows Help form: see the docs hierarchy.

1. Launch Code::Blocks and go to the Editor settings (Settings -> Editor). Select Default code tab.2. Select C/C++ source file and add some text to it. Close settings by pressing OK.3. Open random project.4. Create new c/c++ source file (File -> New, file.cpp).5. Add this file to the project.6. The tab shows that the file is not modified but it is (try closing it).

1. Launch Code::Blocks and open project with some files.2. Open two random files from the project.3. Now try to open these files again in the project view. When clicking those files the tab right activates, but the application title bar shows only one file name and opened files list selection remains the same.

1. Launch Code::Blocks and go to the Editor settings (Settings -> Editor). Select Default code tab.2. Select C/C++ source file and add some text to it. Close settings by pressing OK.3. Open random project.4. Create new c/c++ source file (File -> New, file.cpp).5. Add this file to the project.6. The tab shows that the file is not modified but it is (try closing it).

1. Open random project.2. Create new file (File -> New). Create the file to thesame directory as the project.3. Answer No when asked to add the new file to the project.4. Edit the file in the editor so the tab shows the modification marker.5. Add the file to the project (Project -> Add files).6. Click the file's name in the project manager.

Tab now shows that the file is unmodified.

Quote

1. Launch Code::Blocks and open project with some files.2. Open two random files from the project.3. Now try to open these files again in the project view. When clicking those files the tab right activates, but the application title bar shows only one file name and opened files list selection remains the same.

1. Launch Code::Blocks, go to the Editor settings (Settings -> Editor) and select Default code tab.2. If you already have text in C++ source and/or C++ header remove all text from both of them, save settings by pressing OK, open the Editor settings again and select Default code tab.3. Make sure you have C++ source selected. Type some text to the textbox.4. Select C++ header from the listbox.5. Select C++ source from the listbox and the text you typed is gone.

1. Launch Code::Blocks and load the default layout (I'm using the default default layout, nothing changed).2. Drag the management window so it will undock.3. Dock the management window again to its default place.4. Minimize Code::Blocks.5. When Code::Blocks is minimizing quickly press the Code::Blocks taskbar button. You have to hit it before Code::Blocks is fully minimized. If you did it right Code::Blocks will be unrestoreable from the taskbar by pressing the taskbar button (you can actually restore it by right clicking the taskbar icon with mouse and selecting Restore).

This unrestoreable state only happens if you move the docking windows around.

It was hard to reproduce it back then but no I can reproduce it every time with ease:

1. Open Code::Blocks and load the default layout (again I'm using the very default layout).2. Drag and drop the Open files list so it will undock.3. Dock it back to the default place.4. Press the editor (or start page) so any docking windows does not get focus.5. Minimize Code::Blocks using the taskbar button, not the minimize button!6. Try to maximize Code::Blocks by clicking taskbar button. Code::Blocks won't maximize.

Quote1. Launch Code::Blocks and open project with some files.2. Open two random files from the project.3. Now try to open these files again in the project view. When clicking those files the tab right activates, but the application title bar shows only one file name and opened files list selection remains the same.

#1403642 App title bar / Open files list show wrong selected file

Okay flks, I have found the cause of the poblem and I have a solution (proposal). I did NOT specify it as a patch, because a second opinion is need from the devs. They might have a better solution for this.

Let's take as an example the Keybinder plug-in project.

What is the corect behaviour : In the project tree you double click on a file nod, and an aeditor should open up in the editors pane showing the contents of that file, AND !!! the title of the Cb window should say :file.cpp [Project] - Code::Blocks v1.0

Now let's start our excursion. Open up the keybinder project, double click on cbkeybinder.cpp i nthe project tree. It opens up [see REMARK 1 (below)] and look at the title bar (yes, I know, but hold your breath, wait till REMARK 1). What happened behind the scenes : at a given moment we ended up at : cbEditor* EditorManager::Open(const wxString& filename, int pos,ProjectFile* data) which in the case the file is not open yet in CB ends up in the following : ed = new cbEditor(m_pNotebook, fname, m_Theme);This cbEditor constructor will call the Open function :bool cbEditor::Open()and this function will do the following at the end : NotifyPlugins(cbEVT_EDITOR_OPEN);Thie Notify function loops over all plug-ins, and already the first plug-in it looked at result in a call to :void MainFrame::DoUpdateAppTitle()And this method sets the (new) title.-- >So apart from the REMARK1 we made it.

Next double click keybinder.cpp in the project tree, and the story repeats.

Alrighty, time fo the instrumental break which instruments do you want u to break Cliff ... ).Double click on cbkeybinder.cpp, the story 'nearly repeats' itself. Again we end up at :cbEditor* EditorManager::Open(const wxString& filename, int pos,ProjectFile* data) which in the case the BUT .... This time the opening tests ome to the conclusion that this 'to construct' cbEditor already exists, so no need to the new call --> woops, the rest of the story remains untold, no cookies,no drinks, no MainFrame::DoUpdateAppTitle() :-(

if (eb->IsBuiltinEditor()) { ed = (cbEditor*)eb; ed->NotifyPlugins(cbEVT_EDITOR_OPEN); }No luck : we notify a little bit to early,in the MainFrame::DoUpdateAppTitle() they ask for the active editor, but out reopend file did not receive the state of active editor yet. SO be patient, let's just signal that we want to update the plug-ins as follows :

bool bNotifyPlugIns = false; if (eb) { if (eb->IsBuiltinEditor()) {ed = (cbEditor*)eb;bNotifyPlugIns = true; } else return 0; // is open but not a builtin editor }And at the end of our EditorManager::Open(), when the reopened editor has achieved the active editor state, we check our flag and act accordingly :

With this adjustments ....... Problem fixed, and and and it shows in the title :cbkeybinder.cpp [C::B KeyBinder] - Code::Blocks v1.0 :-) :-) :-) :-)

Well it is time for that remark :REMARK 1 :Ater opening that cbkeybinder.cpp for the first time, you will notice that the project name i no shown, it only shows :cbkeybinder.cpp - Code::Blocks v1.0 :-( :-(

Why ? Well I know why, didn't find a solution yet, Yiannis, this is where you come in ;-)Look at this code (from MainFrame::DoUpdateAppTitle() ):

How come it worked in our fixed 'reopen' path, well then the project file was associated. So it seems, we have something like this :- open in editor- notify plug-ins -> app title adjustements- ...- somewhere now the projectfile is associated- ...

Thanks a lot for the insight Lieven (although I kinda of knew this stuff)

There 's one fundamental flaw in your solution though: EVT_EDITOR_OPEN is supposed to fire only once, just when the editor opens. That's why you don't see it anywhere else.The event you 're looking for is EVT_EDITOR_ACTIVATED. So the actual bug is that MainFrame doesn't hook to EVT_EDITOR_ACTIVATED and the following one liner is the fix.