Page 1 of 1

Text Rotation

Posted: Tue Aug 14, 2018 12:34 am
by dominique
Hi

Does anyone know how to rotate a label or something else like in the Picture below?
leftMen.jpg
leftMen.jpg (10.17 KiB) Viewed 1355 times
I couldn't find the trick to place my element at the correct place. All my attempts have failed. :cry:

Thanks
Dominique

Re: Text Rotation

Posted: Wed Aug 15, 2018 2:18 am
by TomC
There might be a better way to do this, but if you place a label onto a panel (fit height/width) and set the rotation property of the label to 270 it should work.

The label should be transparent, and the panel is used to fill in the background. If you wanted to add the 45 degree angle, look to use the skew property with another panel which is white.

Note that rotation/skew/etc do not show up at design time.

Here is an example:

Code: Select all

Begin_Com Role(*EXTENDS #PRIM_WEB) Layoutmanager(#LayoutMain) Theme(#SYS_THEME<MaterialDesignBlue>)
Define_Com Class(#PRIM_VS.Style) Name(#Style1) Backgroundbrush(#Brush1)
Define_Com Class(#PRIM_VS.SolidBrush) Name(#Brush1) Color(74:178:255)

Define_Com Class(#PRIM_VS.Style) Name(#Style2)

Define_Com Class(#PRIM_TBLO) Name(#LayoutMain)
Define_Com Class(#PRIM_TBLO.Column) Name(#LayoutMainColumn1) Displayposition(1) Parent(#LayoutMain) Units(Pixels) Width(60)
Define_Com Class(#PRIM_TBLO.Column) Name(#LayoutMainColumn2) Displayposition(2) Parent(#LayoutMain)
Define_Com Class(#PRIM_TBLO.Row) Name(#LayoutMainRow1) Displayposition(1) Parent(#LayoutMain) Units(Pixels) Height(100)
Define_Com Class(#PRIM_TBLO.Row) Name(#LayoutMainRow2) Displayposition(2) Parent(#LayoutMain)
Define_Com Class(#PRIM_TBLO.Item) Name(#LayoutMainItem1) Alignment(TopLeft) Column(#LayoutMainColumn1) Manage(#Panel1) Parent(#LayoutMain) Row(#LayoutMainRow2) Sizing(FitToWidth)
Define_Com Class(#PRIM_TBLO.Item) Name(#LayoutMainItem2) Column(#LayoutMainColumn1) Manage(#Panel2) Parent(#LayoutMain) Row(#LayoutMainRow1) Columnspan(2)
Define_Com Class(#PRIM_TBLO) Name(#Layout1)
Define_Com Class(#PRIM_TBLO.Row) Name(#Layout1Row1) Displayposition(1) Parent(#Layout1)
Define_Com Class(#PRIM_TBLO.Column) Name(#Layout1Column1) Displayposition(1) Parent(#Layout1)
Define_Com Class(#PRIM_TBLO.Item) Name(#Layout1Item1) Column(#Layout1Column1) Parent(#Layout1) Row(#Layout1Row1)
Define_Com Class(#PRIM_TBLO.Item) Name(#Layout1Item2) Column(#Layout1Column1) Parent(#Layout1) Row(#Layout1Row1)
Define_Com Class(#PRIM_TBLO.Item) Name(#Layout1Item3) Column(#Layout1Column1) Manage(#Label1) Parent(#Layout1) Row(#Layout1Row1)
Define_Com Class(#PRIM_PANL) Name(#Panel1) Displayposition(1) Left(0) Parent(#COM_OWNER) Tabposition(1) Tabstop(False) Top(100) Height(141) Themedrawstyle('MediumTitle') Layoutmanager(#Layout1) Width(60) Style(#Style1)
Define_Com Class(#PRIM_LABL) Name(#Label1) Caption('Label1') Displayposition(1) Height(141) Left(0) Parent(#Panel1) Tabposition(1) Top(0) Rotation(270) Width(60) Tabstop(False) Alignment(Center) Verticalalignment(Center) Style(#Style2)
Define_Com Class(#PRIM_PANL) Name(#Panel2) Displayposition(2) Left(0) Parent(#COM_OWNER) Tabposition(2) Tabstop(False) Top(0) Height(100) Width(1200) Style(#Style1)
End_Com

Re: Text Rotation

Posted: Wed Aug 15, 2018 3:59 pm
by dominique
Thanks Tom

In the meantime I have found a similar solution. At the end I had to code in a very static way. The layout manager did not work as expected especially you want to have the label on top. To handle this I had to slide panels in each other objects and if my lable changes in future I have to adjust everything new by hand. Can this be the best solution or am I doing something wrong?
TopMargin,jpg.jpg
TopMargin,jpg.jpg (8.61 KiB) Viewed 1319 times
Dominique