Author Topic: PJSR: TreeBoxNode.setAlignment has no effect?  (Read 4303 times)

Offline mschuster

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1087
PJSR: TreeBoxNode.setAlignment has no effect?
« on: 2014 December 30 08:52:37 »
Hi Juan,

Win 7 1123.

I am trying to right align a numeric TreeBoxNode column to so that %.1f decimal points are aligned. treeBox.setHeaderAlignment(<col>, TextAlign_Right | TextAlign_VertCenter) works fine. But treeBoxNode.setAlignment(<col>, TextAlign_Right | TextAlign_VertCenter) has no effect. A subsequent call to treeBoxNode.alignment(<col>) returns TextAlign_Left | TextAlign_VertCenter, and text remains left aligned.

Thanks,
Mike

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: PJSR: TreeBoxNode.setAlignment has no effect?
« Reply #1 on: 2014 December 30 09:51:40 »
Hi Mike,

This is a documentation problem. TextAlign_XXX flags are not applicable to TreeBoxNode columns. Use the following constants for calls to TreeBoxNode.setAlignment() :

#define Align_Left   1
#define Align_Right  2
#define Align_Center 3


Note that vertical alignment cannot be set for TreeBoxNode objects. Note also that you have to call setAlignment() for each TreeBoxNode that you create, that is, alignment (as the rest of node visualization properties such as font, color, etc) is a column property of each individual node, not of a table column.

In the next version I'll include a pjsr/Align.jsh header with these constants.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline mschuster

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1087
Re: PJSR: TreeBoxNode.setAlignment has no effect?
« Reply #2 on: 2014 December 30 11:58:09 »
Thanks, Align_Right works.

FYI: These constants are defined in Sizer.h.

Thanks you also for the Array/Matrix comments. Code uses Arrays extensively, to convert to Matrix involves lots of work unfortunately.

Mike