IonicWind Software

IWBasic => GUI Central => Topic started by: billhsln on November 30, 2020, 10:48:06 AM

Title: Window positioning
Post by: billhsln on November 30, 2020, 10:48:06 AM
I know we can center a window, but is there a way to force it to be positioned where you want.  I need to open multiple programs, but would like them automatically set to a certain position.  Is this possible?

Thanks,
Bill
Title: Re: Window positioning
Post by: Brian on November 30, 2020, 11:09:30 AM
Bill,

Doesn't SETSIZE do just what you need?

Brian
Title: Re: Window positioning
Post by: billhsln on November 30, 2020, 12:11:09 PM
Not really.  CENTERWINDOW centers the window in the screen.  What I want to do is have the window in the upper right hand side of the screen for one program and lower right hand for the other.  I think it will make it easier switching between the two programs and having it so I can see both screens at the same time.

Bill
Title: Re: Window positioning
Post by: Egil on November 30, 2020, 12:25:18 PM
Hi Bill,

Unless i misunderstand you completely, you can put a window wherever you want on the screen by using the WINDOW definition.

QuoteThe syntax of the OPENWINDOW function is:
OPENWINDOW variable, left, top, width, height, flags, parent, title, handler

Parameters:
variable - The name of the WINDOW variable used to store the window
left - The left edge of the window
top - The top edge of the window
width - The width of the window
height - The height of the window
flags - A numeric value specifying creation style flags
parent - a WINDOW variable if this is a child window or NULL
title - The text shown in the caption of the window
handler - The address of a subroutine to handle messages for the window. Use the & operator.

See the Users Guide "Windows Programming" and select "Creating a Window".


Egil




Title: Re: Window positioning
Post by: billhsln on November 30, 2020, 03:55:20 PM
Egil, that was 100% what I was looking for.  I have done CENTERWINDOW on every program, so never even tried to just let it fall where it may.  I was just thinking that it would work like other programs, where every time you bring it up it moves over a little and down a little.  Didn't think it would stay static at a fixed position.

So, Thank you,
Bill
Title: Re: Window positioning
Post by: Andy on November 30, 2020, 08:18:22 PM
Bill,

I'm doing something similar in my editor program.

I wanted a second screen up, but thought it would help if it was moved down slightly so you can still see the top few lines of code in the main program:

CASE @IDCREATE
    'Centre window and move down a little
    'so you can see in the rich edit what the search case screen has found easier.
    CENTERWINDOW w16
    INT wl,wt,ww,wh
    GETSIZE w16,wl,wt,ww,wh
    SETSIZE w16,wl,wt+30,ww,wh


Andy.
Title: Re: Window positioning
Post by: Brian on December 01, 2020, 05:42:20 AM
I still stand by my comment on SETSIZE. You initially create your window(s) with OPENWINDOW, positioning as required, then if you want to move them, you use SETSIZE to do that

Brian
Title: Re: Window positioning
Post by: LarryMc on December 01, 2020, 06:43:27 AM
Build a Visual Designer and you'll have GETSIZE and SETSIZE coming out your ears. LOL!
Title: Re: Window positioning
Post by: Brian on December 01, 2020, 07:25:56 AM
No, thanks!