Author |
Topic: PROC_editbox: only works first time (Read 776 times) |
|
g3nrw
Junior Member
member is offline


Posts: 74
|
 |
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
|
|
Logged
|
|
|
|
rtr
Guest
|
 |
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.
|
|
Logged
|
|
|
|
g3nrw
Junior Member
member is offline


Posts: 74
|
 |
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
|
|
Logged
|
|
|
|
rtr
Guest
|
 |
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 » |
Logged
|
|
|
|
g3nrw
Junior Member
member is offline


Posts: 74
|
 |
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
|
|
Logged
|
|
|
|
|