KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

Radio Buttons not working as expected.

 
Post new topic   Reply to topic    KiXforms Forum Index -> Advanced Scripting
View previous topic :: View next topic  
Author Message
MACE1
KiXforms Enthusiast
KiXforms Enthusiast


Joined: 12 Oct 2004
Posts: 130
Location: Manchester UK

PostPosted: Sat Oct 29, 2011 12:05 pm    Post subject: Radio Buttons not working as expected. Reply with quote

Sad
I am having to revisit an OLD app in kixform.dll which has served me very well but needs some additional functionality going forward.
To my absolute frustration, on my Win7 x64 box I CAN'T get this to work and am not sure WHY !
Code:


Break On
$System = CreateObject("Kixtart.System")
;Kixforms.dll   2.46.55.0

;************* Form **************
$Form = $System.Form()
$Form.BackColor = 240,240,240
$Form.Height = 400
$Form.Left = 1
$Form.Text = "TEST RADIO BUTTONS"
$Form.Top = 2
$Form.Width = 500
;**************************************

;************* McnAudio **************
;$McnAudio = $Form.Controls.GroupBox("", 15, 65, 231, 66)
;$McnAudio = $Form.Controls.Panel("", 15, 65, 231, 66)
;$McnAudio = $Form.Controls.Add("Panel")
$McnAudio = $Form.Controls.Add("GroupBox")
$McnAudio.Size = 231,66
$McnAudio.Location  = 15,65
$McnAudio.BackColor = 240,240,240
;**************************************

;************* McnAudioModeL **************
$McnAudioModeL = $McnAudio.Controls.Label("Audio Mode:", 20, 70, 50, 30)
$McnAudioModeL.BackColor = 240,240,240
$McnAudioModeL.FontBold = "True"
;**************************************

;************* McnAudioMode0 **************
$McnAudioMode0 = $McnAudio.Controls.RadioButton("MODE 0", 72, 70, 135, 16)
$McnAudioMode0.BackColor = 240,240,240
$McnAudioMode0.Checked = "False"
$McnAudioMode0.TabStop = "False"
$McnAudioMode0.OnClick = "$McnAudioMode=0"
;**************************************

;************* McnAudioMode1 **************
$McnAudioMode1 = $McnAudio.Controls.RadioButton("MODE 1", 72, 90, 155, 16)
$McnAudioMode1.BackColor = 240,240,240
$McnAudioMode1.Checked = "False"
$McnAudioMode1.TabStop = "False"
$McnAudioMode1.OnClick = "$McnAudioMode=1"
;**************************************

;************* McnAudioMode2 **************
$McnAudioMode2 = $McnAudio.Controls.RadioButton("MODE 2", 72, 110, 80, 16)
$McnAudioMode2.BackColor = 240,240,240
$McnAudioMode2.Checked = "False"
$McnAudioMode2.TabStop = "False"
$McnAudioMode2.OnClick = "$McnAudioMode=2"
;**************************************
$Form.Show
While $Form.Visible
   $=Execute($Form.DoEvents())
Loop
Exit 1


Whether Panel or GroupBox, whichever format I choose, I get NO radio buttens in the panel/groupbox - NOTHING is visible !
Is it me or the code or Windows ???
Back to top
View user's profile Send private message
enahsyemotp
KiXforms Regular
KiXforms Regular


Joined: 22 Sep 2010
Posts: 40
Location: Tulsa, OK

PostPosted: Sat Oct 29, 2011 2:20 pm    Post subject: Reply with quote

I think it's either just a problem with the sizing (out of the groupbox bounds somewhere), or it could be an expando property problem. If I recall correctly Shawn said something about having some problems with them in the newest releases....I could be totally off, but anyhow, I got this to work.

Code:
Break On
$System = CreateObject("Kixtart.System")


$Form = $System.Form()
$Form.Width = 500
$Form.Height = 400
$Form.Left = 1
$Form.Top = 2
$Form.Text = "TEST RADIO BUTTONS"

$McnAudio = $Form.Controls.Add("GroupBox")
$McnAudio.Text = "Group"
$McnAudio.Width = 231
$McnAudio.Height = 66
$McnAudio.Left = 15
$McnAudio.Top = 65

$McnAudioMode0 = $McnAudio.Controls.Add("RadioButton")
$McnAudioMode0.Text = "Mode 0"
$McnAudioMode0.Left = 10
$McnAudioMode0.Top = 15
$McnAudioMode0.Width = 135
$McnAudioMode0.Height = 16
$McnAudioMode0.Checked = 0
$McnAudioMode0.TabStop = 0
$McnAudioMode0.OnClick = "$McnAudioMode=0"

$McnAudioMode1 = $McnAudio.Controls.Add("RadioButton")
$McnAudioMode1.Text = "Mode 1"
$McnAudioMode1.Left = 10
$McnAudioMode1.Top = $McnAudioMode0.Bottom
$McnAudioMode1.Width = 135
$McnAudioMode1.Height = 16
$McnAudioMode1.Checked = 0
$McnAudioMode1.TabStop = 0
$McnAudioMode1.OnClick = "$McnAudioMode=1"

$McnAudioMode2 = $McnAudio.Controls.Add("RadioButton")
$McnAudioMode2.Text = "Mode 2"
$McnAudioMode2.Left = 10
$McnAudioMode2.Top = $McnAudioMode1.Bottom
$McnAudioMode2.Width = 135
$McnAudioMode2.Height = 16
$McnAudioMode2.Checked = 0
$McnAudioMode2.TabStop = 0
$McnAudioMode2.OnClick = "$McnAudioMode=2"

$Form.Show
While $Form.Visible
   $=Execute($Form.DoEvents())
Loop
Exit 1
Back to top
View user's profile Send private message
enahsyemotp
KiXforms Regular
KiXforms Regular


Joined: 22 Sep 2010
Posts: 40
Location: Tulsa, OK

PostPosted: Sat Oct 29, 2011 2:24 pm    Post subject: Reply with quote

OK, so it wasnt the properties, must have been the location/sizing. Because this also works.

Code:
Break On
$System = CreateObject("Kixtart.System")

$Form = $System.Form()
$Form.Width = 500
$Form.Height = 400
$Form.Left = 1
$Form.Top = 2
$Form.Text = "TEST RADIO BUTTONS"

$McnAudio = $Form.Controls.Add("GroupBox")
$McnAudio.Text = "Group"
$McnAudio.Width = 231
$McnAudio.Height = 66
$McnAudio.Left = 15
$McnAudio.Top = 65

$McnAudioMode0 = $McnAudio.Controls.RadioButton("MODE 0", 10, 15, 135, 16)
$McnAudioMode0.Checked = "False"
$McnAudioMode0.TabStop = "False"
$McnAudioMode0.OnClick = "$McnAudioMode=0"

$McnAudioMode1 = $McnAudio.Controls.RadioButton("MODE 1", 10, $McnAudioMode0.Bottom, 135, 16)
$McnAudioMode1.Checked = "False"
$McnAudioMode1.TabStop = "False"
$McnAudioMode1.OnClick = "$McnAudioMode=1"

$McnAudioMode2 = $McnAudio.Controls.RadioButton("MODE 2", 10, $McnAudioMode1.Bottom, 135, 16)
$McnAudioMode2.Checked = "False"
$McnAudioMode2.TabStop = "False"
$McnAudioMode2.OnClick = "$McnAudioMode=2"


$Form.Show
While $Form.Visible
   $=Execute($Form.DoEvents())
Loop
Exit 1
Back to top
View user's profile Send private message
MACE1
KiXforms Enthusiast
KiXforms Enthusiast


Joined: 12 Oct 2004
Posts: 130
Location: Manchester UK

PostPosted: Sat Oct 29, 2011 3:51 pm    Post subject: Your a star Reply with quote

I had forgotten one so obvious fundamental.
My initial layout design used the primary form coordinates, not the sub coordinates of the groupbox or panel..Duhh!
This works:
Code:

Break On
$System = CreateObject("Kixtart.System")

$Form = $System.Form()
$Form.Width = 500
$Form.Height = 400
$Form.Left = 1
$Form.Top = 2
$Form.Text = "TEST RADIO BUTTONS"

$McnAudio = $Form.Controls.Add("Panel")
$McnAudio.Width = ($Form.Width/2)-15
$McnAudio.Height = 100
$McnAudio.Left = 15
$McnAudio.Top = 65


$McnAudioMode = $McnAudio.Controls.Label("Audio Mode:", $McnAudio.left, 0, 50, 30)
$McnAudioMode.BackColor = 240,240,240
$McnAudioMode.FontBold = "True"

$McnAudioMode0 = $McnAudio.Controls.RadioButton("MODE 0", $McnAudio.left+50, 0, 135, 16)
$McnAudioMode0.Checked = "False"
$McnAudioMode0.TabStop = "False"
$McnAudioMode0.OnClick = "$McnAudioMode=0"

$McnAudioMode1 = $McnAudio.Controls.RadioButton("MODE 1", $McnAudioMode0.left, $McnAudioMode0.Bottom, 135, 16)
$McnAudioMode1.Checked = "False"
$McnAudioMode1.TabStop = "False"
$McnAudioMode1.OnClick = "$McnAudioMode=1"

$McnAudioMode2 = $McnAudio.Controls.RadioButton("MODE 2", $McnAudioMode1.left, $McnAudioMode1.Bottom, 135, 16)
$McnAudioMode2.Checked = "true"
$McnAudioMode2.TabStop = "true"
$McnAudioMode2.OnClick = "$McnAudioMode=2"


$Form.Show
While $Form.Visible
   $=Execute($Form.DoEvents())
Loop
Exit 1


Thanks a lot, its so frustrating in retrospect to have ground to a halt on something so simple ! 'Cant see the wood for the trees' Very Happy
Back to top
View user's profile Send private message
enahsyemotp
KiXforms Regular
KiXforms Regular


Joined: 22 Sep 2010
Posts: 40
Location: Tulsa, OK

PostPosted: Sat Oct 29, 2011 3:58 pm    Post subject: Reply with quote

Yea, I totally know what you're talking about lol.

I was just glad to see a post on the kixforms site. Sorry it was at the expense of your frustration. Laughing
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> Advanced Scripting All times are GMT
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
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group