Browse Source

Couple of translation tweaks to KeyMappingEditorComponent.

tags/2021-05-28
jules 12 years ago
parent
commit
58f4a38ad8
2 changed files with 13 additions and 15 deletions
  1. +12
    -14
      modules/juce_gui_extra/misc/juce_KeyMappingEditorComponent.cpp
  2. +1
    -1
      modules/juce_gui_extra/misc/juce_KeyMappingEditorComponent.h

+ 12
- 14
modules/juce_gui_extra/misc/juce_KeyMappingEditorComponent.cpp View File

@@ -35,8 +35,8 @@ public:
setWantsKeyboardFocus (false); setWantsKeyboardFocus (false);
setTriggeredOnMouseDown (keyNum >= 0); setTriggeredOnMouseDown (keyNum >= 0);
setTooltip (keyIndex < 0 ? TRANS("adds a new key-mapping")
: TRANS("click to change this key-mapping"));
setTooltip (keyIndex < 0 ? TRANS("Adds a new key-mapping")
: TRANS("Click to change this key-mapping"));
} }
void paintButton (Graphics& g, bool /*isOver*/, bool /*isDown*/) override void paintButton (Graphics& g, bool /*isOver*/, bool /*isDown*/) override
@@ -64,9 +64,9 @@ public:
{ {
// existing key clicked.. // existing key clicked..
PopupMenu m; PopupMenu m;
m.addItem (1, TRANS("change this key-mapping"));
m.addItem (1, TRANS("Change this key-mapping"));
m.addSeparator(); m.addSeparator();
m.addItem (2, TRANS("remove this key-mapping"));
m.addItem (2, TRANS("Remove this key-mapping"));
m.showMenuAsync (PopupMenu::Options(), m.showMenuAsync (PopupMenu::Options(),
ModalCallbackFunction::forComponent (menuCallback, this)); ModalCallbackFunction::forComponent (menuCallback, this));
@@ -211,7 +211,7 @@ public:
const bool isReadOnly = owner.isCommandReadOnly (commandID); const bool isReadOnly = owner.isCommandReadOnly (commandID);
const Array <KeyPress> keyPresses (owner.getMappings().getKeyPressesAssignedToCommand (commandID));
const Array<KeyPress> keyPresses (owner.getMappings().getKeyPressesAssignedToCommand (commandID));
for (int i = 0; i < jmin ((int) maxNumAssignments, keyPresses.size()); ++i) for (int i = 0; i < jmin ((int) maxNumAssignments, keyPresses.size()); ++i)
addKeyPressButton (owner.getDescriptionForKeyPress (keyPresses.getReference (i)), i, isReadOnly); addKeyPressButton (owner.getDescriptionForKeyPress (keyPresses.getReference (i)), i, isReadOnly);
@@ -301,8 +301,7 @@ public:
g.setFont (Font (height * 0.6f, Font::bold)); g.setFont (Font (height * 0.6f, Font::bold));
g.setColour (owner.findColour (KeyMappingEditorComponent::textColourId)); g.setColour (owner.findColour (KeyMappingEditorComponent::textColourId));
g.drawText (categoryName,
2, 0, width - 2, height,
g.drawText (TRANS (categoryName), 2, 0, width - 2, height,
Justification::centredLeft, true); Justification::centredLeft, true);
} }
@@ -312,11 +311,11 @@ public:
{ {
if (getNumSubItems() == 0) if (getNumSubItems() == 0)
{ {
const Array <CommandID> commands (owner.getCommandManager().getCommandsInCategory (categoryName));
const Array<CommandID> commands (owner.getCommandManager().getCommandsInCategory (categoryName));
for (int i = 0; i < commands.size(); ++i) for (int i = 0; i < commands.size(); ++i)
if (owner.shouldCommandBeIncluded (commands[i]))
addSubItem (new MappingItem (owner, commands[i]));
if (owner.shouldCommandBeIncluded (commands.getUnchecked(i)))
addSubItem (new MappingItem (owner, commands.getUnchecked(i)));
} }
} }
else else
@@ -338,8 +337,7 @@ class KeyMappingEditorComponent::TopLevelItem : public TreeViewItem,
private ChangeListener private ChangeListener
{ {
public: public:
TopLevelItem (KeyMappingEditorComponent& kec)
: owner (kec)
TopLevelItem (KeyMappingEditorComponent& kec) : owner (kec)
{ {
setLinesDrawnForSubItems (false); setLinesDrawnForSubItems (false);
owner.getMappings().addChangeListener (this); owner.getMappings().addChangeListener (this);
@@ -362,11 +360,11 @@ public:
for (int i = 0; i < categories.size(); ++i) for (int i = 0; i < categories.size(); ++i)
{ {
const Array <CommandID> commands (owner.getCommandManager().getCommandsInCategory (categories[i]));
const Array<CommandID> commands (owner.getCommandManager().getCommandsInCategory (categories[i]));
int count = 0; int count = 0;
for (int j = 0; j < commands.size(); ++j) for (int j = 0; j < commands.size(); ++j)
if (owner.shouldCommandBeIncluded (commands[j]))
if (owner.shouldCommandBeIncluded (commands.getUnchecked(j)))
++count; ++count;
if (count > 0) if (count > 0)


+ 1
- 1
modules/juce_gui_extra/misc/juce_KeyMappingEditorComponent.h View File

@@ -48,7 +48,7 @@ public:
bool showResetToDefaultButton); bool showResetToDefaultButton);
/** Destructor. */ /** Destructor. */
virtual ~KeyMappingEditorComponent();
~KeyMappingEditorComponent();
//============================================================================== //==============================================================================
/** Sets up the colours to use for parts of the component. /** Sets up the colours to use for parts of the component.


Loading…
Cancel
Save