[Gambas-user] how to 'close' combobox after combobox.Popup?
wig
wig at noxqs.org
Fri Sep 24 11:10:06 CEST 2021
Yes, I know there are tooltips - I use them extensively, and I know I
could just do something else (and I will try what you showed).
But first I want to be sure:
- From code, I can open the combobox, but from code, I cannot close it
without selecting something first. (code example down here).
While, as user of the running program, you can just click somewhere
else, and the combobox will close WITHOUT making a selection.
I tried to emulate that, by changing the focus from in the code, or
activating a click somewhere else, but then the combobox stays open.
So it might just be not possible by the limitations of Qt / KDE /...
Code ; I made an entry in the Help menu: "Demo":
mniHelpDemo_Click()
Dim iWaitABit as integer = 2
...
combobox1.Background = Color.Yellow
combobox1.Popup
Wait iWaitABit
' combobox1.Popdown - doesn't exist?
' I know I can do .. (but that selects something):
combobox1_Click()
combobox1.Background = Color.Background
' ....
' for the rest it is really funny to show the user around in a form:
Button1.Background = Color.Yellow
Wait iWaitABit
Button1.Background = Color.Background
Tabstrip1.index=4
Tabstrip1.Background = Color.Yellow
Wait iWaitABit
Tabstrip1.Background = Color.Background
Textbox1.Background = Color.Yellow
Wait iWaitABit
Textbox1.Background = Color.Background
' etc...
Kind greetings,
Wig
Gianluigi Gradaschi schreef op 2021-09-24 10:01:
> Il 23/09/21 19:29, T Lee Davidson ha scritto:
>
>> To demonstrate something to the user of my form, I let the application open a combobox with .Popup.
>
> If I understand correctly you use a ComboBox as a step by step help.
> I remind you that for small explanations there are ToolTips, for more detailed explanations, I recommend this method (copy the code in a graphic project): (*)
>
> Regards
> Gianluigi
>
> (*)
> Public Sub Form_Open()
>
> Dim panWind As Panel
> Dim panWiki As SidePanel
> Dim panScroll As ScrollView
> Dim txtWiki As TextLabel
> Dim sWiki As String
>
> With Me
> .H = 512
> .W = 752
> .Arrangement = Arrange.Horizontal
> .Margin = True
> .Spacing = True
> End With
>
> '--Window
> With panWind = New Panel(Me)
> .Arrangement = Arrange.Vertical
> .Expand = True
> .Spacing = True
> End With
>
> '--Help
> With panWiki = New SidePanel(Me)
> .Arrangement = Arrange.Fill
> .W = 176
> .Background = Color.TextBackground
> .Margin = True
> .Orientation = Align.Right
> .Border = True
> End With
>
> With panScroll = New ScrollView(panWiki)
> .Arrangement = Arrange.Vertical
> .Border = False
> .ScrollBar = Scroll.Vertical
> End With
>
> sWiki = "<center><b>HELP</b></center><br><b>1</b> <br>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.<br><br><b>2</b><br>Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem.<br><br><b>3</b> <br>Investigationes demonstraverunt lectores legere me lius quod ii legunt saepius. <br><br><b>4</b> <br>Claritas est etiam processus dynamicus, qui
sequitur mutationem consuetudium lectorum.<br><br><b>5</b> <br>Mirum est notare quam littera gothica, quam nunc putamus parum claram, anteposuerit litterarum formas humanitatis per seacula quarta decima et quinta decima. Eodem modo typi, qui nunc nobis videntur parum clari, fiant sollemnes in futurum.<br><br><b>6</b> <br>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.<br><br><b>7</b> <br>Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer
possim assum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem.<br><br><b>8</b> <br>Investigationes demonstraverunt lectores legere me lius quod ii legunt saepius. Claritas est etiam processus dynamicus, qui sequitur mutationem consuetudium lectorum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem.<br><br><b>9</b> <br>Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Luis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. <br><br><b>10</b> <br>Nam liber tempor cum soluta nobis
eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem."
>
> With txtWiki = New TextLabel(panScroll)
> .AutoResize = True
> .Text = sWiki
> End With
>
> End
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette [1] ]----
Links:
------
[1] http://gambaswiki.org/wiki/doc/netiquette
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210924/13a19096/attachment.htm>
More information about the User
mailing list