mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-11 23:54:18 +00:00
Cleaned up some ints that should have been CommandIDs.
This commit is contained in:
parent
58f4a38ad8
commit
57db92b276
9 changed files with 61 additions and 55 deletions
|
|
@ -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
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -22,9 +22,8 @@
|
|||
==============================================================================
|
||||
*/
|
||||
|
||||
ApplicationCommandInfo::ApplicationCommandInfo (const CommandID commandID_) noexcept
|
||||
: commandID (commandID_),
|
||||
flags (0)
|
||||
ApplicationCommandInfo::ApplicationCommandInfo (const CommandID cid) noexcept
|
||||
: commandID (cid), flags (0)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ public:
|
|||
the command's registered name
|
||||
*/
|
||||
void addCommandItem (ApplicationCommandManager* commandManager,
|
||||
int commandID,
|
||||
CommandID commandID,
|
||||
const String& displayName = String::empty);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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…
Add table
Add a link
Reference in a new issue