openshot-audio
0.1.2
|
#include <juce_gui_extra.h>
Classes | |
class | CodeEditorLine |
struct | ColourScheme |
class | GutterComponent |
class | Pimpl |
struct | State |
Public Types | |
enum | ColourIds { backgroundColourId = 0x1004500, highlightColourId = 0x1004502, defaultTextColourId = 0x1004503, lineNumberBackgroundId = 0x1004504, lineNumberTextId = 0x1004505 } |
![]() | |
enum | FocusChangeType { focusChangedByMouseClick, focusChangedByTabKey, focusChangedDirectly } |
![]() | |
enum | VirtualKeyboardType { textKeyboard = 0, numericKeyboard, decimalKeyboard, urlKeyboard, emailAddressKeyboard, phoneNumberKeyboard } |
Public Member Functions | |
CodeEditorComponent (CodeDocument &document, CodeTokeniser *codeTokeniser) | |
~CodeEditorComponent () | |
CodeDocument & | getDocument () const noexcept |
void | loadContent (const String &newContent) |
float | getCharWidth () const noexcept |
int | getLineHeight () const noexcept |
int | getNumLinesOnScreen () const noexcept |
int | getFirstLineOnScreen () const noexcept |
int | getNumColumnsOnScreen () const noexcept |
CodeDocument::Position | getCaretPos () const |
Rectangle< int > | getCaretRectangle () override |
void | moveCaretTo (const CodeDocument::Position &newPos, bool selecting) |
Rectangle< int > | getCharacterBounds (const CodeDocument::Position &pos) const |
CodeDocument::Position | getPositionAt (int x, int y) |
CodeDocument::Position | getSelectionStart () const |
CodeDocument::Position | getSelectionEnd () const |
void | setLineNumbersShown (bool shouldBeShown) |
bool | moveCaretLeft (bool moveInWholeWordSteps, bool selecting) |
bool | moveCaretRight (bool moveInWholeWordSteps, bool selecting) |
bool | moveCaretUp (bool selecting) |
bool | moveCaretDown (bool selecting) |
bool | scrollDown () |
bool | scrollUp () |
bool | pageUp (bool selecting) |
bool | pageDown (bool selecting) |
bool | moveCaretToTop (bool selecting) |
bool | moveCaretToStartOfLine (bool selecting) |
bool | moveCaretToEnd (bool selecting) |
bool | moveCaretToEndOfLine (bool selecting) |
bool | deleteBackwards (bool moveInWholeWordSteps) |
bool | deleteForwards (bool moveInWholeWordSteps) |
bool | deleteWhitespaceBackwardsToTabStop () |
virtual bool | copyToClipboard () |
virtual bool | cutToClipboard () |
virtual bool | pasteFromClipboard () |
bool | undo () |
bool | redo () |
void | selectRegion (const CodeDocument::Position &start, const CodeDocument::Position &end) |
bool | selectAll () |
void | deselectAll () |
void | scrollToLine (int newFirstLineOnScreen) |
void | scrollBy (int deltaLines) |
void | scrollToColumn (int newFirstColumnOnScreen) |
void | scrollToKeepCaretOnScreen () |
void | scrollToKeepLinesOnScreen (Range< int > linesToShow) |
void | insertTextAtCaret (const String &textToInsert) override |
void | insertTabAtCaret () |
void | indentSelection () |
void | unindentSelection () |
Range< int > | getHighlightedRegion () const override |
bool | isHighlightActive () const noexcept |
void | setHighlightedRegion (const Range< int > &newRange) override |
String | getTextInRange (const Range< int > &range) const override |
void | setTabSize (int numSpacesPerTab, bool insertSpacesInsteadOfTabCharacters) |
int | getTabSize () const noexcept |
bool | areSpacesInsertedForTabs () const |
String | getTabString (int numSpaces) const |
void | setFont (const Font &newFont) |
const Font & | getFont () const noexcept |
void | setReadOnly (bool shouldBeReadOnly) noexcept |
bool | isReadOnly () const noexcept |
void | setColourScheme (const ColourScheme &scheme) |
const ColourScheme & | getColourScheme () const noexcept |
Colour | getColourForTokenType (int tokenType) const |
void | setScrollbarThickness (int thickness) |
int | getScrollbarThickness () const noexcept |
virtual void | handleReturnKey () |
virtual void | handleTabKey () |
virtual void | handleEscapeKey () |
virtual void | addPopupMenuItems (PopupMenu &menuToAddTo, const MouseEvent *mouseClickEvent) |
virtual void | performPopupMenuAction (int menuItemID) |
void | setCommandManager (ApplicationCommandManager *newManager) noexcept |
void | paint (Graphics &) override |
void | resized () override |
bool | keyPressed (const KeyPress &) override |
void | mouseDown (const MouseEvent &) override |
void | mouseDrag (const MouseEvent &) override |
void | mouseUp (const MouseEvent &) override |
void | mouseDoubleClick (const MouseEvent &) override |
void | mouseWheelMove (const MouseEvent &, const MouseWheelDetails &) override |
void | focusGained (FocusChangeType) override |
void | focusLost (FocusChangeType) override |
bool | isTextInputActive () const override |
void | setTemporaryUnderlining (const Array< Range< int > > &) override |
ApplicationCommandTarget * | getNextCommandTarget () override |
void | getAllCommands (Array< CommandID > &) override |
void | getCommandInfo (CommandID, ApplicationCommandInfo &) override |
bool | perform (const InvocationInfo &) override |
![]() | |
Component () noexcept | |
virtual | ~Component () |
Component (const String &componentName) noexcept | |
const String & | getName () const noexcept |
virtual void | setName (const String &newName) |
const String & | getComponentID () const noexcept |
void | setComponentID (const String &newID) |
virtual void | setVisible (bool shouldBeVisible) |
bool | isVisible () const noexcept |
virtual void | visibilityChanged () |
bool | isShowing () const |
virtual void | addToDesktop (int windowStyleFlags, void *nativeWindowToAttachTo=nullptr) |
void | removeFromDesktop () |
bool | isOnDesktop () const noexcept |
ComponentPeer * | getPeer () const |
virtual void | userTriedToCloseWindow () |
virtual void | minimisationStateChanged (bool isNowMinimised) |
virtual float | getDesktopScaleFactor () const |
void | toFront (bool shouldAlsoGainFocus) |
void | toBack () |
void | toBehind (Component *other) |
void | setAlwaysOnTop (bool shouldStayOnTop) |
bool | isAlwaysOnTop () const noexcept |
int | getX () const noexcept |
int | getY () const noexcept |
int | getWidth () const noexcept |
int | getHeight () const noexcept |
int | getRight () const noexcept |
Point< int > | getPosition () const noexcept |
int | getBottom () const noexcept |
const Rectangle< int > & | getBounds () const noexcept |
Rectangle< int > | getLocalBounds () const noexcept |
Rectangle< int > | getBoundsInParent () const noexcept |
int | getScreenX () const |
int | getScreenY () const |
Point< int > | getScreenPosition () const |
Rectangle< int > | getScreenBounds () const |
Point< int > | getLocalPoint (const Component *sourceComponent, Point< int > pointRelativeToSourceComponent) const |
Point< float > | getLocalPoint (const Component *sourceComponent, Point< float > pointRelativeToSourceComponent) const |
Rectangle< int > | getLocalArea (const Component *sourceComponent, const Rectangle< int > &areaRelativeToSourceComponent) const |
Point< int > | localPointToGlobal (Point< int > localPoint) const |
Point< float > | localPointToGlobal (Point< float > localPoint) const |
Rectangle< int > | localAreaToGlobal (const Rectangle< int > &localArea) const |
void | setTopLeftPosition (int x, int y) |
void | setTopLeftPosition (Point< int > newTopLeftPosition) |
void | setTopRightPosition (int x, int y) |
void | setSize (int newWidth, int newHeight) |
void | setBounds (int x, int y, int width, int height) |
void | setBounds (const Rectangle< int > &newBounds) |
void | setBounds (const RelativeRectangle &newBounds) |
void | setBounds (const String &newBoundsExpression) |
void | setBoundsRelative (float proportionalX, float proportionalY, float proportionalWidth, float proportionalHeight) |
void | setBoundsInset (const BorderSize< int > &borders) |
void | setBoundsToFit (int x, int y, int width, int height, Justification justification, bool onlyReduceInSize) |
void | setCentrePosition (int x, int y) |
void | setCentreRelative (float x, float y) |
void | centreWithSize (int width, int height) |
void | setTransform (const AffineTransform &transform) |
AffineTransform | getTransform () const |
bool | isTransformed () const noexcept |
int | proportionOfWidth (float proportion) const noexcept |
int | proportionOfHeight (float proportion) const noexcept |
int | getParentWidth () const noexcept |
int | getParentHeight () const noexcept |
Rectangle< int > | getParentMonitorArea () const |
int | getNumChildComponents () const noexcept |
Component * | getChildComponent (int index) const noexcept |
int | getIndexOfChildComponent (const Component *child) const noexcept |
Component * | findChildWithID (StringRef componentID) const noexcept |
void | addChildComponent (Component *child, int zOrder=-1) |
void | addChildComponent (Component &child, int zOrder=-1) |
void | addAndMakeVisible (Component *child, int zOrder=-1) |
void | addAndMakeVisible (Component &child, int zOrder=-1) |
void | addChildAndSetID (Component *child, const String &componentID) |
void | removeChildComponent (Component *childToRemove) |
Component * | removeChildComponent (int childIndexToRemove) |
void | removeAllChildren () |
void | deleteAllChildren () |
Component * | getParentComponent () const noexcept |
template<class TargetClass > | |
TargetClass * | findParentComponentOfClass () const |
Component * | getTopLevelComponent () const noexcept |
bool | isParentOf (const Component *possibleChild) const noexcept |
virtual void | parentHierarchyChanged () |
virtual void | childrenChanged () |
virtual bool | hitTest (int x, int y) |
void | setInterceptsMouseClicks (bool allowClicksOnThisComponent, bool allowClicksOnChildComponents) noexcept |
void | getInterceptsMouseClicks (bool &allowsClicksOnThisComponent, bool &allowsClicksOnChildComponents) const noexcept |
bool | contains (Point< int > localPoint) |
bool | reallyContains (Point< int > localPoint, bool returnTrueIfWithinAChild) |
Component * | getComponentAt (int x, int y) |
Component * | getComponentAt (Point< int > position) |
void | repaint () |
void | repaint (int x, int y, int width, int height) |
void | repaint (const Rectangle< int > &area) |
void | setBufferedToImage (bool shouldBeBuffered) |
Image | createComponentSnapshot (const Rectangle< int > &areaToGrab, bool clipImageToComponentBounds=true, float scaleFactor=1.0f) |
void | paintEntireComponent (Graphics &context, bool ignoreAlphaLevel) |
void | setPaintingIsUnclipped (bool shouldPaintWithoutClipping) noexcept |
void | setComponentEffect (ImageEffectFilter *newEffect) |
ImageEffectFilter * | getComponentEffect () const noexcept |
LookAndFeel & | getLookAndFeel () const noexcept |
void | setLookAndFeel (LookAndFeel *newLookAndFeel) |
virtual void | lookAndFeelChanged () |
void | sendLookAndFeelChange () |
void | setOpaque (bool shouldBeOpaque) |
bool | isOpaque () const noexcept |
void | setBroughtToFrontOnMouseClick (bool shouldBeBroughtToFront) noexcept |
bool | isBroughtToFrontOnMouseClick () const noexcept |
void | setWantsKeyboardFocus (bool wantsFocus) noexcept |
bool | getWantsKeyboardFocus () const noexcept |
void | setMouseClickGrabsKeyboardFocus (bool shouldGrabFocus) |
bool | getMouseClickGrabsKeyboardFocus () const noexcept |
void | grabKeyboardFocus () |
bool | hasKeyboardFocus (bool trueIfChildIsFocused) const |
void | moveKeyboardFocusToSibling (bool moveToNext) |
virtual KeyboardFocusTraverser * | createFocusTraverser () |
int | getExplicitFocusOrder () const |
void | setExplicitFocusOrder (int newFocusOrderIndex) |
void | setFocusContainer (bool shouldBeFocusContainer) noexcept |
bool | isFocusContainer () const noexcept |
bool | isEnabled () const noexcept |
void | setEnabled (bool shouldBeEnabled) |
virtual void | enablementChanged () |
void | setAlpha (float newAlpha) |
float | getAlpha () const |
void | setMouseCursor (const MouseCursor &cursorType) |
virtual MouseCursor | getMouseCursor () |
void | updateMouseCursor () const |
virtual void | paintOverChildren (Graphics &g) |
virtual void | mouseMove (const MouseEvent &event) override |
virtual void | mouseEnter (const MouseEvent &event) override |
virtual void | mouseExit (const MouseEvent &event) override |
virtual void | mouseMagnify (const MouseEvent &event, float scaleFactor) |
void | setRepaintsOnMouseActivity (bool shouldRepaint) noexcept |
void | addMouseListener (MouseListener *newListener, bool wantsEventsForAllNestedChildComponents) |
void | removeMouseListener (MouseListener *listenerToRemove) |
void | addKeyListener (KeyListener *newListener) |
void | removeKeyListener (KeyListener *listenerToRemove) |
virtual bool | keyStateChanged (bool isKeyDown) |
virtual void | modifierKeysChanged (const ModifierKeys &modifiers) |
virtual void | focusOfChildComponentChanged (FocusChangeType cause) |
bool | isMouseOver (bool includeChildren=false) const |
bool | isMouseButtonDown () const |
bool | isMouseOverOrDragging () const |
Point< int > | getMouseXYRelative () const |
virtual void | moved () |
virtual void | childBoundsChanged (Component *child) |
virtual void | parentSizeChanged () |
virtual void | broughtToFront () |
void | addComponentListener (ComponentListener *newListener) |
void | removeComponentListener (ComponentListener *listenerToRemove) |
void | postCommandMessage (int commandId) |
virtual void | handleCommandMessage (int commandId) |
int | runModalLoop () |
void | enterModalState (bool takeKeyboardFocus=true, ModalComponentManager::Callback *callback=nullptr, bool deleteWhenDismissed=false) |
void | exitModalState (int returnValue) |
bool | isCurrentlyModal () const noexcept |
bool | isCurrentlyBlockedByAnotherModalComponent () const |
virtual bool | canModalEventBeSentToComponent (const Component *targetComponent) |
virtual void | inputAttemptWhenModal () |
NamedValueSet & | getProperties () noexcept |
const NamedValueSet & | getProperties () const noexcept |
Colour | findColour (int colourId, bool inheritFromParent=false) const |
void | setColour (int colourId, Colour newColour) |
void | removeColour (int colourId) |
bool | isColourSpecified (int colourId) const |
void | copyAllExplicitColoursTo (Component &target) const |
virtual void | colourChanged () |
virtual MarkerList * | getMarkers (bool xAxis) |
void * | getWindowHandle () const |
Positioner * | getPositioner () const noexcept |
void | setPositioner (Positioner *newPositioner) |
void | setCachedComponentImage (CachedComponentImage *newCachedImage) |
CachedComponentImage * | getCachedComponentImage () const noexcept |
JUCE_DEPRECATED (Point< int > relativePositionToGlobal(Point< int >) const) | |
JUCE_DEPRECATED (Point< int > globalPositionToRelative(Point< int >) const) | |
JUCE_DEPRECATED (Point< int > relativePositionToOtherComponent(const Component *, Point< int >) const) | |
![]() | |
virtual | ~MouseListener () |
![]() | |
ApplicationCommandTarget () | |
virtual | ~ApplicationCommandTarget () |
bool | invoke (const InvocationInfo &invocationInfo, const bool asynchronously) |
bool | invokeDirectly (const CommandID commandID, const bool asynchronously) |
ApplicationCommandTarget * | getTargetForCommand (const CommandID commandID) |
bool | isCommandActive (const CommandID commandID) |
ApplicationCommandTarget * | findFirstTargetParentComponent () |
![]() | |
TextInputTarget () | |
virtual | ~TextInputTarget () |
virtual VirtualKeyboardType | getKeyboardType () |
Friends | |
class | Pimpl |
struct | ContainerDeletePolicy< Pimpl > |
class | GutterComponent |
struct | ContainerDeletePolicy< GutterComponent > |
Additional Inherited Members | |
![]() | |
static Component *JUCE_CALLTYPE | getCurrentlyFocusedComponent () noexcept |
static void JUCE_CALLTYPE | unfocusAllComponents () |
static void JUCE_CALLTYPE | beginDragAutoRepeat (int millisecondsBetweenCallbacks) |
static bool JUCE_CALLTYPE | isMouseButtonDownAnywhere () noexcept |
static int JUCE_CALLTYPE | getNumCurrentlyModalComponents () noexcept |
static Component *JUCE_CALLTYPE | getCurrentlyModalComponent (int index=0) noexcept |
![]() | |
virtual ComponentPeer * | createNewPeer (int styleFlags, void *nativeWindowToAttachTo) |
A text editor component designed specifically for source code.
This is designed to handle syntax highlighting and fast editing of very large files.
A set of colour IDs to use to change the colour of various aspects of the editor.
These constants can be used either via the Component::setColour(), or LookAndFeel::setColour() methods.
CodeEditorComponent::CodeEditorComponent | ( | CodeDocument & | document, |
CodeTokeniser * | codeTokeniser | ||
) |
Creates an editor for a document.
The tokeniser object is optional - pass nullptr to disable syntax highlighting. The object that you pass in is not owned or deleted by the editor - you must make sure that it doesn't get deleted while this component is still using it.
CodeEditorComponent::~CodeEditorComponent | ( | ) |
Destructor.
|
virtual |
This adds the items to the popup menu.
By default it adds the cut/copy/paste items, but you can override this if you need to replace these with your own items.
If you want to add your own items to the existing ones, you can override this, call the base class's addPopupMenuItems() method, then append your own items.
When the menu has been shown, performPopupMenuAction() will be called to perform the item that the user has chosen.
If this was triggered by a mouse-click, the mouseClickEvent parameter will be a pointer to the info about it, or may be null if the menu is being triggered by some other means.
|
inline |
Returns true if the tab key will insert spaces instead of actual tab characters.
|
virtual |
|
virtual |
bool CodeEditorComponent::deleteBackwards | ( | bool | moveInWholeWordSteps | ) |
bool CodeEditorComponent::deleteForwards | ( | bool | moveInWholeWordSteps | ) |
bool CodeEditorComponent::deleteWhitespaceBackwardsToTabStop | ( | ) |
void CodeEditorComponent::deselectAll | ( | ) |
|
overridevirtual |
Called to indicate that this component has just acquired the keyboard focus.
Reimplemented from juce::Component.
|
overridevirtual |
Called to indicate that this component has just lost the keyboard focus.
Reimplemented from juce::Component.
This must return a complete list of commands that this target can handle.
Your target should add all the command IDs that it handles to the array that is passed-in.
Implements juce::ApplicationCommandTarget.
|
inline |
Returns the current caret position.
|
overridevirtual |
Returns the position of the caret, relative to the editor's origin.
Implements juce::TextInputTarget.
Rectangle< int > CodeEditorComponent::getCharacterBounds | ( | const CodeDocument::Position & | pos | ) | const |
Returns the on-screen position of a character in the document. The rectangle returned is relative to this component's top-left origin.
|
inlinenoexcept |
Returns the standard character width.
Colour CodeEditorComponent::getColourForTokenType | ( | int | tokenType | ) | const |
Returns one the syntax highlighting colour for the given token. The token type values are dependent on the tokeniser being used.
|
inlinenoexcept |
Returns the current syntax highlighting colour scheme.
|
overridevirtual |
This must provide details about one of the commands that this target can perform.
This will be called with one of the command IDs that the target provided in its getAllCommands() methods.
It should fill-in all appropriate fields of the ApplicationCommandInfo structure with suitable information about the command. (The commandID field will already have been filled-in by the caller).
The easiest way to set the info is using the ApplicationCommandInfo::setInfo() method to set all the fields at once.
If the command is currently inactive for some reason, this method must use ApplicationCommandInfo::setActive() to make that clear, (or it should set the isDisabled bit of the ApplicationCommandInfo::flags field).
Any default key-presses for the command should be appended to the ApplicationCommandInfo::defaultKeypresses field.
Note that if you change something that affects the status of the commands that would be returned by this method (e.g. something that makes some commands active or inactive), you should call ApplicationCommandManager::commandStatusChanged() to cause the manager to refresh its status.
Implements juce::ApplicationCommandTarget.
|
inlinenoexcept |
Returns the code document that this component is editing.
|
inlinenoexcept |
Returns the index of the first line that's visible at the top of the editor.
|
inlinenoexcept |
Returns the font that the editor is using.
|
overridevirtual |
Returns the extents of the selected text region, or an empty range if nothing is selected,
Implements juce::TextInputTarget.
|
inlinenoexcept |
Returns the height of a line of text, in pixels.
|
overridevirtual |
This must return the next target to try after this one.
When a command is being sent, and the first target can't handle that command, this method is used to determine the next target that should be tried.
It may return nullptr if it doesn't know of another target.
If your target is a Component, you would usually use the findFirstTargetParentComponent() method to return a parent component that might want to handle it.
Implements juce::ApplicationCommandTarget.
|
inlinenoexcept |
Returns the number of whole columns visible on the screen. This doesn't include any cut-off columns at the right-hand edge.
|
inlinenoexcept |
Returns the number of whole lines visible on the screen, This doesn't include a cut-off line that might be visible at the bottom if the component's height isn't an exact multiple of the line-height.
CodeDocument::Position CodeEditorComponent::getPositionAt | ( | int | x, |
int | y | ||
) |
Finds the character at a given on-screen position. The coordinates are relative to this component's top-left origin.
|
inlinenoexcept |
Returns the thickness of the scrollbars.
|
inline |
Returns the end of the selection as a position.
|
inline |
Returns the start of the selection as a position.
|
inlinenoexcept |
Returns the current number of spaces per tab.
String CodeEditorComponent::getTabString | ( | int | numSpaces | ) | const |
Returns a string containing spaces or tab characters to generate the given number of spaces.
Returns a specified sub-section of the text.
Implements juce::TextInputTarget.
|
virtual |
Called when the escape key is pressed - this can be overridden for custom behaviour.
|
virtual |
Called when the return key is pressed - this can be overridden for custom behaviour.
|
virtual |
Called when the tab key is pressed - this can be overridden for custom behaviour.
void CodeEditorComponent::indentSelection | ( | ) |
void CodeEditorComponent::insertTabAtCaret | ( | ) |
|
overridevirtual |
Inserts some text, overwriting the selected text region, if there is one.
Implements juce::TextInputTarget.
|
noexcept |
|
inlinenoexcept |
Returns true if the editor is set to be read-only.
|
overridevirtual |
Returns true if this input target is currently accepting input. For example, a text editor might return false if it's in read-only mode.
Implements juce::TextInputTarget.
|
overridevirtual |
Called when a key is pressed.
When a key is pressed, the component that has the keyboard focus will have this method called. Remember that a component will only be given the focus if its setWantsKeyboardFocus() method has been used to enable this.
If your implementation returns true, the event will be consumed and not passed on to any other listeners. If it returns false, the key will be passed to any KeyListeners that have been registered with this component. As soon as one of these returns true, the process will stop, but if they all return false, the event will be passed upwards to this component's parent, and so on.
The default implementation of this method does nothing and returns false.
Reimplemented from juce::Component.
void CodeEditorComponent::loadContent | ( | const String & | newContent | ) |
Loads the given content into the document. This will completely reset the CodeDocument object, clear its undo history, and fill it with this text.
|
overridevirtual |
Called when a mouse button has been double-clicked on a component.
The MouseEvent object passed in contains lots of methods for finding out which button was pressed, as well as which modifier keys (e.g. shift, ctrl) were held down at the time.
event | details about the position and status of the mouse event, including the source component in which it occurred |
Reimplemented from juce::Component.
|
overridevirtual |
Called when a mouse button is pressed.
The MouseEvent object passed in contains lots of methods for finding out which button was pressed, as well as which modifier keys (e.g. shift, ctrl) were held down at the time.
Once a button is held down, the mouseDrag method will be called when the mouse moves, until the button is released.
event | details about the position and status of the mouse event, including the source component in which it occurred |
Reimplemented from juce::Component.
|
overridevirtual |
Called when the mouse is moved while a button is held down.
When a mouse button is pressed inside a component, that component receives mouseDrag callbacks each time the mouse moves, even if the mouse strays outside the component's bounds.
event | details about the position and status of the mouse event, including the source component in which it occurred |
Reimplemented from juce::Component.
|
overridevirtual |
Called when a mouse button is released.
A mouseUp callback is sent to the component in which a button was pressed even if the mouse is actually over a different component when the button is released.
The MouseEvent object passed in contains lots of methods for finding out which buttons were down just before they were released.
event | details about the position and status of the mouse event, including the source component in which it occurred |
Reimplemented from juce::Component.
|
overridevirtual |
Called when the mouse-wheel is moved.
This callback is sent to the component that the mouse is over when the wheel is moved.
If not overridden, a component will forward this message to its parent, so that parent components can collect mouse-wheel messages that happen to child components which aren't interested in them. (Bear in mind that if you attach a component as a mouse-listener to other components, then those wheel moves will also end up calling this method and being passed up to the parents, which may not be what you intended to happen).
event | details about the mouse event |
wheel | details about the mouse wheel movement |
Reimplemented from juce::Component.
bool CodeEditorComponent::moveCaretDown | ( | bool | selecting | ) |
bool CodeEditorComponent::moveCaretLeft | ( | bool | moveInWholeWordSteps, |
bool | selecting | ||
) |
bool CodeEditorComponent::moveCaretRight | ( | bool | moveInWholeWordSteps, |
bool | selecting | ||
) |
void CodeEditorComponent::moveCaretTo | ( | const CodeDocument::Position & | newPos, |
bool | selecting | ||
) |
Moves the caret. If selecting is true, the section of the document between the current caret position and the new one will become selected. If false, any currently selected region will be deselected.
bool CodeEditorComponent::moveCaretToEnd | ( | bool | selecting | ) |
bool CodeEditorComponent::moveCaretToEndOfLine | ( | bool | selecting | ) |
bool CodeEditorComponent::moveCaretToStartOfLine | ( | bool | selecting | ) |
bool CodeEditorComponent::moveCaretToTop | ( | bool | selecting | ) |
bool CodeEditorComponent::moveCaretUp | ( | bool | selecting | ) |
bool CodeEditorComponent::pageDown | ( | bool | selecting | ) |
bool CodeEditorComponent::pageUp | ( | bool | selecting | ) |
|
overridevirtual |
Components can override this method to draw their content.
The paint() method gets called when a region of a component needs redrawing, either because the component's repaint() method has been called, or because something has happened on the screen that means a section of a window needs to be redrawn.
Any child components will draw themselves over whatever this method draws. If you need to paint over the top of your child components, you can also implement the paintOverChildren() method to do this.
If you want to cause a component to redraw itself, this is done asynchronously - calling the repaint() method marks a region of the component as "dirty", and the paint() method will automatically be called sometime later, by the message thread, to paint any bits that need refreshing. In Juce (and almost all modern UI frameworks), you never redraw something synchronously.
You should never need to call this method directly - to take a snapshot of the component you could use createComponentSnapshot() or paintEntireComponent().
g | the graphics context that must be used to do the drawing operations. |
Reimplemented from juce::Component.
|
virtual |
|
overridevirtual |
This must actually perform the specified command.
If this target is able to perform the command specified by the commandID field of the InvocationInfo structure, then it should do so, and must return true.
If it can't handle this command, it should return false, which tells the caller to pass the command on to the next target in line.
Implements juce::ApplicationCommandTarget.
|
virtual |
This is called to perform one of the items that was shown on the popup menu.
If you've overridden addPopupMenuItems(), you should also override this to perform the actions that you've added.
If you've overridden addPopupMenuItems() but have still left the default items on the menu, remember to call the superclass's performPopupMenuAction() so that it can perform the default actions if that's what the user clicked on.
bool CodeEditorComponent::redo | ( | ) |
|
overridevirtual |
Called when this component's size has been changed.
A component can implement this method to do things such as laying out its child components when its width or height changes.
The method is called synchronously as a result of the setBounds or setSize methods, so repeatedly changing a components size will repeatedly call its resized method (unlike things like repainting, where multiple calls to repaint are coalesced together).
If the component is a top-level window on the desktop, its size could also be changed by operating-system factors beyond the application's control.
Reimplemented from juce::Component.
void CodeEditorComponent::scrollBy | ( | int | deltaLines | ) |
bool CodeEditorComponent::scrollDown | ( | ) |
void CodeEditorComponent::scrollToColumn | ( | int | newFirstColumnOnScreen | ) |
void CodeEditorComponent::scrollToKeepCaretOnScreen | ( | ) |
void CodeEditorComponent::scrollToKeepLinesOnScreen | ( | Range< int > | linesToShow | ) |
void CodeEditorComponent::scrollToLine | ( | int | newFirstLineOnScreen | ) |
bool CodeEditorComponent::scrollUp | ( | ) |
bool CodeEditorComponent::selectAll | ( | ) |
void CodeEditorComponent::selectRegion | ( | const CodeDocument::Position & | start, |
const CodeDocument::Position & | end | ||
) |
void CodeEditorComponent::setColourScheme | ( | const ColourScheme & | scheme | ) |
Changes the syntax highlighting scheme. The token type values are dependent on the tokeniser being used - use CodeTokeniser::getTokenTypes() to get a list of the token types.
|
noexcept |
Specifies a commmand-manager which the editor will notify whenever the state of any of its commands changes. If you're making use of the editor's ApplicationCommandTarget interface, then you should also use this to tell it which command manager it should use. Make sure that the manager does not go out of scope while the editor is using it. You can pass a nullptr here to disable this.
void CodeEditorComponent::setFont | ( | const Font & | newFont | ) |
Changes the font. Make sure you only use a fixed-width font, or this component will look pretty nasty!
|
overridevirtual |
Sets the currently-selected text region.
Implements juce::TextInputTarget.
void CodeEditorComponent::setLineNumbersShown | ( | bool | shouldBeShown | ) |
Enables or disables the line-number display in the gutter.
|
noexcept |
Makes the editor read-only.
void CodeEditorComponent::setScrollbarThickness | ( | int | thickness | ) |
Changes the size of the scrollbars.
void CodeEditorComponent::setTabSize | ( | int | numSpacesPerTab, |
bool | insertSpacesInsteadOfTabCharacters | ||
) |
Changes the current tab settings. This lets you change the tab size and whether pressing the tab key inserts a tab character, or its equivalent number of spaces.
|
overridevirtual |
Sets a number of temporarily underlined sections. This is needed by MS Windows input method UI.
Implements juce::TextInputTarget.
bool CodeEditorComponent::undo | ( | ) |
void CodeEditorComponent::unindentSelection | ( | ) |
|
friend |
|
friend |
|
friend |
|
friend |