How does the MessageView control work?

Post your Gambas programming questions here.
User avatar
BruceSteers
Posts: 390
Joined: Thursday 23rd July 2020 5:20pm

Re: How does the MessageView control work?

Post by BruceSteers » Wednesday 03rd February 2021 9:24pm

BruceSteers wrote:
Wednesday 03rd February 2021 6:39pm
stevedee wrote:
Wednesday 03rd February 2021 6:31pm
BruceSteers wrote:
Wednesday 03rd February 2021 6:23pm
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..

Private $aText As New String[]
Private $aIcon As New Picture[]

https://gitlab.com/gambas/gambas/-/blob ... View.class

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
Wishing well
Bruce

If at first you don't succeed , try it differently.

User avatar
stevedee
Posts: 378
Joined: Monday 20th March 2017 6:06pm

Re: How does the MessageView control work?

Post by stevedee » Thursday 04th February 2021 6:35am

BruceSteers wrote:
Wednesday 03rd February 2021 9:24pm
...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

User avatar
PJBlack
Posts: 103
Joined: Tuesday 09th June 2020 10:26pm
Location: Florstadt, Hessen, Germany

Re: How does the MessageView control work?

Post by PJBlack » Thursday 04th February 2021 8:40am

stevedee wrote:
Thursday 04th February 2021 6:35am
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 :)

User avatar
BruceSteers
Posts: 390
Joined: Thursday 23rd July 2020 5:20pm

Re: How does the MessageView control work?

Post by BruceSteers » Thursday 04th February 2021 3:04pm

stevedee wrote:
Thursday 04th February 2021 6:35am
BruceSteers wrote:
Wednesday 03rd February 2021 9:24pm
...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...
If MessageView1.Messages.Count > 50 And If Not bReadAll Then
iRes = Message.Warning("There are 50+ messages", "Close All", "Read Vital", "Read All")

  If iRes = 1 Then 
   MessageView1.Close()
  Else If iRes = 2 Then
    For c As Integer = MessageView1.Messages.Count-1 To 0 Step -1
     If Not MessageView1.Messages[c] Begins "Vital:" Then MessageView1.Messages.Remove(c)
    Next
  Else If iRes = 3 Then
    bReadAll = True
    Return
Endif
I definitely see an advantage in being able to access the message count and removing unwanted messages if needed
stevedee wrote:
Thursday 04th February 2021 6:35am
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 :) Cest la vie

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
Wishing well
Bruce

If at first you don't succeed , try it differently.

User avatar
BruceSteers
Posts: 390
Joined: Thursday 23rd July 2020 5:20pm

Re: How does the MessageView control work?

Post by BruceSteers » Thursday 04th February 2021 3:12pm

PJBlack wrote:
Thursday 04th February 2021 8:40am
stevedee wrote:
Thursday 04th February 2021 6:35am
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 :lol:
I appreciate your bug reports/suggestions , I can't find them all myself.

Wishing well
Bruce
Wishing well
Bruce

If at first you don't succeed , try it differently.

User avatar
PJBlack
Posts: 103
Joined: Tuesday 09th June 2020 10:26pm
Location: Florstadt, Hessen, Germany

Re: How does the MessageView control work?

Post by PJBlack » Thursday 04th February 2021 5:18pm

can't believe that bruce ... everybody who deals with x.x.90 should use it

Post Reply