Skip to main content
Inspiring
July 1, 2013
Answered

SetVJBalanceColumns does not notify Indesign

  • July 1, 2013
  • 2 replies
  • 1243 views

Hi,

I need to set the balance columns of a selection of textframes as chosen by my plug-in user, through my plug-in action.

So after a selection is done, I fetch all the selected items, and for all the textframes, I call

void IMultiColumnTextFrame :: SetVJBalanceColumns(bool)

I wrap these calls in a command, because it changes the persistant data of the textframes. My problem is, the Balance Columns  and Unbalance Columns buttons that appear on selection of a textframe do not get notified and as a result, unless my selection gets changed, they are not updated.

On further inspection, I found that kSetVJBalanceColumnsCmdBoss is the class that is triggered when the balance is set through indesign's own Balance/Unbalance buttons.

So, how can notify indesign that I have changed balance column settings?

This topic has been closed for replies.
Correct answer maddy1907

Try,

IMultiColumnTextFrame::RecomposeThru();


Hi  Norio and Bartek,

I simple deselected the items and reseleted them. It updated the UI of Indesign. Not sure if this is the right solution but it works.

Thanks alot for your inputs.

2 replies

Legend
July 2, 2013

Why do you need an own command?

Notification is the responsibility of the command. In general you should only create an own command for own persistent data. For existing data use the existing command (you mentioned you already found kSetVJBalanceColumnsCmdBoss).

Dirk

maddy1907Author
Inspiring
July 3, 2013

Hi Dirk,

For a textframe, I maintain the state(my own perisistant data besides indesign's) of balance columns that I needed to update the moment I had changed the Balance column info. So, what should have been my approach incase of an undo? Is there a way I can undo two commands together. Sorry if it's  naive question. (A little code could help)

Regards

maddy1907

Legend
July 4, 2013

From ICommand.h:

kAutoUndo The command does not show up in undo / redo menu items, it is always undone / redone with some other step.

In earlier versions of the SDK this was called kAutoUndoWithPrevious.

You choose this mode when for example the command is triggered by the notification of the previous command.

To combine multiple commands issued by yourself, you'd wrap them with a command sequence.

Dirk

Bartek_Kropaczewski
Inspiring
July 1, 2013

Hi. If you wan't see the changes immediately u can use.

Utils<ILayoutUtils>()->InvalidateViews(iDoc);

Regards

Bartek

maddy1907Author
Inspiring
July 2, 2013

Hi Bartek,

I've already tried, does not work.

Regards

maddy1907

Inspiring
July 2, 2013

Try,

IMultiColumnTextFrame::RecomposeThru();