window:center() doesn´t work right

window:center() doesn´t work right

Postby AHF » Wed Oct 17, 2007 4: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
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Postby Antonio Linares » Wed Oct 17, 2007 5:00 pm

Its working fine used this way:
Code: Select all  Expand view  RUN
   ACTIVATE WINDOW oWnd ;
      ON INIT oWnd:Center()
regards, saludos

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

Postby AHF » Wed Oct 17, 2007 5:07 pm

I'm using build Marhc 2006. Is it ok ?
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Postby Antonio Linares » Wed Oct 17, 2007 5:08 pm

Please try it that way, thanks
regards, saludos

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

Postby AHF » Thu Oct 18, 2007 2:35 pm

Antonio,

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

Antonio
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Postby AHF » Mon Oct 22, 2007 4:44 pm

Antonio,

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


Antonio
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Postby Antonio Linares » Mon Oct 22, 2007 6: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42107
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby AHF » Tue Oct 23, 2007 9:17 am

Antonio,

I want to center it regarding its parent window.

Regards
Antonio
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Postby Antonio Linares » Tue Oct 23, 2007 9:26 am

Hazlo así:

oWnd:Center( oWndParent )
regards, saludos

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

Postby AHF » Tue Oct 23, 2007 9:45 am

Antonio,

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

Regards
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Postby Antonio Linares » Tue Oct 23, 2007 9:51 am

Antonio,

Please try this test:
Code: Select all  Expand view  RUN
#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

Image
regards, saludos

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

Postby AHF » Wed Oct 24, 2007 4:16 pm

It works with dialogs but not with mdichilds.

Antonio
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Postby Antonio Linares » Wed Oct 24, 2007 6:28 pm

Antonio,

Please try this:
Code: Select all  Expand view  RUN
#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
User avatar
Antonio Linares
Site Admin
 
Posts: 42107
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby AHF » Thu Oct 25, 2007 9:17 am

Antonio,

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

Antonio
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Postby Antonio Linares » Thu Oct 25, 2007 9:27 am

Antonio,

Here it is working fine on 1280x1024.

Are you running the same test ?
regards, saludos

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

Next

Return to FiveWin for Harbour/xHarbour

Who is online

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