Page 2 of 2

Re: [PB 6.20 beta 2] EditorGadget no longer centres text

Posted: Sun Dec 22, 2024 12:09 am
by BarryG
Nobody read my post? What's wrong with using a centered TextGadget to show the text?

Re: [PB 6.20 beta 2] EditorGadget no longer centres text

Posted: Sun Dec 22, 2024 6:49 am
by marcoagpinto
BarryG wrote: Sun Dec 22, 2024 12:09 am Nobody read my post? What's wrong with using a centered TextGadget to show the text?
Ahhhhh... sorry... I have used your suggestion:

Code: Select all

  t$=""+#LF$
  t$+"Coded/Compiled using PureBasic "+current_version_purebasic$+" — "+current_release_date_purebasic$+#LF$
  t$+Chr(34)+"Feel the ..Pure.. Power"+Chr(34)+#LF$+#LF$
  t$+"© 1998–"+FormatDate("%yyyy", #PB_Compiler_Date)+" Fantaisie Software."+#LF$
  t$+"www.purebasic.com"
    TextGadget(#WEBGADGET_WINDOW_ABOUT,x,y,ImageWidth(#GLOBAL_IMAGE_ABOUT_PTG_PB_LOGO)-ImageWidth(#GLOBAL_IMAGE_ABOUT_PTG_PB_LOGO_Z)-10,ImageHeight(#GLOBAL_IMAGE_ABOUT_PTG_PB_LOGO_Z),t$,#PB_Text_Border|#PB_Text_Center)
    SetGadgetColor(#WEBGADGET_WINDOW_ABOUT,#PB_Gadget_BackColor,#White)
Thanks!

Re: [PB 6.20 beta 2] EditorGadget no longer centres text

Posted: Sun Dec 22, 2024 8:05 am
by BarryG
Just use the right tool for the job, was my point. You're showing non-editable plain text, so an EditorGadget makes no sense, and neither does a WebGadget because you're not showing HTML. The TextGadget does literally what you wanted, so... :) The KISS principle.

Re: [PB 6.20 beta 2] EditorGadget no longer centres text

Posted: Sun Dec 22, 2024 8:17 am
by Randy Walker
BarryG wrote: Sun Dec 22, 2024 8:05 am Just use the right tool for the job, was my point. You're showing non-editable plain text, so an EditorGadget makes no sense, ...
Makes perfect sense if you do not want to block the user from copying text. Personally I hate when they do that, especially places like the About window. Just because they are allowed to access/modify the text does not necessarily mean they can make permanent changes unless you design it that way.

Re: [PB 6.20 beta 2] EditorGadget no longer centres text

Posted: Sun Dec 22, 2024 8:19 am
by BarryG
Anyone can copy any text they can see anyway. Heard of Microsoft PowerToys? It literally provides a tool for users to copy any text on the desktop. You can't stop them. Link -> https://learn.microsoft.com/en-us/windo ... -extractor

Re: [PB 6.20 beta 2] EditorGadget no longer centres text

Posted: Sun Dec 22, 2024 8:24 am
by Randy Walker
No, can't say I ever heard of Microsoft PowerToys per say, but then I tend to stay away from Windows OS tweakers, so I don''t create problems as I did once long ago.

Re: [PB 6.20 beta 2] EditorGadget no longer centres text

Posted: Sun Dec 22, 2024 8:42 am
by Randy Walker
Now that I followed your link on the text capture thing, I see it is supposed to be native to Windows but I tried (default: ⊞ Win+Shift+T but nothing happened.

Re: [PB 6.20 beta 2] EditorGadget no longer centres text

Posted: Sun Dec 22, 2024 10:05 am
by BarryG
It's not native. You need to install PowerToys -> https://learn.microsoft.com/en-us/windows/powertoys/

Re: [PB 6.20 beta 2] EditorGadget no longer centres text

Posted: Sun Dec 22, 2024 10:33 am
by infratec
BarryG wrote: Sun Dec 22, 2024 8:05 am Just use the right tool for the job, was my point. You're showing non-editable plain text, so an EditorGadget makes no sense, and neither does a WebGadget because you're not showing HTML. The TextGadget does literally what you wanted, so... :) The KISS principle.
Please show me how you can show a http link inside of a TextGadget().

Yes, you have to use the right tools and in this case, I, personally, would like also to present a link to the url.
So a WebGadget makes sense for me. (Better user experience)

Re: [PB 6.20 beta 2] EditorGadget no longer centres text

Posted: Sun Dec 22, 2024 10:55 am
by BarryG
infratec wrote: Sun Dec 22, 2024 10:33 amPlease show me how you can show a http link inside of a TextGadget()
You can't. But Marco wasn't doing that in his original code that he posted - he showed an URL in the EditorGadget, yes; but he wasn't making it clickable (or didn't show the code that did it). I can only go by what's posted.

[Edit] I downloaded Marco's app to check, and yes, the PureBasic URL is not clickable, so a TextGadget would work fine for his needs.

Re: [PB 6.20 beta 2] EditorGadget no longer centres text

Posted: Sun Dec 22, 2024 11:26 am
by infratec
Yes ... not a good user experience :wink:

Like in the original 'About' of the PB IDE.
Fred should change this if he want more clicks to his page.

Re: [PB 6.20 beta 2] EditorGadget no longer centres text

Posted: Sun Dec 22, 2024 10:06 pm
by Shardik
BarryG wrote: Sun Dec 22, 2024 10:55 am
infratec wrote: Sun Dec 22, 2024 10:33 amPlease show me how you can show a http link inside of a TextGadget()
You can't.
That's incorrect. It's possible (though complicated) and mback2k had posted this example in the German forum in 2008. I have just tested it and it's still working in Windows 10 22H2 x64 in PB 5.46 x86 and x64 in both ASCII and Unicode mode. In PB 5.73, 6.04 and 6.12 parts of the displayed text are missing but the HyperText links are still working. Unfortunately I currently don't have the time to adapt mback2k's code to the newer PB versions.

However, in oder to try mback2k's example you have to change 2 lines:
  • Code: Select all

          Words$ + (" " + StringField(Text$, Index, " "))
    The outermost round bracket pair has to be removed:

    Code: Select all

          Words$ + " " + StringField(Text$, Index, " ")
  • Code: Select all

        ElseIf Not Search$ And Line = Index
    has to be changed to

    Code: Select all

        ElseIf Search$ = "" And Line = Index

Re: [PB 6.20 beta 2] EditorGadget no longer centres text

Posted: Sun Dec 22, 2024 10:11 pm
by infratec
The code in the german forum uses Windows API stuff.

The program, as I know, is platform independent.