May 12, 2024, 05:48:48 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Some Ebasic dialog questions

Started by aronoffs, April 21, 2008, 12:53:51 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

aronoffs

I am new to window's programming but have found it quite pleasant with EBasic.  I have run into a couple of problems with using a dialog box.

My dialog box contains a couple of radio buttons and a place to enter a password.

First of all, I can't seem to make a group out of the two buttons.  In the dialog editor, I tried creating the buttons, then surrounding them with a group item, then checked the Group checkbox in the properties of the buttons, but it doesn't act like a group.  I also tried creating the group first, then adding the radio buttons in it, but that didn't work either.

Second, I want the password edit control and associated static text to be invisible until the user has checked one of the radio buttons.  In the properties of these two text items in the dialog editor I did not check the Visible box but did check the Disable box.  The result is that they are invisible when running my program, however, I don't know how to make them Enabled and Visible from within my program.

Thanks for any info you can provide.

LarryMc

First of all, you are asking an EBasic question but you posted it in the Aurora Forum.

2nd, it is usually faster if you post the code you are working with so people that are willing to help can SEE what you are doing.

That being said:
QuoteFirst of all, I can't seem to make a group out of the two buttons.
If you used @group with both radiobuttons you have created 2 different groups.

When using radiobuttons add the @group style to the first radiobutton in your source file.  Every radiobutton that follows will be in that same group until another @group style is encountered.

That's how you can have multiple groups of radiobuttons that are independent of each group.

QuoteSecond, I want the password edit control and associated static text to be invisible until the user has checked one of the radio buttons. ... I don't know how to make them Enabled and Visible from within my program.

From the General Control Functions section of the Help file:

Quotestate =  GETSTATE (window | dialog, ID)

Returns the state of a checkbox or radio button control. Returns 1 if control is checked and 0 if control is unchecked. Radio buttons in a group are mutually exclusive. When a radio button is selected your program will receive an @IDCONTROL message with @CONTROLID containing the newly selected radio button. If the radio button is created outside of a group, you will need to use GETSTATE to determine whether the button is selected.

QuoteENABLECONTROL window | dialog, ID, 0 | 1

The ENABLECONTROL function enables or disables a control in a window or dialog. Controls that are disables are grayed out and cannot be selected. Use 0 to disable the control or 1 to enable. Example: ENABLECONTROL mydialog, 2, 0

And from the command list see :

QuoteSHOWWINDOW(win as WINDOW,nCmdShow as INT,OPT id=0 as UINT)

Description

Shows or hides a window, dialog or control.

Hope that helps.

Larry
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library