Browse Source

Cleaned up some ints that should have been CommandIDs.

tags/2021-05-28
jules 12 years ago
parent
commit
57db92b276
9 changed files with 61 additions and 55 deletions
  1. +24
    -21
      extras/Introjucer/Source/ComponentEditor/ui/jucer_JucerCommandIDs.h
  2. +2
    -2
      modules/juce_gui_basics/buttons/juce_Button.cpp
  3. +4
    -3
      modules/juce_gui_basics/buttons/juce_Button.h
  4. +25
    -22
      modules/juce_gui_basics/commands/juce_ApplicationCommandID.h
  5. +2
    -3
      modules/juce_gui_basics/commands/juce_ApplicationCommandInfo.cpp
  6. +1
    -1
      modules/juce_gui_basics/menus/juce_PopupMenu.cpp
  7. +1
    -1
      modules/juce_gui_basics/menus/juce_PopupMenu.h
  8. +1
    -1
      modules/juce_gui_extra/code_editor/juce_CodeEditorComponent.cpp
  9. +1
    -1
      modules/juce_gui_extra/code_editor/juce_CodeEditorComponent.h

+ 24
- 21
extras/Introjucer/Source/ComponentEditor/ui/jucer_JucerCommandIDs.h View File

@@ -27,32 +27,35 @@
*/
namespace JucerCommandIDs
{
static const int test = 0xf20009;
static const int toFront = 0xf2000a;
static const int toBack = 0xf2000b;
enum
{
test = 0xf20009,
toFront = 0xf2000a,
toBack = 0xf2000b,
static const int group = 0xf20017;
static const int ungroup = 0xf20018;
group = 0xf20017,
ungroup = 0xf20018,
static const int showGrid = 0xf2000e;
static const int enableSnapToGrid = 0xf2000f;
showGrid = 0xf2000e,
enableSnapToGrid = 0xf2000f,
static const int editCompLayout = 0xf20010;
static const int editCompGraphics = 0xf20011;
editCompLayout = 0xf20010,
editCompGraphics = 0xf20011,
static const int bringBackLostItems = 0xf20012;
bringBackLostItems = 0xf20012,
static const int zoomIn = 0xf20013;
static const int zoomOut = 0xf20014;
static const int zoomNormal = 0xf20015;
static const int spaceBarDrag = 0xf20016;
zoomIn = 0xf20013,
zoomOut = 0xf20014,
zoomNormal = 0xf20015,
spaceBarDrag = 0xf20016,
static const int compOverlay0 = 0xf20020;
static const int compOverlay33 = 0xf20021;
static const int compOverlay66 = 0xf20022;
static const int compOverlay100 = 0xf20023;
compOverlay0 = 0xf20020,
compOverlay33 = 0xf20021,
compOverlay66 = 0xf20022,
compOverlay100 = 0xf20023,
static const int newDocumentBase = 0xf32001;
static const int newComponentBase = 0xf30001;
static const int newElementBase = 0xf31001;
newDocumentBase = 0xf32001,
newComponentBase = 0xf30001,
newElementBase = 0xf31001
};
}

+ 2
- 2
modules/juce_gui_basics/buttons/juce_Button.cpp View File

@@ -45,8 +45,8 @@ Button::Button (const String& name)
autoRepeatSpeed (0),
autoRepeatMinimumDelay (-1),
radioGroupId (0),
commandID (0),
connectedEdgeFlags (0),
commandID(),
buttonState (buttonNormal),
lastToggleState (false),
clickTogglesState (false),
@@ -464,7 +464,7 @@ void Button::parentHierarchyChanged()
//==============================================================================
void Button::setCommandToTrigger (ApplicationCommandManager* const newCommandManager,
const int newCommandID, const bool generateTip)
const CommandID newCommandID, const bool generateTip)
{
commandID = newCommandID;
generateTooltip = generateTip;


+ 4
- 3
modules/juce_gui_basics/buttons/juce_Button.h View File

@@ -212,11 +212,11 @@ public:
@see addShortcut, getCommandID
*/
void setCommandToTrigger (ApplicationCommandManager* commandManagerToUse,
int commandID,
CommandID commandID,
bool generateTooltip);
/** Returns the command ID that was set by setCommandToTrigger(). */
int getCommandID() const noexcept { return commandID; }
CommandID getCommandID() const noexcept { return commandID; }
//==============================================================================
/** Assigns a shortcut key to trigger the button.
@@ -457,7 +457,8 @@ private:
uint32 buttonPressTime, lastRepeatTime;
ApplicationCommandManager* commandManagerToUse;
int autoRepeatDelay, autoRepeatSpeed, autoRepeatMinimumDelay;
int radioGroupId, commandID, connectedEdgeFlags;
int radioGroupId, connectedEdgeFlags;
CommandID commandID;
ButtonState buttonState;
Value isOn;


+ 25
- 22
modules/juce_gui_basics/commands/juce_ApplicationCommandID.h View File

@@ -51,37 +51,40 @@ typedef int CommandID;
*/
namespace StandardApplicationCommandIDs
{
/** This command ID should be used to send a "Quit the App" command.
enum
{
/** This command ID should be used to send a "Quit the App" command.
This command is recognised by the JUCEApplication class, so if it is invoked
and no other ApplicationCommandTarget handles the event first, the JUCEApplication
object will catch it and call JUCEApplicationBase::systemRequestedQuit().
*/
static const CommandID quit = 0x1001;
This command is recognised by the JUCEApplication class, so if it is invoked
and no other ApplicationCommandTarget handles the event first, the JUCEApplication
object will catch it and call JUCEApplicationBase::systemRequestedQuit().
*/
quit = 0x1001,
/** The command ID that should be used to send a "Delete" command. */
static const CommandID del = 0x1002;
/** The command ID that should be used to send a "Delete" command. */
del = 0x1002,
/** The command ID that should be used to send a "Cut" command. */
static const CommandID cut = 0x1003;
/** The command ID that should be used to send a "Cut" command. */
cut = 0x1003,
/** The command ID that should be used to send a "Copy to clipboard" command. */
static const CommandID copy = 0x1004;
/** The command ID that should be used to send a "Copy to clipboard" command. */
copy = 0x1004,
/** The command ID that should be used to send a "Paste from clipboard" command. */
static const CommandID paste = 0x1005;
/** The command ID that should be used to send a "Paste from clipboard" command. */
paste = 0x1005,
/** The command ID that should be used to send a "Select all" command. */
static const CommandID selectAll = 0x1006;
/** The command ID that should be used to send a "Select all" command. */
selectAll = 0x1006,
/** The command ID that should be used to send a "Deselect all" command. */
static const CommandID deselectAll = 0x1007;
/** The command ID that should be used to send a "Deselect all" command. */
deselectAll = 0x1007,
/** The command ID that should be used to send a "undo" command. */
static const CommandID undo = 0x1008;
/** The command ID that should be used to send a "undo" command. */
undo = 0x1008,
/** The command ID that should be used to send a "redo" command. */
static const CommandID redo = 0x1009;
/** The command ID that should be used to send a "redo" command. */
redo = 0x1009
};
}


+ 2
- 3
modules/juce_gui_basics/commands/juce_ApplicationCommandInfo.cpp View File

@@ -22,9 +22,8 @@
==============================================================================
*/
ApplicationCommandInfo::ApplicationCommandInfo (const CommandID commandID_) noexcept
: commandID (commandID_),
flags (0)
ApplicationCommandInfo::ApplicationCommandInfo (const CommandID cid) noexcept
: commandID (cid), flags (0)
{
}


+ 1
- 1
modules/juce_gui_basics/menus/juce_PopupMenu.cpp View File

@@ -1302,7 +1302,7 @@ void PopupMenu::addItem (const int itemResultID, const String& itemText,
}
void PopupMenu::addCommandItem (ApplicationCommandManager* commandManager,
const int commandID,
const CommandID commandID,
const String& displayName)
{
jassert (commandManager != nullptr && commandID != 0);


+ 1
- 1
modules/juce_gui_basics/menus/juce_PopupMenu.h View File

@@ -133,7 +133,7 @@ public:
the command's registered name
*/
void addCommandItem (ApplicationCommandManager* commandManager,
int commandID,
CommandID commandID,
const String& displayName = String::empty);


+ 1
- 1
modules/juce_gui_extra/code_editor/juce_CodeEditorComponent.cpp View File

@@ -1267,7 +1267,7 @@ bool CodeEditorComponent::perform (const InvocationInfo& info)
return performCommand (info.commandID);
}
bool CodeEditorComponent::performCommand (const int commandID)
bool CodeEditorComponent::performCommand (const CommandID commandID)
{
switch (commandID)
{


+ 1
- 1
modules/juce_gui_extra/code_editor/juce_CodeEditorComponent.h View File

@@ -408,7 +408,7 @@ private:
void cut();
void indentSelectedLines (int spacesToAdd);
bool skipBackwardsToPreviousTab();
bool performCommand (int);
bool performCommand (CommandID);
int indexToColumn (int line, int index) const noexcept;
int columnToIndex (int line, int column) const noexcept;


Loading…
Cancel
Save