Comments (5)
HardWrap is definitely the default value. See here:
Line 179 in a8c6b2a
I'll have to check whether specifying or omitting MUIA_TextEditor_WrapMode
during OM_NEW
makes any difference or not.
from texteditor.
Well, according to a quick test data->WrapMode
stays MUIV_TextEditor_WrapMode_HardWrap
all the time when it is not explicitly defined at OM_NEW
time, at least the value is correct. And hence I assume the behaviour also corresponds to that value.
Have you tried OM_GET'ing it already when you think it has the wrong value?
from texteditor.
Any comment on this issue?
from texteditor.
Seems I forgot about this. Try the attached example. Enter enough words to make TextEditor wrap the line. Then hit the button. You'll see that no newline characters have been inserted. In other words: Softwrapping has been used.
#include <ctype.h>
#include <stdlib.h>
#include <stdio.h>
#include <exec/exec.h>
#include <exec/types.h>
#include <intuition/intuition.h>
#include <libraries/mui.h>
#include <mui/TextEditor_mcc.h>
#include <proto/dos.h>
#include <proto/exec.h>
#include <proto/intuition.h>
#include <proto/muimaster.h>
#include <proto/utility.h>
struct Library *MUIMasterBase = NULL;
struct MUIMasterIFace *IMUIMaster = NULL;
struct Library *IntuitionBase = NULL;
struct IntuitionIFace *IIntuition = NULL;
int main(int argc, char *argv[])
{
Object *win, *app, *bt, *str;
ULONG sigs = 0;
ULONG id;
int flag = 0;
Object *subwin, *parent, *reg;
IntuitionBase = (struct Library *) OpenLibrary("intuition.library", 0);
IIntuition = (struct IntuitionIFace *) GetInterface(IntuitionBase, "main", 1, NULL);
MUIMasterBase = OpenLibrary("muimaster.library", 0);
IMUIMaster = (struct MUIMasterIFace *) GetInterface(MUIMasterBase, "main", 1, NULL);
app = ApplicationObject,
MUIA_Application_Title, "Foo",
MUIA_Application_Base, "xxxxx",
SubWindow, win = WindowObject,
MUIA_Window_Title, "Bar",
WindowContents, VGroup,
Child, VGroup,
Child, str = TextEditorObject,
MUIA_TextEditor_Contents, "x",
End,
Child, VGroup,
Child, bt = SimpleButton("Click me"),
End,
End,
End,
End,
End;
DoMethod(win, MUIM_Notify, MUIA_Window_CloseRequest, TRUE, app, 2, MUIM_Application_ReturnID, MUIV_Application_ReturnID_Quit);
DoMethod(bt, MUIM_Notify, MUIA_Pressed, FALSE, app, 2, MUIM_Application_ReturnID, 1001);
set(win, MUIA_Window_Open, TRUE);
while((id = DoMethod(app,MUIM_Application_NewInput,&sigs)) != MUIV_Application_ReturnID_Quit) {
if(id == 1001) {
STRPTR s = DoMethod(str, MUIM_TextEditor_ExportText);
printf("HMM: %s\n", s);
FreeVec(s);
}
if(sigs) {
sigs = Wait(sigs | SIGBREAKF_CTRL_C);
if (sigs & SIGBREAKF_CTRL_C) break;
}
}
MUI_DisposeObject(app);
if(IIntuition) DropInterface((struct Interface *) IIntuition);
if(IMUIMaster) DropInterface((struct Interface *) IMUIMaster);
if(MUIMasterBase) CloseLibrary(MUIMasterBase);
if(IntuitionBase) CloseLibrary(IntuitionBase);
return 0;
}
from texteditor.
Ah, yes, now I get it!
It seems you did not read the documentation carefully enough. It is clearly stated that MUIV_TextEditor_WrapMode_HardWrap requires MUIA_TextEditor_WrapBorder to be set to a non-zero value to work. However, the default value of MUIA_TextEditor_WrapBorder is zero and hence effectively disables hard wrapping. As soon as MUIA_TextEditor_WrapBorder ist set to i.e. 20 you will get the desired result.
from texteditor.
Related Issues (20)
- A fatal bug in separator drawing! HOT 9
- Crash when doing a text copy in Yam HOT 1
- Keybinding bug HOT 3
- Add MUIA_TextEditor_GlobalAlign attribute
- Characters flow out the line if wrapmode is nowrap HOT 7
- Feature request: MUIA_TextEditor_InactiveContents
- Version 15.51 crashes YAM after change of message selection HOT 11
- MUIM_TextEditor_CursorXYToIndex should indicate success/failure HOT 4
- Cannot get() MUIA_TextEditor_RedoAvailable from call hook HOT 2
- AROS i-386 version 15.51 & 15.52 Text is invisible HOT 3
- Double notification when selecting item from a context menu on TextEditor.mcc HOT 7
- Setting MUIA_Font doesn't work at all HOT 7
- Wrong mouse pointer when context menu is open HOT 1
- TextEditor 15.54 opens a "Inser MUI: drive" requester on i386 AROS HOT 3
- Italian translation for the installer
- Get cursor index from mouse position HOT 2
- MUIA_TextEditor_Rows shouldn't affect MaxHeight HOT 12
- Broken uses topaz font
- MorphOS: MUIC_TextEditor class prevents mouse-wheel/touchbar to scroll content of accompanying MUIC_List, MUIC_Floattext etc
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 texteditor.