<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body>
<div class="moz-cite-prefix">On 14/08/2020 16:40,
<a class="moz-txt-link-abbreviated" href="mailto:user-request@lists.gambas-basic.org">user-request@lists.gambas-basic.org</a> wrote:<br>
</div>
<blockquote type="cite"
cite="mid:mailman.0.1597419603.20523.user@lists.gambas-basic.org">On
8/14/20 2:35 AM, John Rose wrote:
<br>
<blockquote type="cite" style="color: #000000;">When I run the
attached stripped-down TestApp3 app, the app enters
ComboBoxConnectChannel_Change before I select an item (possibly
due to clicking on the combobox's arrow or because the
SetAvailableConnectChannels procedure has been executed in order
to populate the combobox). This can be seen in the Console
output shown below:
<br>
<br>
Channel=Please Select Channel
<br>
</blockquote>
<br>
The ComboBox Change event is raised when the text in the combo box
is modified. This happens at line 78 of the
SetAvailableConnectChannels procedure which is called upon
Form_Open before any user interaction. So, Bruce is correct on
this.
<br>
<br>
However, I disagree that ComboBoxConnectChannel.Text will return
the string in the textbox, not the item in the combobox list that
the user has selected. While technically correct, the string in
the textbox <b class="moz-txt-star"><span class="moz-txt-tag">*</span>should<span
class="moz-txt-tag">*</span></b> have been set to the text of
the currently selected item so the result should be the same. This
is how the ComboBox behaves on my system even when using GTK3
instead of Qt5.
<br>
<br>
On a side note, it is not necessary to explicitly set the values
of the RadioButtons as you have done at lines 34 & 35 and 44
& 45 in the RadioButton_Click event handlers. Since the
RadioButtons have the same parent, they are mutually exclusive.
Clicking one will set its value to true and all others (with the
same parent) to false.
<br>
<br>
<br>
<blockquote type="cite" style="color: #000000;">Please note that
I'm using the gb.gui component as I've been told that the better
of QT and GTK+ will be selected according to the machine it's
being run on.
<br>
</blockquote>
<br>
It's not a matter of which one is better. It is a matter of which
one is available. If you intend to share your project, you should
make it compatible with systems that use either one exclusively.
Using gb.gui accomplishes that. If you will be the only one using
your project, you can use whichever component you wish.
<br>
<br>
<br>
<blockquote type="cite" style="color: #000000;">PS I find it
difficult to get the 'quoting' of previous messages correct when
I reply to someone else's post. Is this due to my using Digest
Mode (which I prefer in order to get fewer emails where I'm not
interested in the topic)?
<br>
</blockquote>
<br>
Not necessarily. I don't know what you consider to be correct
quoting. But, simply highlighting the text of a singular message
in the digest and using the Reply To function (button?) should
place the highlighted text as a quote in a new message.
<br>
</blockquote>
<p>Thanks Lee & Bruce for your answers. I've now amended
TestApp3 (attached) in away that ignores clicks on the ComboBox
until a 'valid' item has been selected. By 'valid' I mean that the
user has not clicked on the arrow or the textbox part of the
ComboBox. The code is quite simple, though no doubt some people
will disagree:<br>
Public Sub ComboBoxConnectChannel_Change()<br>
Dim iIndex As Integer<br>
iIndex = Last.Index<br>
Print "Channel Index = " & iIndex<br>
If iIndex < 0 Then <br>
Return<br>
Endif<br>
Last.Text = Last.Current.Text<br>
sConnectChannel = Trim(Last.Current.Text)<br>
Print "Channel=" & sConnectChannel<br>
End</p>
<p>Useful to know about the RadioButtons. As I'm a belt & braces
man, I'll stick with what I have.</p>
<p>I'll also stick with gb.gui. Hopefully that will give a wider
audience (rather than my using gb.gtk+) when I eventually put the
app (from which I created TestApp3) on Gambas Farm. Some way off
due to problems that I won't go into.<br>
</p>
<p>Useful to know the simple technique of "highlighting the text of
a singular message in the digest and using the Reply To function
(button?) should place the highlighted text as a quote in a new
message.". The actual option in Thunderbird is "Reply to List". <br>
<br>
</p>
</body>
</html>