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 » CExtTabPageContainerWnd problem Collapse All
Subject Author Date
Offer Har Mar 1, 2007 - 11:01 AM

Dear Support,

I have a CExtTabPageContainerWnd with many tabs, and would like all the tabs names to be displayed on multiple lines.
I could not find method of doing this. The default behavior of tab is to scroll through the tab names, but this is not acceptable for the application, as all the tab names must be displayed for quick access.

Please let me know how this can be done.

Regards,
Ron.

Suhai Gyorgy Mar 2, 2007 - 2:21 AM

Check out this thread: CExtTabWnd and tabs width

Offer Har Mar 2, 2007 - 5:59 AM

Thanks Suhai,

Dear Support & Suhai,

I have ran the above mentioned sample, is there any way in which i can make all the tabs have the same width?
Applying the flag __ETWS_EQUAL_WIDTHS had no effect.

This is the combination of flags i used:
__ETWS_MULTI_ROW_COLUMN|
__ETWS_ORIENT_TOP|
__ETWS_FULL_WIDTH|
__ETWS_EQUAL_WIDTHS|
__ETWS_CENTERED_TEXT|
__ETWS_BOLD_SELECTION


Regarding your inputs to not use multi-line tab control. I looked at the proposed ribbon replacement. This proposal takes much more space then multi-line tabs, so it leaves me with no option but using the multi-line tab in my case.

Regards,
Ron.

Technical Support Mar 2, 2007 - 11:09 AM

Please read the following document:

http://msdn2.microsoft.com/en-us/library/aa511493.aspx

The most interesting part of this document is the following:

Use horizontal tabs if:
* The window has seven or fewer tabs.
* All the tabs fit on one row, even when the UI is localized.
Use vertical tabs if:
* The property window has eight or more tabs.
* Using horizontal tabs would require more than one row.


The vertical tabs there look like the classic list box common control which you can see in the ribbon bar’s Options dialog.

The multi-row tabs in Prof-UIS is still at the beta stage and we moved them to the bottom of our TO-DO list after reading this document.

Offer Har Mar 15, 2007 - 1:51 PM

You have convinced me... (Also microsoft ;-))

How can i use the control i see in the ribbon bar’s Option dialog outside the ribbon bar?

Thanks,
Ron.

Technical Support Mar 16, 2007 - 9:26 AM

Please download a test project that illustrates the use of the Options dialog and ribbon pages detached from the ribbon bar. You need to update the following Prof-UIS method first

LRESULT CExtRibbonOptionsDialog::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
      switch( message )
      {
      case WM_DESTROY:
            if(         (! m_strCommandProfileName.IsEmpty() )
                  &&    LPCTSTR( g_CmdManager->ProfileNameFromWnd( m_hWnd ) ) != NULL
                  )
                  g_CmdManager->ProfileWndRemove( m_hWnd );
            break;
      } // switch( message )
LRESULT lResult = CExtNCW < CExtResizableDialog > :: WindowProc( message,  wParam,  lParam );
      return lResult;
}

Offer Har Mar 16, 2007 - 1:13 PM

Dear support,

That’s nice, but what i really need is that this control will be stand-alone.
I have a complex dialog, that one part of it is the list of sub-dialogs that needs to be open, so I cannot use the CMyOptionsDialogBase concept, in the same way I use a tab control in a dialog.

Also, I need to control the width of the list, as space saving is very important, and I need to narrow the list to the optimum.

Is it possible to extract the list control out of the option dialog?

Thanks!
Ron.

Technical Support Mar 17, 2007 - 10:31 AM

The list box-like tabs are implemented in the CExtRibbonOptionsTabsWnd class which is based on the CExtRibbonGalleryWnd class implementing the ribbon gallery control based on CExtToolBoxWnd. You could create a CExtRibbonOptionsTabsWnd class which is also based on the CExtRibbonGalleryWnd gallery control without any difficulties. We can help you if you provide us with as much as possible details about what you need.

Offer Har Mar 18, 2007 - 8:38 AM

Actually the best method for me would be to have the list as a stand alone control so I can place it in a dialog, and get event or virtual function whenever an item is clicked in the list.

Just like a normal list control, but better looking A LA vista style :-)

Thanks!
Ron.

Technical Support Mar 19, 2007 - 5:37 AM

Here is a project that contains a CMyVerticalTabsListBox class based on the ribbon gallery control and used as a control in the main dialog window. Please also fix the following issue in the ../Prof-UIS/Include/ExtRibbonBar.h

class __PROF_UIS_API CExtRibbonGalleryWnd : public CExtToolBoxWnd
There is no __PROF_UIS_API in that line in Prof-UIS 2.64.

Offer Har Mar 19, 2007 - 9:28 AM

Thanks!

Another question - How can I change the background color of the list from white to another color? I would like also to change the text color of the items that are not selected.

One small problem in the control is the scroll bar when you press the up or down buttons it moves the list one pixel up or down, which is not a good behavior, as it takes for ever to scroll that way (you can see it easily in the demo project) I think it should move a full item up or down, and not a pixel.

Technical Support Mar 20, 2007 - 12:32 PM

There is a CExtRibbonGalleryWnd::OnToolBoxWndEraseEntire() virtual method that you can oveeride to paint a custom background.

virtual void OnToolBoxWndEraseEntire(
      CDC & dc,
      const CRect & rcClient,
      const CRect & rcActiveChildArea,
      CRgn & rgnActiveChildArea,
      const CRect & rcActiveChildArea2,
      CRgn & rgnActiveChildArea2
      );
You should use only the first two parameters and ignore other ones that are specific for the toolbox control only.

Offer Har Mar 21, 2007 - 8:57 AM

One small question:
I see that the scroll bar appears even if there is not need for it (disabled, but there)
How can I change the behavior to be like in a list control or in the grid, that the scroll bar does not appear if not needed?

Thanks,
Ron.

Technical Support Mar 21, 2007 - 11:21 AM

The following virtual method auto-hides the scroll bar when it’s not needed:

bool OnSwCanAutoHideScrollBar( bool bHorz ) const
{
      ASSERT_VALID( this );
      bHorz;
      return false;
}

Offer Har Mar 21, 2007 - 12:08 PM

Thanks, it works!
I guess you meant to return true, and not false.

Can you please remind me what is the <tag> for wrapping a block of code nicely?

Technical Support Mar 22, 2007 - 1:05 PM

Yes, we are sorry for that typo. The correct returned value should be true.

This tag is <pre>. We use it for rendering code blocks.

Offer Har Mar 20, 2007 - 10:01 PM

Thanks, That solved the background problem.
By the way, rcActiveChildArea was always zeroed.

Now to the text’s color:
I found that m_clrRibbonModeMenuTextNormal controls the color of the text, but I need a separate color for the selected text, and the not-selected texts, because for the selected button I want the default black text, for the rest I need a white text.

I have a feeling from seeing the code that this might need some change in the code.
Please let me know what this can be available.

Thanks,
Ron

Technical Support Mar 21, 2007 - 11:04 AM

We think you should override the CExtRibbonGalleryWnd::OnToolBoxWndDrawItem() virtual method, reset the text of the pTBCI object to empty string with saving it (using the CExtToolBoxWnd::TOOLBOX_ITEM_DATA::TextGet() and CExtToolBoxWnd::TOOLBOX_ITEM_DATA::TextSet() methods), invoke parent class method, paint text manually and finally restore the text of the pTBCI object.

The rest of the CExtToolBoxWnd::OnToolBoxWndEraseEntire() method’s parameters, including the rcActiveChildArea, are used by the CExtToolBoxWnd control only and only when this control uses style and behavior of toolbox in Visual Studio .NET 2003 and only when group expanding animation is performed.

Offer Har Mar 21, 2007 - 12:06 PM

Great!
Thanks a lot for your great support.