- This topic has 6 replies, 2 voices, and was last updated 10 years, 8 months ago by DarrenB.
-
AuthorPosts
-
March 4, 2014 at 9:05 pm #36064DarrenBParticipant
Hi Serge,
been programming today for a long, long time but I've been running round in circles with this problem for about 6 hours now. I thought it was something I'd missed but now I'm not so sure.
I have included a demo file, the instructions for reproducing the error(?) are included in a memo box on form1.
Basically
Set up a new app, form1 and form2. Add the usual skinmanager,skinprovider to form1.
Add 3 buttons to form1.
Button1.caption 'Make Board2 Invisible'
Button2.caption 'Change form2 Radiobuttons'
Button3.caption 'Show Form2'
Code for form1 should look basically like this
Quote:procedure TForm1.FormShow(Sender: TObject);begin
form2.show;
end;
procedure TForm1.sButton1Click(Sender: TObject);
begin
form2.Hide;
end;
procedure TForm1.sButton2Click(Sender: TObject);
begin
form2.sRadioButton1.Checked := true;
form2.sRadioButton2.Checked := false;
end;
procedure TForm1.sButton3Click(Sender: TObject);
begin
form2.show;
end;
Add 2 panels to form2, and on each panel place a sradiobutton. Set sradiobutton1.checked to true, and sradiobutton2.checked to false;
Code for form2 should look basically like this
Quote:procedure TForm2.sRadioButton1Click(Sender: TObject);begin
sRadioButton2.Checked := false;
end;
procedure TForm2.sRadioButton2Click(Sender: TObject);
begin
sRadioButton1.Checked := false;
end;
How to Reproduce Error(?)
Click on RadioButton2 on form2.
Notice the settings for the
radiobuttons.
Now Click 'Make Board2
Invisible'
Then Click 'Change form2
RadioButtons;
Then Click 'Show Form2'
The radiobuttons' checked value
for did not change!!!
If this is an error and not just me being very tired then it's an important error because at the moment I can't go any further in my main app.
AlphaSkins 8.53, Delphi XE, Vista 64bit
Regards,
Darren
March 5, 2014 at 12:16 am #51630CheshireCatParticipantHello Darren,
if you make Form2 invisible, RadioButtons should have no focus!
Code:procedure TForm2.FormHide(Sender: TObject);
begin
ActiveControl := nil;
end;I don't know it's an error, but I observe this behavior since I use delphi …
March 5, 2014 at 10:30 am #51634DarrenBParticipantGood morning Sascha, I hope u r well 🙂
Thanks for your reply… I did not know what you said! I have inserted an
ActiveControl := nil;
In all the relevant positions in my main application and the advice you offered seems to be perfect. Certainly the error I was having last night is now fixed 🙂
Thankyou 😀
Darren
March 5, 2014 at 10:59 am #51635CheshireCatParticipant'DarrenB' wrote:I did not know what you said!
Sorry for my bad english :blush:
March 5, 2014 at 11:03 am #51636DarrenBParticipant'CheshireCat' wrote:Sorry for my bad english :blush:
lol Sascha nooooo your english was perfectly understandable… I just meant I did not know that I should put the ActiveControl:=nil into the form hide event!!!!
In this case, my English was bad!!!! lol 😉
March 5, 2014 at 1:24 pm #51637CheshireCatParticipantOk Darren, that calms me 🙄
'DarrenB' wrote:I just meant I did not know that I should put the ActiveControl:=nil into the form hide event!!!!
What I meant to say:
Radio buttons are activated when gets the focus. If the active control is a radio button when the form changes from hidden to visible, Windows sends a SetFocus message and the button is activated. This is not a Alpha Controls bug but a questionable behavior of Windows.
March 5, 2014 at 8:14 pm #51638DarrenBParticipantUseful to know, thanks Sascha 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.