Window position

Window position

Postby frose » Wed Mar 25, 2009 2:38 pm

Hi,

I want to save the position of the main window with 'oWnd:nTop' and 'oWnd:nLeft', but although the user has changed the position of the window, the values of 'oWnd:nTop' and 'oWnd:nLeft' didn't change.

What is the right approach?
Windows 11 Pro 22H2 22621.1848
Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Harbour 3.2.0dev (r2008190002)
FWH 23.10 x86
User avatar
frose
 
Posts: 392
Joined: Tue Mar 10, 2009 11:54 am
Location: Germany, Rietberg

Re: Window position

Postby ukoenig » Wed Mar 25, 2009 3:23 pm

Hello,

For a customer of mine, the Start-window ( with buttonbar-size ) shows only a Buttonbar.
Each user can move the bar.
A new start shows the bar on the selected position.

Code: Select all  Expand view


// saving the WINDOWS-Pos to a INI-File for each user

nPos := oWnd:GetRect()
cCOR1 := ltrim(str(nPos[2]))
cCOR2 := ltrim(str(nPos[3]))

INI oIni FILE cIniFile
oIni:Set("Main", "xPos", cCOR1)
oIni:Set("Main", "yPos", cCOR2)

// ------------------- PROG-Start ----

INI oIni FILE cIniFile
nCOR1 := val(oIni:Get("Main", "xPos", "100"))  // Top-Position
nCOR2 := val(oIni:Get("Main", "yPos", "100"))  // Left-Position

// nCOR1+160 desired Height of the bar ( Bottom )
// nCOR2+630 desired Width of the bar ( Right )
// -------------------------------------------------------
DEFINE WINDOW oWnd FROM nCOR1, nCOR2 TO nCOR1+160, nCOR2+630 PIXEL    
..
..
 


Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Window position

Postby frose » Wed Mar 25, 2009 6:08 pm

Hello Uwe,

the method GetRect() was what I'm looking for! :D

THX
Windows 11 Pro 22H2 22621.1848
Microsoft (R) Windows (R) Resource Compiler Version 10.0.10011.16384
Harbour 3.2.0dev (r2008190002)
FWH 23.10 x86
User avatar
frose
 
Posts: 392
Joined: Tue Mar 10, 2009 11:54 am
Location: Germany, Rietberg


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 88 guests