Feature #627

IDE tool bar should update respect editor state

Added by Zbigniew Rebacz over 10 years ago. Updated over 10 years ago.

Status:ApprovedStart date:01/05/2014
Priority:NormalDue date:
Assignee:Miroslav Fidler% Done:

0%

Category:IDESpent time:-
Target version:-

Description

I think it will be good if ide toolbar will react on editor states. We need to modify several things.

First of all we need to add two following methods(ide.h):

    void      SetBar();
    void      SetMenuBar();
    void      SetToolBar();

Secnondly we need to add toolbar reaction on editor event(idewin.cpp - line 309):

editor.WhenSel = THISBACK(SetToolBar);

At the end we need to improve idebar behavior(idebar.cpp).

--------------------------------------------------------------------------------------------------------
I have found the way how we can speed up setting tool bar process (idebar.cpp - BrowseMenu):

    if (menu.IsMenuBar()) { // <- This additional if gives as extra performance. In addition, this should speed up channging tab process.
        menu.AddMenu(AK_NAVIGATOR, IdeImg::Navigator(), THISBACK(ToggleNavigator))
             .Check(editor.IsNavigator());
        menu.Add(AK_SEARCHCODE, THISBACK(SearchCode));
        menu.Add(!designer, AK_GOTO, THISBACK(Goto));
        menu.Add(AK_GOTOGLOBAL, THISBACK(GotoGlobal));
        menu.Add(!designer, AK_JUMPS, THISBACK(ContextGoto));
        menu.Add(!designer, AK_SWAPS, THISBACK(SwapS));
        menu.Add(!designer, AK_ASSIST, callback(&editor, &AssistEditor::Assist));
        menu.Add(!designer, AK_DCOPY, callback(&editor, &AssistEditor::DCopy));
        menu.Add(!designer, AK_VIRTUALS, callback(&editor, &AssistEditor::Virtuals));
        menu.Add(!designer, AK_THISBACKS, callback(&editor, &AssistEditor::Thisbacks));
        menu.Add(!designer, AK_COMPLETE, callback(&editor, &AssistEditor::Complete));
        menu.Add(!designer, AK_COMPLETE2, callback(&editor, &AssistEditor::Complete2));
        menu.Add(!designer, AK_ABBR, callback(&editor, &AssistEditor::Abbr));
        menu.Add(!designer, "Insert", THISBACK(InsertMenu));
        menu.MenuSeparator();
        menu.Add("Rescan code", THISBACK(RescanCode));
        menu.MenuSeparator();
        menu.AddMenu(AK_CALC, IdeImg::calc(), THISBACK1(ToggleBottom, BCALC))
         .Check(IsBottomShown() && btabs.GetCursor() == BCALC);
        menu.AddMenu(AK_QTF, IdeCommonImg::Qtf(), THISBACK(Qtf));
        menu.AddMenu(!designer, AK_XML, IdeCommonImg::xml(), THISBACK(Xml));
        menu.AddMenu(!designer, AK_JSON, IdeCommonImg::json(), THISBACK(Json));
    }

ide.h Magnifier (31.3 KB) Zbigniew Rebacz, 01/05/2014 01:36 AM

idewin.cpp Magnifier (20.2 KB) Zbigniew Rebacz, 01/05/2014 01:36 AM

idebar.cpp Magnifier (21.3 KB) Zbigniew Rebacz, 01/05/2014 01:36 AM

LockedOperations.png (300 KB) Zbigniew Rebacz, 01/08/2014 04:35 PM


Related issues

Follows Bug #625: Console menu bar shoulde use standard copy and paste icon. Approved 01/04/2014

History

#1 Updated by Miroslav Fidler over 10 years ago

Well, I am a bit confused here. Which icons in toolbar should react to editor changes? I think only menu items do and those do not need to be synchronized...

(OTOH, if we ever get to configurable toolbars, this will be necessitty).

Mirek

#2 Updated by Miroslav Fidler over 10 years ago

  • Assignee changed from Miroslav Fidler to Zbigniew Rebacz

#3 Updated by Miroslav Fidler over 10 years ago

  • Status changed from Patch ready to In Progress

#4 Updated by Zbigniew Rebacz over 10 years ago

I enclose demonstrative screenshot.

#5 Updated by Zbigniew Rebacz over 10 years ago

  • Status changed from In Progress to Patch ready
  • Assignee changed from Zbigniew Rebacz to Miroslav Fidler

#6 Updated by Miroslav Fidler over 10 years ago

  • Status changed from Patch ready to Approved

Also available in: Atom PDF