Page 1 of 1

StringGadget Center Text

Posted: Mon Jun 10, 2013 11:23 pm
by Blankname
How would I go about center aligning the text inside of a StringGadget.

Image

Re: StringGadget Center Text

Posted: Tue Jun 11, 2013 2:22 am
by skywalk
Windows snippet only I think...

Code: Select all

Define.i gf
gf = gf|#PB_Text_Center ; text is centered in the gadget.
;gf = gf|#PB_Text_Right  ;  text is right aligned.
;gf = gf|0              ; text is left aligned by default.
mystringgadget_n = StringGadget(#PB_Any, x, y, Wd, Ht, Txt$, gf|#ES_NOHIDESEL)

Re: StringGadget Center Text

Posted: Tue Jun 11, 2013 3:05 am
by Blankname
skywalk wrote:Windows snippet only I think...

Code: Select all

Define.i gf
gf = gf|#PB_Text_Center ; text is centered in the gadget.
;gf = gf|#PB_Text_Right  ;  text is right aligned.
;gf = gf|0              ; text is left aligned by default.
mystringgadget_n = StringGadget(#PB_Any, x, y, Wd, Ht, Txt$, gf|#ES_NOHIDESEL)
It's a no go, #PB_Text_Center doesn't seem to work.

Re: StringGadget Center Text

Posted: Tue Jun 11, 2013 3:21 am
by skywalk
try: StringGadget(1, 10, 45, 150, 20, "-1.234e-12", #ES_CENTER)
EDIT:
Both #ES_CENTER and #PB_TEXT_CENTER = 1 and work for me on PB 5.11, Win7 x86.