I use to do this using the old Harbour compiler. But since I moved to Borland my program gets hung up when clicking on the menu.
Here is the old code I used in the main program just before the Activate Window:
@ 0,0 Bitmap oLogo File Mcs_AppPath() + "Images\EocwdLogo.bmp" of oWnd:oWndClient PIXEL NOBORDER
oWnd:CoorsUpdate()
oWnd:bPainted := {|| SetLogo( oLogo,oWnd )}
Here is the function that runs during the paint event.
Function SetLogo( oLogo,oWnd )
Local nX,nY
oWnd:CoorsUpdate()
oWnd:oWndClient:CoorsUpdate()
oLogo:CoorsUpdate()
oLogo:Hide()
nX := oWnd:oWndClient:nWidth() - oLogo:nWidth() - 10
nY := oWnd:oWndClient:nHeight() - oLogo:nHeight() - 10
oLogo:Move( nY,nX,oLogo:nWidth(), oLogo:nHeight(),.t. )
oLogo:Show()
return NIL
Logo on MDI window.
-
- Posts: 254
- Joined: Sun Nov 06, 2005 3:55 pm
- Location: Southern California, USA
- Contact:
Logo on MDI window.
Thanks,
Byron Hopp
Matrix Computer Services
Byron Hopp
Matrix Computer Services
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Logo on MDI window.
Byron,
I have modified your code and it is working fine with Borland and Microsoft:
I have modified your code and it is working fine with Borland and Microsoft:
Code: Select all
#include "FiveWin.ch"
function Main()
local oWnd, oLogo
DEFINE WINDOW oWnd MDI
@ 0, 0 Bitmap oLogo File "c:\fwh\bitmaps\fivetech.bmp" of oWnd:oWndClient PIXEL NOBORDER
oWnd:oWndClient:bPainted := { || SetLogo( oLogo,oWnd ), 1 }
oWnd:bResized := { || SetLogo( oLogo, oWnd ) }
ACTIVATE WINDOW oWnd
return nil
function SetLogo( oLogo, oWnd )
local nX, nY
nX := oWnd:oWndClient:nWidth() - oLogo:nWidth() - 10
nY := oWnd:oWndClient:nHeight() - oLogo:nHeight() - 10
oLogo:Move( nY, nX, oLogo:nWidth(), oLogo:nHeight(), .T. )
return nil
-
- Posts: 254
- Joined: Sun Nov 06, 2005 3:55 pm
- Location: Southern California, USA
- Contact:
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: Logo on MDI window.
May I suggest another alternative?
Code: Select all
#include "FiveWin.ch"
function Main()
local oWnd
DEFINE WINDOW oWnd MDI
oWnd:oWndClient:bPainted := ;
{ || oWnd:oWndClient:DrawImage( "c:\fwh\bitmaps\fivetech.bmp", ;
{ nil, nil, -10, -10 }, .f., nil, nil, nil, "BR" ) }
ACTIVATE WINDOW oWnd
return nil
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Logo on MDI window.
The shortest, the nicest
Thank you Rao
Thank you Rao