[SOLVED] No BottomTo EditorGadget()

Just starting out? Need help? Post your questions and find answers here.
Randy Walker
Addict
Addict
Posts: 1109
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA

[SOLVED] No BottomTo EditorGadget()

Post by Randy Walker »

I'm trying to troubleshoot my EditorGadget not being able to scroll down to bottom line where it should show - end -.
Here is a modified excert what I am looking at:

Code: Select all

#Window_5 = 0
Enumeration
#UserPick_5
#PrvUsr_5
#NxtUsr_5
#ViewPhoto_5
#F4_5
#Back_5
#Next_5
#Close_5
#HelpText_5
EndEnumeration
fontSan10.i = LoadFont(#PB_Default,"MS Sans Serif",10)
ExamineDesktops()
_y = DesktopHeight(0)
Debug _y
X_trbW.W = 10
Y_trbW.W = 10
HWND5 = OpenWindow(#Window_5, X_trbW.W, Y_trbW.W, 631, _y - Y_trbW - 656, "TroubleShooting",  #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_SizeGadget | #PB_Window_Invisible | #PB_Window_TitleBar)
If HWND5
  UserPick5 = ComboBoxGadget(#UserPick_5, 31, 0, 159, 20)
  ButtonGadget(#PrvUsr_5, 0, 0, 30, 20, "<< |")
  ButtonGadget(#NxtUsr_5, 190, 0, 30, 20, "| >>")
  ViewPhoto5 = ButtonGadget(#ViewPhoto_5, -5, 0, 225, 25, "&View Photo")
  ButtonGadget(#F4_5, 220, 0, 120, 25, "[F4] CLIPBOARD")
  ButtonGadget(#Back_5, 340, 0, 110, 25, "<<< &BACK   ")
  ButtonGadget(#Next_5, 450, 0, 100, 25, "  &NEXT >>>")
  ButtonGadget(#Close_5, 550, 0, 80, 25, "CLOSE")
  SetGadgetFont(#PB_Default,FontID(fontSan10.i))
  HelpText5 = EditorGadget(#HelpText_5, -2, 25, 635, _y - Y_trbW - 80)
  SendMessage_(HelpText5, #EM_SETTARGETDEVICE, #Null, 0) ; 0=wrap , 1up=linewidth , $FFFFFF(effectively)=wrapoff
  ;SendMessage_(HelpText5, #EM_SETREADONLY, 1, 0) 
  ;SendMessage_(HelpText5, #EM_SETBKGNDCOLOR, 0, RGB(255, 255, 255))
  SetGadgetText(#HelpText_5, "HelpText")
  HideGadget(#PrvUsr_5,1)
  HideGadget(#NxtUsr_5,1)
  HideGadget(#UserPick_5,1)
EndIf
HideWindow(0,0)
For n = 1 To 69  ;Fill edidgadget with 69 lines of text
  s$ = LSet(Chr(Random(122,65)),55,Chr(Random(122,65)))
  AddGadgetItem(#HelpText_5,-1,s$)
Next n
AddGadgetItem(#HelpText_5,-1,"           - end -")
Repeat
  event =WaitWindowEvent()
Until event = #PB_Event_CloseWindow
  
OH!!! SORRY. Working in PB 5.40 and Win 11 Pro.
Last edited by Randy Walker on Tue Feb 11, 2025 7:03 am, edited 1 time in total.
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
Randy Walker
Addict
Addict
Posts: 1109
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA

Re: No BottomTo EditorGadget()

Post by Randy Walker »

Same issue in PB ver 6.12
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
PBJim
Enthusiast
Enthusiast
Posts: 296
Joined: Fri Jan 19, 2024 11:56 pm

Re: No BottomTo EditorGadget()

Post by PBJim »

Hi Randy,

It's because the calculations result in the editor gadget being larger than the window. Adjust the two lines below and it shows what was happening.

Code: Select all

HWND5 = OpenWindow(#Window_5, X_trbW.W, Y_trbW.W, 631, _y - Y_trbW - 456, "TroubleShooting",  #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_SizeGadget | #PB_Window_Invisible | #PB_Window_TitleBar) 

Code: Select all

  HelpText5 = EditorGadget(#HelpText_5, -2, 25, 635, _y - Y_trbW - 480) 
Randy Walker
Addict
Addict
Posts: 1109
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA

Re: No BottomTo EditorGadget()

Post by Randy Walker »

PBJim wrote: Tue Feb 11, 2025 5:51 am Hi Randy,

It's because the calculations result in the editor gadget being larger than the window. Adjust the two lines below and it shows what was happening.
Thank you PBJim. I can be such an idiot. Hey, you wouldn't happen to be the same old "PB" member that we used to see around here would you?
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
PBJim
Enthusiast
Enthusiast
Posts: 296
Joined: Fri Jan 19, 2024 11:56 pm

Re: No BottomTo EditorGadget()

Post by PBJim »

Randy Walker wrote: Tue Feb 11, 2025 7:02 am
PBJim wrote: Tue Feb 11, 2025 5:51 am Hi Randy,

It's because the calculations result in the editor gadget being larger than the window. Adjust the two lines below and it shows what was happening.
Thank you PBJim. I can be such an idiot. Hey, you wouldn't happen to be the same old "PB" member that we used to see around here would you?
I guess there must have been a variation in PB 5.40 that compensated for the editor being larger, but not sure.

No, I'm not really a PB veteran, joined fairly recently. We began using a PB licence in our business a couple of years ago but the two times I attempted to join the forum, the membership was cancelled, so mostly I learnt as I went along.
Post Reply