Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » TabWnd border Collapse All
Subject Author Date
Suhai Gyorgy Aug 8, 2007 - 9:17 AM

Dear Support,

I’d like to use your CExtTabPageContainerOneNoteWnd control, but I’d like to remove the colorful line it has near the tabs. To understand which part I mean, please check this screenshot. How could I remove that couple of pixel of red lines and have my page starting right under the tabs?

Thank you!

Technical Support Aug 8, 2007 - 10:31 AM

All the page container classes have the common CExtTabPageContainerWnd::PageInsert() method for registering page windows. But the One Note tab page container has its own CExtTabPageContainerOneNoteWnd::PageInsert() method for this because its method allows you to specify two gradient colors. You can specify your own colors to find more consistent color of the tab line on your screenshot. The color of this tab line is the bottom color of the selected tab item. The TabbedBars sample paints a custom background in the page windows inserted into One Note tab page container which is used as the main SDI child view there. We think this is the best way to ’hide’ the tab line you are talking about. It is also possible to make the One Note tab control of a lesser height, but we need to know more details about your task if you need this.

Suhai Gyorgy Aug 8, 2007 - 2:34 PM

I’d like to keep the default colors, which are different for each tabitem. I’d just like to remove that line that goes beyond the tab item all along the whole tabwnd. When using CExtTabPageContainerFlatWnd, the white color of the tab item stays only inside the tab item. I’d like to achieve the same. By editing the previous screenshot, I could produce a picture showing what I need. The DevStudio tab is selected, but the green color does not go beyond the tab item.

Technical Support Aug 9, 2007 - 8:29 AM

Please try the following improved version of the One Note tab page container class:

class CTabPageContainerForChris : public CExtWRB < CExtTabPageContainerOneNoteWnd >
{
      class LocalTabs : public CExtTWPC < CExtTabOneNoteWnd >
      {
      protected:
            virtual INT OnTabWndGetParentSizingMargin(
                  DWORD dwOrientation
                  ) const
            {
                  dwOrientation;
                  return 0;
            }
      };
      virtual CExtTabWnd* OnTabWndGetTabImpl()
      {
            return new LocalTabs;
      }
};
It removes the bottom tab line But we think this makes the tab control unusable because it is hardly possible to see which tab item is selected.

Suhai Gyorgy Aug 10, 2007 - 3:32 AM

Yes, I agree, the above code makes the tab control unusable, so I modified it a little.

In the default implementation, two different parts make up your bottom tab line (they are drawn in OnTabWndEraseClientArea method):
- a colorline, which is 2-3 pixels wide and has the same color as the selected tab item,
- and a tab border margin, which is 1 pixel wide and has the color COLOR_3DSHADOW.

I wanted to remove the colorline and keep only the tab border margin. I could achieve this by returning 3 in OnTabWndGetParentSizingMargin and also overriding OnTabWndEraseClientArea and providing a proper rcTabNearBorderArea parameter for the base class’ method.

Keeping the tab border margin makes the tab window usable just the same. Thank you for putting me to the right path!