ReAction ListBrowser gadget (solved)

AmigaOS users can make feature requests in this forum.
Post Reply
User avatar
OldFart
Posts: 100
Joined: Tue Jul 12, 2011 2:56 pm
Location: Groningen, Netherlands

ReAction ListBrowser gadget (solved)

Post by OldFart »

Hi,

Suggestion for a ListBrowser node's list of tags:
LBNA_ReadOnly (BOOL)
Turns a node at allocation time into a read only node.
Defaults to FALSE.

While updating my program 'TaskView', I ran into this suggestion as the upcoming version is able to change a task's priority. I would like to block certain nodes i.c. 'input.device' and qua priority higher ranked tasks from being reprioritised.

OldFart
Last edited by OldFart on Sat Sep 04, 2021 6:48 am, edited 1 time in total.
X5000, appears to be sick. Dismantled jan 1, 2024.
Dead MicroA1
A1200 in ElBox, c/w Blizzard '040 @ 50MHz + SCSI module, ZIV-board c/w (o.a.) cv64/3d + flickerdoubler + FastATA-ZIV + Lots of SCSI gear, sitting idle.
RaspBerry Pi 2B, 3B, 4B/4Gb, 4B/8Gb
OrangePi 5+ 8Gb
ACER Windows 10
NinjaCyborg
Posts: 58
Joined: Wed Oct 10, 2018 11:28 pm

Re: ReAction ListBrowser gadget

Post by NinjaCyborg »

Maybe hide those ones from the list?
User avatar
polluks
Posts: 55
Joined: Tue May 19, 2015 6:30 pm
Location: Germany
Contact:

Re: ReAction ListBrowser gadget

Post by polluks »

NinjaCyborg wrote: Fri Mar 12, 2021 5:44 pm Maybe hide those ones from the list?
Well, at least you want to show this task exists. Hiding is no alternative.
User avatar
Rigo
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 360
Joined: Mon Jan 17, 2011 9:42 pm

Re: ReAction ListBrowser gadget

Post by Rigo »

Isn't LBNA_ReadOnly already a usable tag?

I'm sure it's been there for yonks...

Simon
User avatar
OldFart
Posts: 100
Joined: Tue Jul 12, 2011 2:56 pm
Location: Groningen, Netherlands

Re: ReAction ListBrowser gadget

Post by OldFart »

@Rigo

Well, when looking at the autodocs:

Code: Select all

listbrowser.gadget/GetListBrowserNodeAttrsA

    NAME
	GetListBrowserNodeAttrsA -- Get ListBrowser node attributes.

    SYNOPSIS
	VOID GetListBrowserNodeAttrsA(struct Node *node, struct TagItem *tags);

	VOID GetListBrowserNodeAttrs(struct Node *node, Tag tag1, ...);

    FUNCTION
	The ListBrowser uses a private node structure and all attributes
	are hidden and must therefore be accessed with this function.

	TAGS
	Most of the tags listed in SetListBrowserNodeAttrsA() are supported
	including some that are only gettable.

	LBNA_Selected (BOOL)
	LBNA_Flags (uint32)
	LBNA_Generation (int16)
	LBNA_CheckBox (BOOL) (V41)
	LBNA_Checked (BOOL) (V41)
	LBNA_Priority (int8)
	LBNA_UserData (APTR)

	LBNA_NumColumns (uint8)
	    The number of columns this Node has.

	LBNA_Column (int16)
	    A column (starting from 0) that the column attribute tags
	    below it affect. All column attribute tags have the prefix
	    LBNCA_#? to distinguish them from node attributes. You
	    typically specify the column to get attributes from and
	    then the attributes for that column. For example,
	      uint32 text_ptr = 0;
	      uint32 fill_pen = 0;
	      ...
	      LBNA_Column, 2,
	        LBNCA_Text, &text_ptr,
	        LBNCA_FillPen, &fill_pen,
	      ...

	LBNCA_HorizJustify (int16)
	LBNCA_Text (STRPTR)
	LBNCA_Editable (BOOL)
	LBNCA_MaxChars (int16)
	LBNCA_Integer (int32 *)
	LBNCA_FGPen (int16)
	LBNCA_BGPen (int16)
	LBNCA_FillPen (int16) (V51)
	LBNCA_SoftStyle (uint8) (V52.14)
	LBNCA_Image (struct Image *)
	LBNCA_SelImage (struct Image *)
	LBNCA_RenderHook (struct Hook *) (V41)
	LBNCA_HookHeight (int16) (V41)

    INPUTS
	node - ListBrowser node to get the information on.
	       Safe to call with a NULL pointer.

	tags - A tag list of attributes to get. Each ti_Tag is the
	       attribute to get and ti_Data is a pointer to a location
	       to copy the result into. Any exceptions to this rule
	       are documented in the tag descriptions above.
	       Safe to call with a NULL pointer.

    NOTES
	Do not forget that the ti_Data pointer must point to a uint32
	sized storage location no matter what type you are getting.

    SEE ALSO
	SetListBrowserNodeAttrsA()
I didn't find it there.

And also, when taking a look at listbrowser.h:

Code: Select all

/* ListBrowser Node attributes. */
#define LBNA_Dummy                (TAG_USER+0x5003500)

#define LBNA_Selected             (LBNA_Dummy+1)
    /* (BOOL) If the node is to be selected.  Defaults to FALSE. */

#define LBNA_Flags                (LBNA_Dummy+2)
    /* (uint32) Flags for the node.  Defaults to 0. */

#define LBNA_UserData             (LBNA_Dummy+3)
    /* (uint32) User data.  Defaults to NULL. */

#define LBNA_Column               (LBNA_Dummy+4)
    /* (int16) Column in the node that the attributes below affect.
       Defaults to 0. */

#define LBNCA_Text                (LBNA_Dummy+5)
    /* (CONST_STRPTR) Text to display in the column. Defaults to NULL. */

#define LBNCA_Integer             (LBNA_Dummy+6)
    /* (int32 *) Pointer to an integer to display in the column.
       Defaults to NULL. */

#define LBNCA_FGPen               (LBNA_Dummy+7)
    /* (int16) Column foreground pen. */

#define LBNCA_BGPen               (LBNA_Dummy+8)
    /* (int16) Column background pen. */

#define LBNCA_Image               (LBNA_Dummy+9)
    /* (struct Image *) Image to display in the column.  Defaults to NULL. */

#define LBNCA_SelImage            (LBNA_Dummy+10)
    /* (struct Image *) Image to display in column when selected.
       Defaults to NULL. */

#define LBNCA_HorizJustify        (LBNA_Dummy+11)
#define LBNCA_Justification       LBNCA_HorizJustify
    /* (uint32) Column justification.  Defaults to LCJ_LEFT. */

#define LBNA_Generation           (LBNA_Dummy+12)
    /* (uint32) Node generation (1..N).  Defaults to 0 (no generation). */

#define LBNCA_Editable            (LBNA_Dummy+13)
    /* (BOOL) If this column is editable.  Requires LBNCA_CopyText.
       Defaults to FALSE. */

#define LBNCA_MaxChars            (LBNA_Dummy+14)
    /* (int16) Maximum characters in an editable entry.  Required when using
       LBNCA_Editable. */

#define LBNCA_CopyText            (LBNA_Dummy+15)
    /* (BOOL) Copy the LBNCA_Text contents to an internal buffer. */

#define LBNA_CheckBox             (LBNA_Dummy+16)
    /* (BOOL) This is a checkbox node. */

#define LBNA_Checked              (LBNA_Dummy+17)
    /* (BOOL) If true, this checkbox node is checked. */

#define LBNA_NodeSize             (LBNA_Dummy+18)
    /* (uint32) Size of custom node (and optimize mempool puddles). */

#define LBNCA_EditTags            (LBNA_Dummy+19)
    /* (struct TagItem *) Tag list for string gadget used to edit column. */

#define LBNCA_RenderHook          (LBNA_Dummy+20)
    /* (struct Hook *) Effectively the same as GadTools listview hook. */

#define LBNCA_HookHeight          (LBNA_Dummy+22)
    /* (int16) Height in pixels of the hook function rendering. */

#define LBNA_MemPool              (LBNA_Dummy+23)
    /* (APTR) Exec memory pool to use for this node's allocations. */

#define LBNA_NumColumns           (LBNA_Dummy+24)
    /* (int16) For GetListBrowserNodeAttrs() only! */

#define LBNA_Priority             (LBNA_Dummy+25)
    /* (int8) Sets the Exec node->ln_Pri. */

#define LBNCA_CopyInteger         (LBNA_Dummy+26)
    /* (BOOL) AllocListBrowserNodeAttrs() or SetListBrowserNodeAttrs()
       only! */

#define LBNCA_WordWrap            (LBNA_Dummy+27)
    /* (BOOL) Word wrap this node's LBNCA_Text data. */

#define LBNCA_VertJustify         (LBNA_Dummy+28)
    /* (uint32) Row justification.  Defaults to LRJ_BOTTOM. */

#define LBNCA_FillPen             (LBNA_Dummy+29)
    /* (int16) Column fill pen. (V51) */


/* ListBrowser ColumnInfo attributes. */
#define LBCIA_MemPool             (LBNA_Dummy+50)
    /* (APTR) MemPool for ColumnInfo (V45) */

#define LBCIA_Column              (LBNA_Dummy+51)
    /* (int16) Column number (0..N) (V45) */

#define LBCIA_Title               (LBNA_Dummy+52)
    /* (CONST_STRPTR) Column text label. (V45) */

#define LBCIA_Weight              (LBNA_Dummy+53)
    /* (int16) Column weight (implies ~CIF_FIXED) (V45) */

#define LBCIA_Width               (LBNA_Dummy+54)
    /* (int16) Column width in pixels (implies CIF_FIXED) (V45) */

#define LBCIA_Flags               (LBNA_Dummy+55)
    /* (uint32) Column flags (defined below) (V45) */

#define LBNCA_SoftStyle           (LBNA_Dummy+56)
    /* (uint8) Text font style (V52.14) */

#define LBCIA_UserData            (LBNA_Dummy+57)
    /* (APTR) User data (V53.16) */

#define LBCIA_AutoSort            (LBNA_Dummy+58)
    /* (BOOL) Automatically sort this column (V53.17) */

#define LBCIA_SortDirection       (LBNA_Dummy+59)
    /* (uint32) Direction of the sort (V53.17) */

#define LBCIA_CompareHook         (LBNA_Dummy+60)
    /* (struct Hook *) Sort comparison hook (V53.17) */

#define LBCIA_Sortable            (LBNA_Dummy+61)
    /* (BOOL) Column is sortable (V53.17) */

#define LBCIA_DraggableSeparator  (LBNA_Dummy+62)
    /* (BOOL) Column separator is draggable (V53.17) */

#define LBCIA_Separator           (LBNA_Dummy+63)
    /* (BOOL) Column has separators (V53.17) */

#define LBCIA_SortArrow           (LBNA_Dummy+64)
    /* (BOOL) Column has a sort arrow (V53.17) */

#define LBCIA_CopyTitle           (LBNA_Dummy+65)
    /* (BOOL) Copy the LBCIA_Title contents to an internal buffer (V53.62) */

I could not find an entry.

And if it indeed *IS* there, since "yonks", as you say, then it presence MIGHT be broadcasted to either file.

Thanks for pointing out the availabillity. When the machine is taken out of storage and fired up again, which will probably not be in the near future, then I'll try it out.

OldFart
X5000, appears to be sick. Dismantled jan 1, 2024.
Dead MicroA1
A1200 in ElBox, c/w Blizzard '040 @ 50MHz + SCSI module, ZIV-board c/w (o.a.) cv64/3d + flickerdoubler + FastATA-ZIV + Lots of SCSI gear, sitting idle.
RaspBerry Pi 2B, 3B, 4B/4Gb, 4B/8Gb
OrangePi 5+ 8Gb
ACER Windows 10
User avatar
nbache
Beta Tester
Beta Tester
Posts: 1714
Joined: Mon Dec 20, 2010 7:25 pm
Location: Copenhagen, Denmark
Contact:

Re: ReAction ListBrowser gadget

Post by nbache »

Wouldn't it just be the one column containing the priority you'd want to make editable or protected?

Maybe what you need is the LBNCA_Editable tag (preceded by an LBNA_Column tag)?

(Disclaimer: This is just from reading the autodoc/include files, I have close to zero practical experiance in actually programming with ReAction.)

Best regards,

Niels
User avatar
javierdlr
Beta Tester
Beta Tester
Posts: 389
Joined: Sun Jun 19, 2011 10:13 pm
Location: Donostia (GUIPUZCOA) - Spain
Contact:

Re: ReAction ListBrowser gadget

Post by javierdlr »

@OldFart

Maybe is what you're looking for:

LBNA_Flags (uint32)
Flags for this node. The following flags are currently defined:
LBFLG_READONLY - node is read-only
User avatar
OldFart
Posts: 100
Joined: Tue Jul 12, 2011 2:56 pm
Location: Groningen, Netherlands

Re: ReAction ListBrowser gadget

Post by OldFart »

@javier

Yep, that probably does it. I must have overlooked that one.
From the headerfile: include_h/gadgets/listbrowser.h

Code: Select all

/* Flags for the LBNA_Flags node attribute. */
#define LBFLG_READONLY      1
#define LBFLG_CUSTOMPENS    2
#define LBFLG_HASCHILDREN   4
#define LBFLG_SHOWCHILDREN  8
#define LBFLG_HIDDEN       16

Thank you all for contributing. Within a couple of months, when my x5000 is retrieved from storage again (fingers crossed), I'll try this one out.

OldFart
X5000, appears to be sick. Dismantled jan 1, 2024.
Dead MicroA1
A1200 in ElBox, c/w Blizzard '040 @ 50MHz + SCSI module, ZIV-board c/w (o.a.) cv64/3d + flickerdoubler + FastATA-ZIV + Lots of SCSI gear, sitting idle.
RaspBerry Pi 2B, 3B, 4B/4Gb, 4B/8Gb
OrangePi 5+ 8Gb
ACER Windows 10
Post Reply