Quantcast
Channel: Northwoods Software - Latest topics
Viewing all articles
Browse latest Browse all 7425

Textbox text alignment

$
0
0

@Tany wrote:

Hi,
I'm trying to create some group template with an header that has the group key.
I'm using textblock to put the group header and i want the group header to be in the center of the header.
Here is my Group template. For some reason the text is align to left. I tried to use textAlign, verticalAlignment, strech, in order to centrelize the group name. No Success....

function defaultGroupTemplate() {
var GO = $;
var x =
GO(go.Group, "Vertical", // Header and group members panel one below each other
{
isSubGraphExpanded: true,
ungroupable: true,
background: "white",
isShadowed: true,
//doubleClick: function(e, node) { that.expandGroup(node); },
width: 200, height: 300,
defaultStretch: go.GraphObject.Horizontal,
},

                    // Panel for holding COLLAPSED Group Header info
                    GO(go.Panel, "Horizontal",
                            {
                                background: "#124386",
                            },
                            GO("SubGraphExpanderButton", {
                                        alignment: go.Spot.Left,
                                        desiredSize: new go.Size(35,35),
                                    },
                            ),
                            // group name in Header
                            GO(go.TextBlock,
                                    {
                                        font: "bold 14pt rubikregular",
                                        editable: false,
                                        stroke: "white",
                                        margin: 2,
                                        verticalAlignment: go.Spot.TopCenter,
                                        textAlign: "center",
                                        stretch: go.GraphObject.Horizontal,
                                    },
                                    new go.Binding("text", "key").makeTwoWay()
                            ),
                    ),
            ); // end of Header Panel
    return x;
}

Anyi ideas ?

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7425