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 » CExtPageContainerWnd - problems detecting which page is expanded Collapse All
Subject Author Date
Krustys Donuts Nov 15, 2005 - 10:44 PM

I’d like my page container to notify my application when a user expands one of the page dialogs. I tried to override OnPageContainerCaptionPressedStop and simply use the pPageInfo parameter, but that parameter doesn’t necessarily provide the information that I need (which page is expanded). So I went ahead and implemented it as follows:

void MyExtPageContainerWnd::OnPageContainerCaptionPressedStop( CExtPageContainerWnd::PAGE_ITEM_INFO* pPageInfo)
{
	CExtPageContainerWnd::OnPageContainerCaptionPressedStop( pPageInfo);
	TRACE( "%s\n", pPageInfo->TextGet());
	LONG numChevrons = PageGetCount();
	for( LONG i=0; i<numChevrons; i++) {
		CExtPageContainerWnd::PAGE_ITEM_INFO* pInfo = PageGetInfo( i);
		if( !pInfo->IsExpanded())
			continue;
		TRACE( "%s\n", pInfo->TextGet());
	}
}


I’m using this override as a trigger to determine that the user has clicked on a caption, and then the loop attempts to determine which page is expanded. However, it doesn’t seem to work correctly.

For example, let’s say there are three captions: "donut1", "donut2", and "donut3", and "donut1" is initially expanded. If I press down the left mouse button on "donut1", and then release over "donut2", my code correctly identifies "donut1" as the expanded page. However, if I click normally, things don’t work. In the same example, if I were to click on "donut2", it would say that "donut1" was expanded. Then if I click on "donut1", it will say that "donut2" is expanded. It’s always one page behind.

Can you please help me identify the bug, if any?

Technical Support Nov 16, 2005 - 11:10 AM

The CExtPageContainerWnd::OnPageContainerItemExpanded() virtual method is invoked when a page gets expanded/contracted. The CExtPageContainerWnd::OnPageContainerItemExpanding() virtual method is invoked immediately before the page becomes expanded/contracted and returns a flag which indicates whether the page can be expanded/contracted. So, this allows you to fully control the process.

Krustys Donuts Nov 16, 2005 - 11:53 AM

Thanks... can you please add this to the documentation? The v2.40 help file doesn’t have this method listed, and the v2.50 archive doesn’t have a new help file in it.

Technical Support Nov 19, 2005 - 12:22 PM

The Prof-UIS 2.50 archive (available on www.prof-uis.com/download.aspx) contains help files (both help 1.x and help 2.x) in the Help folder. You can also download the chm file from here. The methods in question are available in these help files.