I need to code an editor so that each line contains no more than n characters. For this I used a monospaced font and calculated the required number of pixels. I also set the 'WordWrap' flag. But it works strangely. This very simple code does not work as expected. It only uses the carry flag. Also in the debug window I expected to get what I see in the editor, but this is not the case at all. I think a workaround is to count the number of lines in the editor and then read them one by one, adding #CRLS$ between them. But why doesn't the GetGadgetText() command do this ? I don't know if this is a bug.
Code: Select all
If OpenWindow(0, 0, 0, 322, 150, "Editor", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
EditorGadget(0, 8, 8, 306, 133, #PB_Editor_WordWrap)
SendMessage_(eWnd, #EM_SETTEXTMODE, #TM_RICHTEXT, 0)
For a = 0 To 5
AddGadgetItem(0, a, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ~!abcdefghijk")
Next
Debug GetGadgetText(0)
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
Can anyone confirm the same editor behavior ?
Thank you.