Text on a brush

Text on a brush

Postby betoncu » Thu Jun 29, 2006 3:48 am

I print a text on a brush in a main window.
But when I open a client window in the main window
it clears the text printed in the main window.
How can I get rid of this problem?

Many Thanks
Birol Betoncu
User avatar
betoncu
 
Posts: 126
Joined: Sat Oct 08, 2005 9:38 pm
Location: Cyprus (North)

Postby Antonio Linares » Thu Jun 29, 2006 5:24 am

Birol,

You have to paint it from the ON PAINT clause of the window:

ACTIVATE WINDOW oWnd ;
ON PAINT ...
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby betoncu » Fri Jun 30, 2006 5:30 pm

Thanks Antonio. I will try.
User avatar
betoncu
 
Posts: 126
Joined: Sat Oct 08, 2005 9:38 pm
Location: Cyprus (North)

Postby betoncu » Sun Jul 02, 2006 6:54 pm

Antonio,
If I use a dialog it is OK.
But when I use a window the text overlays the client window.
Any Suggestions?

Many Thanks,
Birol
User avatar
betoncu
 
Posts: 126
Joined: Sat Oct 08, 2005 9:38 pm
Location: Cyprus (North)

Postby Antonio Linares » Sun Jul 02, 2006 8:34 pm

Birol,

> But when I use a window the text overlays the client window.

Please post an image of it, or a sample to reproduce it. You may store an image at www.imageshack.us and copy here the provided url.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby betoncu » Mon Jul 03, 2006 12:52 am

Antonio,
I have attached a reduced code to show my problem.

Thanks & Regards
Birol

Code: Select all  Expand view
#include "FiveWin.ch"
#include "xbrowse.ch"

static oWndMain

function Main()
local oBrush,oFont

   DEFINE BRUSH oBrush COLOR nRGB( 12, 129, 87 )

   DEFINE WINDOW oWndMain ;
      BRUSH oBrush ;
      MDI ;
      MENU BuildMenu()

   ACTIVATE WINDOW oWndMain MAXIMIZED ON PAINT PaintRtn()
return nil

STATIC FUNCTION PaintRtn()
LOCAL oFont,cYear:='2006'
   DEFINE FONT oFont NAME "ARIAL" SIZE 100, -180
   @ 15,40 SAY cYear OF oWndMain FONT oFont ;
           COLOR CLR_YELLOW, nRGB( 12, 129, 87 ) ;
           SIZE 500,200
   oFont:End()
RETURN NIL

STATIC FUNCTION BuildMenu()
LOCAL oMenu
   MENU oMenu
      MENUITEM "Test"
      MENU
         MENUITEM "Test" ACTION TestRtn(oWndMain)
      ENDMENU
   ENDMENU
return oMenu

STATIC FUNCTION TestRtn(oWnd)
local oChild, oBrw, aArray:={}

   AADD(aArray,{'aaaa','aaaaaaaaaaaaaa','aaaaaaaaaaaaaa','aaaaaaaaaaaa'})

   DEFINE WINDOW oChild ;
      FROM 0, 0 TO 500,400 ;
      MDICHILD ;
      PIXEL ;
      OF oWnd

   oBrw := TXBrowse():New( oChild )

   oBrw:SetArray( aArray)

   oBrw:aCols[1]:cHeader := "Head-1"
   oBrw:aCols[2]:cHeader := "Head-2"
   oBrw:aCols[3]:cHeader := "Head-3"
   oBrw:aCols[4]:cHeader := "Head-4"

   oBrw:nMarqueeStyle   := MARQSTYLE_HIGHLCELL
   oBrw:lRecordSelector := .f.

   oBrw:CreateFromCode()

   oChild:SetControl(oBrw)

   ACTIVATE WINDOW oChild ON INIT oBrw:SetFocus()
RETURN NIL
User avatar
betoncu
 
Posts: 126
Joined: Sat Oct 08, 2005 9:38 pm
Location: Cyprus (North)

Postby Antonio Linares » Mon Jul 03, 2006 4:48 am

Birol,

Modify this function this way:
Code: Select all  Expand view
STATIC FUNCTION PaintRtn()
LOCAL oFont,cYear:='2006'
   DEFINE FONT oFont NAME "ARIAL" SIZE 100, -180
   oWndMain:oWndClient:Say( 15, 40, cYear, CLR_YELLOW, nRGB( 12, 129, 87 ), oFont ) 
   oFont:End()
RETURN NIL

Remember that a MDI environment uses a "ghost" child window (oWndClient). Its explained in FW documentation :)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby betoncu » Mon Jul 03, 2006 2:59 pm

Antonio,
It works perfectly.
Thank you very much.

Birol :D
User avatar
betoncu
 
Posts: 126
Joined: Sat Oct 08, 2005 9:38 pm
Location: Cyprus (North)


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 93 guests