April 19, 2024, 11:51:49 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Window positioning

Started by billhsln, November 30, 2020, 10:48:06 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

billhsln

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
When all else fails, get a bigger hammer.

Brian

Bill,

Doesn't SETSIZE do just what you need?

Brian

billhsln

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
When all else fails, get a bigger hammer.

Egil

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




Support Amateur Radio  -  Have a ham  for dinner!

billhsln

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
When all else fails, get a bigger hammer.

Andy

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.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Brian

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

LarryMc

Build a Visual Designer and you'll have GETSIZE and SETSIZE coming out your ears. LOL!
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Brian