Changing the tTitle text at runtime

Changing the tTitle text at runtime

Postby Marco Turco » Sat May 07, 2011 12:48 pm

Any ideas ?
I tried with oTitle:SetText("New text") without success.

Thanks in advance.
Best Regards,

Marco Turco
SOFTWARE XP LLP
User avatar
Marco Turco
 
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London

Re: Changing the tTitle text at runtime

Postby Horizon » Sat May 07, 2011 1:02 pm

Hi Marco,

Can you try it oTitle:aText[3] := "New Text"
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1288
Joined: Fri May 23, 2008 1:33 pm

Re: Changing the tTitle text at runtime

Postby ukoenig » Sat May 07, 2011 1:33 pm

Marco,

in File : \samples\testtitl.prg change / add these lines for a Test :

Local oText1
...
...
// Title 1 Horizontal ( top )
@ 015,150 TITLE oTitle1 size 460, 60 of oWnd SHADOW TOPRIGHT
oTitle1:aGrdBack = { { 1, nRGB( 129, 130, 138 ), nRGB( 59, 60, 62 ) } }
oTitle1:nShadowIntensity = 70
@ 10, 10 TITLETEXT oText1 OF oTitle1 TEXT "FIVEWIN 9.07" FONT oFont1 BRUSH oBrush1
...
...
//Title 5 Horizontal( Down )
@ 480, 150 TITLE oTitle5 size 460, 60 of oWnd SHADOW BOTTOMLEFT SHADOWSIZE 2
@ 5, 10 TITLEIMG OF oTitle5 BITMAP "../bitmaps\32X32\keys.bmp" SIZE 30, 30 REFLEX TRANSPARENT ANIMA
@ 20, 60 TITLETEXT OF oTitle5 TEXT "<== Move over me" COLOR CLR_BLACK
@ 14, 220 TITLETEXT OF oTitle5 TEXT "FIVEWIN 9.07" COLOR CLR_BLACK FONT oFont2 3d
@ 5, 400 TITLEIMG OF oTitle5 BITMAP "../bitmaps\fivetech.bmp" SIZE 30, 30 REFLEX ;
ACTION oText1:SetText( "New text" )

Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Changing the tTitle text at runtime

Postby Marco Turco » Sat May 07, 2011 2:56 pm

Hi Uwe,
your last sample runs well but is there a solution to change the text directly from oTitle1 ?
Best Regards,

Marco Turco
SOFTWARE XP LLP
User avatar
Marco Turco
 
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London

Re: Changing the tTitle text at runtime

Postby ukoenig » Sat May 07, 2011 3:18 pm

Marco,

it works the same, also from inside the same Title

LOCAL oText1, oText2

//Title 5 Horizontal( Down )
@ 480, 150 TITLE oTitle5 size 460, 60 of oWnd SHADOW BOTTOMLEFT SHADOWSIZE 2

@ 5, 10 TITLEIMG OF oTitle5 BITMAP "../bitmaps\32X32\keys.bmp" SIZE 30, 30 REFLEX TRANSPARENT ANIMA ;
ACTION oText2:SetText( "<== Text changed" )

@ 20, 60 TITLETEXT oText2 OF oTitle5 TEXT "<== Move over me" COLOR CLR_BLACK
@ 14, 220 TITLETEXT OF oTitle5 TEXT "FIVEWIN 9.07" COLOR CLR_BLACK FONT oFont2 3d
@ 5, 400 TITLEIMG OF oTitle5 BITMAP "../bitmaps\fivetech.bmp" SIZE 30, 30 REFLEX ;
ACTION oText1:SetText("New text")

Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Changing the tTitle text at runtime

Postby Marco Turco » Sat May 07, 2011 3:21 pm

I mean something like oTitle1:xcontrol:settext("new text").
Best Regards,

Marco Turco
SOFTWARE XP LLP
User avatar
Marco Turco
 
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London

Re: Changing the tTitle text at runtime

Postby ukoenig » Sat May 07, 2011 4:13 pm

Hello Marco,

You don't need to define the Title, only the Textobject.
This button ( on Mainwindow ) changes the Text defined in Title 1.

// Style 2007
// -------------
@ 580, 300 BTNBMP oBtn1 OF oWnd ;
SIZE 200, 80 ;
PROMPT "&Change Text" 2007 ;
FONT oFont2 CENTER ;
ACTION oText1:SetText("FIVEWIN 9.10")

There could be another Combination :
A window with Titles, a Dialog and from inside the Dialog changing a Title-text of a Window-title.

...
...
ACTIVATE WINDOW OWND MAXIMIZED ;
ON INIT TEST_DLG( oWnd, oText1 )
...
...
FUNCTION TEST_DLG( oWnd, oText1 )
LOCAL oDlg
DEFINE DIALOG oDlg FROM 10, 10 TO 20, 45 OF oWnd ;
TITLE "Change Title-text" STYLE nOr( WS_VISIBLE, WS_OVERLAPPEDWINDOW )
@ 2, 2 BUTTON "&Change Title-text" ACTION oText1:SetText( "FIVEWIN 9.10" )
ACTIVATE DIALOG oDlg CENTERED
RETURN( NIL )

Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Changing the tTitle text at runtime

Postby Marco Turco » Sat May 07, 2011 4:43 pm

I know. The problem is that I manage all my app windows thorough a routine that return me only the object related to the tTitle object, not the tTitleText of tTitle object. It is for this reason that I can't use directly the tTitletext object and I need to find a solution through the tTitle object.
Best Regards,

Marco Turco
SOFTWARE XP LLP
User avatar
Marco Turco
 
Posts: 858
Joined: Fri Oct 07, 2005 12:00 pm
Location: London


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], SantaCroya and 20 guests