Tabbed miniwindows

Posted by Kevnuke on Wed 03 Jul 2019 10:10 PM — 5 posts, 22,233 views.

USA #0
I'm sure I've seen somewhere that you made a version of the miniwindows where you can have tabs and each tab has its own content. How does this work? Does each tab have its own unique identifier, or is the whole window named and then content is added to each tab? I was planning to use one as a communications hub in Achaea where the messages from each clan/channel is assigned to a tab. Also how many tabs does a tabbed window support?
Australia Forum Administrator #1
See https://www.gammon.com.au/forum/?id=14161

It's all explained there.

Quote:

How does this work?


The main part of the window draws a different set of content depending on which tab is active. When you change tabs the main area is cleared and then redrawn.

Quote:

Does each tab have its own unique identifier, or is the whole window named and then content is added to each tab?


It's all one window. The way I implemented it in the link above I had one function to draw each different tab.

So it's like:


if tab1_active then
  draw_tab1()
elseif tab2_active then
  draw_tab2()
elseif tab3_active then
  draw_tab3()
elseif tab4_active then
  draw_tab4()
end


Effectively a tabbed window is X number of windows drawn on top of each other, although of course you don't actually draw them at once, you only draw the active one.

Quote:

I was planning to use one as a communications hub in Achaea where the messages from each clan/channel is assigned to a tab.


That sounds sensible. If your case you could probably use the same code to draw all the channels, the only difference would be which channel gets filtered into each tab.

Quote:

Also how many tabs does a tabbed window support?


As many as you can fit. If you have a wide window then you have room for more tabs at the bottom. You could stack them I suppose although my code doesn't do that.
USA #2
Thank you for the reply, Nick. I'll play around with it some and see how things go.

Also, while we're on the subject of miniwindows, when the tooltip value gets set for mouse overs in the mapper plugin, they stay that way even when hovering the mouse over something outside the map. For example, when I hover the mouse over a room named "Centre Crossing" on the map and then over a line in output to see line information, Centre Crossing is still the tooltip title.
Amended on Thu 04 Jul 2019 01:41 AM by Kevnuke
Australia Forum Administrator #3
I can't reproduce that on Windows XP.
USA #4
Nick Gammon said:

I can't reproduce that on Windows XP.


It's happening on Windows 10.

Before: https://snag.gy/TSF937.jpg
After: https://snag.gy/1zTYmN.jpg