BBC BASIC for Windows
« PROC_editbox: only works first time »

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: PROC_editbox: only works first time  (Read 776 times)
g3nrw
Junior Member
ImageImage


member is offline

Avatar




PM


Posts: 74
xx PROC_editbox: only works first time
« Thread started on: May 28th, 2014, 07:43am »

Program contains these statements:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
editStatus% = 40

PROC_editbox(dlg%, status_box_text$, editStatus%, 230, 21, 160, 12, ES_READ_ONLY)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The PROC_editbox call works fine, but only the first time.

On subsequent calls, the text in the box is not updated.

I have tried changing the final parameter from READ_ONLY to ES_AUTOHSCROLL and then to ES_NUMBER, to see what would happen. These parameters *were* understood (I could scroll horizontally, and only enter numeric values), but still the text was not updated.

What am I doing wrong?

--
Ian
User IP Logged

rtr
Guest
xx Re: PROC_editbox: only works first time
« Reply #1 on: May 28th, 2014, 4:00pm »

on May 28th, 2014, 07:43am, g3nrw wrote:
The PROC_editbox call works fine, but only the first time

Why would you want to create a second editbox in exactly the same position, and with exactly the same size, as the first? Although Windows will let you do that (one editbox would then obscure the other, depending on their Z-order), it seems to me a rather unusual requirement.

Quote:
On subsequent calls, the text in the box is not updated.

If the 'second' editbox is behind the first in the Z-order it will be invisible, and hence any change you make to the text it contains will not be apparent. To be able to see it you would have to change the Z-order (SetWindowPos API) so that the editbox which was 'behind' is now 'in front').

But I'm still unsure whether this is really what you are wanting to achieve. Why can't you use a single editbox and simply update the text it contains?

Richard.
User IP Logged

g3nrw
Junior Member
ImageImage


member is offline

Avatar




PM


Posts: 74
xx Re: PROC_editbox: only works first time
« Reply #2 on: May 28th, 2014, 6:10pm »

on May 28th, 2014, 4:00pm, Richard Russell wrote:
But I'm still unsure whether this is really what you are wanting to achieve. Why can't you use a single editbox and simply update the text it contains?
Richard.


That is exactly what I am trying to do. The box is intended to show the current status of a process, and all that is required is to update the message displayed in the box from time to time. How do I do this?

--
Ian
User IP Logged

rtr
Guest
xx Re: PROC_editbox: only works first time
« Reply #3 on: May 28th, 2014, 6:55pm »

on May 28th, 2014, 6:10pm, g3nrw wrote:
The box is intended to show the current status of a process

You will probably want to use a read-only edit box, or perhaps a simple static control, so the user cannot modify the contents. Other options may be to display the information in the title bar or a status bar.

Quote:
all that is required is to update the message displayed in the box from time to time.

That is the most basic of all operations on a dialogue box item, and indeed is the first to be described in the Initialising the contents of a dialogue box section of the BB4W Help docs:

http://www.bbcbasic.co.uk/bbcwin/manual/bbcwing.html#initdialog

It says: "To change the text associated with a dialogue box item (which may for example be the contents of an edit box or a label for a check box) you can use the SetDlgItemText API call":

Code:
      SYS "SetDlgItemText", !dlg%, id%, text$ 

Of course had GUILIB been developed it would have included a BASIC wrapper function for this call.

Richard.
« Last Edit: May 28th, 2014, 7:12pm by rtr » User IP Logged

g3nrw
Junior Member
ImageImage


member is offline

Avatar




PM


Posts: 74
xx Re: PROC_editbox: only works first time
« Reply #4 on: May 28th, 2014, 7:49pm »

Another one bites the dust.

It's easy when you know how (and when you remember to read the right documentation)!

Thanks Richard

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