Code::Blocks Forums

User forums => Help => Topic started by: MoonKid on March 31, 2006, 09:56:22 pm

Title: hotkey/shortcut view on tooltips
Post by: MoonKid on March 31, 2006, 09:56:22 pm
I found no functionality in C::B.

Is it possible to view the shortcuts in the tooltips?

example
"step into" should be "step into (Shift+F7)"
Title: Re: hotkey/shortcut view on tooltips
Post by: thomas on March 31, 2006, 10:52:32 pm
The menus show their shortcuts by default. To have shortcuts displayed on tooltips, too, you would have to modify the XRC file (is not a configuration thing).
Title: Re: hotkey/shortcut view on tooltips
Post by: MoonKid on April 01, 2006, 04:21:30 pm
The menus show their shortcuts by default.

Yes, I know. But it is not what I want. :)

you would have to modify the XRC file (is not a configuration thing).

I found no XRC file. I think it is in the source package.
Ok, it should be a configuration thing. I will set a request.
Title: Re: hotkey/shortcut view on tooltips
Post by: thomas on April 01, 2006, 04:46:04 pm
The XRC files are inside share\CodeBlocks\resources.zip. You can edit them with any text editor (including Code::Blocks, SciTE, or Notebook).

Submitting a feature request will not avail you, since we will certainly not make this configurable any time soon, but it will be included in the action based event system, anyway. Right now, it is a prohibitive amount of work to change toolbar tooltips programmatically.

On the other hand, the future action-based event handling system generates toolbar buttons programmatically, anyway. Thus, showing shortcuts in tooltips (and making this configurable) comes for free.
Title: Re: hotkey/shortcut view on tooltips
Post by: MoonKid on April 01, 2006, 06:49:41 pm
the future action-based event handling system generates toolbar buttons programmatically

Is it a wxWidget system or is it C::B specific?

It could be modified. Reading C::B settings/options
if tooltips + shortcuts
 read the <tooltip> tag + <shortcut> tag in the xrc files.

It is important for usability! Please do not close the feauter request. I will handle it as soon has possible.
Title: Re: hotkey/shortcut view on tooltips
Post by: thomas on April 01, 2006, 07:03:53 pm
Is it a wxWidget system or is it C::B specific?
The latter.

It could be modified. Reading C::B settings/options
if tooltips + shortcuts
 read the <tooltip> tag + <shortcut> tag in the xrc files.
We do not read in the XRC files. This is done by wxWidgets. What you describe would require us to patch wxWidgets, which is not an option.
Title: Re: hotkey/shortcut view on tooltips
Post by: MoonKid on April 06, 2006, 02:03:28 pm
We do not read in the XRC files. This is done by wxWidgets. What you describe would require us to patch wxWidgets, which is not an option.

Is that why the toolbars are not customizable?
Title: Re: hotkey/shortcut view on tooltips
Post by: thomas on April 06, 2006, 04:23:46 pm
No, the reason why they are not customizable is that they are stored in XRC.

You cannot customise XRC thingies (dialogs, controls, toolbars) in an easy way without using nasty hacks. It is of course technically possible, but an awful lot of work (and not worth the trouble).

There are for example at least three things you could do. One would be to use TinyXML to modify the XRC files (works, but very nasty hack). The second would be to modify wxWidgets (that's even worse). The last would be to query a pointer to the respective objects from wxWidgets one by one and modify them after they have been loaded (very tedious and adds noticeable overhead to startup time).

As I said above, the reason why we aren't putting work into this is that we can already see at this time that our work would be useless. When the action-based event handling system gets merged (which will be one of the first things to happen after version 1.0), toolbars will no longer be loaded from XRC, so all the tedious work will be thrown overboard.
Title: Re: hotkey/shortcut view on tooltips
Post by: takeshimiya on April 06, 2006, 04:42:45 pm
As I said above, the reason why we aren't putting work into this is that we can already see at this time that our work would be useless. When the action-based event handling system gets merged (which will be one of the first things to happen after version 1.0), toolbars will no longer be loaded from XRC, so all the tedious work will be thrown overboard.
That's the way to go. :)

About XRC hardcoding-ness, do you know how to make the XRC strings translatable?
With language catalogs (.po) or with different xrc's for each language?