Page 1 of 2
[Module] TextEx - Extended TextGadget (All OS / DPI)
Posted: Fri Mar 08, 2019 5:24 pm
by Thorsten1867
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
Re: [Module] TextEx - Extended TextGadget (All OS / DPI)
Posted: Fri Mar 08, 2019 8:01 pm
by Zebuddi123
Thank you Thorsten1867 yet another very useful addition
Zebuddi.
Re: [Module] TextEx - Extended TextGadget (All OS / DPI)
Posted: Fri Mar 08, 2019 9:23 pm
by Cyllceaux
This is cool...
Really thanks you
Re: [Module] TextEx - Extended TextGadget (All OS / DPI)
Posted: Sun Mar 10, 2019 7:08 pm
by Kwai chang caine
Works fine
Thanks for sharing

Re: [Module] TextEx - Extended TextGadget (All OS / DPI)
Posted: Tue Nov 19, 2019 10:21 am
by Cyllceaux
Now, its missing the Themes

Re: [Module] TextEx - Extended TextGadget (All OS / DPI)
Posted: Tue Nov 19, 2019 1:32 pm
by Thorsten1867
Fixed
Re: [Module] TextEx - Extended TextGadget (All OS / DPI)
Posted: Fri Dec 27, 2019 12:24 am
by ozzie
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)
Re: [Module] TextEx - Extended TextGadget (All OS / DPI)
Posted: Fri Dec 27, 2019 10:40 am
by Thorsten1867
I can't find a problem.

Re: [Module] TextEx - Extended TextGadget (All OS / DPI)
Posted: Fri Dec 27, 2019 1:37 pm
by ozzie
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).
Re: [Module] TextEx - Extended TextGadget (All OS / DPI)
Posted: Fri Dec 27, 2019 7:26 pm
by Thorsten1867
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).
Re: [Module] TextEx - Extended TextGadget (All OS / DPI)
Posted: Fri Dec 27, 2019 11:49 pm
by ozzie
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!
Re: [Module] TextEx - Extended TextGadget (All OS / DPI)
Posted: Sat Dec 28, 2019 11:14 am
by Thorsten1867
Update: TextEx::AdjustSize()
Re: [Module] TextEx - Extended TextGadget (All OS / DPI)
Posted: Mon Feb 24, 2020 9:34 pm
by davido
@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?
Re: [Module] TextEx - Extended TextGadget (All OS / DPI)
Posted: Tue Feb 25, 2020 11:00 am
by Thorsten1867
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.
Re: [Module] TextEx - Extended TextGadget (All OS / DPI)
Posted: Tue Feb 25, 2020 11:47 am
by Thorsten1867
davido wrote:Is there some way making the text wrap if it is longer than the box?
Update: #WordWrap added