How to Add Custom Buttons?

Ask for help and post your question on how to use XnView MP.

Moderators: XnTriq, helmut, xnview

power1
Posts: 9
Joined: Wed Jul 30, 2014 8:21 pm

How to Add Custom Buttons?

Post by power1 »

Hello, Where we can find the list of available "cmd_???" commands and a tutorial on how to add custom buttons? I need to add these custom buttons: "Filter by Images", "Filter by All", "View as Thumbnails + Filename" and "View as Details". Thanks.
User avatar
m.Th.
XnThusiast
Posts: 1666
Joined: Wed Aug 16, 2006 6:31 am

Re: How to Add Custom Buttons?

Post by m.Th. »

Go to Tools | Settings | Interface | Toolbar

Choose a command in the list from left and press the ">" button which is in the middle of the form. It will add the currently selected button to the list from the right which represents the toolbar buttons.

Beware, there are two modes: "Browse mode" (when you're in the thumbs pane) and "View mode" (when you're in Full Screen or you're looking at a picture in a separate tab).

Some actions (including (some of?) the ones which you mention) perhaps aren't available as separate actions because you already have for them buttons in the File Toolbar (the small toolbar just above the thumbs pane).
m. Th.

- Dark Themed XnViewMP 1.7.1 64bit on Win11 x64 -
power1
Posts: 9
Joined: Wed Jul 30, 2014 8:21 pm

Re: How to Add Custom Buttons?

Post by power1 »

OK, thanks for the reply. Both "Filter by [menu]" and "View as [menu]" can be added as you described ... I need to add Filter and View buttons, rather than menus. I guess this is not possible then.
power1
Posts: 9
Joined: Wed Jul 30, 2014 8:21 pm

Re: How to Add Custom Buttons?

Post by power1 »

Hello, We can add a toolbar button to run an exe or a batch file. How we can pass on the file name of the selected image to that exe/bat file? Thanks!
power1
Posts: 9
Joined: Wed Jul 30, 2014 8:21 pm

Re: How to Add Custom Buttons?

Post by power1 »

Well, I guess this is not possible either as there is no response on how to do it.
User avatar
XnTriq
Moderator & Librarian
Posts: 6352
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: How to Add Custom Buttons?

Post by XnTriq »

  1. Click somewhere on the toolbar with the right mouse button and select Customize toolbar... in the context menu.
  2. Select a mode (Browse mode or View mode).
  3. Select -- COMMAND -- in the list on the left and add it to the list on the right by clicking on the button.
  4. Click on Set command... to specify an EXE/BAT file or an XBS script.
  5. Click on Set label... to define a tooltip.
  6. Click on the blank button to select an icon.
power1
Posts: 9
Joined: Wed Jul 30, 2014 8:21 pm

Re: How to Add Custom Buttons?

Post by power1 »

Thank you. I think I have found a bug: XNViewMP passes the file path using "/" while Windows expects "\" and thats why the image file doesn't get passes on to the batch file.

Edit: For now, you can have a batch file like this to get it working:
set a="%~1"
set a=%a:/=\%
start "" "C:\windows\system32\mspaint.exe" %a%