BBC BASIC for Windows
« Positioning a property sheet »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 10:10pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Positioning a property sheet  (Read 349 times)
AlanRoberts
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 10
xx Positioning a property sheet
« Thread started on: Dec 14th, 2015, 2:19pm »

A dialog box is positioned with x,y coordinates when creating it, but a property sheet ignores all the x,y, coordinates. Is there a way to position a property sheet once it's opened?
User IP Logged

Alan Roberts
Zaphod
Guest
xx Re: Positioning a property sheet
« Reply #1 on: Dec 14th, 2015, 2:53pm »

Does this work?

SYS "SetWindowPos", psh%, 0, X%, Y%, 0, 0, 5
User IP Logged

AlanRoberts
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 10
xx Re: Positioning a property sheet
« Reply #2 on: Dec 14th, 2015, 5:12pm »

Dunno, I'll try ... I'll be back.
User IP Logged

Alan Roberts
AlanRoberts
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 10
xx Re: Positioning a property sheet
« Reply #3 on: Dec 14th, 2015, 5:18pm »

Well, it might work, but I can't see how to use it. In the statement, what is psh%?

I created 6 versions of the property sheet so that I can reopen it with the dialog tab that was last used, so I launch it with:

PROC_showpropsheet(ShtTLCI%(ShtOpen%),DlgTLCI%())

... and have just tried:

SYS "SetWindowPos",ShtTLCI%(ShtOpen%),0,200,150,0,0,5

but that doesn't appear to do anything. I'm stumped as usual with SYS calls.
User IP Logged

Alan Roberts
Zaphod
Guest
xx Re: Positioning a property sheet
« Reply #4 on: Dec 14th, 2015, 7:05pm »


The variable psh% is the handle of the property sheet that you got when you initialized it using this call from the manual:
psh% = FN_newpropsheet("Property sheet",pages%,0,&20,page%())

It is the handle to the window that all the property sheets (dialogs) sit in. The property sheet container is a window like any other window so when you have its handle, as you do, you can move it and manipulate it like any other window.

The "5" in the SYS "SetWindowPos" call as the last parameter is the Windows constants SWP_NOSIZE OR SWP_NOZORDER
User IP Logged

AlanRoberts
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 10
xx Re: Positioning a property sheet
« Reply #5 on: Dec 14th, 2015, 9:04pm »

That's what I thought, but, like I said, it doesn't seem to work. Maybe it's because it's an array element in my case. if so, then I;ll pout up with not being able to place it in exchange for the ability to open it on a nominated tab.
User IP Logged

Alan Roberts
Zaphod
Guest
xx Re: Positioning a property sheet
« Reply #6 on: Dec 14th, 2015, 9:39pm »


I think you may be getting confused. To show the property sheet you called:

PROC_showpropsheet(psh%,hdlg%())

The psh% is what you want to set the position not the array of dialog handles.
User IP Logged

AlanRoberts
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 10
xx Re: Positioning a property sheet
« Reply #7 on: Dec 15th, 2015, 09:12am »

Yes, I know about that. I have created 6 identical property sheets so that I can open with the chosen tab. So my equivalent of psh% is an array ShtTLCI%() where the argument is the number of the tab. It works fine, but the positioning doesn't.

I've just tried reverting to a single property sheet, and the SetWindowPos call still doesn't work.
User IP Logged

Alan Roberts
AlanRoberts
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 10
xx Re: Positioning a property sheet
« Reply #8 on: Dec 15th, 2015, 10:11am »

The penny has dropped. Because it's a property sheet and not a dialog, the rules are different, so this doesn't work:

SYS "SetWindowPos",ShtTLCI%(ShtOpen%),0,600,300,0,0,5

... but this does -

SYS "SetWindowPos",!ShtTLCI%(ShtOpen%),0,600,300,0,0,5

In the same way, access to the dialog items in a normal dialog need, e.g.:

SYS "SendDlgItemMessage",!dlg%,i%,&143,0,text$

... but in a property sheet it needs -

SYS "SendDlgItemMessage",dlg%,n%,&143,0,text$

If only Richard had told me that a year ago, I wouldn't have wasted so much time. never mind, it works now.

User IP Logged

Alan Roberts
Zaphod
Guest
xx Re: Positioning a property sheet
« Reply #9 on: Dec 15th, 2015, 3:22pm »

Sorry, it was me that was confused by your array of property boxes and I was making the same mistake as you.

You are absolutely right the "!" is needed. The container for which we have psh% is actually dialog which needs the indirection to get the handle. The hdlg%() has a clue in that it starts with an "h" and so it IS the handle in this case although the sheets are more dialogs.

That indirection to get the handle of dialogs has caught me out so many times as well. In the case of Property sheets it really does look inconsistent.

Glad you got that sorted and it is a lesson for us all.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls