scroll bar of EditorGadget cannot reach the bottom

Just starting out? Need help? Post your questions and find answers here.
User avatar
gurj
Enthusiast
Enthusiast
Posts: 664
Joined: Thu Jan 22, 2009 3:48 am
Location: china
Contact:

scroll bar of EditorGadget cannot reach the bottom

Post 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
my pb for chinese:
http://ataorj.ys168.com
Fred
Administrator
Administrator
Posts: 16664
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

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

Post by Fred »

Seems to work fine here, can anybody else confirm ?
fryquez
Enthusiast
Enthusiast
Posts: 367
Joined: Mon Dec 21, 2015 8:12 pm

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

Post by fryquez »

Using the mouse wheel you can't reach the last empty line it adds.
User avatar
gurj
Enthusiast
Enthusiast
Posts: 664
Joined: Thu Jan 22, 2009 3:48 am
Location: china
Contact:

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

Post by gurj »

Before 2010(?), there is this problem.I remember that about.
my pb for chinese:
http://ataorj.ys168.com
BarryG
Addict
Addict
Posts: 3318
Joined: Thu Apr 18, 2019 8:17 am

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

Post 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)
Fred
Administrator
Administrator
Posts: 16664
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

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

Post by Fred »

So probably another winapi oddity
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8433
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: scroll bar of EditorGadget cannot reach the bottom

Post 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).
BERESHEIT
Fred
Administrator
Administrator
Posts: 16664
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: scroll bar of EditorGadget cannot reach the bottom

Post 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 :)
User avatar
gurj
Enthusiast
Enthusiast
Posts: 664
Joined: Thu Jan 22, 2009 3:48 am
Location: china
Contact:

Re: scroll bar of EditorGadget cannot reach the bottom

Post by gurj »

@BarryG,ok! thanks!
my pb for chinese:
http://ataorj.ys168.com
User avatar
gurj
Enthusiast
Enthusiast
Posts: 664
Joined: Thu Jan 22, 2009 3:48 am
Location: china
Contact:

Re: scroll bar of EditorGadget cannot reach the bottom

Post by gurj »

@Fred,why only 6.02 not?
my pb for chinese:
http://ataorj.ys168.com
Fred
Administrator
Administrator
Posts: 16664
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: scroll bar of EditorGadget cannot reach the bottom

Post 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()
User avatar
gurj
Enthusiast
Enthusiast
Posts: 664
Joined: Thu Jan 22, 2009 3:48 am
Location: china
Contact:

Re: scroll bar of EditorGadget cannot reach the bottom

Post by gurj »

but,now,why pb6.02 cannot use #TM_PLAINTEXT? why 6.01 can?
my pb for chinese:
http://ataorj.ys168.com
Post Reply