Working with MDI
Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
-
- User
- Posts: 103
- Joined: Mon Mar 18, 2013 4:26 pm
Working with MDI
Hello,
I am working on MDI app and wandering if your API supports Window operations like:
Maximize
Minimize All
Arrange Icons
Also, I would need to catch an event when user switches from one opened document to an other in my MDI, so I can do some actions as well...
Thanks,
-Tatiana
I am working on MDI app and wandering if your API supports Window operations like:
Maximize
Minimize All
Arrange Icons
Also, I would need to catch an event when user switches from one opened document to an other in my MDI, so I can do some actions as well...
Thanks,
-Tatiana
-
- Site Admin
- Posts: 19868
- Joined: Mon Jan 12, 2009 8:07 am
-
- User
- Posts: 103
- Joined: Mon Mar 18, 2013 4:26 pm
Re: Working with MDI
Not really, I import .dat configuration I created in the viewer and set it up as MDI that way.
What I am looking for is more information about your API for MDI.
Events like on Close Document, on Document select, etc.
Also, child window operations like: Maximize, Minimize All, Arrange Icons
Tanks,
Tatiana
What I am looking for is more information about your API for MDI.
Events like on Close Document, on Document select, etc.
Also, child window operations like: Maximize, Minimize All, Arrange Icons
Tanks,
Tatiana
-
- Site Admin
- Posts: 2445
- Joined: Thu Jun 30, 2005 4:11 pm
Re: Working with MDI
Hi, Tatiana
As I understand you - you have a standard MDI and each MDI-child embeds our ActiveX Control. In this case you have some separated ActiveX
controls and each control "don't know" about others. In this case I can suggest you the next way:
firstly you must attach your event-listener to each instance of our ActiveX (may be new listener for new control) and you will be able to intercept one special event about focus changing inside the controls:
OR you may handle WM_NCACTIVATE standard message from your MDI-child window. It might be more correct way.
HTH
As I understand you - you have a standard MDI and each MDI-child embeds our ActiveX Control. In this case you have some separated ActiveX
controls and each control "don't know" about others. In this case I can suggest you the next way:
firstly you must attach your event-listener to each instance of our ActiveX (may be new listener for new control) and you will be able to intercept one special event about focus changing inside the controls:
Code: Select all
youreventhandler ChildFrame::OnEvent(type, name, ...)
{
if ((type == PXCVA_OnNamedNotify) AND (name == Global::FocusGained))
{
// statrt timer to lazy update UI by possible activation of new document
mainFrame.StartTimer(LASY_UPDATE_MDI_ACTIVATION_TIMER_ID, 50); // 50ms
return;
}
}
HWND g_hWndLastActiveMDIChild = NULL;
MainFrame::OnTimer(timerID)
{
if (timerID == LASY_UPDATE_MDI_ACTIVATION_TIMER_ID)
{
StopTimer(timerID);
HWND hWndActiveMDIChild = mainFrame.MDIGetActive();
if (g_hWndLastActiveMDIChild != hWndActiveMDIChild)
{
g_hWndLastActiveMDIChild = hWndActiveMDIChild;
OnNewMDIChildActivated(hWndActiveMDIChild);
}
}
}
HTH
PDF-XChange Co. LTD (Project Developer)
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
-
- User
- Posts: 103
- Joined: Mon Mar 18, 2013 4:26 pm
Re: Working with MDI
I do have only one ActiveX control configured as MDI.
Could you maybe provide API call on how to set a child window to maximize or minimize mode.
Thanks,
Tatiana
Could you maybe provide API call on how to set a child window to maximize or minimize mode.
Thanks,
Tatiana
-
- Site Admin
- Posts: 2445
- Joined: Thu Jun 30, 2005 4:11 pm
Re: Working with MDI
Hi, Tatiana.
Use next UI-commands:
"CascadeWindows"
"TileWindowsHorizontal"
"TileWindowsVertical"
"ArrangeWindowIcons"
But currently is no way to maximize/minimize/restore of internal mdi-child window.. It is possible to add it in the future but not in neard future because we are too busy with our new PDF-Editor's EU/SDK..
In any case - no events from our ActiveX about changing of internal focus or re-activating of any internal windows. Only one named notify exists - "Documents.Active" - notifies about document activating.
HTH.
Use next UI-commands:
"CascadeWindows"
"TileWindowsHorizontal"
"TileWindowsVertical"
"ArrangeWindowIcons"
But currently is no way to maximize/minimize/restore of internal mdi-child window.. It is possible to add it in the future but not in neard future because we are too busy with our new PDF-Editor's EU/SDK..
To be clear - what means your "in my MDI" ? Do you meaning the your MDI App which embedds our ActiveX(that is also in own 'MDI' mode) ?Also, I would need to catch an event when user switches from one opened document to an other in my MDI, so I can do some actions as well...
In any case - no events from our ActiveX about changing of internal focus or re-activating of any internal windows. Only one named notify exists - "Documents.Active" - notifies about document activating.
HTH.
PDF-XChange Co. LTD (Project Developer)
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
-
- User
- Posts: 103
- Joined: Mon Mar 18, 2013 4:26 pm
Re: Working with MDI
Thanks, the UI-commands work, but because I am not using your Menu bar, the Minimize, Restore Down and Close menu buttons (see attachment) are not visible for me when multiple documents are opened and one of them is maximized.
I am planning on painting those buttons myself on my menu bar, and I would need to change page properties: Pages.Height, Pages.Width and Pages.ScreenX and Pages.ScreenY (for minimize) accordingly.
I have tried this Delphi code, but it doesn't do anything:
DataIn := 20;
fCoPDFXCview.DoVerb('Documents[#'+IntToStr(activeDocID)+'].Pages[0].Width', 'set', DataIn, DataOut, 0);
So, how can I get Minimize and Restore Down to work with page sizing or any other way?
Can you tell me maybe what events are triggered from your side, maybe I could create these events on my side?
Thanks,
Tatiana
I am planning on painting those buttons myself on my menu bar, and I would need to change page properties: Pages.Height, Pages.Width and Pages.ScreenX and Pages.ScreenY (for minimize) accordingly.
I have tried this Delphi code, but it doesn't do anything:
DataIn := 20;
fCoPDFXCview.DoVerb('Documents[#'+IntToStr(activeDocID)+'].Pages[0].Width', 'set', DataIn, DataOut, 0);
So, how can I get Minimize and Restore Down to work with page sizing or any other way?
Can you tell me maybe what events are triggered from your side, maybe I could create these events on my side?
Thanks,
Tatiana
You do not have the required permissions to view the files attached to this post.
-
- User
- Posts: 103
- Joined: Mon Mar 18, 2013 4:26 pm
Re: Working with MDI
I forgot to mention that I do not allow tabs in MDI, so that multiple documents can be viewed side by side.
I also tried to import settings from .dat file with your menu which displays Minimize, Restore Up and Close buttons when document is maximized. Unfortunately there is bug, the buttons work only when Mouse Focus is reset.
Steps:
1. Open document
2. Maximize document
3. Click on Minimize or Restore Up
Result: No events are triggered
4. Click away from the application
5. Click on Minimize or Restore Up
Result: Event is triggered and Minimize or Restore Up work
Please note that I have no code in onEvent when testing this.
Please help, this is essential part of the MDI view
Thanks,
Tatiana
I also tried to import settings from .dat file with your menu which displays Minimize, Restore Up and Close buttons when document is maximized. Unfortunately there is bug, the buttons work only when Mouse Focus is reset.
Steps:
1. Open document
2. Maximize document
3. Click on Minimize or Restore Up
Result: No events are triggered
4. Click away from the application
5. Click on Minimize or Restore Up
Result: Event is triggered and Minimize or Restore Up work
Please note that I have no code in onEvent when testing this.
Please help, this is essential part of the MDI view
Thanks,
Tatiana
-
- Site Admin
- Posts: 2445
- Joined: Thu Jun 30, 2005 4:11 pm
Re: Working with MDI
Hi, Tatiana.
Best
Regards.
The Page.Width/Page.Height are readonly properties and contain the physical width/height of PDF-page. It cannot be used for maximize/restore of our internal mdi-child. Currently you cannot manage state(normal/minimized/maximized) of our mdi-child - we have no any functionality for this. This feature can be added a bit later.I am planning on painting those buttons myself on my menu bar, and I would need to change page properties: Pages.Height, Pages.Width and Pages.ScreenX and Pages.ScreenY (for minimize) accordingly.
Confirmed. This bug will be fixed in the next build. Thanks for your report.Unfortunately there is bug, the buttons work only when Mouse Focus is reset.
Best
Regards.
PDF-XChange Co. LTD (Project Developer)
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
-
- User
- Posts: 103
- Joined: Mon Mar 18, 2013 4:26 pm
Re: Working with MDI
Thanks your help, when is the next build is going to go out?
-
- User
- Posts: 103
- Joined: Mon Mar 18, 2013 4:26 pm
Re: Working with MDI
Also, is there a way to hide 'Edit' menu. I need to have it when I export my settings from the Viewer, but need to hide when it is used in my app because I have my own menu.
Thanks.
Thanks.
-
- Site Admin
- Posts: 2445
- Joined: Thu Jun 30, 2005 4:11 pm
Re: Working with MDI
I cannot say exactly when but I hope - it can be in January..Thanks your help, when is the next build is going to go out?
You may hide/show menu-bar or any toolbar by:Also, is there a way to hide 'Edit' menu. I need to have it when I export my settings from the Viewer, but need to hide when it is used in my app because I have my own menu.
Code: Select all
pdfViewer.SetProperty("View.Bars[\"Menu\"].Visible", "false", 0);
pdfViewer.SetProperty("View.Bars[\"File\"].Visible", "true", 0);
PDF-XChange Co. LTD (Project Developer)
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
-
- User
- Posts: 103
- Joined: Mon Mar 18, 2013 4:26 pm
Re: Working with MDI
How can I export my setting if the 'Edit' menu is removed (it contains the export functionality).
Is there any shortcut keys I can use?
Is there any shortcut keys I can use?
-
- Site Admin
- Posts: 19868
- Joined: Mon Jan 12, 2009 8:07 am
Re: Working with MDI
Hi Tatyana,
Vasyl asked me to make a ticket in our system for this forum topic:
#2158: ActiveX: trouble with MDI-buttons. New MDI-features required.
So that we can resolve that for you.
Regards,
Stefan
Vasyl asked me to make a ticket in our system for this forum topic:
#2158: ActiveX: trouble with MDI-buttons. New MDI-features required.
So that we can resolve that for you.
Regards,
Stefan
-
- User
- Posts: 103
- Joined: Mon Mar 18, 2013 4:26 pm
Re: Working with MDI
Thank you so much. You guys are great 

-
- Site Admin
- Posts: 19868
- Joined: Mon Jan 12, 2009 8:07 am
-
- Site Admin
- Posts: 2445
- Joined: Thu Jun 30, 2005 4:11 pm
Re: Working with MDI
Yes, you may use shortcut but you should assign the new shortcut to the UI-command in [Menu/View/Toolbars/Customize Dialog/Commands Tab/Edit Category/Export All Settings to Data File command], because is no any shortcut for this command by default..How can I export my setting if the 'Edit' menu is removed (it contains the export functionality).
Is there any shortcut keys I can use?
PDF-XChange Co. LTD (Project Developer)
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
-
- User
- Posts: 103
- Joined: Mon Mar 18, 2013 4:26 pm
Re: Working with MDI
Thanks, that worked. 

-
- Site Admin
- Posts: 7361
- Joined: Wed Mar 25, 2009 10:37 pm
-
- User
- Posts: 103
- Joined: Mon Mar 18, 2013 4:26 pm
Re: Working with MDI
Hello,
I seem that the ticket #2158 was not resolved in the latest build. This is very important MDI feature and we will not be able to release our app without it. Could you please give me an approximate date when this can be fixed?
Thank you
Tatiana
I seem that the ticket #2158 was not resolved in the latest build. This is very important MDI feature and we will not be able to release our app without it. Could you please give me an approximate date when this can be fixed?
Thank you
Tatiana
-
- User
- Posts: 103
- Joined: Mon Mar 18, 2013 4:26 pm
Re: Working with MDI
Hello,
could you please reply to my question bellow...
Thanks,
Tatiana
could you please reply to my question bellow...
Thanks,
Tatiana
-
- Site Admin
- Posts: 19868
- Joined: Mon Jan 12, 2009 8:07 am
Re: Working with MDI
Hi TatianaS,
I've just asked for an update on when ticket #2158 is expected to be fixed and will post here as soon as I have the update.
Regards,
Stefan
I've just asked for an update on when ticket #2158 is expected to be fixed and will post here as soon as I have the update.
Regards,
Stefan
-
- Site Admin
- Posts: 2445
- Joined: Thu Jun 30, 2005 4:11 pm
Re: Working with MDI
Hi, Tatiana.
"MDIRestore",
"MDIRestoreAll",
"MDIMaximize",
"MDIMinimize",
"MDIMinimizeAll",
"MDICascade",
"MDITile",
"MDITileHorz",
"MDIIconArrange",
"MDIClose",
To use it:
pdfViewer.DoVerb("", "MDIMaximize", stub, null, 0);
Best
Regards.
Some details about new MDI-features in new build (upcoming). Added new simple operations:#2158: ActiveX: trouble with MDI-buttons. New MDI-features required.
"MDIRestore",
"MDIRestoreAll",
"MDIMaximize",
"MDIMinimize",
"MDIMinimizeAll",
"MDICascade",
"MDITile",
"MDITileHorz",
"MDIIconArrange",
"MDIClose",
To use it:
pdfViewer.DoVerb("", "MDIMaximize", stub, null, 0);
Best
Regards.
PDF-XChange Co. LTD (Project Developer)
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
-
- User
- Posts: 103
- Joined: Mon Mar 18, 2013 4:26 pm
Re: Working with MDI
Thanks, that a great news. I already have been using these commands for tiling and they work great:
fCoPDFXCview.DoVerb('', 'ExecuteCommand', 'Cascade', dataOut, 0);
fCoPDFXCview.DoVerb('', 'ExecuteCommand', 'TileHorizontal', dataOut, 0);
fCoPDFXCview.DoVerb('', 'ExecuteCommand', 'TileVertical', dataOut, 0);
I will not be using "MDIMaximize", "MDIRestore", etc myself, but rather expect your component to do it correctly when
I click on the MDI buttons (located on the main menu bar).
Thanks,
Tatiana
fCoPDFXCview.DoVerb('', 'ExecuteCommand', 'Cascade', dataOut, 0);
fCoPDFXCview.DoVerb('', 'ExecuteCommand', 'TileHorizontal', dataOut, 0);
fCoPDFXCview.DoVerb('', 'ExecuteCommand', 'TileVertical', dataOut, 0);
I will not be using "MDIMaximize", "MDIRestore", etc myself, but rather expect your component to do it correctly when
I click on the MDI buttons (located on the main menu bar).
Thanks,
Tatiana
-
- Site Admin
- Posts: 19868
- Joined: Mon Jan 12, 2009 8:07 am
Re: Working with MDI
Glad to hear these are working now Tatiana!
Cheers,
Stefan
Cheers,
Stefan