mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-07-19 17:22:53 +03:00
Reworking input implementation (might have some bugs).
Minor bug fixes. --HG-- branch : dev
This commit is contained in:
10
.clang-format
Normal file
10
.clang-format
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
AlignEscapedNewlines: Left
|
||||
ColumnLimit: '100'
|
||||
CompactNamespaces: 'true'
|
||||
IndentWidth: '4'
|
||||
SpacesInParentheses: 'true'
|
||||
TabWidth: '4'
|
||||
UseTab: Always
|
||||
|
||||
...
|
||||
@@ -73,6 +73,8 @@ class EE_API UITextInput : public UITextView {
|
||||
|
||||
virtual Uint32 onMouseClick( const Vector2i& position, const Uint32& flags );
|
||||
|
||||
virtual Uint32 onMouseDown( const Vector2i& position, const Uint32& flags );
|
||||
|
||||
virtual Uint32 onMouseDoubleClick( const Vector2i& position, const Uint32& flags );
|
||||
|
||||
virtual Uint32 onMouseLeave( const Vector2i& position, const Uint32& flags );
|
||||
@@ -100,6 +102,12 @@ class EE_API UITextInput : public UITextView {
|
||||
virtual Int32 selCurInit();
|
||||
|
||||
virtual Int32 selCurEnd();
|
||||
|
||||
void onCursorPositionChange();
|
||||
|
||||
void onBufferChange();
|
||||
|
||||
void onInputSelectionChange();
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
@@ -25,6 +25,9 @@ enum INPUT_TEXTBUFFER_FLAGS {
|
||||
class EE_API InputTextBuffer {
|
||||
public:
|
||||
typedef std::function<void()> EnterCallback;
|
||||
typedef std::function<void()> CursorPositionChangeCallback;
|
||||
typedef std::function<void()> BufferChangeCallback;
|
||||
typedef std::function<void()> SelectionChangeCallback;
|
||||
|
||||
static InputTextBuffer * New( const bool& active, const bool& newLineEnabled, const bool& freeEditing, EE::Window::Window * window = NULL, const Uint32& maxLength = INPUT_LENGHT_MAX );
|
||||
|
||||
@@ -94,14 +97,14 @@ class EE_API InputTextBuffer {
|
||||
void setChangedSinceLastUpdate( const bool& Changed );
|
||||
|
||||
/** @return The Cursor Position (where is the cursor editing) */
|
||||
int getCursorPos() const;
|
||||
int getCursorPosition() const;
|
||||
|
||||
/** Set the cursor position */
|
||||
void setCursorPos( const Uint32& pos );
|
||||
void setCursorPosition( const Uint32& pos );
|
||||
|
||||
/** This function it's for helping the Font class to locate the cursor position for the correct rendering of it.
|
||||
/** This function locates the cursor line position for the correct rendering of it.
|
||||
* @param LastNewLinePos This will return the position of the closest "\n" to the current Cursor Pos
|
||||
* @return On which line it's the cursor
|
||||
* @return On which line is the cursor
|
||||
*/
|
||||
Uint32 getCurPosLinePos( Uint32& LastNewLinePos );
|
||||
|
||||
@@ -134,6 +137,15 @@ class EE_API InputTextBuffer {
|
||||
|
||||
/** @return The selection cursor final position */
|
||||
const Int32& selCurEnd() const;
|
||||
|
||||
/** Event callback when the cursor position changes. */
|
||||
void setCursorPositionChangeCallback(const CursorPositionChangeCallback& cursorPositionChangeCallback);
|
||||
|
||||
/** Event callback when the text buffer changes. */
|
||||
void setBufferChangeCallback(const BufferChangeCallback& bufferChangeCallback);
|
||||
|
||||
/** Event callback when the selection changes. */
|
||||
void setSelectionChangeCallback(const SelectionChangeCallback& selectionChangeCallback);
|
||||
protected:
|
||||
EE::Window::Window * mWindow;
|
||||
String mText;
|
||||
@@ -141,6 +153,9 @@ class EE_API InputTextBuffer {
|
||||
Uint32 mCallback;
|
||||
int mPromptPos;
|
||||
EnterCallback mEnterCall;
|
||||
CursorPositionChangeCallback mCursorPositionChangeCallback;
|
||||
BufferChangeCallback mBufferChangeCallback;
|
||||
SelectionChangeCallback mSelectionChangeCallback;
|
||||
Uint32 mMaxLength;
|
||||
std::vector<Uint32> mIgnoredChars;
|
||||
Int32 mSelCurInit;
|
||||
@@ -175,6 +190,16 @@ class EE_API InputTextBuffer {
|
||||
void removeSelection();
|
||||
|
||||
void resetSelection();
|
||||
|
||||
void onCursorPositionChange();
|
||||
|
||||
void onSelectionChange();
|
||||
|
||||
void onBufferChange();
|
||||
|
||||
/** Set the cursor position */
|
||||
void setCursorPos( const Uint32& pos );
|
||||
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 4.10.0, 2019-10-06T02:49:35. -->
|
||||
<!-- Written by QtCreator 4.10.1, 2019-11-07T16:36:44. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
@@ -39,23 +39,23 @@
|
||||
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
|
||||
<value type="int" key="EditorConfiguration.IndentSize">4</value>
|
||||
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
|
||||
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
|
||||
<value type="int" key="EditorConfiguration.MarginColumn">100</value>
|
||||
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
|
||||
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
|
||||
<value type="int" key="EditorConfiguration.PaddingMode">2</value>
|
||||
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
|
||||
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
|
||||
<value type="bool" key="EditorConfiguration.ShowMargin">true</value>
|
||||
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
|
||||
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
|
||||
<value type="bool" key="EditorConfiguration.SpacesForTabs">false</value>
|
||||
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
|
||||
<value type="int" key="EditorConfiguration.TabSize">4</value>
|
||||
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
|
||||
<value type="bool" key="EditorConfiguration.UseGlobal">false</value>
|
||||
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
|
||||
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
|
||||
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
|
||||
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
|
||||
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
|
||||
<value type="bool" key="EditorConfiguration.inEntireDocument">true</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
@@ -77,7 +77,7 @@
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{6d057187-158a-4883-8d5b-d470a6b6b025}</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">10</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
|
||||
|
||||
@@ -244,12 +244,12 @@ void Console::draw() {
|
||||
text2.setOutlineColor( mFontStyleConfig.OutlineColor );
|
||||
text2.setFillColor( Color( mFontLineColor.r, mFontLineColor.g, mFontLineColor.b, static_cast<Uint8>(mCurAlpha) ) );
|
||||
|
||||
if ( (unsigned int)mTBuf->getCursorPos() == mTBuf->getBuffer().size() ) {
|
||||
if ( (unsigned int)mTBuf->getCursorPosition() == mTBuf->getBuffer().size() ) {
|
||||
Uint32 width = text.getTextWidth();
|
||||
text2.setString( "_" );
|
||||
text2.draw( mFontSize + width, CurY );
|
||||
} else {
|
||||
text2.setString( "> " + mTBuf->getBuffer().substr( 0, mTBuf->getCursorPos() ) );
|
||||
text2.setString( "> " + mTBuf->getBuffer().substr( 0, mTBuf->getCursorPosition() ) );
|
||||
Uint32 width = mFontSize + text2.getTextWidth();
|
||||
text2.setString( "_" );
|
||||
text2.draw( width, CurY );
|
||||
@@ -629,9 +629,9 @@ void Console::privInputCallback( InputEvent * Event ) {
|
||||
Uint32 Button = Event->button.button;
|
||||
|
||||
if ( InputEvent::KeyDown == etype ) {
|
||||
if ( ( KeyCode == KEY_TAB ) && (unsigned int)mTBuf->getCursorPos() == mTBuf->getBuffer().size() ) {
|
||||
if ( ( KeyCode == KEY_TAB ) && (unsigned int)mTBuf->getCursorPosition() == mTBuf->getBuffer().size() ) {
|
||||
printCommandsStartingWith( mTBuf->getBuffer() );
|
||||
getFilesFrom( mTBuf->getBuffer().toUtf8(), mTBuf->getCursorPos() );
|
||||
getFilesFrom( mTBuf->getBuffer().toUtf8(), mTBuf->getCursorPosition() );
|
||||
}
|
||||
|
||||
if ( KeyMod & KEYMOD_SHIFT ) {
|
||||
|
||||
@@ -80,7 +80,7 @@ bool StateListDrawable::isStateful() {
|
||||
}
|
||||
|
||||
StatefulDrawable * StateListDrawable::setState( Uint32 state ) {
|
||||
if ( state != mCurrentState || mCurrentDrawable == NULL ) {
|
||||
if ( state != mCurrentState || mCurrentDrawable == NULL || mCurrentDrawable != mDrawables[ mCurrentState ] ) {
|
||||
mCurrentState = state;
|
||||
|
||||
auto it = mDrawables.find( state );
|
||||
|
||||
@@ -779,7 +779,7 @@ void Text::ensureGeometryUpdate() {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Apply the outline
|
||||
if (mOutlineThickness != 0) {
|
||||
const Glyph& glyph = mFont->getGlyph(curChar, mRealCharacterSize, bold, mOutlineThickness);
|
||||
@@ -926,7 +926,6 @@ void Text::setFillColor( const Color& color, Uint32 from, Uint32 to ) {
|
||||
|
||||
bool underlined = (mStyle & Underlined) != 0;
|
||||
bool strikeThrough = (mStyle & StrikeThrough) != 0;
|
||||
std::vector<Color> colors( GLi->quadVertexs(), color );
|
||||
std::size_t s = mString.size();
|
||||
|
||||
if ( to >= s ) {
|
||||
@@ -974,7 +973,7 @@ void Text::setFillColor( const Color& color, Uint32 from, Uint32 to ) {
|
||||
if ( '\n' == curChar) {
|
||||
if ( underlined || strikeThrough ) {
|
||||
for ( int v = 0; v < GLi->quadVertexs(); v++ )
|
||||
mColors[ rpos * GLi->quadVertexs() + v ] = colors[v];
|
||||
mColors[ rpos * GLi->quadVertexs() + v ] = color;
|
||||
}
|
||||
|
||||
if ( underlined )
|
||||
@@ -984,10 +983,10 @@ void Text::setFillColor( const Color& color, Uint32 from, Uint32 to ) {
|
||||
rpos++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for ( int v = 0; v < GLi->quadVertexs(); v++ )
|
||||
mColors[ lpos * GLi->quadVertexs() + v ] = color;
|
||||
}
|
||||
|
||||
for ( int v = 0; v < GLi->quadVertexs(); v++ )
|
||||
mColors[ lpos * GLi->quadVertexs() + v ] = colors[v];
|
||||
}
|
||||
|
||||
if ( rto == s ) {
|
||||
@@ -997,7 +996,7 @@ void Text::setFillColor( const Color& color, Uint32 from, Uint32 to ) {
|
||||
|
||||
if ( pos < mColors.size() ) {
|
||||
for ( int v = 0; v < GLi->quadVertexs(); v++ )
|
||||
mColors[ lpos * GLi->quadVertexs() + v ] = colors[v];
|
||||
mColors[ lpos * GLi->quadVertexs() + v ] = color;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1007,7 +1006,7 @@ void Text::setFillColor( const Color& color, Uint32 from, Uint32 to ) {
|
||||
|
||||
if ( pos < mColors.size() ) {
|
||||
for ( int v = 0; v < GLi->quadVertexs(); v++ )
|
||||
mColors[ lpos * GLi->quadVertexs() + v ] = colors[v];
|
||||
mColors[ lpos * GLi->quadVertexs() + v ] = color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -592,7 +592,7 @@ void Node::childAddAt( Node * ChildCtrl, Uint32 Pos ) {
|
||||
eeASSERT( NULL != ChildCtrl );
|
||||
|
||||
Node * ChildLoop = mChild;
|
||||
|
||||
|
||||
ChildCtrl->setParent( this );
|
||||
|
||||
childRemove( ChildCtrl );
|
||||
@@ -1252,8 +1252,11 @@ const Float& Node::getAlpha() const {
|
||||
}
|
||||
|
||||
void Node::setAlpha( const Float& alpha ) {
|
||||
mAlpha = alpha;
|
||||
onAlphaChange();
|
||||
if ( mAlpha != alpha ) {
|
||||
mAlpha = alpha;
|
||||
invalidateDraw();
|
||||
onAlphaChange();
|
||||
}
|
||||
}
|
||||
|
||||
void Node::setChildsAlpha( const Float &alpha ) {
|
||||
|
||||
@@ -127,38 +127,6 @@ void UITextEdit::onAlphaChange() {
|
||||
UIWidget::onAlphaChange();
|
||||
}
|
||||
|
||||
void UITextEdit::fixScroll() {
|
||||
int Width = mSize.getWidth() - mContainerPadding.Left - mContainerPadding.Right;
|
||||
int Height = mSize.getHeight() - mContainerPadding.Top - mContainerPadding.Bottom;
|
||||
|
||||
if ( mVScrollBar->isVisible() )
|
||||
Width -= mVScrollBar->getPixelsSize().getWidth();
|
||||
|
||||
if ( mHScrollBar->isVisible() )
|
||||
Height -= mHScrollBar->getPixelsSize().getHeight();
|
||||
|
||||
int diff;
|
||||
Float pos;
|
||||
|
||||
if ( mTextInput->getPixelsSize().getHeight() - Height >= 0 ) {
|
||||
diff = mTextInput->getPixelsSize().getHeight() - Height;
|
||||
|
||||
pos = diff * mVScrollBar->getValue();
|
||||
|
||||
mTextInput->setPixelsPosition( mTextInput->getPixelsPosition().x, mContainerPadding.Top - pos );
|
||||
}
|
||||
|
||||
if ( mTextInput->getPixelsSize().getWidth() - Width >= 0 ) {
|
||||
diff = mTextInput->getPixelsSize().getWidth() - Width;
|
||||
|
||||
pos = diff * mHScrollBar->getValue();
|
||||
|
||||
mTextInput->setPixelsPosition( mContainerPadding.Left - pos, mTextInput->getPixelsPosition().y );
|
||||
}
|
||||
|
||||
invalidateDraw();
|
||||
}
|
||||
|
||||
void UITextEdit::scrollbarsSet() {
|
||||
switch ( mHScrollBarMode ) {
|
||||
case UI_SCROLLBAR_ALWAYS_OFF:
|
||||
@@ -231,6 +199,7 @@ void UITextEdit::scrollbarsSet() {
|
||||
}
|
||||
|
||||
mSkipValueChange = true;
|
||||
|
||||
if ( mVScrollBar->isVisible() ) {
|
||||
int extraH = 0;
|
||||
|
||||
@@ -323,7 +292,7 @@ void UITextEdit::onInputSizeChange( const Event * Event ) {
|
||||
Width -= mVScrollBar->getPixelsSize().getWidth();
|
||||
|
||||
mNodeFlags |= NODE_FLAG_FREE_USE;
|
||||
mTextInput->setText( text );
|
||||
mTextInput->getInputTextBuffer()->setBuffer( text );
|
||||
mNodeFlags &= ~NODE_FLAG_FREE_USE;
|
||||
|
||||
shrinkText( Width );
|
||||
@@ -370,7 +339,7 @@ void UITextEdit::onCursorPosChange( const Event * ) {
|
||||
fixScrollToCursor();
|
||||
}
|
||||
|
||||
void UITextEdit::fixScrollToCursor() {
|
||||
void UITextEdit::fixScroll() {
|
||||
int Width = mSize.getWidth() - mContainerPadding.Left - mContainerPadding.Right;
|
||||
int Height = mSize.getHeight() - mContainerPadding.Top - mContainerPadding.Bottom;
|
||||
|
||||
@@ -380,36 +349,61 @@ void UITextEdit::fixScrollToCursor() {
|
||||
if ( mHScrollBar->isVisible() )
|
||||
Height -= mHScrollBar->getPixelsSize().getHeight();
|
||||
|
||||
int diff;
|
||||
Float pos;
|
||||
|
||||
diff = mTextInput->getPixelsSize().getHeight() - Height;
|
||||
if ( diff >= 0 ) {
|
||||
pos = diff * mVScrollBar->getValue();
|
||||
|
||||
mTextInput->setPixelsPosition( mTextInput->getPixelsPosition().x, mContainerPadding.Top - pos );
|
||||
}
|
||||
|
||||
diff = mTextInput->getPixelsSize().getWidth() - Width;
|
||||
if ( diff >= 0 ) {
|
||||
pos = diff * mHScrollBar->getValue();
|
||||
|
||||
mTextInput->setPixelsPosition( mContainerPadding.Left - pos, mTextInput->getPixelsPosition().y );
|
||||
}
|
||||
|
||||
invalidateDraw();
|
||||
}
|
||||
|
||||
void UITextEdit::fixScrollToCursor() {
|
||||
if ( fontHAlignGet( mTextInput->getFlags() ) == UI_HALIGN_LEFT ) {
|
||||
int Width = mSize.getWidth() - mContainerPadding.Left - mContainerPadding.Right;
|
||||
int Height = mSize.getHeight() - mContainerPadding.Top - mContainerPadding.Bottom;
|
||||
|
||||
if ( mVScrollBar->isVisible() )
|
||||
Width -= mVScrollBar->getPixelsSize().getWidth();
|
||||
|
||||
if ( mHScrollBar->isVisible() )
|
||||
Height -= mHScrollBar->getPixelsSize().getHeight();
|
||||
|
||||
Uint32 NLPos = 0;
|
||||
Uint32 LineNum = mTextInput->getInputTextBuffer()->getCurPosLinePos( NLPos );
|
||||
|
||||
Text textCache( mTextInput->getFont(), mTextInput->getFontStyleConfig().CharacterSize );
|
||||
Text textCache( mTextInput->getFont(), mTextInput->getFontStyleConfig().getFontCharacterSize() );
|
||||
textCache.setString(
|
||||
mTextInput->getInputTextBuffer()->getBuffer().substr(
|
||||
NLPos, mTextInput->getInputTextBuffer()->getCursorPos() - NLPos
|
||||
NLPos, mTextInput->getInputTextBuffer()->getCursorPosition() - NLPos
|
||||
)
|
||||
);
|
||||
|
||||
mSkipValueChange = true;
|
||||
|
||||
Float tW = textCache.getTextWidth();
|
||||
Float tH = (Float)(LineNum + 1) * (Float)textCache.getFont()->getLineSpacing( textCache.getCharacterSizePx() );
|
||||
Float lineHeight = (Float)textCache.getFont()->getLineSpacing( textCache.getCharacterSizePx() );
|
||||
Float tH = (Float)(LineNum == 0 ? 0 : LineNum + 1) * lineHeight;
|
||||
|
||||
if ( tW > Width ) {
|
||||
mTextInput->setPixelsPosition( mContainerPadding.Left + Width - tW, mTextInput->getPixelsPosition().y );
|
||||
} else {
|
||||
mTextInput->setPixelsPosition( mContainerPadding.Left, mTextInput->getPixelsPosition().y );
|
||||
}
|
||||
|
||||
if ( tH > Height ) {
|
||||
mTextInput->setPixelsPosition( mTextInput->getPixelsPosition().x, mContainerPadding.Top + Height - tH );
|
||||
} else {
|
||||
mTextInput->setPixelsPosition( mTextInput->getPixelsPosition().x, mContainerPadding.Top );
|
||||
if ( mTextInput->getPixelsPosition().y + tH < lineHeight ||
|
||||
mTextInput->getPixelsPosition().y + tH > Height ) {
|
||||
mVScrollBar->setValue( tH / mTextInput->getPixelsSize().getHeight() );
|
||||
}
|
||||
|
||||
mHScrollBar->setValue( tW / mTextInput->getPixelsSize().getWidth() );
|
||||
mVScrollBar->setValue( tH / mTextInput->getPixelsSize().getHeight() );
|
||||
|
||||
fixScroll();
|
||||
|
||||
mSkipValueChange = false;
|
||||
}
|
||||
|
||||
@@ -33,6 +33,9 @@ UITextInput::UITextInput( const std::string& tag ) :
|
||||
mTextBuffer.setFreeEditing( true );
|
||||
mTextBuffer.setTextSelectionEnabled( isTextSelectionEnabled() );
|
||||
mTextBuffer.setReturnCallback( cb::Make0( this, &UITextInput::privOnPressEnter ) );
|
||||
mTextBuffer.setCursorPositionChangeCallback( cb::Make0( this, &UITextInput::onCursorPositionChange ) );
|
||||
mTextBuffer.setBufferChangeCallback( cb::Make0( this, &UITextInput::onBufferChange ) );
|
||||
mTextBuffer.setSelectionChangeCallback( cb::Make0( this, &UITextInput::onInputSelectionChange ) );
|
||||
|
||||
applyDefaultTheme();
|
||||
}
|
||||
@@ -57,36 +60,6 @@ void UITextInput::scheduledUpdate( const Time& time ) {
|
||||
mSceneNode->setCursor( Cursor::IBeam );
|
||||
}
|
||||
|
||||
if ( mTextBuffer.changedSinceLastUpdate() ) {
|
||||
Vector2f offSet = mRealAlignOffset;
|
||||
|
||||
UITextView::setText( mTextBuffer.getBuffer() );
|
||||
|
||||
updateText();
|
||||
|
||||
mRealAlignOffset = offSet;
|
||||
|
||||
resetWaitCursor();
|
||||
|
||||
alignFix();
|
||||
|
||||
mCursorPos = mTextBuffer.getCursorPos();
|
||||
|
||||
mTextBuffer.setChangedSinceLastUpdate( false );
|
||||
|
||||
invalidateDraw();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ( mCursorPos != mTextBuffer.getCursorPos() ) {
|
||||
alignFix();
|
||||
mCursorPos = mTextBuffer.getCursorPos();
|
||||
mWaitCursorTime = 0.f;
|
||||
mShowingWait = true;
|
||||
onCursorPosChange();
|
||||
}
|
||||
|
||||
updateWaitingCursor( time );
|
||||
}
|
||||
|
||||
@@ -180,7 +153,7 @@ void UITextInput::alignFix() {
|
||||
|
||||
Text textCache( mTextCache->getFont(), mTextCache->getCharacterSize() );
|
||||
|
||||
textCache.setString( mTextBuffer.getBuffer().substr( NLPos, mTextBuffer.getCursorPos() - NLPos ) );
|
||||
textCache.setString( mTextBuffer.getBuffer().substr( NLPos, mTextBuffer.getCursorPosition() - NLPos ) );
|
||||
|
||||
Float tW = textCache.getTextWidth();
|
||||
Float tX = mRealAlignOffset.x + tW;
|
||||
@@ -278,27 +251,51 @@ void UITextInput::updateText() {
|
||||
}
|
||||
|
||||
Uint32 UITextInput::onMouseClick( const Vector2i& Pos, const Uint32& Flags ) {
|
||||
if ( Flags & EE_BUTTON_LMASK ) {
|
||||
Vector2f controlPos( Vector2f( Pos.x, Pos.y ) );
|
||||
worldToNode( controlPos );
|
||||
controlPos = PixelDensity::dpToPx( controlPos ) - mRealAlignOffset;
|
||||
UITextView::onMouseClick( Pos, Flags );
|
||||
|
||||
Int32 curPos = mTextCache->findCharacterFromPos( Vector2i( controlPos.x, controlPos.y ) );
|
||||
if ( ( Flags & EE_BUTTON_LMASK ) ) {
|
||||
if ( selCurInit() == selCurEnd() ) {
|
||||
Vector2f controlPos( Vector2f( Pos.x, Pos.y ) );
|
||||
worldToNode( controlPos );
|
||||
controlPos = PixelDensity::dpToPx( controlPos ) - mRealAlignOffset;
|
||||
|
||||
if ( -1 != curPos ) {
|
||||
mTextBuffer.setCursorPos( curPos );
|
||||
Int32 curPos = mTextCache->findCharacterFromPos( Vector2i( controlPos.x, controlPos.y ) );
|
||||
|
||||
if ( -1 != curPos ) {
|
||||
mTextBuffer.setCursorPosition( curPos );
|
||||
onCursorPositionChange();
|
||||
resetWaitCursor();
|
||||
}
|
||||
} else {
|
||||
mTextBuffer.setCursorPosition( selCurEnd() );
|
||||
onCursorPositionChange();
|
||||
resetWaitCursor();
|
||||
}
|
||||
}
|
||||
|
||||
return UITextView::onMouseClick( Pos, Flags );
|
||||
return 1;
|
||||
}
|
||||
|
||||
Uint32 UITextInput::onMouseDown(const Vector2i& position, const Uint32& flags) {
|
||||
int endPos = selCurEnd();
|
||||
|
||||
UITextView::onMouseDown( position, flags );
|
||||
|
||||
if ( endPos != selCurEnd() && -1 != selCurEnd() ) {
|
||||
mTextBuffer.setCursorPosition( selCurEnd() );
|
||||
onCursorPositionChange();
|
||||
resetWaitCursor();
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
Uint32 UITextInput::onMouseDoubleClick( const Vector2i& Pos, const Uint32& Flags ) {
|
||||
UITextView::onMouseDoubleClick( Pos, Flags );
|
||||
|
||||
if ( isTextSelectionEnabled() && ( Flags & EE_BUTTON_LMASK ) && selCurEnd() != -1 ) {
|
||||
mTextBuffer.setCursorPos( selCurEnd() );
|
||||
mTextBuffer.setCursorPosition( selCurEnd() );
|
||||
onCursorPositionChange();
|
||||
resetWaitCursor();
|
||||
}
|
||||
|
||||
@@ -315,14 +312,21 @@ Uint32 UITextInput::onMouseLeave( const Vector2i& Pos, const Uint32& Flags ) {
|
||||
}
|
||||
|
||||
void UITextInput::selCurInit( const Int32& init ) {
|
||||
mTextBuffer.selCurInit( init );
|
||||
if ( mTextBuffer.selCurInit() != init ) {
|
||||
mTextBuffer.selCurInit( init );
|
||||
invalidateDraw();
|
||||
}
|
||||
}
|
||||
|
||||
void UITextInput::selCurEnd( const Int32& end ) {
|
||||
mTextBuffer.selCurEnd( end );
|
||||
if ( mTextBuffer.selCurEnd() != end ) {
|
||||
mTextBuffer.selCurEnd( end );
|
||||
invalidateDraw();
|
||||
|
||||
if ( mTextBuffer.selCurEnd() != mTextBuffer.selCurInit() ) {
|
||||
mTextBuffer.setCursorPos( end );
|
||||
if ( mTextBuffer.selCurEnd() != mTextBuffer.selCurInit() ) {
|
||||
mTextBuffer.setCursorPosition( end );
|
||||
onCursorPosChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -334,6 +338,40 @@ Int32 UITextInput::selCurEnd() {
|
||||
return mTextBuffer.selCurEnd();
|
||||
}
|
||||
|
||||
void UITextInput::onCursorPositionChange() {
|
||||
if ( mCursorPos != mTextBuffer.getCursorPosition() ) {
|
||||
alignFix();
|
||||
mCursorPos = mTextBuffer.getCursorPosition();
|
||||
mWaitCursorTime = 0.f;
|
||||
mShowingWait = true;
|
||||
onCursorPosChange();
|
||||
}
|
||||
}
|
||||
|
||||
void UITextInput::onBufferChange() {
|
||||
Vector2f offSet = mRealAlignOffset;
|
||||
|
||||
UITextView::setText( mTextBuffer.getBuffer() );
|
||||
|
||||
updateText();
|
||||
|
||||
mRealAlignOffset = offSet;
|
||||
|
||||
resetWaitCursor();
|
||||
|
||||
alignFix();
|
||||
|
||||
mCursorPos = mTextBuffer.getCursorPosition();
|
||||
|
||||
mTextBuffer.setChangedSinceLastUpdate( false );
|
||||
|
||||
invalidateDraw();
|
||||
}
|
||||
|
||||
void UITextInput::onInputSelectionChange() {
|
||||
onSelectionChange();
|
||||
}
|
||||
|
||||
UITextInput * UITextInput::setMaxLength( Uint32 maxLength ) {
|
||||
mTextBuffer.setMaxLength( maxLength );
|
||||
return this;
|
||||
|
||||
@@ -80,7 +80,7 @@ void UITextInputPassword::alignFix() {
|
||||
Uint32 NLPos = 0;
|
||||
Uint32 LineNum = mTextBuffer.getCurPosLinePos( NLPos );
|
||||
|
||||
String curStr( mTextBuffer.getBuffer().substr( NLPos, mTextBuffer.getCursorPos() - NLPos ) );
|
||||
String curStr( mTextBuffer.getBuffer().substr( NLPos, mTextBuffer.getCursorPosition() - NLPos ) );
|
||||
String pasStr;
|
||||
|
||||
for ( size_t i = 0; i < curStr.size(); i++ )
|
||||
|
||||
@@ -335,6 +335,8 @@ void UITextView::onAlphaChange() {
|
||||
color = getOutlineColor();
|
||||
newColor = Color( color.r, color.g, color.b, color.a * mAlpha / 255.f );
|
||||
mTextCache->setOutlineColor( newColor );
|
||||
|
||||
invalidateDraw();
|
||||
}
|
||||
|
||||
void UITextView::setTheme( UITheme * Theme ) {
|
||||
|
||||
@@ -92,15 +92,15 @@ void InputTextBuffer::promptToLeftFirstNoChar() {
|
||||
if ( mPromptPos - 2 > 0 ) {
|
||||
for ( Int32 i = mPromptPos - 2; i > 0; i-- ) {
|
||||
if ( !String::isLetter( mText[i] ) && !String::isNumber( mText[i] ) && '\n' != mText[i] ) {
|
||||
mPromptPos = i + 1;
|
||||
setCursorPos( i + 1 );
|
||||
break;
|
||||
} else if ( i - 1 == 0 ) {
|
||||
mPromptPos = 0;
|
||||
setCursorPos( 0 );
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
mPromptPos = 0;
|
||||
setCursorPos( 0 );
|
||||
}
|
||||
|
||||
resetSelection();
|
||||
@@ -114,10 +114,10 @@ void InputTextBuffer::promptToRightFirstNoChar() {
|
||||
|
||||
for ( Int32 i = mPromptPos; i < s; i++ ) {
|
||||
if ( !String::isLetter( mText[i] ) && !String::isNumber( mText[i] ) && '\n' != mText[i] ) {
|
||||
mPromptPos = i + 1;
|
||||
setCursorPos( i + 1 );
|
||||
break;
|
||||
} else if ( i + 1 == s ) {
|
||||
mPromptPos = s;
|
||||
setCursorPos( s );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,6 +128,7 @@ void InputTextBuffer::resetSelection() {
|
||||
if ( isTextSelectionEnabled() ) {
|
||||
selCurInit( -1 );
|
||||
selCurEnd( -1 );
|
||||
onSelectionChange();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,14 +141,14 @@ void InputTextBuffer::eraseToPrevNoChar() {
|
||||
do {
|
||||
if ( mPromptPos < (int)mText.size() ) {
|
||||
mText.erase( mPromptPos - 1, 1 );
|
||||
mPromptPos--;
|
||||
setCursorPos( mPromptPos - 1 );
|
||||
} else {
|
||||
mText.resize( mText.size() - 1 );
|
||||
mPromptPos = mText.size();
|
||||
setCursorPos( mText.size() );
|
||||
}
|
||||
|
||||
if ( mPromptPos <= 0 ) {
|
||||
mPromptPos = 0;
|
||||
setCursorPos( 0 );
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -157,6 +158,7 @@ void InputTextBuffer::eraseToPrevNoChar() {
|
||||
resetSelection();
|
||||
|
||||
setChangedSinceLastUpdate( true );
|
||||
onBufferChange();
|
||||
}
|
||||
|
||||
void InputTextBuffer::eraseToNextNoChar() {
|
||||
@@ -184,6 +186,7 @@ void InputTextBuffer::eraseToNextNoChar() {
|
||||
setBuffer( iniStr + endStr );
|
||||
|
||||
resetSelection();
|
||||
onBufferChange();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -223,15 +226,16 @@ void InputTextBuffer::tryAddChar( const Uint32& c ) {
|
||||
if ( validChar( c ) ) {
|
||||
removeSelection();
|
||||
|
||||
setChangedSinceLastUpdate( true );
|
||||
|
||||
if ( autoPrompt() ) {
|
||||
mText += c;
|
||||
mPromptPos = (int)mText.size();
|
||||
setCursorPos( (int)mText.size() );
|
||||
} else {
|
||||
String::insertChar( mText, mPromptPos, c );
|
||||
mPromptPos++;
|
||||
setCursorPos( mPromptPos+1 );
|
||||
}
|
||||
|
||||
setChangedSinceLastUpdate( true );
|
||||
onBufferChange();
|
||||
}
|
||||
} else {
|
||||
if ( canAdd() && String::isCharacter(c) ) {
|
||||
@@ -261,6 +265,7 @@ void InputTextBuffer::removeSelection() {
|
||||
setCursorPos( init );
|
||||
|
||||
resetSelection();
|
||||
onBufferChange();
|
||||
} else {
|
||||
resetSelection();
|
||||
}
|
||||
@@ -310,6 +315,7 @@ void InputTextBuffer::update( InputEvent* Event ) {
|
||||
selCurInit( 0 );
|
||||
selCurEnd( mText.size() );
|
||||
setCursorPos( mSelCurEnd );
|
||||
onSelectionChange();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -329,12 +335,10 @@ void InputTextBuffer::update( InputEvent* Event ) {
|
||||
}
|
||||
|
||||
if ( txt.size() ) {
|
||||
setChangedSinceLastUpdate( true );
|
||||
|
||||
if ( mText.size() + txt.size() < mMaxLength ) {
|
||||
if ( autoPrompt() ) {
|
||||
mText += txt;
|
||||
mPromptPos = (int)mText.size();
|
||||
setCursorPos( (int)mText.size() );
|
||||
} else {
|
||||
mText.insert( mPromptPos, txt );
|
||||
mPromptPos += txt.size();
|
||||
@@ -342,6 +346,9 @@ void InputTextBuffer::update( InputEvent* Event ) {
|
||||
|
||||
autoPrompt( false );
|
||||
}
|
||||
|
||||
setChangedSinceLastUpdate( true );
|
||||
onBufferChange();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -364,13 +371,11 @@ void InputTextBuffer::update( InputEvent* Event ) {
|
||||
|
||||
if ( ( c == KEY_BACKSPACE || c == KEY_DELETE ) ) {
|
||||
if ( mText.size() ) {
|
||||
setChangedSinceLastUpdate( true );
|
||||
|
||||
if ( mPromptPos < (int)mText.size() ) {
|
||||
if ( c == KEY_BACKSPACE ) {
|
||||
if ( mPromptPos > 0 ) {
|
||||
mText.erase(mPromptPos-1,1);
|
||||
mPromptPos--;
|
||||
setCursorPos( mPromptPos - 1 );
|
||||
}
|
||||
} else {
|
||||
mText.erase(mPromptPos,1);
|
||||
@@ -381,16 +386,20 @@ void InputTextBuffer::update( InputEvent* Event ) {
|
||||
}
|
||||
|
||||
resetSelection();
|
||||
|
||||
setChangedSinceLastUpdate( true );
|
||||
onBufferChange();
|
||||
}
|
||||
} else if ( ( c == KEY_RETURN || c == KEY_KP_ENTER ) ) {
|
||||
if ( setSupportNewLine() && canAdd() ) {
|
||||
String::insertChar( mText, mPromptPos, '\n' );
|
||||
|
||||
mPromptPos++;
|
||||
setCursorPos( mPromptPos + 1 );
|
||||
|
||||
resetSelection();
|
||||
|
||||
setChangedSinceLastUpdate( true );
|
||||
onBufferChange();
|
||||
}
|
||||
|
||||
if ( mEnterCall )
|
||||
@@ -398,13 +407,13 @@ void InputTextBuffer::update( InputEvent* Event ) {
|
||||
|
||||
} else if ( c == KEY_LEFT ) {
|
||||
if ( ( mPromptPos - 1 ) >= 0 ) {
|
||||
mPromptPos--;
|
||||
setCursorPos( mPromptPos - 1 );
|
||||
autoPrompt( false );
|
||||
shiftSelection( mPromptPos + 1 );
|
||||
}
|
||||
} else if ( c == KEY_RIGHT ) {
|
||||
if ( ( mPromptPos + 1 ) < (int)mText.size() ) {
|
||||
mPromptPos++;
|
||||
setCursorPos( mPromptPos + 1 );
|
||||
autoPrompt(false);
|
||||
shiftSelection( mPromptPos - 1 );
|
||||
} else if ( ( mPromptPos + 1 ) == (int)mText.size() ) {
|
||||
@@ -432,13 +441,13 @@ void InputTextBuffer::update( InputEvent* Event ) {
|
||||
if ( c == KEY_END ) {
|
||||
for ( Uint32 i = mPromptPos; i < mText.size(); i++ ) {
|
||||
if ( mText[i] == '\n' ) {
|
||||
mPromptPos = i;
|
||||
setCursorPos( i );
|
||||
autoPrompt( false );
|
||||
break;
|
||||
}
|
||||
|
||||
if ( i == ( mText.size() - 1 ) ) {
|
||||
mPromptPos = mText.size();
|
||||
setCursorPos( mText.size() );
|
||||
autoPrompt( false );
|
||||
}
|
||||
}
|
||||
@@ -450,13 +459,13 @@ void InputTextBuffer::update( InputEvent* Event ) {
|
||||
if ( 0 != mPromptPos ) {
|
||||
for ( Int32 i = (Int32)mPromptPos - 1; i >= 0; i-- ) {
|
||||
if ( mText[i] == '\n' ) {
|
||||
mPromptPos = i + 1;
|
||||
setCursorPos( i + 1 );
|
||||
autoPrompt( false );
|
||||
break;
|
||||
}
|
||||
|
||||
if ( i == 0 ) {
|
||||
mPromptPos = 0;
|
||||
setCursorPos( 0 );
|
||||
autoPrompt( false );
|
||||
}
|
||||
}
|
||||
@@ -474,7 +483,7 @@ void InputTextBuffer::update( InputEvent* Event ) {
|
||||
}
|
||||
|
||||
if ( c == KEY_HOME ) {
|
||||
mPromptPos = 0;
|
||||
setCursorPos( 0 );
|
||||
autoPrompt(false);
|
||||
|
||||
shiftSelection( lPromtpPos );
|
||||
@@ -487,8 +496,6 @@ void InputTextBuffer::update( InputEvent* Event ) {
|
||||
if ( Event->Type == InputEvent::TextInput ) {
|
||||
tryAddChar( Event->text.text );
|
||||
} else if ( Event->Type == InputEvent::KeyDown ) {
|
||||
setChangedSinceLastUpdate( true );
|
||||
|
||||
if ( c == KEY_BACKSPACE && mText.size() > 0 ) {
|
||||
mText.resize( mText.size() - 1 );
|
||||
} else if ( ( c == KEY_RETURN || c == KEY_KP_ENTER ) && !Input->isMetaPressed() && !Input->isAltPressed() && !Input->isControlPressed() ) {
|
||||
@@ -498,6 +505,9 @@ void InputTextBuffer::update( InputEvent* Event ) {
|
||||
if ( mEnterCall )
|
||||
mEnterCall();
|
||||
}
|
||||
|
||||
setChangedSinceLastUpdate( true );
|
||||
onBufferChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -510,11 +520,13 @@ void InputTextBuffer::shiftSelection( const int& lastPromtpPos ) {
|
||||
Input * Input = mWindow->getInput();
|
||||
|
||||
if ( Input->isShiftPressed() && !Input->isControlPressed() ) {
|
||||
if ( selCurInit() != getCursorPos() ) {
|
||||
selCurEnd( getCursorPos() );
|
||||
if ( selCurInit() != getCursorPosition() ) {
|
||||
selCurEnd( getCursorPosition() );
|
||||
onSelectionChange();
|
||||
} else {
|
||||
if ( selCurInit() != getCursorPos() ) {
|
||||
selCurInit( getCursorPos() );
|
||||
if ( selCurInit() != getCursorPosition() ) {
|
||||
selCurInit( getCursorPosition() );
|
||||
onSelectionChange();
|
||||
} else {
|
||||
resetSelection();
|
||||
return;
|
||||
@@ -523,10 +535,12 @@ void InputTextBuffer::shiftSelection( const int& lastPromtpPos ) {
|
||||
|
||||
if ( -1 == selCurInit() ) {
|
||||
selCurInit( lastPromtpPos );
|
||||
onSelectionChange();
|
||||
}
|
||||
|
||||
if ( -1 == selCurEnd() ) {
|
||||
selCurEnd( lastPromtpPos );
|
||||
onSelectionChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -564,9 +578,9 @@ void InputTextBuffer::movePromptRowDown( const bool& breakit ) {
|
||||
|
||||
if ( 0 != dLastLinePos ) {
|
||||
if ( dCharLineCount < dCharsTo ) {
|
||||
mPromptPos = dLastLinePos + dCharLineCount;
|
||||
setCursorPos( dLastLinePos + dCharLineCount );
|
||||
} else {
|
||||
mPromptPos = dLastLinePos + dCharsTo;
|
||||
setCursorPos( dLastLinePos + dCharsTo );
|
||||
}
|
||||
|
||||
autoPrompt( false );
|
||||
@@ -604,9 +618,9 @@ void InputTextBuffer::movePromptRowUp( const bool& breakit ) {
|
||||
}
|
||||
|
||||
if ( uCharLineCount < uCharsTo ) {
|
||||
mPromptPos = uLastLinePos + uCharLineCount;
|
||||
setCursorPos( uLastLinePos + uCharLineCount );
|
||||
} else {
|
||||
mPromptPos = uLastLinePos + uCharsTo;
|
||||
setCursorPos( uLastLinePos + uCharsTo );
|
||||
}
|
||||
|
||||
autoPrompt( false );
|
||||
@@ -632,18 +646,25 @@ void InputTextBuffer::setBuffer( const String& str ) {
|
||||
}
|
||||
}
|
||||
|
||||
int InputTextBuffer::getCursorPos() const {
|
||||
int InputTextBuffer::getCursorPosition() const {
|
||||
return mPromptPos;
|
||||
}
|
||||
|
||||
void InputTextBuffer::setCursorPosition(const Uint32& pos) {
|
||||
if ( isFreeEditingEnabled() ) {
|
||||
if ( pos < mText.size() ) {
|
||||
autoPrompt( false );
|
||||
}
|
||||
|
||||
mPromptPos = pos;
|
||||
}
|
||||
}
|
||||
|
||||
void InputTextBuffer::setCursorPos( const Uint32& pos ) {
|
||||
if ( isFreeEditingEnabled() ) {
|
||||
if ( pos < mText.size() ) {
|
||||
mPromptPos = pos;
|
||||
autoPrompt( false );
|
||||
} else {
|
||||
cursorToEnd();
|
||||
}
|
||||
setCursorPosition( pos );
|
||||
|
||||
onCursorPositionChange();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -697,7 +718,9 @@ void InputTextBuffer::autoPrompt( const bool& set ) {
|
||||
BitOp::writeBitKey( &mFlags, INPUT_TB_PROMPT_AUTO_POS, set == true );
|
||||
|
||||
if ( set ) {
|
||||
mPromptPos = (int)mText.size();
|
||||
mPromptPos = (int)mText.size();
|
||||
|
||||
onCursorPositionChange();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -759,7 +782,7 @@ void InputTextBuffer::setTextSelectionEnabled( const bool& enabled ) {
|
||||
}
|
||||
|
||||
void InputTextBuffer::cursorToEnd() {
|
||||
mPromptPos = mText.size();
|
||||
setCursorPos( mText.size() );
|
||||
}
|
||||
|
||||
void InputTextBuffer::selCurInit( const Int32& init ) {
|
||||
@@ -778,4 +801,34 @@ const Int32& InputTextBuffer::selCurEnd() const {
|
||||
return mSelCurEnd;
|
||||
}
|
||||
|
||||
void InputTextBuffer::setCursorPositionChangeCallback( const CursorPositionChangeCallback& cursorPositionChangeCallback ) {
|
||||
mCursorPositionChangeCallback = cursorPositionChangeCallback;
|
||||
}
|
||||
|
||||
void InputTextBuffer::setBufferChangeCallback(const BufferChangeCallback& bufferChangeCallback) {
|
||||
mBufferChangeCallback = bufferChangeCallback;
|
||||
}
|
||||
|
||||
void InputTextBuffer::setSelectionChangeCallback(const SelectionChangeCallback& selectionChangeCallback) {
|
||||
mSelectionChangeCallback = selectionChangeCallback;
|
||||
}
|
||||
|
||||
void InputTextBuffer::onCursorPositionChange() {
|
||||
if ( mCursorPositionChangeCallback ) {
|
||||
mCursorPositionChangeCallback();
|
||||
}
|
||||
}
|
||||
|
||||
void InputTextBuffer::onSelectionChange() {
|
||||
if ( mSelectionChangeCallback ) {
|
||||
mSelectionChangeCallback();
|
||||
}
|
||||
}
|
||||
|
||||
void InputTextBuffer::onBufferChange() {
|
||||
if ( mBufferChangeCallback ) {
|
||||
mBufferChangeCallback();
|
||||
}
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
@@ -452,6 +452,7 @@ void EETest::createBaseUI() {
|
||||
comboBox->getListBox()->setSelected( 0 );
|
||||
|
||||
UITextEdit * TextEdit = UITextEdit::New();
|
||||
TextEdit->setFlags( UI_WORD_WRAP );
|
||||
TextEdit->setParent( C )->setPosition( 5, 245 )->setSize( 315, 130 );
|
||||
TextEdit->setText( mBuda );
|
||||
|
||||
@@ -715,6 +716,7 @@ void EETest::createNewUI() {
|
||||
comboBox->getListBox()->setSelected( 0 );
|
||||
|
||||
UITextEdit * textEdit = UITextEdit::New();
|
||||
textEdit->setFlags( UI_WORD_WRAP );
|
||||
textEdit->setPosition( 350, 4 )->setSize( 200, 200 )->setParent( container );
|
||||
textEdit->setText( mBuda );
|
||||
|
||||
@@ -1029,6 +1031,7 @@ void EETest::createDecoratedWindow() {
|
||||
->setParent( lay );
|
||||
|
||||
UITextEdit * TEdit = UITextEdit::New();
|
||||
TEdit->setFlags( UI_WORD_WRAP );
|
||||
TEdit->setParent( TabWidget );
|
||||
TEdit->setText( mBuda );
|
||||
TabWidget->add( "TextEdit", TEdit );
|
||||
|
||||
Reference in New Issue
Block a user