Opened 13 years ago

Last modified 8 years ago

#942 assigned enhancement

[PATCH] Improve Atlas toolbar

Reported by: historic_bruno Owned by: trompetin17
Priority: Nice to Have Milestone: Backlog
Component: Atlas editor Keywords: patch
Cc: joswwa-0ad@… Patch:

Description

The Atlas toolbar could be improved in several ways:

  • Move the simulation buttons from the map panel to the toolbar and give them "media player" style icons (e.g. play, pause, stop, fast forward).
  • We'll want different sections for different types of buttons. This will require modifications of our custom toolbar which treats every button as a tool (e.g. paint, modify elevation, transform object). Do we need all the tool buttons?
  • Investigate wxAUIToolbar, it's more complex so more likely to have bugs, but does supposedly offer advanced features. Documentation appears sparse and we need to check compatibility on various platforms and versions of wxWidgets.

Attachments (7)

atlas save button preview.png (472.1 KB ) - added by trompetin17 10 years ago.
atlas save button.2.diff (10.2 KB ) - added by trompetin17 10 years ago.
save.png (3.3 KB ) - added by trompetin17 10 years ago.
atlas save button preview 2.png (98.7 KB ) - added by trompetin17 10 years ago.
atlas save button.diff (7.1 KB ) - added by trompetin17 10 years ago.
Actualizacion
atlas save button.3.diff (7.7 KB ) - added by trompetin17 10 years ago.
atlas save button.4.diff (7.8 KB ) - added by trompetin17 10 years ago.

Download all attachments as: .zip

Change History (29)

comment:1 by historic_bruno, 13 years ago

Here's an old mockup, containing a few clues for the proposed toolbar: http://i.imgur.com/j9CKh.jpg

by trompetin17, 10 years ago

comment:2 by trompetin17, 10 years ago

Keywords: review patch added
Summary: Improve Atlas toolbar[PATCH] Improve Atlas toolbar

comment:3 by sanderd17, 10 years ago

I think it would be nice to have some visual distinction between the tool types. All types that are currently on the toolbar change your pointer, while this save button is a conceptually different button. Something like avertical bar between the two groups would work I think.

Also, don't forget to include your icon (binary files aren't included in a diff) + mention the source of your icon.

by trompetin17, 10 years ago

Attachment: atlas save button.2.diff added

by trompetin17, 10 years ago

Attachment: save.png added

comment:4 by trompetin17, 10 years ago

Image from http://shlyapnikova.deviantart.com Toolbar Icon Set

by trompetin17, 10 years ago

comment:5 by sanderd17, 10 years ago

Good icon, listed under cc-by, so we only need to mention her devianArt in the commit.

Fit the code, could you revert those strange indentation fixes? It's nicer if the stars of comments are aligned, when ifs are on the same level as endifs, ...

Apart from that, it looks good for now.

by trompetin17, 10 years ago

Attachment: atlas save button.diff added

Actualizacion

comment:6 by historic_bruno, 10 years ago

There are a few minor formatting issues I noticed:

  • ToolButton.cpp
    • Line 74: should have a space in ,m_IdAction(baseID)
    • Line 85: should not have a space in iconPath (
    • Line 89: should not have a space in ! fstr.Ok()
    • Line 110: should have a space between operator in 1000+m_IdAction
    • Line 154: should be a space in action=evt.GetId()
    • Line 155: should be spaces in if(action>=1000)
  • ToolButton.h
    • m_funcion is misspelled?
  • ScenarioEditor.cpp
    • Line 546: missing spaces between arguments

There are others similar to those, see Coding_Conventions for a guideline.

Is there a reason to use boost::function? We don't seem to use this anywhere currently, which is why I ask.

I think it's more conventional to use e.g. <boost/bind.hpp> than "boost/bind.hpp" assuming that works. Also, boost/bind.hpp doesn't seem to be needed in ScenarioEditor.h, so it should be moved to ScenarioEditor.cpp (headers should be included in the cpp files as much as possible for more efficient compilation).

The new action button being pressed is an event, maybe it would be cleaner if the callback passed a wxCommandEvent directly to it, instead of having to use a wrapper as with OnToolSave? I'm not certain, it's just an idea.

comment:7 by historic_bruno, 10 years ago

Keywords: simple,atlas,ui,review patch → simple atlas ui review patch
Milestone: BacklogAlpha 17

by trompetin17, 10 years ago

Attachment: atlas save button.3.diff added

comment:8 by trompetin17, 10 years ago

Hi historic_bruno, thx for your feedback, First I wanna say Im sorry , my main languaje is spanish and i called "m_funcion" no "m_function". Im using boost:function because I wanna introduce some dynamic handlers, for example, some actions come from ScenarioEditor(save), but other come from MapSidebar(Simulations buttons). With boost:function i could use Function pointer(global functions) and member function pointer. So every Sidebar could add a toolbutton without having a EventCommand inside.

If you could join in #oad-dev i could explain more or even know what could do next in atlas.

comment:9 by historic_bruno, 10 years ago

No problem, thank you for working on this! :) Atlas could use some attention in the usability area, as I'm sure Michael (Mythos_Ruler) would agree.

by trompetin17, 10 years ago

Attachment: atlas save button.4.diff added

comment:10 by trompetin17, 10 years ago

hi historic_bruno, I fixed all you tell me, could you review once again please

"atlas save button.4.diff​"

Last edited 10 years ago by trompetin17 (previous) (diff)

comment:11 by sanderd17, 10 years ago

Keywords: review removed

I got the following build warning that should be fixed:

../../../source/tools/atlas/AtlasUI/CustomControls/Buttons/ToolButton.cpp: In member function ‘void ToolButtonBar::AddToolAction(const wxString&, const wxString&, const wxString&, fnAction)’:
../../../source/tools/atlas/AtlasUI/CustomControls/Buttons/ToolButton.cpp:110:65: warning: ‘wxToolBarToolBase* wxToolBarBase::AddTool(int, const wxBitmap&, const wxString&, const wxString&)’ is deprecated (declared at /usr/include/wx-3.0/wx/tbarbase.h:507) [-Wdeprecated-declarations]
  AddTool(1000 + m_IdAction, wxBitmap(img), shortLabel, longLabel);
                                                                 ^

And when starting Atlas, I also got a window saying

iCCP: Not recognizing known sRGB profile that has been edited

I often see this in the terminal, but having a window pop up is really annoying.

Apart from that, it works well.

comment:12 by Itms, 10 years ago

Milestone: Alpha 17Alpha 18

comment:13 by njm, 10 years ago

Owner: set to njm

comment:14 by njm, 10 years ago

Cc: joswwa-0ad@… added
Keywords: patch removed
Status: newassigned
Summary: [PATCH] Improve Atlas toolbarImprove Atlas toolbar

in reply to:  11 comment:15 by njm, 10 years ago

Replying to sanderd17:

I got the following build warning that should be fixed:

../../../source/tools/atlas/AtlasUI/CustomControls/Buttons/ToolButton.cpp: In member function ‘void ToolButtonBar::AddToolAction(const wxString&, const wxString&, const wxString&, fnAction)’:
../../../source/tools/atlas/AtlasUI/CustomControls/Buttons/ToolButton.cpp:110:65: warning: ‘wxToolBarToolBase* wxToolBarBase::AddTool(int, const wxBitmap&, const wxString&, const wxString&)’ is deprecated (declared at /usr/include/wx-3.0/wx/tbarbase.h:507) [-Wdeprecated-declarations]
  AddTool(1000 + m_IdAction, wxBitmap(img), shortLabel, longLabel);
                                                                 ^

On Stackoverflow someone had the same issue with AddTool and InsertTool, but he only shows a solution for InsertTool. Maybe ask the developers about it.

comment:16 by njm, 9 years ago

Owner: njm removed
Status: assignednew

I'm still on it, but maybe someone is faster than me.

comment:17 by Itms, 9 years ago

Hello njm, we'd like to have some information about whether you're still on it.

Maybe you are facing problems or have questions, in any case you can reach us on IRC (http://webchat.quakenet.org/?channels=0ad-dev).

Looking forward to your answer!

comment:18 by Itms, 9 years ago

Milestone: Alpha 18Alpha 19

comment:19 by historic_bruno, 9 years ago

Milestone: Alpha 19Backlog

comment:20 by trompetin17, 9 years ago

Owner: set to trompetin17
Status: newassigned

comment:21 by Stan, 8 years ago

Milestone: BacklogAlpha 20

refs #3414

comment:22 by elexis, 8 years ago

Keywords: patch added; simple atlas ui removed
Milestone: Alpha 20Backlog
Summary: Improve Atlas toolbar[PATCH] Improve Atlas toolbar
Note: See TracTickets for help on using tickets.