Get Icon's area in tab header of CMFCTabCtrl? - mfc-feature-pack

I need to add checkbox in tab header of CMFCTabCtrl. Since I am not finding anything for it, I planned to set icon in tab header.
when click on icon i need to display checkbox with tickmark or without tickmark.
So how to determine that the point is on icon area?

Related

Ionic 6: How to custom ion-accordion icon place right after header label

I'm trying to implement the follow design:
I'm using ion-accordion, but property "toggle-icon-slot" provide only 2 options to put icon at the start right before header label or at the end.
Is there a way to place the icon right after header label but keep 'ion-accordion' width responsive, because I want 'change' button at right edge of screen.

How do I remove (not hide) UI button in Xcode?

I have a view with a lot of UI buttons. I want some of the buttons to show and some to be hidden depending on my dynamic content. This can be done with button.isHidden = true. The problem is that the layout still set its constraints to the hidden buttons which create a lot of empty space.
You can see the empty space at the bottom in the picture where the buttons are hidden. So, is it possible to make the buttons "gone" instead of hidden? In Android Studio there is a isGone code (can't remember the exact code) that not only hides the button but removes the height and width of it as well.

How to get tab control's header height in an empty control

My app's main window contains a Rebar control which contains a menubar band, a toolbar band, and a tab control band. When adding those bands using RB_INSERTBAND I have to pass a minimum height for the band in the cyMinChild member field of the REBARBANDINFO structure. Otherwise the Rebar control doesn't layout its bands correctly.
I can easily calculate the cyMinChild for the menubar and toolbar bands by simply using the TB_GETBUTTONSIZE message to find out the height of the menubar and toolbar.
For the tab control, however, things are more difficult. In fact, I'm unable to find any way of determining the tab control's header height. The problem is that initially, the tab control doesn't have any entries. If the tab control had some entries, I could just use TCM_GETITEMRECT to find out the header size but when I create the tab control and add it into the Rebar control, it doesn't have any entries yet.
So how should I find out the cyMinChild height for my tab control? Do I have to insert a dummy entry, grab the height using TCM_GETITEMRECT, and instantly remove the dummy entry again to achieve that? Or is there a nicer solution?
Note that I'm not using any toolkits. Everything is done in pure C so any solution should also be in plain Win32 API.
Thanks!

XCode: Graphical button with invisible title

I have a bunch of buttons. They appears as an graphical image. If a user clicked on a button I can determine with
sender.titleLabel!.text!
which button the user pressed. But the title of the button appears in the view. I want only to show the image and give the button a invisible title. But I think that is not possible.
Me second solution is to create for each button an outlet. But I think with 30 buttons that is a very bad solution.
Option 1:
For the button text color property set opacity to 0. The text is there, but fully transparent.
Option 2:
You may use the tag value to identify a button so you do not have to rely on the button title. You can set the tag value in interface builder (Xcode) or in code. (The tag is an integer.)
I usually prefer option 2 as it is resilient to text changes over time (think of typos, translations for other languages etc.).

Rounded rect button in NSToolbar

How do you change the width of a button in a tool bar on Mac? I can change the width in interface builder but it only updates if the width is larger than the current size. If I try to make it smaller it doesn't change in tool bar.
Not sure if you found an answer yet, but I was recently looking to do this as well for a popup button. The answer is to create the button outside the toolbar first. Then once you create it you can drag it onto the toolbar area and it will be added as a toolbar item.
For example, I created a popup button on my main window and set it to the width that I wanted. Then I opened the toolbar section and dragged that button onto it... and it worked.
Good luck.

Resources