Custom icon on document's Tab  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

Custom icon on document's Tab

Post by zarkogajic »

Hi support,

Can a custom icon be specified for document's tab, and changed from code (add/remove/change icon) when needed?

image.png

So, something like the icon that appears by default for protected documents.


-žarko
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Custom icon on document's Tab

Post by Sasha - Tracker Dev Team »

Hello žarko,

This is not available via the SDK, though I will ask whether we can add this to the IUIX_LayoutItem methods in the future.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Custom icon on document's Tab

Post by Sasha - Tracker Dev Team »

Hello žarko,

These methods will be available from the next release for the IUIX_LayoutItem interface:

Code: Select all

HRESULT TitlePrefix([out, retval] BSTR* pVal);
HRESULT TitlePrefix([in] BSTR sVal);
HRESULT TitlePrefixIcon([out, retval] IUIX_Icon** ppIcon);
HRESULT TitlePrefixIcon([in] IUIX_Icon* pIcon);

HRESULT TitleSuffix([out, retval] BSTR* pVal);
HRESULT TitleSuffix([in] BSTR sVal);
HRESULT TitleSuffixIcon([out, retval] IUIX_Icon** ppIcon);
HRESULT TitleSuffixIcon([in] IUIX_Icon* pIcon);

HRESULT TitlePrefixMixColor([out, retval] LONG* pVal);
HRESULT TitlePrefixMixColor([in] LONG nVal); // RGBA

HRESULT TitleSuffixMixColor([out, retval] LONG* pVal);
HRESULT TitleSuffixMixColor([in] LONG nVal); // RGBA

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
zarkogajic
User
Posts: 1372
Joined: Thu Sep 05, 2019 12:35 pm

Re: Custom icon on document's Tab

Post by zarkogajic »

:)

Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Custom icon on document's Tab

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
zarkogajic
User
Posts: 1372
Joined: Thu Sep 05, 2019 12:35 pm

Re: Custom icon on document's Tab

Post by zarkogajic »

Hi Support,

Is this a part of the 335 release? Not listed here: https://www.pdf-xchange.com/produc ... or/history

Edit (after installing the 335 version): yes a part of it :)

Edit2: I've tried setting TitlePrefix for a document tab - but nothing happens. Do I need to do additional calls after(?):

Code: Select all

PDFXEdit.IPXV_Document doc = pdfCtl.Doc;
PDFXEdit.IPXV_DocumentView docView = doc.ActiveView;
PDFXEdit.IUIX_LayoutItem layoutItem = docView.Obj.Parent.LI;

layoutItem.TitlePrefix = "prefix"; //<- no changes to tab title
Only If I also do layoutItem.Title = "something new" - then the title will change and also include the prefix.

Edit3:

image.png
image.png (6.06 KiB) Viewed 2948 times

The prefix goes directly before title, while suffix has a space before the title (by design?). Also, suffix seems to be in bold style (by design, cannot change?). In all above cases (prefix, suffix, icons, colors), the title must be set to something different than the current title - for the tab display to be updated.

All in all, a handy new feature :)

Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Custom icon on document's Tab

Post by Sasha - Tracker Dev Team »

Hello žarko,

This should not be like this - we'll think what can be done with the space and the bold font and also the update should happen after you set prefix/suffix - this should be fixed from our side.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
zarkogajic
User
Posts: 1372
Joined: Thu Sep 05, 2019 12:35 pm

Re: Custom icon on document's Tab

Post by zarkogajic »

Thanks Alex.

Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Custom icon on document's Tab

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
zarkogajic
User
Posts: 1372
Joined: Thu Sep 05, 2019 12:35 pm

Re: Custom icon on document's Tab

Post by zarkogajic »

Hi support,

I'm trying to apply custom icon/prefix/suffix to a pane (any in Frame.View.Panes collection) - it seems this is not implemented?

-žarko
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Custom icon on document's Tab

Post by Sasha - Tracker Dev Team »

Hello žarko,

Can you make a screenshot on where do you want to place a icon?

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
zarkogajic
User
Posts: 1372
Joined: Thu Sep 05, 2019 12:35 pm

Re: Custom icon on document's Tab

Post by zarkogajic »

Hi Alex,

Any pane in the MainView's Panes collection:

image.png

Code:

Code: Select all

  view : IPXV_View;
  li : IUIX_LayoutItem;
...
  view := pxv.Frame.View.Panes.Active[PDFXHelper.Inst.Str2ID('searchView', false)];
  if Assigned(view) then
  begin
    li := pxv.Frame.View.Panes.Layout.GetItem(view.Obj);
    if Assigned(li) then
    begin
      ttl := li.Title;
      li.Title := '';
      li.TitlePrefixIcon := PDFXHelper.InstUI.Theme.GetIcon('ico.oneDrive');
      li.TitlePrefix := 'prefix';
      li.Title := 'new ' + ttl;
    end;
  end;
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Custom icon on document's Tab

Post by Sasha - Tracker Dev Team »

Hello žarko,

The layout suffix/prefix icon goes here (same as document):
image.png
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
zarkogajic
User
Posts: 1372
Joined: Thu Sep 05, 2019 12:35 pm

Re: Custom icon on document's Tab

Post by zarkogajic »

Hi Alex,

Sorry, I'm not sure I understand your answer :(

So, prefix/suffix/icon cannot be set for a LayoutItem for an arbitrary pane (IPXV_View) [even though I have access to pane's LayoutItem and can change the title in that way] ?

-žarko
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Custom icon on document's Tab

Post by Sasha - Tracker Dev Team »

Hello žarko,

The icon won't be set in the header of the layout item, but in the tab of the layout item. Though I'm not sure whether this will work for panes at all, as we did not yet tried this from our native code except for document tabs.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
zarkogajic
User
Posts: 1372
Joined: Thu Sep 05, 2019 12:35 pm

Re: Custom icon on document's Tab

Post by zarkogajic »

Hi Alex,

Thanks. I was hoping it will work for any IUIX_LayoutItem as stated by previous post in this topic.

Anyhow, I wanted to add a custom icon to my custom pane's title "bar" ....

-žarko
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Custom icon on document's Tab

Post by Sasha - Tracker Dev Team »

Hello žarko,

Well I'm afraid that there is no such a method in the SDK.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
zarkogajic
User
Posts: 1372
Joined: Thu Sep 05, 2019 12:35 pm

Re: Custom icon on document's Tab

Post by zarkogajic »

:)

ž
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Custom icon on document's Tab  SOLVED

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply