BBC BASIC for Windows
« Fixing the position of a progress bar »

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



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: Fixing the position of a progress bar  (Read 715 times)
g3nrw
Junior Member
ImageImage


member is offline

Avatar




PM


Posts: 74
xx Fixing the position of a progress bar
« Thread started on: Aug 28th, 2014, 5:03pm »

I have an app containing many controls, whose positions are expressed as x%, y% units relative to the top left hand corner of the window. When I run the app on different systems with different resolution monitors, all the controls appear in the same position relative to each other. No problem.

I have now added a progress bar to the app. It works, but it appears in different positions on different resolution monitors. This is evidently because the position of the bar is expressed as xpos%, ypos%, where these parameters are in pixels relative to the top left hand corner, rather than in x%, y% units.

This is a pain, because the bar appears in different places on different systems, depending on the screen resolution.

Is there any way to express the position of the bar as x%, y% units, as with all the other controls, rather than xpos%, ypos% pixels?

--
Ian
User IP Logged

DDRM
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 321
xx Re: Fixing the position of a progress bar
« Reply #1 on: Aug 29th, 2014, 08:57am »

Hi Ian,

Please can you clarify a little? Does your app put the controls on the main window (e.g. using Winlib5), or are you using a dialogue box (eg. using Winlib2)?

If you are using Winlib5, it looks like control sizes are specified in pixels anyway, as are progress bars in Winlib3.

If you are using Winlib2, have you seen the section in the manual on making a progress bar using

PROC_dlgctrl(dlg%,"",id%,x%,y%, cx%, cy%, &50000000, "msctls_progress32")

That seems to generate a progress bar in dialogue box units, which scales with other controls as you change font size or screen resolution, at least on my machine and a quick test.

If it's a dialogue box and you aren't using Winlib2, would the MapDialogRect function do what you need?

http://msdn.microsoft.com/en-gb/library/windows/desktop/ms645502%28v=vs.85%29.aspx

If you search for "rect" in the help, there's an example (under displaying enhanced metafiles) of how to make and use a rect structure in BB4W to send/receive data from a SYS call, which I guess, but have not tried, should work similarly with this call.

Hope that's helpful,

David
User IP Logged

g3nrw
Junior Member
ImageImage


member is offline

Avatar




PM


Posts: 74
xx Re: Fixing the position of a progress bar
« Reply #2 on: Aug 30th, 2014, 08:35am »

Hi David

on Aug 29th, 2014, 08:57am, DDRM wrote:
Please can you clarify a little?

Yes, I realize I didn't give much information!

Quote:
If you are using Winlib2, have you seen the section in the manual on making a progress bar using

PROC_dlgctrl(dlg%,"",id%,x%,y%, cx%, cy%, &50000000, "msctls_progress32")


Yes, that is what I should have used. I used instead:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pb% = FN_createprogressbar(@hwnd%, 550, 145, 150, 20, 0)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Problem solved.

Thanks David

--
Ian
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