|
Post by Walt Decker on Dec 22, 2020 15:12:56 GMT -5
Given:
ES.AUTOHSCROLL = HEXDEC("&H0080") WS.HSCROLL = HEXDEC("&H00100000")
UpperLeftX = 100 UpperLeftY = 100 WindowWidth = 300 WindoHeight = 300
STYLEBITS #WIN.ED, 0, ES.AUTOHSCROLL OR WS.HSCROLL , 0, 0
TEXTEDITOR #WIN.ED, 4, 4, 200, 200 OPEN "Txt Test" FOR WINDOW AS #WIN PRINT #WIN, "trapclose EndIt"
WAIT END
'---------------------------------------------------------------------------- '----------------------------------------------------------------------------
SUB EndIt Hndl$
CLOSE #Hndl$
END SUB The removal of ES.AUTOHSCROLL AND WS.HSCROLL works. However, the multi-line edit control does not behave properly. With the removal of those styles the control should wrap the text when it reaches the limit of its client window. It does not.
|
|
|
Post by gidiom2 on Dec 22, 2020 16:12:10 GMT -5
TEXTEDITOR is a special widget, see reference in "https://alycesrestaurant.com/lbpe/Stylebits - Textboxes.html", which does not accept stylebits but a solution is offered by Alyce.
|
|
|
Post by Chris Iverson on Dec 22, 2020 16:18:49 GMT -5
That's because it's not a Win32 multi-line edit control.
ES.AUTOHSCROLL = HEXDEC("&H0080") WS.HSCROLL = HEXDEC("&H00100000")
UpperLeftX = 100 UpperLeftY = 100 WindowWidth = 300 WindoHeight = 300
STYLEBITS #WIN.ED, 0, ES.AUTOHSCROLL OR WS.HSCROLL , 0, 0
TEXTEDITOR #WIN.ED, 4, 4, 200, 200 OPEN "Txt Test" FOR WINDOW AS #WIN PRINT #WIN, "trapclose EndIt"
hEdit = hwnd(#WIN.ED)
size = 255 edName$ = space$(size) CallDLL #user32, "GetClassNameA",_ hEdit as ulong,_ edName$ as ptr,_ size as long,_ ret as long
print edName$
WAIT END
'---------------------------------------------------------------------------- '----------------------------------------------------------------------------
SUB EndIt Hndl$
CLOSE #Hndl$
END SUB
I mentioned in another post that some LB controls, TEXTEDITOR in particular, are widgets provided by the toolset used to create LB, and are not native Win32 controls.
That said, I do not know if the built-in texteditor can be configured as you wish(that is, not scrolling, and instead wrapping.)
|
|
|
Post by Carl Gundel on Dec 23, 2020 10:30:45 GMT -5
That's because it's not a Win32 multi-line edit control. I mentioned in another post that some LB controls, TEXTEDITOR in particular, are widgets provided by the toolset used to create LB, and are not native Win32 controls. That said, I do not know if the built-in texteditor can be configured as you wish(that is, not scrolling, and instead wrapping.) In a nutshell, what specific features are required for texteditors and other widgets for your applications Walt? I ask because I want to make sure that LB5 has enough built in features so that API calls will be largely made unnecessary.
|
|
|
Post by Walt Decker on Dec 24, 2020 15:11:39 GMT -5
Let me review what features the text edit widgit has and I will post what I think it needs.
|
|
|
Post by Walt Decker on Dec 25, 2020 9:33:51 GMT -5
Mr. Gundel, you have just about everything a programmer would need for a text editor except:
1. Word wrap 2. Setting tabs 3. Overwrite mode 4. Margin setting 5. Changing the size of the caret for the visually impaired.
The one I am working on in LB has those characteristics except margin setting. The tab setting is simulated because I get a memory protection violation when using EM_SETTABSTOPS. I have not tried margin setting because I think it will generate a protection violation also.
Insert mode is the standard caret 3 pels wide by the font height while the overwrite mode is the average size of the font used.
Word wrap is just the standard multi-line behaviour when there is no horizontal scroll bar.
I am also going to include a find-replace module more like the MS find/find replace common dialog. I would use the MS common dialog, but I am not familiar enough with LB to do it.
|
|
Tasp
Full Member
Posts: 215
|
Post by Tasp on Dec 26, 2020 13:30:17 GMT -5
This is not my area of expertise, but are you using EM_SETTABSTOPS or _EM_SETTABSTOPS, I believe there must be an underscore. You may not need to reinvent the wheel, as Alyce covered this sometime ago. Alyces article, if you haven't already seen it, it may offer some info, can be found here. alycesrestaurant.com/lbpe/Textbox%20with%20Columns.html
|
|