Page 1 of 1

ReAction ListBrowser gadget (solved)

Posted: Fri Mar 12, 2021 1:50 pm
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

Re: ReAction ListBrowser gadget

Posted: Fri Mar 12, 2021 5:44 pm
by NinjaCyborg
Maybe hide those ones from the list?

Re: ReAction ListBrowser gadget

Posted: Sun Aug 15, 2021 3:15 pm
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.

Re: ReAction ListBrowser gadget

Posted: Mon Aug 16, 2021 12:41 am
by Rigo
Isn't LBNA_ReadOnly already a usable tag?

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

Simon

Re: ReAction ListBrowser gadget

Posted: Mon Aug 16, 2021 7:12 pm
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

Re: ReAction ListBrowser gadget

Posted: Mon Aug 16, 2021 10:07 pm
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

Re: ReAction ListBrowser gadget

Posted: Tue Aug 31, 2021 9:20 am
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

Re: ReAction ListBrowser gadget

Posted: Sat Sep 04, 2021 6:47 am
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