VSTO Outlook: Custom task pane height includes the titlebar or not? - outlook

When I set the height of the custom task pane (which is in points), this height includes the titlebar or not? Microsoft does not tell anything about it, I doubt if the height refers only to the content, I mean, the user control, or also it takes into account the custom task pane title bar. Could someone confirm this, please?
For example, if I set the height to 80 points, does it includes the titlebar? or not (only the user control height)?

Yes, the Size (Height or Width) of custom task panes includes the title bar. This is for the whole task pane.
If you need to know the client area you may check out the Size property of the user control placed there.

Related

Set appropriate initial height for custom task pane in VSTO Outlook Add-in

I have an VSTO Outlook Add-in in which I create a custom task pane and I assign a usercontrol to it.
How can I set the initial height of the custom task pane in order to be device-independent, I mean,
that works independently of the screen resolution?
I have observed that if I set a fixed value for it, for example, ctp.Height = 130, it works on some screen resolutions but not in others, I mean, it seems height is not kept between different screen resolution. In lower screen resolutions, the height is bigger, and in higher screen resolutions, the height is smaller. Why is it happening? and how to solve it?
It depends on Outlook first of all. Newest Outlook versions are DPI-aware, so the controls size can be changed depending on the DPI set per-monitor.
Another point is your configuration of the user control, how it is set up for auto-scaling.

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!

Glade 3.18 + GTK3 - Make children keep internal size

So i have a GUI with a toplevel GtkWindow that has alot of boxes and windows beneath it. See image below
the problem is when a user resizes window1 (downwards) , the bottom element, i.e statusbar2 only enlarges and fills up the rest of the available area.
The notion of a status bar is that it should be always the same size, like 80 px of height. What I want to do is that when a user resizes the window, the internal components stay the same relative height and width. Atleast the status bar. So when i drag down to enlarge, the box3 item should only enlarge. The statusbar2 should "hook" onto the bottom edge of the window and stay the same size.
This must be doable surely?
If you need the glade file, I might be able to upload it
Any help is appreciated!
Regards
You'll want to set the status bar's vexpand property to False, and set the vexpand property to True of whatever widget(s) you would like to absorb the extra space.

Use combined titlebar + toolbar while preserving title visibility

The System Preferences app feature a combined title bar and toolbar with vertically centered buttons and the title. I am trying to mimic this exactly in my app. I have been able to combine the title bar and toolbar using Interface Builder (on the NSWindow check Title Bar and Unified Title and Toolbar), but this does not center the content vertically. I discovered via this question you can simply set the window's titleVisibility to NSWindowTitleHidden which will vertically center the stoplight buttons. Unfortunately this of course hides the title. How can one vertically center content in the unified titlebar/toolbar and also show the window's title just like System Preferences - either in IB or programmatically?
I ended up setting titleVisibility to NSWindowTitleHidden and manually created an NSView that contains an NSTextField that mimics the standard title appearance, providing that to the window's addTitlebarAccessoryViewController method. Still would like to find a better solution to use the default title appearance, if possible.
I used WAYAppStoreWindow on GitHub to do this. I created a fork of the WAYWindow subproject to vertically centre the document title since this wasn't supported. This means any applied themes/appearances are honoured.

Mac OS X/Cocoa: create "docked" sidebar that reduces maximizable area, like the Dock

When the OS X dock is shown, it "reserves" some screen area and prevents maximized windows from going behind the dock when maximized. How do I make my own Cocoa application do the same?
A window's "maximizable area" is based on the screen's visibleFrame.
[[NSScreen mainScreen] visibleFrame]
The returned rectangle is always based on the current user-interface settings and does not include the area currently occupied by the dock and menu bar.
Because it is based on the current user -interface settings, the returned rectangle can change between calls and should not be cached.
The rectangle defining the portion of the screen in which it is currently safe to draw your application content.
There is no mention of being able to adjust this visibleFrame rectangle, so I do not think you will have any success influencing the "global" Zoom size.
However, if you only want to adjust the Zoomed size of your app's window, return a smaller rectangle in the NSWindowDelegate method windowWillUseStandardFrame:defaultFrame:.
The standard frame for a window should supply the size and location that are “best” for the type of information shown in the window, taking into account the available display or displays. For example, the best width for a window that displays a word-processing document is the width of a page or the width of the display, whichever is smaller. The best height can be determined similarly. On return from this method, the zoom: method modifies the returned standard frame, if necessary, to fit on the current screen.
This will allow you to take into account a "docked sidebar" when Zooming your app's windows. Other apps will be resized on top of the docked sidebar.

Resources