1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-11 23:54:18 +00:00

Added method TextEditor::setJustification()

This commit is contained in:
jules 2017-09-22 14:37:13 +01:00
parent cf67b1d12d
commit d00a459480
2 changed files with 253 additions and 272 deletions

File diff suppressed because it is too large Load diff

View file

@ -475,8 +475,10 @@ public:
*/
void setScrollToShowCursor (bool shouldScrollToShowCaret);
/** Sets the line spacing of the TextEditor.
/** Modifies the horizontal justification of the text within the editor window. */
void setJustification (Justification newJustification);
/** Sets the line spacing of the TextEditor.
The default (and minimum) value is 1.0 and values > 1.0 will increase the line spacing as a
multiple of the line height e.g. for double-spacing call this method with an argument of 2.0.
*/
@ -680,17 +682,17 @@ protected:
private:
//==============================================================================
class Iterator;
JUCE_PUBLIC_IN_DLL_BUILD (class UniformTextSection)
class TextHolderComponent;
class InsertAction;
class RemoveAction;
friend class InsertAction;
friend class RemoveAction;
struct Iterator;
struct TextHolderComponent;
struct TextEditorViewport;
struct InsertAction;
struct RemoveAction;
ScopedPointer<Viewport> viewport;
TextHolderComponent* textHolder;
BorderSize<int> borderSize { 1, 1, 1, 3 };
Justification justification { Justification::left };
bool readOnly = false;
bool caretVisible = true;
@ -743,10 +745,10 @@ private:
void coalesceSimilarSections();
void splitSection (int sectionIndex, int charToSplitAt);
void clearInternal (UndoManager*);
void insert (const String&, int insertIndex, const Font&, const Colour, UndoManager*, int newCaretPos);
void insert (const String&, int insertIndex, const Font&, Colour, UndoManager*, int newCaretPos);
void reinsert (int insertIndex, const OwnedArray<UniformTextSection>&);
void remove (Range<int> range, UndoManager*, int caretPositionToMoveTo);
void getCharPosition (int index, float& x, float& y, float& lineHeight) const;
void remove (Range<int>, UndoManager*, int caretPositionToMoveTo);
void getCharPosition (int index, Point<float>&, float& lineHeight) const;
void updateCaretPosition();
void updateValueFromText();
void textWasChangedByValue();
@ -754,11 +756,10 @@ private:
int findWordBreakAfter (int position) const;
int findWordBreakBefore (int position) const;
bool moveCaretWithTransaction (int newPos, bool selecting);
friend class TextHolderComponent;
friend class TextEditorViewport;
void drawContent (Graphics&);
void updateTextHolderSize();
float getWordWrapWidth() const;
float getJustificationWidth() const;
void timerCallbackInt();
void repaintText (Range<int>);
void scrollByLines (int deltaLines);