[PB 6.20 beta 2] EditorGadget no longer centres text

Just starting out? Need help? Post your questions and find answers here.
BarryG
Addict
Addict
Posts: 4219
Joined: Thu Apr 18, 2019 8:17 am

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

Post by BarryG »

Nobody read my post? What's wrong with using a centered TextGadget to show the text?
User avatar
marcoagpinto
Addict
Addict
Posts: 1076
Joined: Sun Mar 10, 2013 3:01 pm
Location: Portugal
Contact:

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

Post 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!
BarryG
Addict
Addict
Posts: 4219
Joined: Thu Apr 18, 2019 8:17 am

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

Post 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.
Randy Walker
Addict
Addict
Posts: 1109
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA

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

Post 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.
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
BarryG
Addict
Addict
Posts: 4219
Joined: Thu Apr 18, 2019 8:17 am

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

Post 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
Randy Walker
Addict
Addict
Posts: 1109
Joined: Sun Jul 25, 2004 4:21 pm
Location: USoA

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

Post 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.
- - - - - - - - - - - - - - - -
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: [PB 6.20 beta 2] EditorGadget no longer centres text

Post 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.
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
BarryG
Addict
Addict
Posts: 4219
Joined: Thu Apr 18, 2019 8:17 am

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

Post by BarryG »

It's not native. You need to install PowerToys -> https://learn.microsoft.com/en-us/windows/powertoys/
infratec
Always Here
Always Here
Posts: 7662
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

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

Post 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)
BarryG
Addict
Addict
Posts: 4219
Joined: Thu Apr 18, 2019 8:17 am

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

Post 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.
infratec
Always Here
Always Here
Posts: 7662
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

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

Post 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.
User avatar
Shardik
Addict
Addict
Posts: 2067
Joined: Thu Apr 21, 2005 2:38 pm
Location: Germany

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

Post 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
infratec
Always Here
Always Here
Posts: 7662
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

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

Post by infratec »

The code in the german forum uses Windows API stuff.

The program, as I know, is platform independent.
Post Reply