Page 1 of 1

scroll bar of EditorGadget cannot reach the bottom

Posted: Fri May 26, 2023 2:56 pm
by gurj
PUB6.02 has been returned to bug of the old version, and the scroll bar of EditorGadget () cannot reach the bottom.
6.01 Normal.

Code: Select all

If OpenWindow(0, 0, 0, 322, 150, "EditorGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
 S.S
 f=LoadFont(0,"SILDoulosIPA",18)
 SetGadgetFont(#PB_Default,f)
 EditorGadget(0, 8, 8, 306, 133)
 For a = $250 To $2AF:s+Chr(a)+" ":n+1:If n=8:s+~"\n":n=0:EndIf
 Next:SetGadgetText(0,s)
 Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
; IDE Options = PureBasic 6.02 LTS (Windows - x86)
; CursorPosition = 9
; Folding = -
; EnableXP
; DPIAware
; CPU = 5
; DisableDebugger

Re: [PUB6.02bug] scroll bar of EditorGadget cannot reach the bottom

Posted: Fri May 26, 2023 3:08 pm
by Fred
Seems to work fine here, can anybody else confirm ?

Re: [PUB6.02bug] scroll bar of EditorGadget cannot reach the bottom

Posted: Fri May 26, 2023 3:16 pm
by fryquez
Using the mouse wheel you can't reach the last empty line it adds.

Re: [PUB6.02bug] scroll bar of EditorGadget cannot reach the bottom

Posted: Sat May 27, 2023 2:20 am
by gurj
Before 2010(?), there is this problem.I remember that about.

Re: [PUB6.02bug] scroll bar of EditorGadget cannot reach the bottom

Posted: Sat May 27, 2023 2:27 am
by BarryG
Confirmed here: Using 6.01, I can mouse scroll wheel down to the bottom of the gadget. With 6.02, I can't.

However, it works with 6.02 if you add this line after the EditorGadget() command:

Code: Select all

SendMessage_(GadgetID(0), #EM_SETTEXTMODE, #TM_RICHTEXT, 0)

Re: [PUB6.02bug] scroll bar of EditorGadget cannot reach the bottom

Posted: Sat May 27, 2023 7:47 am
by Fred
So probably another winapi oddity

Re: scroll bar of EditorGadget cannot reach the bottom

Posted: Sat May 27, 2023 8:06 am
by netmaestro
Not sure I agree with the winapi idea. The reason is if I do the same thing on the wordpad app that ships with windows, put in 20 lines or so followed by some blank lines, shorten the window up so only ten or so lines show, the mousewheel will scroll the gadget all the way down to show the last blank line. Both are using the RICHEDIT50W control. I lean towards a vote for a bug in PB (for now).

Re: scroll bar of EditorGadget cannot reach the bottom

Posted: Sat May 27, 2023 9:10 am
by Fred
Notepad uses the RTF mode AFAIK, that's why it behaves like that. You could try with a pure winapi control but we don't hook any mouse related events so I don't think it will on PB side this time :)

Re: scroll bar of EditorGadget cannot reach the bottom

Posted: Sat May 27, 2023 10:30 pm
by gurj
@BarryG,ok! thanks!

Re: scroll bar of EditorGadget cannot reach the bottom

Posted: Sat May 27, 2023 11:20 pm
by gurj
@Fred,why only 6.02 not?

Re: scroll bar of EditorGadget cannot reach the bottom

Posted: Sun May 28, 2023 8:45 am
by Fred
It's because we switched the EditorGadget to plain mode by default (instead of RTF) as it raised unexpected issues. To get 6.01 behaviour, just set back the RTF mode with SendMessage()

Re: scroll bar of EditorGadget cannot reach the bottom

Posted: Sun May 28, 2023 10:38 am
by gurj
but,now,why pb6.02 cannot use #TM_PLAINTEXT? why 6.01 can?

Re: scroll bar of EditorGadget cannot reach the bottom

Posted: Mon Jan 20, 2025 11:19 am
by gurj
Now PB-V6.12, #TM_RICHTEXT and #TM_PLAINTEXT are all the same bug.