Requester with (scrolling) list to chose from

AmigaOS users can make feature requests in this forum.
Post Reply
JosDuchIt
Posts: 291
Joined: Sun Jun 26, 2011 5:47 pm
Contact:

Requester with (scrolling) list to chose from

Post by JosDuchIt »

Often i want to be able to chose between a large list of alternatives (filepaths, options) , Requestchoice rapidly becomes an ugly looking thing.

Here is how it can be done now:
- Creating small files in some directory with the given alternatives as name
- (multi)select the alternatives with a filerequester
The small files may contain additional info . eg as in Appdir: the filepaths for files (not only tools) identified by their name only
Of course the unneeded gadgets (Parent, Volume, Textin for path & file) may confuse the user, and generate errors

It would be much nicer to have a generic CLI command" (and easy programming of such a requester)
>RequestFromList listtobeshown Title choicebuttons"
with possibility to multiselect in the listview and have some alternative actions to propose (eg view, edit, delete)
User avatar
thomasrapp
Posts: 310
Joined: Sat Jun 18, 2011 11:22 pm

Re: Requester with (scrolling) list to chose from

Post by thomasrapp »

See attachment.
Attachments
RequestList.lha
(5.26 KiB) Downloaded 454 times
JosDuchIt
Posts: 291
Joined: Sun Jun 26, 2011 5:47 pm
Contact:

Re: Requester with (scrolling) list to chose from

Post by JosDuchIt »

@thomasrapp

splendid!

Thanks so much
JosDuchIt
Posts: 291
Joined: Sun Jun 26, 2011 5:47 pm
Contact:

Re: Requester with (scrolling) list to chose from

Post by JosDuchIt »

@ThomasRapp

Trying to make some variations in the code of RequestList?c

What gcc options should i use to compile ?
gcc RequestList.c -lauto -N -o ram:RequestList still shows a lot of warnings & undefined references.
User avatar
LyleHaze
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 525
Joined: Sat Jun 18, 2011 4:06 pm
Location: North Florida, near the Big Bend

Re: Requester with (scrolling) list to chose from

Post by LyleHaze »

You might add
#define __USE_INLINE__
At the beginning of System Includes.

Then add "Intuition" to the
BASEDEF, OPENLIB, and CLOSELIB groups, or use libauto

AllocVec() needs to be updated to AllocVecTags()
// if (list = AllocVec (sizeof(struct List), MEMF_CLEAR))
if ((list = AllocVecTags (sizeof(struct List), AVT_ClearWithValue, 0, TAG_END)))

Most of the rest are just warnings about using double paren around evaluating assignments,
JosDuchIt
Posts: 291
Joined: Sun Jun 26, 2011 5:47 pm
Contact:

Re: Requester with (scrolling) list to chose from

Post by JosDuchIt »

@Lylehaze

thanks
User avatar
LyleHaze
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 525
Joined: Sat Jun 18, 2011 4:06 pm
Location: North Florida, near the Big Bend

Re: Requester with (scrolling) list to chose from

Post by LyleHaze »

JosDuchIt wrote:@Lylehaze

thanks
Happy to help.
When it comes to compiler errors I have WAY too much experience, and that's not a particularly good thing. :?

Here's a cute trick that will get you no respect at all.. I do NOT use this in my normal projects, but it
can be really handy when you put all the code into one ?#?.c file, for an example like this one..

;/* RequestList.c - Execute me to compile me with GCC
gcc RequestList.c -lauto -N -o ram:RequestList
quit ;
*/

Normal projects are much better off with a real makefile, which gives more control over errors, warnings, optimization, a debug executable etc..
But if you paste this at the VERY TOP of RequestList.c, then you can compile it without a makefile, just by typing
execute RequestList.c
into a shell.

Back to learning about programming errors for me. :)
JosDuchIt
Posts: 291
Joined: Sun Jun 26, 2011 5:47 pm
Contact:

Re: Requester with (scrolling) list to chose from

Post by JosDuchIt »

@Lylehaze, that's a cool trick

I have been studying Reaction to enhance the code provided by Thomas.


I want to add some buttons such as Select ALL select NONe (which i think are easier) and INVERSE selection.
I was expecting the latter could be handled in the same way, so this is maybe a new "Feature request"

The way i figured out to do it with present ListBrowser possibilities (inspired by SDK's Listbrowserexample.c)
is to create a numbered list (string column and linenumbercolumn.)
I add corresponding arrays that are directly accessible mapping the list which are created in the make_listbrowserlist function
edit: Found out where the freeze came from & am progressing.
Edit2:
Salass00 gave me the simple solution i looked for in the OS4 coding site.. No need for a new feature request i guess
Belxjander
Posts: 314
Joined: Mon May 14, 2012 10:26 pm
Location: 日本千葉県松戸市 / Matsudo City, Chiba, Japan
Contact:

Re: Requester with (scrolling) list to chose from

Post by Belxjander »

@LyleHaze: I recall the same trick in the Lattice (later SAS) C compiler and C= examples for Kickstart 2 and later...

never relied on it myself... too many things to go wrong with possible pebkac after distribution
JosDuchIt
Posts: 291
Joined: Sun Jun 26, 2011 5:47 pm
Contact:

Re: Requester with (scrolling) list to chose from

Post by JosDuchIt »

I uploaded ReqList archive here
http://users.online.be/AD/ReqList.lha
Thanks for all help.
Joerg van de Loo , not me, did most of the work to finish it in its present state,.
He showed me a much more colored view than the one the ReqList.aos68k or ReqList.aosppc do provide
Image
(in my gcc AOS4 compile the background even is not coloured (standard grey)

i guess he tried to achieve the same under aos4


He did run into trouble but tried to solve it using
http://users.online.be/AD/Gradient.lha
He asked me:
By the way, does OS4 contain a preferences panel where the user can
deactivate window BackFill -- or set a general one?
Reply:
Only thing i see is the GUI preferences
i don't see any deactivation button
The tabs Controls, Effects Options??
Having done the tests he asked for he replied
As the BackFill hook is in both versions established, I think that the
issue is related to the OS4 GUI preferences. Under m68k it works, under
PPC it is ignored.
I am off here. :-{
Comments or suggestions?
Post Reply