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
Text on a brush
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
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.
> 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.
Antonio,
I have attached a reduced code to show my problem.
Thanks & Regards
Birol
I have attached a reduced code to show my problem.
Thanks & Regards
Birol
Code: Select all
#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
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Birol,
Modify this function this way:
Remember that a MDI environment uses a "ghost" child window (oWndClient). Its explained in FW documentation
Modify this function this way:
Code: Select all
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