Comments (1)
The ofxDatGuiTextInput.h makes an instance of ofxDatGuiTextInputField
here is a very bad way of adding text scrolling effect when full to setText in ofxDatGuiTextInputField.
`` void setText(string text)
{
mText = text;
mTextChanged = true;
//render visable text
mRendered = mUpperCaseText ? ofToUpper(mText) : mText;
mTextRect = mFont->rect(mType == ofxDatGuiInputType::COLORPICKER ? "#" + mRendered : mRendered);
float InputRectWidth = mInputRect.width - (mInputRect.height - mTextHeight.height);
textv = mText;
if (mTextRect.width > InputRectWidth && !textv.empty() && mInputRect.width > (mInputRect.height - mTextHeight.height)) {
//this takes X amount off the string then the while will double check
float letterWidth = mFont->rect("#").width;
float diffWidth = mTextRect.width - InputRectWidth;
float divWidth = diffWidth / letterWidth;
textv = textv.substr(static_cast<int>(divWidth));
mRendered = mUpperCaseText ? ofToUpper(textv) : textv;
mTextRect = mFont->rect(mType == ofxDatGuiInputType::COLORPICKER ? "#" + mRendered : mRendered);
while (mTextRect.width > InputRectWidth && !textv.empty()) {
//take 1 at a time
textv = textv.substr(1);
mRendered = mUpperCaseText ? ofToUpper(textv) : textv;
mTextRect = mFont->rect(mType == ofxDatGuiInputType::COLORPICKER ? "#" + mRendered : mRendered);
}
}
}``
from ofxdatgui.
Related Issues (20)
- how to freeze the plot graphs? HOT 1
- Gui resize and no Interactivity when moving app from external screen to retina display on macbook pro
- Button size HOT 1
- std namespace is assumed and causes compile error with latest release build: ofx 0.10.0 HOT 1
- scrollView move and remove clear entire scrollview HOT 1
- compile error with linux x oF0.10.0 HOT 2
- Disable interactivity of component HOT 1
- User Visual feedback for Matrix GUI without clicking onto it HOT 1
- ofVec2f support for slider HOT 3
- issue with OF 10 on Xcode 9.4 HOT 2
- No addScrollView for gui HOT 1
- Setout and interaction issues in OF_WINDOW mode on PC HOT 1
- EXC_BAD_ACCESS when adding anything to ofxDatGui
- ui displays incorrectly if ofSetRectMode(OF_RECT_MODE_CENTER) is set
- Pixelated GUI
- if (e.target == Exit) Not working
- ofxDatGuiDropdown on bottom HOT 1
- Linker error with onDropdownEvent - missing required architecture arm64
- Mouse event propagation with MousePressed and MouseReleased of event HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ofxdatgui.