Applications, Games, Tools, User libs and useful stuff coded in PureBasic
Thorsten1867
Addict
Posts: 1366 Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany
Post
by Thorsten1867 » Fri Mar 08, 2019 5:24 pm
TextEx Gadget - Module (All OS / DPI)
Background with color gradient
Multiline text
DPI support
Automatic size adjustment (#MoveX|#MoveY|#ResizeWidth|#ResizeHeight)
Code: Select all
; TextEx::Gadget() - similar to 'TextGadget()'
; TextEx::GetColor() - similar to 'GetGadgetColor()'
; TextEx::GetText() - similar to 'GetGadgetText()'
; TextEx::SetColor() - similar to 'SetGadgetColor()'
; TextEx::SetFont() - similar to 'SetGadgetFont()'
; TextEx::SetText() - similar to 'SetGadgetText()'
; TextEx::SetAutoResizeFlags() - [#MoveX|#MoveY|#ResizeWidth|#ResizeHeight]
Download: TextExModule.pbi
Last edited by
Thorsten1867 on Fri Dec 20, 2019 3:37 pm, edited 3 times in total.
Zebuddi123
Enthusiast
Posts: 794 Joined: Wed Feb 01, 2012 3:30 pm
Location: Nottinghamshire UK
Contact:
Post
by Zebuddi123 » Fri Mar 08, 2019 8:01 pm
Thank you Thorsten1867 yet another very useful addition
Zebuddi.
malleo, caput, bang. Ego, comprehendunt in tempore
Cyllceaux
Enthusiast
Posts: 467 Joined: Mon Jun 23, 2014 1:18 pm
Contact:
Post
by Cyllceaux » Fri Mar 08, 2019 9:23 pm
This is cool...
Really thanks you
Kwai chang caine
Always Here
Posts: 5353 Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France
Post
by Kwai chang caine » Sun Mar 10, 2019 7:08 pm
Works fine
Thanks for sharing
The happiness is a road...
Not a destination
Cyllceaux
Enthusiast
Posts: 467 Joined: Mon Jun 23, 2014 1:18 pm
Contact:
Post
by Cyllceaux » Tue Nov 19, 2019 10:21 am
Now, its missing the Themes
ozzie
Enthusiast
Posts: 429 Joined: Sun Apr 06, 2008 12:54 pm
Location: Brisbane, Qld, Australia
Contact:
Post
by ozzie » Fri Dec 27, 2019 12:24 am
How do I get AutoResize to work? The example includes the line:
Code: Select all
;TextEx::SetAutoResizeFlags(#Text, TextEx::#MoveY|TextEx::#ResizeWidth)
but if I remove the ; comment marker the results are still the same, with the displayed gadget still being 170 pixels wide.
(Using TextExModule version 19120800 with PB 5.71 LTS 64-bit under Windows 10)
ozzie
Enthusiast
Posts: 429 Joined: Sun Apr 06, 2008 12:54 pm
Location: Brisbane, Qld, Australia
Contact:
Post
by ozzie » Fri Dec 27, 2019 1:37 pm
I misunderstood the purpose. I was expecting the gadget to be resized to match the required size, eg to match #PB_Gadget_RequiredSize.
How can I resize the gadget myself? It doesn't seem to have a SetWidth or Resize function (similarly for other modules).
Thorsten1867
Addict
Posts: 1366 Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany
Post
by Thorsten1867 » Fri Dec 27, 2019 7:26 pm
ozzie wrote: I misunderstood the purpose. I was expecting the gadget to be resized to match the required size, eg to match #PB_Gadget_RequiredSize.
How can I resize the gadget myself? It doesn't seem to have a SetWidth or Resize function (similarly for other modules).
ozzie
Enthusiast
Posts: 429 Joined: Sun Apr 06, 2008 12:54 pm
Location: Brisbane, Qld, Australia
Contact:
Post
by ozzie » Fri Dec 27, 2019 11:49 pm
Thanks. I didn't realise these native PB functions would work on the modules, but on checking this I see you use BindGadgetEvent() calls to catch and process these native functions. Brilliant!
Thorsten1867
Addict
Posts: 1366 Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany
Post
by Thorsten1867 » Sat Dec 28, 2019 11:14 am
Update: TextEx::AdjustSize()
davido
Addict
Posts: 1890 Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK
Post
by davido » Mon Feb 24, 2020 9:34 pm
@Thorsten1867 ,
Module TextEx
#Version = 19122900
#ModuleEx = 19112102
I have been using TextEx on my MacBook and have discovered a minor problem with your example:
The box with rounded corners appears to have rectangular box beneath it.
Also I have a question:
Is there some way making the text wrap if it is longer than the box, when #Multiline is specified?
DE AA EB
Thorsten1867
Addict
Posts: 1366 Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany
Post
by Thorsten1867 » Tue Feb 25, 2020 11:00 am
Added: #GadgetColor for SetColor()
The box with rounded corners appears to have rectangular box beneath it.
This will delete the content of the CanvasGadget (= background color), if you have changed the background color, you can adjust it with #GadgetColor.
Thorsten1867
Addict
Posts: 1366 Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany
Post
by Thorsten1867 » Tue Feb 25, 2020 11:47 am
davido wrote: Is there some way making the text wrap if it is longer than the box?
Update: #WordWrap added