How does the MessageView control work?
Posted
#1
(In Topic #572)
Regular

Its not a problem getting it to display a single message, but the help file says;
"Messages are displayed successively, and the message panel is closed only when there is no message to read anymore."
This makes me think it should have a string array associated with it, but if you just write code like this;
…it will display the first message along with a "next" button but not show subsequent messages.
Using the Object Inspector does not show were these messages are held within MessageView.
Posted
Enthusiast

Posted
Guru

PJBlack said
didn't get it to work
Nor me, came up with a similar solution.
Posted
Guru

It works as expected if you also give the icon argument.
possibly a bug worth reporting?
the control passes the optional icon argument like this ..
that looks okay to me.
the line that fails is in DoOpen()
the Warning icon shows if no icon argument is given so where it's going wrong i have no idea :-\
Posted
Regular

BruceSteers said
i had a play.
It works as expected if you also give the icon argument…
Thanks Bruce, I came to the same conclusion about half an hour ago.
I'm still trying to work out where the text is stacked, thought it would be in a Children object.
Posted
Guru

stevedee said
BruceSteers said
i had a play.
It works as expected if you also give the icon argument…
Thanks Bruce, I came to the same conclusion about half an hour ago.
I'm still trying to work out where the text is stacked, thought it would be in a Children object.
nah looking at the code it's in a private string list..
comp/src/gb.form/.src/Message/MessageView.class · master · Gambas / gambas · GitLab
BruceS
Posted
Regular

BruceSteers said
…possibly a bug worth reporting?…
The help information is correct, in that it does NOT indicate that the image icon is optional…so my stupidity created the problem. Just surprised that the IDE did not protect me from myself by raising a syntax error.
Posted
Guru

stevedee said
BruceSteers said
…possibly a bug worth reporting?…
The help information is correct, in that it does NOT indicate that the image icon is optional…so my stupidity created the problem. Just surprised that the IDE did not protect me from myself by raising a syntax error.
No it's a bug.
I just submitted a fix for Ben.
Fix MessageView.class (acde2619) · Commits · Bruce Steers / gambas · GitLab
checking if an icon argument had been passed and setting the default happened "after" this bit of code…
so in that instance the default icon had not been set.
i moved the default icon setting bit to up before that code and changed Icon to $hIcon.
if Ben thinks the fix is good it will soon be all better
Bruce.
Posted
Regular

BruceSteers said
…No it's a bug.
I just submitted a fix for Ben.
Fix MessageView.class (acde2619) · Commits · Bruce Steers / gambas · GitLab
Bruce you are a star!
Many thanks for taking the time to look at this.
Posted
Guru

stevedee said
BruceSteers said
…No it's a bug.
I just submitted a fix for Ben.
Fix MessageView.class (acde2619) · Commits · Bruce Steers / gambas · GitLab
Bruce you are a star!
Many thanks for taking the time to look at this.
Happy to help <EMOJI seq="1f60e" tseq="1f60e">😎</EMOJI>
The commit has been merged already so its all fixed now <EMOJI seq="1f60a" tseq="1f60a">😊</EMOJI>
I'm happy I've helped you and saved Ben a little time. All is good <EMOJI seq="1f642" tseq="1f642">🙂</EMOJI>
Posted
Guru

BruceSteers said
stevedee said
BruceSteers said
i had a play.
It works as expected if you also give the icon argument…
Thanks Bruce, I came to the same conclusion about half an hour ago.
I'm still trying to work out where the text is stacked, thought it would be in a Children object.
nah looking at the code it's in a private string list..
comp/src/gb.form/.src/Message/MessageView.class · master · Gambas / gambas · GitLab
BruceS
You could probably import the MessageView.class file into your app, give it a different name so not to conflict and make the message list $aText[] public.
Or if you think it a valuable feature I could submit another change to Ben that gave access to the message list.
Wouldn't be much code.
Wishing well
Bruce
Posted
Regular

BruceSteers said
…if you think it a valuable feature I could submit another change to Ben that gave access to the message list….
Hi Bruce,
it was only because I screwed up by NOT using the help example that I started down the road of looking at the MessageView using the Object Inspector. Not recognising the real problem, I was simply wondering how it was structured.
It seems to me that it works just fine by passing each message using MessageView.Open().
Initially, I thought this looked like an interesting control. But at the moment I can't think of a single situation were I would want to use it.
For most of my programs I've used the simple Message box where I needed a user to respond, an 'old school' status label where I wanted to keep the user informed, or a ListBox where I thought it useful to have a simple viewable on-screen log of recent events or other issues.
The idea of stacking up a number of messages in a MessageView that a user has to deal with, no longer seems that useful. But I would be interested if anyone can think of a good use for it.
Thanks once again for your help.
Up until now there has been a bit of a gap between us users on this forum, and the Gambas devs.
You are a great asset for GambasOne as you bridge that gap by looking into the Gambas code, shaking a few trees and taking the time to explain how things work (…or don't work). I just hope you don't get bored with us, and move on!
Stay safe over there on the Diamond Isle.
Steve
Posted
Enthusiast

stevedee said
You are a great asset for GambasOne as you bridge that gap by looking into the Gambas code, shaking a few trees and taking the time to explain how things work (…or don't work). I just hope you don't get bored with us, and move on!
Stay safe over there on the Diamond Isle.
Steve
from here also a BIG thank you
Posted
Guru

stevedee said
BruceSteers said
…if you think it a valuable feature I could submit another change to Ben that gave access to the message list….
Hi Bruce,
it was only because I screwed up by NOT using the help example that I started down the road of looking at the MessageView using the Object Inspector. Not recognising the real problem, I was simply wondering how it was structured.
It seems to me that it works just fine by passing each message using MessageView.Open().
Initially, I thought this looked like an interesting control. But at the moment I can't think of a single situation were I would want to use it.
For most of my programs I've used the simple Message box where I needed a user to respond, an 'old school' status label where I wanted to keep the user informed, or a ListBox where I thought it useful to have a simple viewable on-screen log of recent events or other issues.
The idea of stacking up a number of messages in a MessageView that a user has to deal with, no longer seems that useful. But I would be interested if anyone can think of a good use for it.
The gambas IDE uses it, a running app throws error messages to it and they appear at the top of the window. Or it used to, can't say I have seen it much recently.
I can see uses for it but i also see a use in accessing the message list.
for example something like this if there's been 50+ messages…
Code (gambas)
- bReadAll = True
I definitely see an advantage in being able to access the message count and removing unwanted messages if needed
stevedee said
Thanks once again for your help.
Up until now there has been a bit of a gap between us users on this forum, and the Gambas devs.
You are a great asset for GambasOne as you bridge that gap by looking into the Gambas code, shaking a few trees and taking the time to explain how things work (…or don't work). I just hope you don't get bored with us, and move on!
Stay safe over there on the Diamond Isle.
Steve
aaw , cheers Steve
Like i say I just love to help out.
Sometimes give the help , sometimes I get the help
Funny I was thinking the same about you when i was deliberating how i might ask Benoit about the changes to this class you wanted. I thought to mention it was requested by a chap who is also a great asset to Gambas on the GambasOne forum with his own captainbodgit web page with many gambas examples. Has been a great help to me and many others I'm sure.
So right back at ya my friend.
Stay safe and be well
Bruce
Posted
Guru

PJBlack said
stevedee said
You are a great asset for GambasOne as you bridge that gap by looking into the Gambas code, shaking a few trees and taking the time to explain how things work (…or don't work). I just hope you don't get bored with us, and move on!
Stay safe over there on the Diamond Isle.
Steve
from here also a BIG thank you
And thank you Michael
I think you are the only person who actually uses my gambas updater apps
I appreciate your bug reports/suggestions , I can't find them all myself.
Wishing well
Bruce
Posted
Enthusiast

1 guest and 0 members have just viewed this.


