forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Grey Controlling Using Radio Buttons

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
cmenchini



Joined: 11 Oct 2004
Posts: 2

PostPosted: Wed Oct 20, 2004 8:50 am    Post subject: Grey Controlling Using Radio Buttons Reply with quote

I was wondering if there was any sample code out there showing the usage of a radio button being used to not only specify a value, but also grey control for example, a %rs and %rd box? I am able to follow how some of the clearwin demo programs like "filter" control the greying using %bt buttons, but not with actual radio buttons themselves.
Back to top
View user's profile Send private message
silverfrost
Site Admin


Joined: 29 Nov 2006
Posts: 158
Location: Manchester

PostPosted: Thu Oct 21, 2004 4:37 pm    Post subject: Grey Controlling Using Radio Buttons Reply with quote

You should look at the ^ and ~ modifier codes. From the help:

[quote]
Four special characters, known as format modifiers, are often inserted after the size information and before the two-letter code. The first of these is the caret character (^) which indicates that a call-back function is supplied in the argument list (after any other arguments required by the format code). The tilde character (~) is used with certain format codes to control the disabling (greying) of the control. The grave accent character (`) is also used to modify the action of certain codes. These characters may only be used with the codes that define them as detailed in Format code reference.
[/quote]

If you look at the help text for "Button format":

[quote]
Normally a button created with %bt is permanently enabled. However, if the tilde (~) format modifier is used then an extra INTEGER argument must be supplied (before any call-back function). This argument provides an integer that controls the state of the button. When this integer is zero the button is greyed and cannot be used. When this integer is 1 the button is enabled. Typically this control integer would be altered by code responding to another control. For example, after a successful file-opening, a number of options might be enabled. Note that there is no reason why the same control integer should not control several buttons and/or menu items.

For example:

Code:

WINAPP
INCLUDE <windows.ins>
INTEGER grey_cntrl
EXTERNAL open_f,save_f,save_as_f
COMMON grey_cntrl
c---Only the OPEN button is initially available
grey_cntrl=0
i=winio@( '%^bt[Open] &,open_f)
i=winio@(%~^bt[Save] &,grey_cntrl,save_f)
i=winio@(%~^bt[Save as]',grey_cntrl,save_as_f)
END
c---
INTEGER function open_f()
INTEGER grey_cntrl
COMMON grey_cntrl
grey_cntrl=1
open_f=2
END
.....



[/quote]

The example enables and disables buttons but you use the example on edit boxes

------------
Administrator
Silverfrost Forums
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group