BBC BASIC for Windows
« Rendering some controls invisible? »

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: Rendering some controls invisible?  (Read 828 times)
g3nrw
Junior Member
ImageImage


member is offline

Avatar




PM


Posts: 74
xx Rendering some controls invisible?
« Thread started on: Dec 20th, 2014, 11:02am »

I have an app where, depending on a certain logical state, I want to render a few controls invisible (because they don't apply to the current situation).

The pseudo-BASIC would look something like this:

Code:
PROC_static(dlg%,"labeltext", ....)
PROC_combobox(dlg%, "", .....)

PROC_showdialog(dlg%)

IF somevalue = TRUE THEN
   REM: Code to make the label and combox invisible
ENDIF
 


What code do I need to make this do-able?

So far I have only been able to disable the controls. Then they aren't usable, but they are still visible. It would look much better if they weren't visible at all.

--
Ian


User IP Logged

rtr2
Guest
xx Re: Rendering some controls invisible?
« Reply #1 on: Dec 20th, 2014, 12:07pm »

on Dec 20th, 2014, 11:02am, g3nrw wrote:
I want to render a few controls invisible... What code do I need to make this do-able?

It may be that I haven't properly understood your requirement, but doesn't simply removing the WS_VISIBLE style bit (&10000000) achieve exactly that?

All windows are initially created invisible, unless that style bit is set, although of course the BB4W libraries (e.g. WINLIB2) always set it by default because it's the most common requirement.

If that doesn't do what you want, explain in more detail what you want to achieve.

Richard.
User IP Logged

g3nrw
Junior Member
ImageImage


member is offline

Avatar




PM


Posts: 74
xx Re: Rendering some controls invisible?
« Reply #2 on: Dec 20th, 2014, 3:13pm »

Richard

In the "code" snippet, I defined the two controls, *then* displayed the dialog box, and only *then* wanted to make the controls invisible. Surely I can't define the controls again after displaying the dialog box, this time making them invisible?

--
Ian
User IP Logged

rtr2
Guest
xx Re: Rendering some controls invisible?
« Reply #3 on: Dec 20th, 2014, 3:52pm »

on Dec 20th, 2014, 3:13pm, g3nrw wrote:
I defined the two controls, *then* displayed the dialog box, and only *then* wanted to make the controls invisible.

I didn't spot that. Sorry.

Whenever I've done something similar, I've always had some controls which needed to be initially invisible and some which start off being visible and are subsequently made invisible. In that situation it's better to remove the WS_VISIBLE style bit rather than to hide the controls, because even if you hide them immediately after the PROC_showdialog there is a risk that you might see them 'flash' briefly - and almost invariably it only happens on somebody else's system!

If none of your controls need to be hidden initially then that obviously isn't a problem, and you can subsequently hide and show them using ShowWindow in the usual way without any unwanted glitches (the ShowWindow API is documented in the BB4W help and searching for 'hide' finds it).

Richard.

« Last Edit: Dec 20th, 2014, 4:06pm by rtr2 » 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