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 » "X" btn on CExtDynamicControlBar leaves bIsVisibleState == true Collapse All
Subject Author Date
Dave Kymlicka Mar 23, 2005 - 8:25 PM

Hiding my CExtDynamicControlBar class by using close ("X") button works fine visually, except it’s visible state still == true.

Here’s my code to check visibility:
BOOL CustomIsVisible()
{
bool bIsVisibleState = false;
BarStateGet(&bIsVisibleState);
return (true == bIsVisibleState);
}

Am I doing something wrong?

Following code for bool CExtBarNcAreaButtonClose::OnNcAreaClicked(), it does this:
{
...
pFrame->ShowControlBar( m_pBar, FALSE, FALSE );
...

}


Should I override, and do this instead?

CExtDynamicBarNcAreaButtonClose::OnNcAreaClicked()
{
if( m_rc.PtInRect(point) )
{
BarStateSet( BarStateGet(), false );
}     
}

Technical Support Mar 24, 2005 - 6:43 AM

Yes, we confirm that this is a bug. The CExtDynamicControlBar class uses instances of the following classes for its caption buttons: CExtDynamicBarNcAreaButtonAutoHide, CExtDynamicBarNcAreaButtonMenu and CExtDynamicBarNcAreaButtonClose. The bug can be fixed by modifying the CExtDynamicBarNcAreaButtonClose::OnNcAreaClicked() method in this way:

bool CExtDynamicBarNcAreaButtonClose::OnNcAreaClicked(
   CPoint point
)
{
 ASSERT_VALID( this );
 if( !m_rc.PtInRect(point) )
  return false; // continue asking nc-buttons
 m_bHover = m_bPushed = false;
CExtDynamicControlBar * pBar =
  DYNAMIC_DOWNCAST(
   CExtDynamicControlBar,
   GetBar()
   );
 if( pBar == NULL )
  return CExtBarNcAreaButtonClose::OnNcAreaClicked( point );
 pBar->BarStateSet( pBar->BarStateGet(), false );
 return true;
}

Dave Kymlicka Mar 24, 2005 - 10:15 AM

Yes, that fixes the problem.
Thanks so much!!