BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

odd behavior using frames

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
Totte Karlsson
Guest





PostPosted: Tue Jun 22, 2004 12:11 am    Post subject: odd behavior using frames Reply with quote



Hi,
I have a form which contains a few frames. One these frames I have buttons
doing different things.
Clicking one of these buttons when the main form is open should create a
"wrapper" function for the underlying frames function. Now it has happened
several times that I get an empty function like this

void __fastcall TStatForm::TgetParametersFrame1Button2Click(TObject *Sender)
{

}

which is not right of course.. anyone knows why this happens?

also sometimes the code in such a wrapperfunction is not executed at all.
For example I have this function

void __fastcall TStatForm::TgetParametersFrame1Button2Click(TObject *Sender)
{
TCursor crsCount = Screen->Cursor;
Screen->Cursor = crHourGlass;
TgetParametersFrame1->searchForParaExecute(Sender); //Should be called
in a thread
Screen->Cursor = crsCount;

//Add search to other tab

TRocCurveFrame1->PopFrame1->AddBigSearch(TgetParametersFrame1->GetSearch());

TRocCurveFrame1->PopFrame2->AddBigSearch(TgetParametersFrame1->GetSearch());
TBigSearches1->AddBigSearch(TgetParametersFrame1->GetSearch());
TBigSearches1->UpdateFrame();
}

The last two lines updates another frame with the result from some other
frame. When the code is not executed my frames are not updated. However, I
have found that when I set a breakpoint inside this function, and recompile,
the code is executed again! I can then remove the breakpoint and the code
works ok for some time. This is puzzling.. anyone having a clue on what is
going on?

-totte


Back to top
Simon D
Guest





PostPosted: Thu Jun 24, 2004 12:11 pm    Post subject: Re: odd behavior using frames Reply with quote



"Totte Karlsson" <mtk (AT) qm (DOT) com> wrote

Quote:
Hi,
I have a form which contains a few frames. One these frames I have buttons
doing different things.
Clicking one of these buttons when the main form is open should create a
"wrapper" function for the underlying frames function. Now it has happened
several times that I get an empty function like this

void __fastcall TStatForm::TgetParametersFrame1Button2Click(TObject
*Sender)
{

}

which is not right of course.. anyone knows why this happens?

That is what I would expect to happen. Are you saying that sometimes it does
not?

If you want the frame altered, you need to edit the frame seperately, if you
alter the frame in a form, you are altering how it is used in that instance,
so giving a button an event handler will only happen for that form. If the
button has a click event already it will be replaced for example.

Quote:
also sometimes the code in such a wrapperfunction is not executed at all.
For example I have this function

void __fastcall TStatForm::TgetParametersFrame1Button2Click(TObject
*Sender)
{
snip code

}
Quote:

The last two lines updates another frame with the result from some other
frame. When the code is not executed my frames are not updated. However, I
have found that when I set a breakpoint inside this function, and
recompile,
the code is executed again! I can then remove the breakpoint and the code
works ok for some time. This is puzzling.. anyone having a clue on what is
going on?

Sounds like some kind of bug, but not one I've seen (BCB5).

HTH.
Simon.



Back to top
Totte Karlsson
Guest





PostPosted: Thu Jun 24, 2004 5:31 pm    Post subject: Re: odd behavior using frames Reply with quote



thanks for your reply,

Quote:
Clicking one of these buttons when the main form is open should create a
"wrapper" function for the underlying frames function. Now it has
happened
several times that I get an empty function like this

void __fastcall TStatForm::TgetParametersFrame1Button2Click(TObject
*Sender)
{

}

which is not right of course.. anyone knows why this happens?

That is what I would expect to happen. Are you saying that sometimes it
does
not?

It's not what should happen!


What should happen is that the underlying function should be automatically
wrapped,
e.g. in the frame, I have button4 associated with an action, when clicking
the button in the "standalone" frame i get to this code (the actions execute
method)

void __fastcall TgetParametersFrame::ClearSearchesExecute(TObject *Sender)
{
aSearch.Clear();
paraMemo->Clear();
}

when clicking the same button on the frame, when it is places on the form,
the following code is generated :

void __fastcall TStatForm::TgetParametersFrame1Button4Click(TObject *Sender)
{
TgetParametersFrame1->ClearSearchesExecute(Sender);
}

so the underlying action is executed..

... what I tried to say was that sometimes the generated code looks like this

void __fastcall TStatForm::TgetParametersFrame1Button4Click(TObject *Sender)
{

}

which is not right.. I have not seen it many times, but in this particular
project it happens all the time Sad
Something is messed up somewhere and I don't know what it is?

-totte



Back to top
Simon D
Guest





PostPosted: Fri Jun 25, 2004 10:15 am    Post subject: Re: odd behavior using frames Reply with quote

"Totte Karlsson" <mtk (AT) qm (DOT) com> wrote


Quote:
It's not what should happen!

I tried it and it does what you said (oops).

Quote:
which is not right.. I have not seen it many times, but in this particular
project it happens all the time Sad
Something is messed up somewhere and I don't know what it is?

-totte

The first place I would look is the .dfm and .bpr files for anything odd.
Perhaps something is set that overrides the normal behavior.

Simon.



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) 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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.