How to create "Save As" MenuCommand?
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.
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.
-
- User
- Posts: 141
- Joined: Sat Aug 27, 2016 11:00 am
How to create "Save As" MenuCommand?
Hello,
I have Created pdfviewer using pdfxcontrol.
I want to create "Save As" MenuCommand same as "Save" Command.
How could it possible?
i have atteched image for demo.
i'm looking forward to it.
Thanks.
I have Created pdfviewer using pdfxcontrol.
I want to create "Save As" MenuCommand same as "Save" Command.
How could it possible?
i have atteched image for demo.
i'm looking forward to it.
Thanks.
- Attachments
-
- Save As.rar
- (440.04 KiB) Downloaded 81 times
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: How to create "Save As" MenuCommand?
Hello vivekpatel,
You mean, you want the Save As command to behave the same way as the Save command when the user clicks it?
Cheers,
Alex
You mean, you want the Save As command to behave the same way as the Save command when the user clicks it?
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 141
- Joined: Sat Aug 27, 2016 11:00 am
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: How to create "Save As" MenuCommand?
Then this piece of code should do that:
Cheers,
Alex
Code: Select all
PDFXEdit.IUIX_Inst iuiInst = (PDFXEdit.IUIX_Inst)pdfCtl.Inst.GetExtension("UIX");
PDFXEdit.IUIX_Cmd cmdSave = iuiInst.CmdManager.Cmds.Find("cmd.save");
PDFXEdit.IUIX_Cmd cmdSaveAs = iuiInst.CmdManager.Cmds.Find("cmd.saveAs");
cmdSaveAs.Handler = cmdSave.Handler;
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 141
- Joined: Sat Aug 27, 2016 11:00 am
Re: How to create "Save As" MenuCommand?
Hello,
I have one problem with Save Command.
I want to set save command always enable,in any mode.
i tried,
Dim cmdSave As PDFXEdit.IUIX_Cmd = uiInst.CmdManager.Cmds.Find("cmd.save")
Dim cmdSaveAs As PDFXEdit.IUIX_Cmd = uiInst.CmdManager.Cmds.Find("cmd.saveAs")
cmdSave.Handler = cmdSaveAs.Handler
cmdSave.Title = "Save As"
cmdSave.Offline = False
cmdSave.Hidden = False
it doesn't work.
so what to do?
Thanks.
I have one problem with Save Command.
I want to set save command always enable,in any mode.
i tried,
Dim cmdSave As PDFXEdit.IUIX_Cmd = uiInst.CmdManager.Cmds.Find("cmd.save")
Dim cmdSaveAs As PDFXEdit.IUIX_Cmd = uiInst.CmdManager.Cmds.Find("cmd.saveAs")
cmdSave.Handler = cmdSaveAs.Handler
cmdSave.Title = "Save As"
cmdSave.Offline = False
cmdSave.Hidden = False
it doesn't work.
so what to do?
Thanks.
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: How to create "Save As" MenuCommand?
Hello vivekpatel,
Check out this sample:
https://gist.github.com/Polaringu/16bb2 ... 7cbe36f4e6
In the custom command handler, you should always return UIX_CmdItemState_Normal in the OnGetItemState method.
Cheers,
Alex
Check out this sample:
https://gist.github.com/Polaringu/16bb2 ... 7cbe36f4e6
In the custom command handler, you should always return UIX_CmdItemState_Normal in the OnGetItemState method.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 141
- Joined: Sat Aug 27, 2016 11:00 am
Re: How to create MenuCommand with dropdown option?
Hello,
How to create menucommand with dropdown like open menucommand?
Thanks.
How to create menucommand with dropdown like open menucommand?
Thanks.
- Attachments
-
- DropButton.rar
- (72.07 KiB) Downloaded 76 times
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: How to create "Save As" MenuCommand?
Hello vivekpatel,
Please describe what do you want to do with that dropdown and what it will hold inside.
Cheers,
Alex
Please describe what do you want to do with that dropdown and what it will hold inside.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 141
- Joined: Sat Aug 27, 2016 11:00 am
Re: How to create "Save As" MenuCommand?
Hello,
I want to Create MenuCommand "View" with dropdown having items "Documetn Panel, Property Panel, Thumnail Panel" etc.
Whenever i click this dropdown item panels are hide/show and dropdown item is marked with right sign when panel is show.
Thanks.
I want to Create MenuCommand "View" with dropdown having items "Documetn Panel, Property Panel, Thumnail Panel" etc.
Whenever i click this dropdown item panels are hide/show and dropdown item is marked with right sign when panel is show.
Thanks.
- Attachments
-
- View.rar
- (6.53 KiB) Downloaded 86 times
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: How to create "Save As" MenuCommand?
Hello vivekpatel,
Here's the sample I have that adds a command with two submenu commands to the Help menu:
Cheers,
Alex
Here's the sample I have that adds a command with two submenu commands to the Help menu:
Code: Select all
PDFXEdit.IUIX_CmdBar cmdBar = pdfCtl.Inst.ActiveMainFrm.View.MenuBar;
int nFlatIndex = cmdBar.FlatFindFirstItemByCmdName("cmd.help");
PDFXEdit.IUIX_CmdItem cmdHelp = cmdBar.FlatGetItem(nFlatIndex);
PDFXEdit.IUIX_CmdMenu helpMenu = cmdHelp.SubMenu;
cmdHandler = new PdfEditorCommandHandler(pdfCtl.Inst);
int nCmdLang = pdfCtl.Inst.Str2ID("cmd.help.language");
PDFXEdit.IUIX_Cmd cmd = uiInst.CmdManager.Cmds.AddNew2(nCmdLang, 0, cmdHandler);
cmd.Title = "Languages";
helpMenu.InsertSeparator();
PDFXEdit.IUIX_CmdMenu cmdLangMenu = helpMenu.InsertItem2(nCmdLang, -1, (int)PDFXEdit.UIX_CmdItemStyleFlags.UIX_CmdItemStyle_HasPopup | (int)PDFXEdit.UIX_CmdItemStyleFlags.UIX_CmdItemStyle_WholePopup, (int)PDFXEdit.UIX_CmdItemStyleFlags.UIX_CmdItemStyle_HasPopup | (int)PDFXEdit.UIX_CmdItemStyleFlags.UIX_CmdItemStyle_WholePopup);
cmdLangMenu.DeleteAllItems();
int nCmdLangEng = pdfCtl.Inst.Str2ID("cmd.help.language.english");
PDFXEdit.IUIX_Cmd cmdEng = uiInst.CmdManager.Cmds.AddNew2(nCmdLangEng, 0, cmdHandler);
cmdEng.Title = "English";
cmdLangMenu.InsertItem2(nCmdLangEng);
cmdLangMenu.InsertSeparator();
int nCmdLangFr = pdfCtl.Inst.Str2ID("cmd.help.language.french");
PDFXEdit.IUIX_Cmd cmdFr = uiInst.CmdManager.Cmds.AddNew2(nCmdLangFr, 0, cmdHandler);
cmdFr.Title = "French";
cmdLangMenu.InsertItem2(nCmdLangFr);
cmdLangMenu.InsertSeparator();
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 141
- Joined: Sat Aug 27, 2016 11:00 am
Re: How to create "Save As" MenuCommand?
Hello,
This is not exactly that i want.
I want to create Command Menu or Button with options like open Command.
Thanks.
This is not exactly that i want.
I want to create Command Menu or Button with options like open Command.
Thanks.
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: How to create "Save As" MenuCommand?
Hello vivekpatel,vivekpatel wrote:Hello,
I want to Create MenuCommand "View" with dropdown having items "Documetn Panel, Property Panel, Thumnail Panel" etc.
Whenever i click this dropdown item panels are hide/show and dropdown item is marked with right sign when panel is show.
Thanks.
The sample, I gave you does exactly what you want.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 141
- Joined: Sat Aug 27, 2016 11:00 am
Re: How to create "Save As" MenuCommand?
Hello,
I'm Sorry to say that your code not working.
i have attached my sample code so, that will help yo.
In Sample there is one Function like "CreateDropButton". it produce error.
I'm Sorry to say that your code not working.
i have attached my sample code so, that will help yo.
In Sample there is one Function like "CreateDropButton". it produce error.
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: How to create "Save As" MenuCommand?
Hello vivekpatel,
Your archive contained malware - I'm removing it: Cheers,
Alex
Your archive contained malware - I'm removing it: Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 141
- Joined: Sat Aug 27, 2016 11:00 am
Re: How to create "Save As" MenuCommand?
Hello,
Still it is not working for Commnad Menu.
Still it is not working for Commnad Menu.
- Attachments
-
- DropDownButton.rar
- (117.37 KiB) Downloaded 79 times
-
- User
- Posts: 141
- Joined: Sat Aug 27, 2016 11:00 am
Re: How to create "Save As" MenuCommand?
Hello,
Here is my code that i have added.
Dim cmdBar As PDFXEdit.IUIX_Cmd = uiInst.CmdManager.Cmds.Find("cmd.Save_As")
Dim nFlatIndex As Integer = cmdBar.FlatFindFirstItemByCmdName("cmd.Save_As")
Dim cmdHelp As PDFXEdit.IUIX_CmdItem = cmdBar.FlatGetItem(nFlatIndex)
Dim helpMenu As PDFXEdit.IUIX_CmdMenu = cmdHelp.SubMenu
PdfEditorCommandHandlerobj = New PdfEditorCommandHandler1()
Dim nCmdLang As Integer = pdfctrl.Inst.Str2ID("cmd.Save_As.PropertyPanel", True)
Dim cmd1 As PDFXEdit.IUIX_Cmd = uiInst.CmdManager.Cmds.AddNew2(nCmdLang, -1, PdfEditorCommandHandlerobj)
cmd1.Title = "Property"
helpMenu.InsertSeparator()
Dim cmdLangMenu As PDFXEdit.IUIX_CmdMenu = helpMenu.InsertItem2(nCmdLang, 0, PDFXEdit.UIX_CmdItemStyleFlags.UIX_CmdItemStyle_HasPopup Or PDFXEdit.UIX_CmdItemStyleFlags.UIX_CmdItemStyle_WholePopup, PDFXEdit.UIX_CmdItemStyleFlags.UIX_CmdItemStyle_HasPopup Or PDFXEdit.UIX_CmdItemStyleFlags.UIX_CmdItemStyle_WholePopup)
cmdLangMenu.DeleteAllItems()
Dim nCmdLangEng As Integer = pdfctrl.Inst.Str2ID("cmd.help.language.english", True)
Dim cmdEng As PDFXEdit.IUIX_Cmd = uiInst.CmdManager.Cmds.AddNew2(nCmdLangEng, 0, PdfEditorCommandHandlerobj)
cmdEng.Title = "English"
pdfctrl.Inst.ActiveMainFrm.View.MenuBar.FindFirstItemByCmdName("cmd.help").SubMenu.InsertItem2(nCmdLangEng, 0)
cmdLangMenu.InsertItem2(nCmdLangEng, 0)
cmdLangMenu.InsertSeparator()
it is not working.
Here is my code that i have added.
Dim cmdBar As PDFXEdit.IUIX_Cmd = uiInst.CmdManager.Cmds.Find("cmd.Save_As")
Dim nFlatIndex As Integer = cmdBar.FlatFindFirstItemByCmdName("cmd.Save_As")
Dim cmdHelp As PDFXEdit.IUIX_CmdItem = cmdBar.FlatGetItem(nFlatIndex)
Dim helpMenu As PDFXEdit.IUIX_CmdMenu = cmdHelp.SubMenu
PdfEditorCommandHandlerobj = New PdfEditorCommandHandler1()
Dim nCmdLang As Integer = pdfctrl.Inst.Str2ID("cmd.Save_As.PropertyPanel", True)
Dim cmd1 As PDFXEdit.IUIX_Cmd = uiInst.CmdManager.Cmds.AddNew2(nCmdLang, -1, PdfEditorCommandHandlerobj)
cmd1.Title = "Property"
helpMenu.InsertSeparator()
Dim cmdLangMenu As PDFXEdit.IUIX_CmdMenu = helpMenu.InsertItem2(nCmdLang, 0, PDFXEdit.UIX_CmdItemStyleFlags.UIX_CmdItemStyle_HasPopup Or PDFXEdit.UIX_CmdItemStyleFlags.UIX_CmdItemStyle_WholePopup, PDFXEdit.UIX_CmdItemStyleFlags.UIX_CmdItemStyle_HasPopup Or PDFXEdit.UIX_CmdItemStyleFlags.UIX_CmdItemStyle_WholePopup)
cmdLangMenu.DeleteAllItems()
Dim nCmdLangEng As Integer = pdfctrl.Inst.Str2ID("cmd.help.language.english", True)
Dim cmdEng As PDFXEdit.IUIX_Cmd = uiInst.CmdManager.Cmds.AddNew2(nCmdLangEng, 0, PdfEditorCommandHandlerobj)
cmdEng.Title = "English"
pdfctrl.Inst.ActiveMainFrm.View.MenuBar.FindFirstItemByCmdName("cmd.help").SubMenu.InsertItem2(nCmdLangEng, 0)
cmdLangMenu.InsertItem2(nCmdLangEng, 0)
cmdLangMenu.InsertSeparator()
it is not working.
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: How to create "Save As" MenuCommand?
Hello vivekpatel,
When doing a translation to VB.Net please read the original code more thoroughly. I have this:
and here's your translation:
Also, there is no "cmd.Save_As" command ID - launch the FullDemo and see the Commands Tab for the available commands list. Or open the End User Editor's Customize Toolbars dialog and look for the needed command there.
Cheers,
Alex
When doing a translation to VB.Net please read the original code more thoroughly. I have this:
Code: Select all
PDFXEdit.IUIX_CmdBar cmdBar = pdfCtl.Inst.ActiveMainFrm.View.MenuBar;
Code: Select all
Dim cmdBar As PDFXEdit.IUIX_Cmd = uiInst.CmdManager.Cmds.Find("cmd.Save_As")
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 141
- Joined: Sat Aug 27, 2016 11:00 am
Re: How to create "Save As" MenuCommand?
Hello,
I Did this, but how to add sub menu in this cmd ("cmd.Save_As")?
I Did this, but how to add sub menu in this cmd ("cmd.Save_As")?
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: How to create "Save As" MenuCommand?
Hello vivekpatel,
Please refer to my previous post:
Cheers,
Alex
Please refer to my previous post:
Also, note that the ID of a IUIX_Cmd and IUIX_CmdBar are not the same. See the FullDemo application for the ID's of the Command Bars - they should be in the top of the enumeration.Also, there is no "cmd.Save_As" command ID - launch the FullDemo and see the Commands Tab for the available commands list. Or open the End User Editor's Customize Toolbars dialog and look for the needed command there.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 141
- Joined: Sat Aug 27, 2016 11:00 am
Re: How to create "Save As" MenuCommand?
Hello,
cmd.Save_As is my own command added to MenuBar.
cmd.Save_As is my own command added to MenuBar.
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: How to create "Save As" MenuCommand?
That's an ID of the Command then, not a Command Bar.
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 141
- Joined: Sat Aug 27, 2016 11:00 am
Re: How to create "Save As" MenuCommand?
Hello,
Could you please send me a simple demo of how to add submenu in cmd.
i'm looking forward to it.
Could you please send me a simple demo of how to add submenu in cmd.
i'm looking forward to it.
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: How to create "Save As" MenuCommand?
Hello vivekpatel,
Please refer to this post:
https://forum.pdf-xchange.com/ ... 04#p112332
Cheers,
Alex
Please refer to this post:
https://forum.pdf-xchange.com/ ... 04#p112332
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ