BBC BASIC for Windows
« How to dynamically write a label? »

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



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: How to dynamically write a label?  (Read 349 times)
g3nrw
Junior Member
ImageImage


member is offline

Avatar




PM


Posts: 74
xx How to dynamically write a label?
« Thread started on: Aug 22nd, 2015, 6:19pm »

This is such a simple requirement, but I can't see how to achieve it.

CASE 1. Write a fixed label, once only.
Code:

INSTALL @lib$+"WINLIB2"

dlg%=FN_newdialog("Dialogue box", 20, 20, 160, 128, 8, 560)
PROC_checkbox(dlg%, "LABEL1", 100, 82, 82, 64, 10, 0)

PROC_showdialog(dlg%)

ON CLOSE PROC_closedialog(dlg%):QUIT
 

Here, the label "LABEL1" is written just once and never changes.
.
.
.

CASE 2. Dynamically write different labels in the same place after the dialog box is displayed:
Code:

INSTALL @lib$+"WINLIB2"

ES_READ_ONLY = &880

dlg%=FN_newdialog("Dialogue box", 20, 20, 160, 128, 8, 560)
PROC_checkbox(dlg%, "", 100, 82, 82, 64, 10, 0)

PROC_editbox(dlg%, "", 101, 99, 82, 64, 10,ES_READ_ONLY)

PROC_showdialog(dlg%)

SYS "SetDlgItemText", !dlg%, 101, "LABELaaa"
WAIT 100
SYS "SetDlgItemText", !dlg%, 101, "LABELbbb"
WAIT 100
SYS "SetDlgItemText", !dlg%, 101, "LABELccc"
WAIT 100

ON CLOSE PROC_closedialog(dlg%):QUIT
 

This works, but the bounding box around the label is visible.

Question: is there a way to implement CASE 2 such that only the label text is visible, without the ugly bounding box?

--
Ian

User IP Logged

g3nrw
Junior Member
ImageImage


member is offline

Avatar




PM


Posts: 74
xx Re: How to dynamically write a label?
« Reply #1 on: Aug 22nd, 2015, 8:40pm »

Richard has just answered this in the reflector, by saying:

"It's not obvious to me why you need the edit box at all. Doesn't changing the checkbox text directly have the effect you want? "

He is right of course. Thanks again Richard.

--
Ian
« Last Edit: Aug 22nd, 2015, 8:40pm by g3nrw » 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