FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour window:center() doesn´t work right
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
window:center() doesn´t work right
Posted: Wed Oct 17, 2007 04:46 PM

Hello,

Issuing a window:center method it doesn't center the window correctly. It seems to work only correct with dialogs.

Is is a bug, anyone has some work around ?

Antonio

Regards

Antonio H Ferreira
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
window:center() doesn´t work right
Posted: Wed Oct 17, 2007 05:00 PM
Its working fine used this way:
   ACTIVATE WINDOW oWnd ;
      ON INIT oWnd:Center()
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
window:center() doesn´t work right
Posted: Wed Oct 17, 2007 05:07 PM

I'm using build Marhc 2006. Is it ok ?

Regards

Antonio H Ferreira
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
window:center() doesn´t work right
Posted: Wed Oct 17, 2007 05:08 PM

Please try it that way, thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
window:center() doesn´t work right
Posted: Thu Oct 18, 2007 02:35 PM

Antonio,

This is not working the center() is not caculated right.

Antonio

Regards

Antonio H Ferreira
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
window:center() doesn´t work right
Posted: Mon Oct 22, 2007 04:44 PM

Antonio,

I've tried it but it doesn't centers the window.

Antonio

Regards

Antonio H Ferreira
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
window:center() doesn´t work right
Posted: Mon Oct 22, 2007 06:31 PM

Antonio,

Do you want to center it in the main screen, or regarding its parent window (or dialog) ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
window:center() doesn´t work right
Posted: Tue Oct 23, 2007 09:17 AM

Antonio,

I want to center it regarding its parent window.

Regards
Antonio

Regards

Antonio H Ferreira
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
window:center() doesn´t work right
Posted: Tue Oct 23, 2007 09:26 AM

Hazlo asĂ­:

oWnd:Center( oWndParent )

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
window:center() doesn´t work right
Posted: Tue Oct 23, 2007 09:45 AM

Antonio,

It doesn't work result it's the same, not centered.

Regards

Regards

Antonio H Ferreira
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
window:center() doesn´t work right
Posted: Tue Oct 23, 2007 09:51 AM
Antonio,

Please try this test:
#include "FiveWin.ch"

function Main()

   local oWnd

   DEFINE WINDOW oWnd TITLE "Center test"

   ACTIVATE WINDOW oWnd ;
      ON INIT BuildDlg( oWnd )

return nil

function BuildDlg( oWnd )

   local oDlg

   DEFINE DIALOG oDlg TITLE "Test"

   ACTIVATE DIALOG oDlg ;
      ON INIT oDlg:Center( oWnd )

return nil

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
window:center() doesn´t work right
Posted: Wed Oct 24, 2007 04:16 PM

It works with dialogs but not with mdichilds.

Antonio

Regards

Antonio H Ferreira
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
window:center() doesn´t work right
Posted: Wed Oct 24, 2007 06:28 PM
Antonio,

Please try this:
#include "FiveWin.ch"

function Main()

   local oWnd

   DEFINE WINDOW oWnd TITLE "Center test" MDI

   ACTIVATE WINDOW oWnd ;
      ON INIT BuildChild( oWnd )

return nil

function BuildChild( oWnd )

   local oChild

   DEFINE WINDOW oChild TITLE "Test" MDICHILD

   WndTop( oChild:hWnd, oWnd:nHeight / 7 )
   WndLeft( oChild:hWnd, oWnd:nWidth / 10 )

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
window:center() doesn´t work right
Posted: Thu Oct 25, 2007 09:17 AM

Antonio,

It doesn't center it. My resolution is 1400x1050.

Antonio

Regards

Antonio H Ferreira
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
window:center() doesn´t work right
Posted: Thu Oct 25, 2007 09:27 AM

Antonio,

Here it is working fine on 1280x1024.

Are you running the same test ?

regards, saludos

Antonio Linares
www.fivetechsoft.com