gadget limitations - eg text gadget

Just starting out? Need help? Post your questions and find answers here.
eck49
Enthusiast
Enthusiast
Posts: 153
Joined: Sat Nov 14, 2020 10:08 pm
Location: England

gadget limitations - eg text gadget

Post by eck49 »

I've just hit a limit of 2^15 pixels for the height of a textgadget.

Two questions:
*1* I'd like to write (potentially) a few tens of thousands of short lines of text to a text gadget - where the user may scroll up and down the text but cannot change it. Given the height limit of a textgadget, is there a reasonable alternative?

*2* Are the limits Purebasic sets on the sizes of gadgets (whether height, width, numbers of rows, whatever) documented anywhere? The online reference manual seems a bit patchy on this, unless I am not looking in the right place!
Ubuntu 22.04 64-bit
Purebasic 6.00 (as of 5 Sep 2022)
(native tongue: English)
infratec
Always Here
Always Here
Posts: 7604
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: gadget limitations - eg text gadget

Post by infratec »

Use an EditorGadget() in readonly mode.
eck49
Enthusiast
Enthusiast
Posts: 153
Joined: Sat Nov 14, 2020 10:08 pm
Location: England

Re: gadget limitations - eg text gadget

Post by eck49 »

@infratec
Thanks, I will.
Ubuntu 22.04 64-bit
Purebasic 6.00 (as of 5 Sep 2022)
(native tongue: English)
User avatar
Tenaja
Addict
Addict
Posts: 1959
Joined: Tue Nov 09, 2010 10:15 pm

Re: gadget limitations - eg text gadget

Post by Tenaja »

Another alternative, although likely Overkill, is the scintilla gadget.
User avatar
TI-994A
Addict
Addict
Posts: 2739
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

Re: gadget limitations - eg text gadget

Post by TI-994A »

Tenaja wrote:Another alternative, although likely Overkill, is the scintilla gadget.
Some working examples:

> EditorGadget() & ScintillaGadget()
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
BarryG
Addict
Addict
Posts: 4163
Joined: Thu Apr 18, 2019 8:17 am

Re: gadget limitations - eg text gadget

Post by BarryG »

eck49 wrote:I've just hit a limit of 2^15 pixels for the height of a textgadget.
That's 32768 pixels... your desktop wouldn't even support that resolution to show it. So, what do you mean?
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4953
Joined: Sun Apr 12, 2009 6:27 am

Re: gadget limitations - eg text gadget

Post by RASHAD »

You can try ListViewGadget()
But with tens of thousands you may need more than one list
Egypt my love
User avatar
spikey
Enthusiast
Enthusiast
Posts: 763
Joined: Wed Sep 22, 2010 1:17 pm
Location: United Kingdom

Re: gadget limitations - eg text gadget

Post by spikey »

eck49 wrote:I've just hit a limit of 2^15 pixels for the height of a textgadget.
This limit pops up now and again on Windows. It arises from two sources I think - API functions which date all the way back to the 16-bit versions of Windows and nobody has had a need to replace and/or compressing two signed 16-bit co-ordinate values into one 32-bit value by 'shift-or'ing one value into the high order bits of another.

For example, it constrains also the width of the header control in a ListIconGadget and the internal width of a ScrollAreaGadget. See viewtopic.php?f=13&t=74696

It seems to affect X/Y/W/H based co-ordinate parameters, for the reason that BarryG observed, and API messages where lParam is not a pointer to a structure but that may be a gross generalisation.
eck49
Enthusiast
Enthusiast
Posts: 153
Joined: Sat Nov 14, 2020 10:08 pm
Location: England

Re: gadget limitations - eg text gadget

Post by eck49 »

Thanks, one and all.
Yes, scintilla is overkill....
@BarryG. The gadget was in a scrollarea, so not trying to have it all visible at the same time. Of course the EditorGadget makes the scrollarea redundant and is way faster, although there are off-topic issues.

@spikey. Hmm. That is helpful information (including the link). But I am exclusively on Linux. Do you think the limit has been inherited from somewhere (say in the pre-Cambrian slime pre-Windows!) or is it something kept to retain cross-platform compatibility?
Ubuntu 22.04 64-bit
Purebasic 6.00 (as of 5 Sep 2022)
(native tongue: English)
User avatar
spikey
Enthusiast
Enthusiast
Posts: 763
Joined: Wed Sep 22, 2010 1:17 pm
Location: United Kingdom

Re: gadget limitations - eg text gadget

Post by spikey »

eck49 wrote:But I am exclusively on Linux
:oops: I really should have spotted that - sorry! I'm clearly having an off day!
eck49 wrote:Do you think the limit has been inherited from somewhere (say in the pre-Cambrian slime pre-Windows!) or is it something kept to retain cross-platform compatibility?
The true answer is neither because it's a case of parallel development of different systems not forked development of a common ancestor.

The bit about desktop size still applies though. Nobody realistically has a desktop that big so API functions most likely won't allow for this because the memory requirements and function speed will be adversely affected. Everyone is looking to make graphics performance better not worse...
eck49
Enthusiast
Enthusiast
Posts: 153
Joined: Sat Nov 14, 2020 10:08 pm
Location: England

Re: gadget limitations - eg text gadget

Post by eck49 »

@spikey. No problem, most folk on here are Windows users even if they use other machines as well. And I do have a Windows machine, an old Windows95 one!

Making performance better is good, but for some problems this may not mean faster but widening the range of what can be done. In an ideal world, best to give the user/developer the choice.
Ubuntu 22.04 64-bit
Purebasic 6.00 (as of 5 Sep 2022)
(native tongue: English)
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: gadget limitations - eg text gadget

Post by IdeasVacuum »

The best way is to produce an HTML file (no internet required). Easy to create and excellent presentation is easy too. Plus HTML is lightweight, good performance is standard.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
mrv2k
User
User
Posts: 53
Joined: Fri Jan 20, 2012 3:40 pm
Location: SE England
Contact:

Re: gadget limitations - eg text gadget

Post by mrv2k »

I use a virtual listicon gadget in a Mame frontend I wrote, which can display 43000 text lines pretty much instantly. Might be worth a search on the forums.
eck49
Enthusiast
Enthusiast
Posts: 153
Joined: Sat Nov 14, 2020 10:08 pm
Location: England

Re: gadget limitations - eg text gadget

Post by eck49 »

@mrv2k Would you spell out for me what you mean by a 'virtual' gadget? And what is Mame?
Ubuntu 22.04 64-bit
Purebasic 6.00 (as of 5 Sep 2022)
(native tongue: English)
Post Reply