Number of Tab Groups in DocumentViewsArea ?  SOLVED

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
zarkogajic
User
Posts: 1372
Joined: Thu Sep 05, 2019 12:35 pm

Number of Tab Groups in DocumentViewsArea ?

Post by zarkogajic »

Hi Support,

How can I get the number of Tab groups in IPXV_DocumentViewsArea ?

The below image displays 5 tab groups:

image.png

p.s.
I have my hands on the document's tab's LayoutItem (viewtopic.php?p=138509#p138509).

layoutItem.Parent should be the ScrollContainer containing all tabs in a one tab group.

I though layoutItem.Parent.Parent.Count will give me number of groups - but no :)


-žarko
zarkogajic
User
Posts: 1372
Joined: Thu Sep 05, 2019 12:35 pm

Re: Number of Tab Groups in DocumentViewsArea ?

Post by zarkogajic »

Hi Support,

?

-žarko
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17960
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Number of Tab Groups in DocumentViewsArea ?

Post by Tracker Supp-Stefan »

Hello zarkogajic,

I've asked for some help from the dev team, and we will post a reply here soon!

Kind regards,
Stefan
zarkogajic
User
Posts: 1372
Joined: Thu Sep 05, 2019 12:35 pm

Re: Number of Tab Groups in DocumentViewsArea ?

Post by zarkogajic »

Hi Support,

Ping here :)

-žarko
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2353
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Number of Tab Groups in DocumentViewsArea ?

Post by Vasyl-Tracker Dev Team »

Hi Zarko.

Here is the way:

Code: Select all

private void GetTabGroupsCount(IUIX_LayoutItem parent, ref int tabGroupsCount)
{
	uint count = parent.Count;
	for (uint i = 0; i < count; i++)
	{
		IUIX_LayoutItem kid = parent[i];
		int st = kid.Style; 
		if ((st & (int)UIX_LayoutItemStyleFlags.UIX_LayoutItemStyle_Splitted) == 0)
		{
            		if (((st & (int)UIX_LayoutItemStyleFlags.UIX_LayoutItemStyle_NoTabBar) == 0) && !kid.Hidden && (kid.Count != 0))
				tabGroupsCount++;
		}
		else
		{
			GetTabGroupsCount(kid, ref tabGroupsCount);
        	}
	}
}
....
int tabGroupsCount = 0;
GetTabGroupsCount(pdfCtl.Frame.View.DocViewsArea.Panes.Layout.Root, ref tabGroupsCount);
HTH
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
zarkogajic
User
Posts: 1372
Joined: Thu Sep 05, 2019 12:35 pm

Re: Number of Tab Groups in DocumentViewsArea ?

Post by zarkogajic »

Hi Vasyl,


That's it, thanks!

-žarko
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17960
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Number of Tab Groups in DocumentViewsArea ?  SOLVED

Post by Tracker Supp-Stefan »

:)
Post Reply