Small Toolbar Icons?  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
jeffp
User
Posts: 914
Joined: Wed Sep 30, 2009 6:53 pm

Small Toolbar Icons?

Post by jeffp »

Is there a way to force the toolbar icons to display with small icons, instead of the large icons with text?

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

Re: Small Toolbar Icons?

Post by Sasha - Tracker Dev Team »

Hello Jeff,

What do you mean by small icons? The majority of our commands have 24*24 (that is default by the way) and 32*32 icon sizes. Some of them have 16*16, though this size is available only in half of the commands or so. What size are you implying to?

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
jeffp
User
Posts: 914
Joined: Wed Sep 30, 2009 6:53 pm

Re: Small Toolbar Icons?

Post by jeffp »

In the old ViewerX sdk all the toolbar icons were smaller and had not text.

I was just wondering if there was a way to force the Editor SDK toolbar icons to say 24x24 and not show the text below. The default seems to be 32x32 with a text caption below.

Some of my users like to conserve vertical real estate so they would prefer just small buttons with no text caption.

Does this make sense?
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Small Toolbar Icons?

Post by Sasha - Tracker Dev Team »

Hello Jeff,

Well, what can be done is this:

Code: Select all

PDFXEdit.IUIX_CmdCollection cmds = uiInst.CmdManager.Cmds;
uint cnt = cmds.Count;
for (uint i = 0; i < cnt; i++)
{
	PDFXEdit.IUIX_Cmd cmd = cmds[i];
	cmd.NewItemStyle |= cmd.NewItemStyle | (int)PDFXEdit.UIX_CmdItemStyleFlags.UIX_CmdItemStyle_HideTitle/* | (int)PDFXEdit.UIX_CmdItemStyleFlags.UIX_CmdItemStyle_HideTitleInMenu*/;
	cmd.NewItemStyleMaskEU |= cmd.NewItemStyleMaskEU | (int)PDFXEdit.UIX_CmdItemStyleFlags.UIX_CmdItemStyle_HideTitle/* | (int)PDFXEdit.UIX_CmdItemStyleFlags.UIX_CmdItemStyle_HideTitleInMenu*/;
}
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
jeffp
User
Posts: 914
Joined: Wed Sep 30, 2009 6:53 pm

Re: Small Toolbar Icons?

Post by jeffp »

Here's what I have in Delphi but it doesn't seem to hide the captions on the buttons.

Code: Select all


procedure TMyPDFControl.EnableSmallIcon(AEnable: Boolean);
var
  cmds: IUIX_CmdCollection;
  cmd: IUIX_Cmd;
  i, cnt: Integer;
begin
  cmds := INST_UIX.CmdManager.Cmds;
  cnt := cmds.Count;
  for i := 0 to cnt - 1 do
  begin
   cmd := cmds[i];
   cmd.NewItemStyle := cmd.NewItemStyle or UIX_CmdItemStyle_HideTitle;
   cmd.NewItemStyleMaskEU := cmd.NewItemStyleMaskEU or UIX_CmdItemStyle_HideTitle;
  end;
end;
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Small Toolbar Icons?

Post by Sasha - Tracker Dev Team »

Hello Jeff,

Please try executing that piece of code when the form loads (after the Control initialization).

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
jeffp
User
Posts: 914
Joined: Wed Sep 30, 2009 6:53 pm

Re: Small Toolbar Icons?

Post by jeffp »

Not luck. I've tried running the code when the form loads and it doesn't change anything. Not sure if there is something wrong with my code or not.

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

Re: Small Toolbar Icons?

Post by Sasha - Tracker Dev Team »

Hello Jeff,

We've investigated a little, and it seems that it's Delphi related. We will try to figure out the problem and will reply shortly.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
jeffp
User
Posts: 914
Joined: Wed Sep 30, 2009 6:53 pm

Re: Small Toolbar Icons?

Post by jeffp »

So am I the only Delphi developer on this board that gives you guys grief? :-)

I at least try to post my code snippets in case there are others out there.

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

Re: Small Toolbar Icons?

Post by Sasha - Tracker Dev Team »

Hello Jeff,

Well there are several Deplhi developers here. It's normal to ask questions, because that's what this forum was created for. The original code is written on C++, that is 100% supported and will have the correct work in all of the cases. We tried to populate the SDK sample on the .Net, because right now it is widely used. Delphi is also being used, though sometimes it's behavior differs from the .Net one thus we need to investigate these matters. Like in this case - we suppose that .Net is sending some kind of event that forces our Control to update it's state thus all of the commands reload their state on start. Delphi is different in this matter - thus we have this problem that we are looking into now.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
jeffp
User
Posts: 914
Joined: Wed Sep 30, 2009 6:53 pm

Re: Small Toolbar Icons?

Post by jeffp »

As to the small toolbar icon issue, would it be possible to add this as a User Preference in the Editor. This way, I wouldn't need to call it in code. I could just sent it and save it out to my default user preference file.

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

Re: Small Toolbar Icons?

Post by Sasha - Tracker Dev Team »

Hello Jeff,

We will discuss this on our meeting tomorrow. Meanwhile, try this piece of code - it should make make the command bar smaller along with icons:

Code: Select all

 FInst.ActiveMainView.CmdPaneTop.Item[1].BarSize := UIX_CmdBarSize_Normal;
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
jeffp
User
Posts: 914
Joined: Wed Sep 30, 2009 6:53 pm

Re: Small Toolbar Icons?

Post by jeffp »

Perfect. That works.

But just out of curiosity what do

FInst.ActiveMainView.CmdPaneTop.Item[0]
FInst.ActiveMainView.CmdPaneTop.Item[2].

Refer to.

I don't think I would have known that

FInst.ActiveMainView.CmdPaneTop.Item[1]

was the main toolbar.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Small Toolbar Icons?

Post by Sasha - Tracker Dev Team »

Hello Jeff,

Well that are the IDs of the command lines that you see at the top of the editor. 0 one, for example, is the MenuBar.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
jeffp
User
Posts: 914
Joined: Wed Sep 30, 2009 6:53 pm

Re: Small Toolbar Icons?

Post by jeffp »

Thanks.

I vote for adding this as an Editor preference too :-)
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Small Toolbar Icons?

Post by Sasha - Tracker Dev Team »

Hello Jeff,

Well there are ID's for them - for example, the command bar with 0 index is cmdbar.menubar. You can look into the FullDemo project for that.

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: Small Toolbar Icons?  SOLVED

Post by Sasha - Tracker Dev Team »

Hello Jeff,

Please try executing this piece of code for the command's title hiding:

Code: Select all

uiInst.CmdManager.ExtraOpts |= 8; //hide titles
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
jeffp
User
Posts: 914
Joined: Wed Sep 30, 2009 6:53 pm

Re: Small Toolbar Icons?

Post by jeffp »

Perfect. Thanks.

Looks like this will set it back

Code: Select all

uiInst.CmdManager.ExtraOpts |= 144; //Show titles
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Small Toolbar Icons?

Post by Sasha - Tracker Dev Team »

Hello Jeff,

Well here's the interface that should be available for this:

Code: Select all

enum UIX_CmdExtraOpts
{
	UIX_CmdExtraOpt_HideTips				= 0x000000001,
	UIX_CmdExtraOpt_HideShortcutsInMenusAndTips = 0x000000002,
	UIX_CmdExtraOpt_HideIconsInMenus		= 0x000000004,
	UIX_CmdExtraOpt_HideLabelsInToolbars	= 0x000000008,
	UIX_CmdExtraOpt_LockAllBars				= 0x000000010,
	UIX_CmdExtraOpt_LockAllPanes			= 0x000000020,
	UIX_CmdExtraOpt_DisableAccels			= 0x000000040,
	UIX_CmdExtraOpt_DisableMenuCues			= 0x000000080,
}
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
jeffp
User
Posts: 914
Joined: Wed Sep 30, 2009 6:53 pm

Re: Small Toolbar Icons?

Post by jeffp »

Perfect. Thanks.

But shouldn't these enums be listed in the PDFXEdit_TLB.pas file? They are not.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Small Toolbar Icons?

Post by Sasha - Tracker Dev Team »

Hello Jeff,

They will be from the next release.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
jeffp
User
Posts: 914
Joined: Wed Sep 30, 2009 6:53 pm

Re: Small Toolbar Icons?

Post by jeffp »

When is .322 going to be out?
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Small Toolbar Icons?

Post by Sasha - Tracker Dev Team »

Hello Jeff,

It should be out in a month or so.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply