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 » Switching between horizontal tabs, each having vertical tabs causes screen flickering Collapse All
Subject Author Date
MUKESH GUPTA Feb 21, 2011 - 4:51 AM

We were using ProfUIS version 2.54 and have recently upgraded to the latest version 2.91.I built all the static and dll targets of 2.91 on VS2008.


We have created a class "ClassVerticalTabs" derived from CExtTabPageContainerOneNoteWnd & then have overridden OnCreate(LPCREATESTRUCT lpCreateStruct) which  has been implemented as :-


int ClassVerticalTabs::OnCreate(LPCREATESTRUCT lpCreateStruct)


{


 if( CExtTabPageContainerOneNoteWnd::OnCreate(lpCreateStruct) == -1 )


  return -1;




 OrientationSet( __ETWS_ORIENT_LEFT );




 CCreateContext* pContext = NULL;


 if (lpCreateStruct != NULL)


  pContext = (CCreateContext*)lpCreateStruct->lpCreateParams;




 CString strTabname = "Tab One";


 if( ! m_view1->Create(NULL,_T(""),WS_CHILD | WS_VISIBLE,CRect(20,20,1,1), this,ID_VIEW1, pContext))


 {


  ASSERT( FALSE );


  return -1;


 }


 if( ! PageInsert(m_view1->GetSafeHwnd(),strTabname))


 {


  ASSERT( FALSE );


  return -1;


 }




 if( ! m_View2->Create(NULL,_T(""),WS_CHILD | WS_VISIBLE,CRect(30,30,1,1),this,ID_VIEW2, pContext))


 {


  ASSERT( FALSE );


  return -1;


 }


 strTabname  = "Tab Two";


 if( ! PageInsert(m_View2->GetSafeHwnd(),strTabname))


 {


  ASSERT( FALSE );


  return -1;


 }


}


Here, m_view1 & m_view2 are instances of classes derived from CView class


Then we are creating instance of above derived class using following code:


ClassVerticalTabs tabview;


if( ! tabview.Create(this,CRect( 200,200,1,1 ),UINT(ID_PANE1),

   WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,

   pContext ))

  {

    TRACE0("Failed to create view window\n");

    return -1;

  }


Thus, we have created one horizontal tab having multiple vertical tabs. To add new horizontal tabs, we have defined a class derived from CExtTabWhidbeyWnd. Now, suppose, we create two or more horizontal tabs each of which is having 10 or more vertical tabs. On switching between horizontal tabs, corresponding vertical tabs are to be displayed. This is done using


for ( int i=VerticalTabCount; i>0; --i )


 tabview->PageRemove(i,TRUE,FALSE);


This will hide all the vertical tabs of previous horizontal tab


The problem is that switching between horizontal tabs causes flickering as all vertical tabs needs to be hidden. Please suggest.

MUKESH GUPTA Feb 26, 2011 - 2:18 AM

Will appreciate your quick response on this.

Technical Support Feb 27, 2011 - 11:43 PM

The CExtTabPageContainerWnd::PageRemoveAll() method removes page windows one by one. The CExtTabPageContainerWnd::PageRemove() method allows you to remove several pages at once. Please use the last method. I.e. you should replace this line of code:

    p->m_wndFlatTabPageContainer4.PageRemoveAll(false);

With this one:
    p->m_wndFlatTabPageContainer4.PageRemove( 0, p->m_wndFlatTabPageContainer4.PageGetCount(), false );

MUKESH GUPTA Feb 25, 2011 - 5:41 AM

Would appreciate if you can provide the fix asap.

MUKESH GUPTA Feb 25, 2011 - 2:01 AM

Any updates?  Please take this on high priority as this is critical for our project

MUKESH GUPTA Feb 23, 2011 - 12:06 AM

I have sent a sample application which can reproduce the same issue. Following are the details:-


1. Opened TabPages_900.vcproj from \ProfUIS291\Samples.

2. Added  the following  code to CMainFrame::OnCreate() :-


for(int i =1; i<50; ++i)

  {

                  CExtWFF<CTreeCtrl>* wndEditCtrl1 = new CExtWFF<CTreeCtrl>;

                  InitTreeCtrl(wndEditCtrl1, &m_wndFlatTabPageContainer4);

                int f = rand()%254-100;

                wndEditCtrl1->SetBkColor(RGB(f, f, f));

                VERIFY( m_wndFlatTabPageContainer4.PageInsert( wndEditCtrl1, _T("EditCtrl"), hIcon, TRUE ) ); 

 }


Please note that the above code needs to be added after the calls m_wndFlatTabPageContainer4.PageInsert(). This will insert 50 controls to m_wndFlatTabPageContainer4.


3. In Mainfrm.h, make m_wndFlatTabPageContainer4 as public

4. In CTabManageDlg::OnCheckShowBorders(), add the following code at the start


CMainFrame* p = (CMainFrame*)AfxGetMainWnd();

  if (p)

    p->m_wndFlatTabPageContainer4.PageRemoveAll(false);

return;


This will handle the removal of all pages from m_wndFlatTabPageContainer4 when ShowBorders is clicked.


When ShowBorders check box is clicked, tabs (or pages) will be removed one by one which will cause flickering.


Also, please note that though I have added tabs using CTreeCtrl class instead of classes derived from CView, the actual prolem is with the continuous rendering of pages which is caused by call to PageSelectionSet() in CExtTabPageContainerWnd::PageRemove().  Please suggest how this can be resolved.

MUKESH GUPTA Feb 22, 2011 - 7:07 AM

I have created a sample project. Please let me know how can i attach that.

Technical Support Feb 22, 2011 - 10:53 AM

You can send it to the support mail box at this web site (support@prof-uis.com).

Technical Support Feb 22, 2011 - 3:41 AM

This is a complicated issue. Could you send us a test project?

MUKESH GUPTA Feb 22, 2011 - 12:41 AM

I created 2 horizontal tabs :


 - "tab1" which had 10 vertical  tabs,  &


-  "tab2" which had 3 vertical tabs.


Observed that switching from tab1 to tab2 causes flickering but when we switch from tab2 to tab1, flickering doesnot occur. This is beacuse switching from tab1 to tab2 required  "Hiding 10 vertical tabs & inserting 3 vertical tabs" whereas switching from tab2 to tab1 required "Hiding 3 vertical tabs & inserting 10 vertical tabs". 


 Moreover, I also observed that in CExtTabPageContainerWnd::PageRemove(), we are changing the page selection but when pages are inserted using PageInsert(),  page selection is not changed  as the default value of "bool bSelect" passed as parameter to PageInsert() is false.


Also, if I remove PageSelectionSet() call from CExtTabPageContainerWnd::PageRemove(), flickering doesnot occur. Please suggest.

MUKESH GUPTA Feb 21, 2011 - 10:32 PM

In CExtTabPageContainerWnd::PageRemove(), PageSelectionSet() is called which means that every time a page is removed, selection will change & thus rendering will occur. Removing 10 vertical tabs (or pages), selection changes 10 times & hence rendering occurs 10 times. Please suggest if there is any option through which pages can be removed without changing page selection so that we can avoid rendering multiple times.

Technical Support Feb 21, 2011 - 11:50 AM

This is a very specific problem. It would be very handy to receive a test project demonstrating it.