Logo on MDI window.

Post Reply
byron.hopp
Posts: 254
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA
Contact:

Logo on MDI window.

Post by byron.hopp »

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
Thanks,
Byron Hopp
Matrix Computer Services
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Logo on MDI window.

Post by Antonio Linares »

Byron,

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
regards, saludos

Antonio Linares
www.fivetechsoft.com
byron.hopp
Posts: 254
Joined: Sun Nov 06, 2005 3:55 pm
Location: Southern California, USA
Contact:

Re: Logo on MDI window.

Post by byron.hopp »

Perfect...

Thank you,
Thanks,
Byron Hopp
Matrix Computer Services
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Logo on MDI window.

Post by nageswaragunupudi »

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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Logo on MDI window.

Post by Antonio Linares »

The shortest, the nicest :-)

Thank you Rao
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply