And now for something completely different: How does one make the LBNCA_FGPen tag to work??
I have retrieved 3 different pens with IGraphics->ObtainBestPain, the values returned seem to be sane, so why is my text still all black?
Thanks Gazelle :). Now I have this marvelous red warning in my niffy little console window, yay!
Question now is: How could I ever have known this if you hadn't told me...??
LBNCA_FGPen (int16)
LBNCA_BGPen (int16)
The pens to be used for rendering the text or integer in this
column. Requires that the LBFLG_CUSTOMPENS flag in LBNA_Flags
be specified otherwise the default system pens will be used.
Now another strange problem: My lists content is larger than can be shown inside the listbrowser at one time, and I would expect the scrollbars to become usable. But they don't. I think they used to do that earlier (that is when I started developing db101), so maybe something has changed? This is a common problem for all the tonnes of listbrowsers I am using in the app. Am I being totally stupid here??
EDIT: Problem solved, with help from previous posts in this thread. Apparently one needs to remove the node list from the listbrowser with SetAttrs(lb, LISTBROWSER_Labels, ~0, TAG_END); and then add it back after modification with SetGadgetAttrs. This is cryptic, though. Why doesn't it work to use RemoveGadget and then AddGadget afterwards? Also, I am pretty sure, that earlier it worked just calling RefreshGadgets after adding nodes to the list. Why has this changed?
You are not allowed to change the list if it is attached to the list browser. For changing the nodelist you should either use the methods of the list browser (LBM_ADDNODE, ...) or detach the list, make your changes and attach it again.
I apologize if these are dumb questions, but I looked in the autodocs and can't see the answer.
1) Is there a way to change the behavior of a listbrowser element (field) so that when a user clicks somewhere else WITHOUT hitting enter their data is not lost? Currently, if you do not press ENTER explicitly after modifying any listbrowser field, you lose the data you just typed in. That's really frustrating....there must be a better way?
2) Is there a way to make it so that you can move from field to field in a listbrowser using the TAB key? Suppose I have 4 fields per line, such as Name, Number, Date, Phone Number, and I am currently editing the Name field. I would like to press the TAB key to save the data I am currently editing and also move me to the right one column (into the Number field in this example.) Is such a thing possible? If I am in the Phone Number field, I would like it to move me to the Name field (wrap around).
3) Is there a way to make it so that you can single click on a listbrowser field to begin editing it instead of having to select it (single click) and THEN double click on it to edit?
I have somewhat finished my Amisafe program, incorporated the encoding and decoding algorithms for the data, and am trying to improve the interface handling. It is VERY awkward having to always hit ENTER and use effectively triple mouse clicks to edit fields in my listbrowsers. If there are solutions to any or all of the above questions, that would be wonderful!
@salass00
Okay, I'll see about implementing this correctly using SetPageGadgetAttrs().
My latest updated code is now available here: http://www.os4coding.net/source/162
Thanks for all your help!
@salass00
You never stop learning :-) I didn't do programming at school; surprisingly, I studied literature.
AmigaOne X5000-020 / 2GB RAM / Sapphire Pulse Radeon RX 560 / AmigaOS 4.1 Final Edition Update 2
And now for something completely different: How does one make the LBNCA_FGPen tag to work??
I have retrieved 3 different pens with IGraphics->ObtainBestPain, the values returned seem to be sane, so why is my text still all black?
Here's ma code for reference:
You have to specify the LBFLG_CUSTOMPENS flag in LBNA_Flags for the node.
Thanks Gazelle :). Now I have this marvelous red warning in my niffy little console window, yay!
Question now is: How could I ever have known this if you hadn't told me...??
From the AutoDocs of listbrowser_gc.doc:
Ah I found it, ok. I was looking at AllocListBrowserNode and didn't see anything there. Thanks for the pointer!
Now another strange problem: My lists content is larger than can be shown inside the listbrowser at one time, and I would expect the scrollbars to become usable. But they don't. I think they used to do that earlier (that is when I started developing db101), so maybe something has changed? This is a common problem for all the tonnes of listbrowsers I am using in the app. Am I being totally stupid here??
EDIT: Problem solved, with help from previous posts in this thread. Apparently one needs to remove the node list from the listbrowser with SetAttrs(lb, LISTBROWSER_Labels, ~0, TAG_END); and then add it back after modification with SetGadgetAttrs. This is cryptic, though. Why doesn't it work to use RemoveGadget and then AddGadget afterwards? Also, I am pretty sure, that earlier it worked just calling RefreshGadgets after adding nodes to the list. Why has this changed?
You are not allowed to change the list if it is attached to the list browser. For changing the nodelist you should either use the methods of the list browser (LBM_ADDNODE, ...) or detach the list, make your changes and attach it again.
Well, in any case it works now, so thank you for the help! :)
Some more questions about Reaction listbrowsers.
I apologize if these are dumb questions, but I looked in the autodocs and can't see the answer.
1) Is there a way to change the behavior of a listbrowser element (field) so that when a user clicks somewhere else WITHOUT hitting enter their data is not lost? Currently, if you do not press ENTER explicitly after modifying any listbrowser field, you lose the data you just typed in. That's really frustrating....there must be a better way?
2) Is there a way to make it so that you can move from field to field in a listbrowser using the TAB key? Suppose I have 4 fields per line, such as Name, Number, Date, Phone Number, and I am currently editing the Name field. I would like to press the TAB key to save the data I am currently editing and also move me to the right one column (into the Number field in this example.) Is such a thing possible? If I am in the Phone Number field, I would like it to move me to the Name field (wrap around).
3) Is there a way to make it so that you can single click on a listbrowser field to begin editing it instead of having to select it (single click) and THEN double click on it to edit?
I have somewhat finished my Amisafe program, incorporated the encoding and decoding algorithms for the data, and am trying to improve the interface handling. It is VERY awkward having to always hit ENTER and use effectively triple mouse clicks to edit fields in my listbrowsers. If there are solutions to any or all of the above questions, that would be wonderful!
Thanks!
Pages