Alex,
Here's the opg.Init()
bOptionGroup::Init()
set classlib to ccontrol additive
for each oButton in this.Buttons
lcName = "lbl" + this.Name + oButton.Name
this.parent.AddObject( lcName, "opgLabel", this, oButton )
loLabel = eval( "this.parent." + lcName )
with loLabel
.Visible = .t.
endwith
endfor
* Here's the opgLabel code:
* Init()
lparameter oOptionGroup, oButton
local lnWidth
with this
.Top = oButton.Top + oOptionGroup.Top + 1
.Left = oButton.Left + oOptionGroup.Left + 25
.mcSetValue = left( oButton.Caption, 1 )
.mcOptionGroupName = "this.parent." + oOptionGroup.Name
.mcButtonName = .mcOptionGroupName + "." + oButton.Name
.Caption = substr( oButton.Caption, 2 )
lnWidth = oButton.Width
oButton.AutoSize = .f.
oButton.Caption = .mcSetValue
oButton.Width = lnWidth
endwith
* Click()
local loObject
loObject = eval( this.mcOptionGroupName )
loObject.Value = this.mcSetValue
loObject = eval( this.mcButtonName )
loObject.SetFocus()
You should be able to tweak it and use the hotkey on the label and the value to store.
>Sounds like a perfect class for the situation. Would you share it? Could it be changed it so that the HotKey, if any, becomes the value stored?