Browse Source

Added method TextEditor::setJustification()

tags/2021-05-28
jules 8 years ago
parent
commit
d00a459480
2 changed files with 252 additions and 271 deletions
  1. +239
    -259
      modules/juce_gui_basics/widgets/juce_TextEditor.cpp
  2. +13
    -12
      modules/juce_gui_basics/widgets/juce_TextEditor.h

+ 239
- 259
modules/juce_gui_basics/widgets/juce_TextEditor.cpp
File diff suppressed because it is too large
View File


+ 13
- 12
modules/juce_gui_basics/widgets/juce_TextEditor.h 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);


Loading…
Cancel
Save