Text widget | developer.brewmp.com Text widget | developer.brewmp.com

Developer

Text widget

Hi,
I want to align the text within a text widget.Is that possible using the IDF_ALIGN_CENTER flag ? Or is there any other way to do it.

IDF_ALIGN_CENTER does not work.Anyone has any other idea.

IDF_ALIGN_CENTER does not work.Anyone has any other idea.

Is there any way to do that ?

Is there any way to do that ?

I don't think there's any way to center text within a text widget. If you really want to do that, you'll likely need to write a custom widget.
However, it is possible to center text within a static widget. Use the IDF_ALIGN_CENTER flag. The text will be centered within the extent of the widget, so make sure the widget is as wide as the area you want it centered within.

I don't think there's any way to center text within a text widget. If you really want to do that, you'll likely need to write a custom widget.
However, it is possible to center text within a static widget. Use the IDF_ALIGN_CENTER flag. The text will be centered within the extent of the widget, so make sure the widget is as wide as the area you want it centered within.

How do I write a custom widget ? Pls guide me on that.I am not having any success with the viewport and using a static widget also.It only work for a particular extent.Any idea why this happens ? Waiting for your response.Thanks in advance

How do I write a custom widget ? Pls guide me on that.I am not having any success with the viewport and using a static widget also.It only work for a particular extent.Any idea why this happens ? Waiting for your response.Thanks in advance

TextWidget has many properites such as indicator pos, maybe you can set the pos right after the widget is created, the pos can be calculated because you know the widget's extent, i just give an idea, i don't know if there is an indicator pos or does it work.
So i am waiting for the answer, too

TextWidget has many properites such as indicator pos, maybe you can set the pos right after the widget is created, the pos can be calculated because you know the widget's extent, i just give an idea, i don't know if there is an indicator pos or does it work.
So i am waiting for the answer, too

I thought of this but it will work only if the text will be the same each time.In my case the text will be dynamic and will change each time.Then in some cases it will look bad.

I thought of this but it will work only if the text will be the same each time.In my case the text will be dynamic and will change each time.Then in some cases it will look bad.

HI
you may need to know the text font size and the number of characters each time inputted and then do the calculate, (W)STRLEN and GetFontSize may be helpful.
Also this is just an idea, hehe

HI
you may need to know the text font size and the number of characters each time inputted and then do the calculate, (W)STRLEN and GetFontSize may be helpful.
Also this is just an idea, hehe

Hey.. Forget about the text widget.. Is there any way to have one container on the form static and the other one scrollable ?

Hey.. Forget about the text widget.. Is there any way to have one container on the form static and the other one scrollable ?

hi:
Sure there is a way, just create 2 containers and insert them to a form, one of the containers is wrapped by scroll bar decorator, i guess it would work...

hi:
Sure there is a way, just create 2 containers and insert them to a form, one of the containers is wrapped by scroll bar decorator, i guess it would work...

Doesn`t work :(
Is there any tutorial on custom widget based on a text widget.. pls let me know.

Doesn`t work :(
Is there any tutorial on custom widget based on a text widget.. pls let me know.

cirion wrote:I don't think there's any way to center text within a text widget. If you really want to do that, you'll likely need to write a custom widget.
However, it is possible to center text within a static widget. Use the IDF_ALIGN_CENTER flag. The text will be centered within the extent of the widget, so make sure the widget is as wide as the area you want it centered within.
You can try getting the textlayout object from the textwidget and set alignment for the textlayout. ITextLayout might be supporting the alignment flags.
-empeegee

cirion wrote:I don't think there's any way to center text within a text widget. If you really want to do that, you'll likely need to write a custom widget.
However, it is possible to center text within a static widget. Use the IDF_ALIGN_CENTER flag. The text will be centered within the extent of the widget, so make sure the widget is as wide as the area you want it centered within.
You can try getting the textlayout object from the textwidget and set alignment for the textlayout. ITextLayout might be supporting the alignment flags.
-empeegee

You better write a TextWidget/TextLayout extension (BUIW 201) for that.. for more details look at the flage RtoL (TLLF_RIGHT_TO_LEFT) flag implementation .. it will provide certain inputs for implementing the logic!!

You better write a TextWidget/TextLayout extension (BUIW 201) for that.. for more details look at the flage RtoL (TLLF_RIGHT_TO_LEFT) flag implementation .. it will provide certain inputs for implementing the logic!!