FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Changing the tTitle text at runtime
Posts: 858
Joined: Fri Oct 07, 2005 12:00 PM
Changing the tTitle text at runtime
Posted: 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
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: Changing the tTitle text at runtime
Posted: Sat May 07, 2011 01:02 PM

Hi Marco,

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

Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Changing the tTitle text at runtime
Posted: Sat May 07, 2011 01: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 :-)
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.
Posts: 858
Joined: Fri Oct 07, 2005 12:00 PM
Re: Changing the tTitle text at runtime
Posted: Sat May 07, 2011 02: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
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Changing the tTitle text at runtime
Posted: Sat May 07, 2011 03: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 :-)
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.
Posts: 858
Joined: Fri Oct 07, 2005 12:00 PM
Re: Changing the tTitle text at runtime
Posted: Sat May 07, 2011 03:21 PM

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

Best Regards,



Marco Turco

SOFTWARE XP LLP
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Changing the tTitle text at runtime
Posted: Sat May 07, 2011 04: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 :-)
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.
Posts: 858
Joined: Fri Oct 07, 2005 12:00 PM
Re: Changing the tTitle text at runtime
Posted: Sat May 07, 2011 04: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

Continue the discussion