InfoBar  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
SHartmann
User
Posts: 2
Joined: Fri Jan 22, 2021 10:40 am

InfoBar

Post by SHartmann »

Hello,

I want to hide this info bar.
image.png
I saw this topic viewtopic.php?p=156719&hilit=hide+infobar#p156719
and tried the related code, but I got stuck :(

Code: Select all

      var list = new List<string>();
      IntPtr pChild = IntPtr.Zero;
      Type type = typeof(PDFXEdit.IUIX_ScrollContainer);
      Editor.Inst.MainFrm[0].View.Obj.Children[0].QueryImpl(type.GUID, null, out pChild);
      if (pChild != IntPtr.Zero) {
        PDFXEdit.IUIX_ScrollContainer scrollCon = (PDFXEdit.IUIX_ScrollContainer)System.Runtime.InteropServices.Marshal.GetTypedObjectForIUnknown(pChild, type);
        if (scrollCon != null) {
          if (scrollCon.CmdPaneTop.Count != 0) {
            PDFXEdit.IUIX_CmdLine cmdLine = scrollCon.CmdPaneTop[0];
            for (uint i = 0; i < cmdLine.Count; i++) {
              PDFXEdit.IUIX_CmdBar bar = cmdLine[i];
              string sID = Editor.Inst.ID2Str(bar.ID);
                list.Add(sID);
 
 
            }
          }
        }
      }
My problem is, that I don’t have a deep understanding of your visual architecture.
Where is the red bar really located in the structure?

When debugging there is no CmdPaneTop in in the ScrollContainer, so I assume that possibly the ScrollContainer is not the right place to start the whole search process?

I tried several different values I found during debugging, but I came to the conclusion, that it is no good way to do so, when I don’t know what I’m doing ☹

best regards
Stephan
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2352
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: InfoBar  SOLVED

Post by Vasyl-Tracker Dev Team »

Hi Stefan.

The easiest way to disable any standard InfoBar-message is:

PXV_Inst.Settings["DocInfoBar"]["DisabledSpans"].Add().v = <stdInfoBarSpanID>;
PXV_Inst.FireAppPrefsChanged(PXV_AppPrefsChange_InfoBar);

The ID of the info-span on your screenshot is "docInfoBarSpan.BrokenFlags". To hide that span - run that code once, before opening any doc.

Also, you may disable the whole InfoBar at all, via:

PXV_Inst.Settings["DocInfoBar"]["Enabled"].v = false;
PXV_Inst.FireAppPrefsChanged(PXV_AppPrefsChange_InfoBar);

===

The UI structure is quite complex, and briefly is:

Code: Select all

MainFrame [top window, ID="mainFrame", Impl=IPXV_MainFrame]
	ScrollContainer [ID="mainFrame", Impl=IUIX_ScrollContainer]
		CmdPanes [{contains all main toolbars, menus, whole Ribbon UI}]
		MainView [ID="mainView", Impl=IPXV_MainView, Client]
			ScrollContainer [ID="mainViewLayout", Impl=IUIX_ScrollContainer]
				CmdPanes[{CmdPaneTop contains the main InfoBar}]
				Layout [ID="mainViewLayout", Impl=IUIX_Layout, Client]
					DocumentsViewArea [ID="documentsViewArea", Impl=IPXV_DocumentsViewArea]
						Layout [ID="", Impl=IUIX_Layout, contains all opened document-tabs (i.e. document-views)]
							ScrollContainer [ID="documentView", Impl=IUIX_ScrollContainer]
								CmdPanes[{CmdPaneTop contains the document InfoBar}]
								DocumentView [ID="documentView", Impl=IPXV_DocumentView, Client]
									Layout [ID="", Impl=IUIX_Layout, contains all document panes]
										ScrollContainer [ID="pagesView", Impl=IUIX_ScrollContainer]
											CmdPanes[{contains "cmdbar.docOptions", "cmdbar.pageNav", 
												    "cmdbar.pageLayout" toolbars on the bottom}], 
											Scrollbars
											PagesView [ID="pagesView", Impl=IPXV_PagesView, Client]
PagesView - is the last in that chain and displays pdf-pages.
CmdPanes - represents 'array' of 4(top, bottom, left, right) command panes that are containers for toolbars(cmdbars). The special case - the main top-cmdpane may also contain Ribbon-tabs.
ScrollContainer - is the special object that contains embedded cmdpanes, scrollbars, and its Client-object.
Layout - is the organizer for set of panes; we have two different sets of panes - main panes (Search, History, StampsPalette etc) and panes per-document (Bookmarks, Comments, Thumbnails, etc).

According to your case - you might be interested in two items in that tree:
CmdPanes[{CmdPaneTop contains the main InfoBar}] - that info bar shows app-level messages (about license-issues for example)
CmdPanes[{CmdPaneTop contains the document's InfoBar}] - that info bar shows document-level messages, that are individual per document ("document is broken", "document is suspiciously altered", "document has the digital signature" etc).

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.
Post Reply