Editor see last line and first character too [Resolved]

Just starting out? Need help? Post your questions and find answers here.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5353
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Editor see last line and first character too [Resolved]

Post by Kwai chang caine »

Hello at all,

I want see always the lastline of an editor
I have found the command on the forum by two ways, but she do the same effect :|

Code: Select all

OpenWindow(0, 0, 0, 506, 150, "EditorGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
EditorGadget(0, 8, 8, 500, 133)

For a = 0 To 10
 AddGadgetItem(0, a, "Line is very too long for can be see in the editor gadget without scrolling the horizontal bar " + Str(a))     
 ;SendMessage_(GadgetID(0), #EM_SETSEL, -1, -1) ; First way
 SendMessage_(GadgetID(0), #EM_SCROLLCARET, #False, #False) ; Second way
 Delay(1)
Next

Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow

The last line appears but the ScrollBar H is also at right, and i want see the begin of the sentence
Have you a way for see both last line and first character of the line

Have a good day
Last edited by Kwai chang caine on Tue Oct 20, 2020 3:00 pm, edited 2 times in total.
ImageThe happiness is a road...
Not a destination
User avatar
skywalk
Addict
Addict
Posts: 3995
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: Editor see last line and first charactere too

Post by skywalk »

We think alike KCC!
I have the same requirement...

Code: Select all

SendMessage_(GadgetID(0), #WM_VSCROLL, #SB_BOTTOM, 0) ; Scroll to bottom left
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4662
Joined: Sun Apr 12, 2009 6:27 am

Re: Editor see last line and first charactere too

Post by RASHAD »

Hi KCC

Code: Select all

OpenWindow(0, 0, 0, 506, 150, "EditorGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
EditorGadget(0, 8, 8, 500, 133)

For a = 0 To 10
  AddGadgetItem(0, a, Str(a)+" Line is very too long for can be see in the editor gadget without scrolling the horizontal bar " + Str(a))     
  SendMessage_(GadgetID(0),#EM_LINESCROLL,0,1)
 Delay(1)
Next

Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
Egypt my love
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5353
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: Editor see last line and first charactere too

Post by Kwai chang caine »

Waouuuuh !!
Two answers in several minutes.... :shock: the PB family is really unbeatable 8)

Thanks at you two, your two methods works perfectly
Have a very good night, filled with beautiful digital dreams :mrgreen:
And obviously.... for be surely good... without KCC :lol:

Your fan Kcc
ImageThe happiness is a road...
Not a destination
Post Reply