IonicWind Software

IWBasic => General Questions => Topic started by: Andy on December 19, 2020, 05:29:38 AM

Title: Tab controls
Post by: Andy on December 19, 2020, 05:29:38 AM
I have used tab controls before and they look promising for my next editor upgrade (next year of course), but I have some questions that I can't seem to find the answers for.

Attached is a tab control program with a rich edit control in it.

My idea (for next year) is to modify the editor to use tab controls instead of buttons.

Question 1.

Why is the space to the right of the tab control white (or grey when you don't set a widow colour)?

Question 2.

What makes the selected tab's text white ?

Question 3 (relating to question 1).

How can I change the white area (not text) to a specified colour?

Tabs for me look promising, but would like to be able to customise them first before I spend a lot of time upgrading the editor program.

Yes I spelt "Fourth" wrong - thanks sharp eyes Brian!

Thanks,
Andy.
Title: Re: Tab controls
Post by: Andy on December 21, 2020, 04:04:52 AM
Think it's something to do with the system colour, so I have decided to try something else...

1. I can get the width of each visible tab name, add them together for a total length.

2. I can then set an empty static on the right hand side of the tabs to colour that part.

This actually works, although I need to do some more for when you say delete / add tabs.

NEXT PROBLEM:

Changing a tabs text...

There is a documented bug about changing a tab's text (the title), it apparently inserts a new tab instead of changing the text.

However, IF you know the tab's text you can simply delete the tab, and then insert a new one in the same place with the new title - looks okay to me.

I had to do it this way as I could not head nor tail of the API commands.

Andy.
Title: Re: Tab controls
Post by: billhsln on December 21, 2020, 11:01:44 AM
Just a thought and it might not work, but might be worth a try.

Colour the entire area where the tabs are to be and then create the tabs.  It might not work, but it might.  That way you don't have to calculate the size of the tabs.

Bill
Title: Re: Tab controls
Post by: Brian on December 21, 2020, 11:04:44 AM
That was one of my thoughts, Bill - I tried it, no banana!

Brian
Title: Re: Tab controls
Post by: aurelCB on December 21, 2020, 11:15:15 AM
You can do it using DC as with any other control but require lot of api code
Title: Re: Tab controls
Post by: aurelCB on December 21, 2020, 11:20:13 AM
Andy 
look here ...looks  hmmm
https://stackoverflow.com/questions/28081251/win32-tab-control-grey-background
Title: Re: Tab controls
Post by: aurelCB on December 21, 2020, 11:53:30 AM
Guys
I am not sure but i think that work ...
Using bitmaps is the easiest way to change tab colors

or this
https://www.codeproject.com/Articles/14712/Win32-SDK-C-Tab-Control-Made-Easy
Title: Re: Tab controls
Post by: Andy on December 21, 2020, 10:26:46 PM
Thanks for all the replies.

Firstly, sorry I could not get back to any one yesterday, Anne gets a lot of requests for Christmas cakes, chocolate logs, mince pies etc and just as she thought she'd finished making them all two late requests came in - so I hand to lend a hand.

By the time it was all done I was not fit for anything else!

You have all posted interesting ideas etc, so today I need to read these and play around with your ideas.

Thanks for replying,
Andy.
 :)