dreynier
asked on
Intercept OK button in TPropertySheet
Hi World
Does any body know how to intercept OK Button in TPropertySheet ? I've tried CloseWindow and CanClose but witout a result.
Thanks for your help
Does any body know how to intercept OK Button in TPropertySheet ? I've tried CloseWindow and CanClose but witout a result.
Thanks for your help
ASKER
Thanks for your answer
...Before asking for help, I've tried to define a Reponse function but whith a wrong parameter type ( my french documentation is ::HandleFunction(uint param) and not HandleFunction(WPARAM param) )
I've tried your example but I still can't intercept OK Button
I've set a Breakpoint on the response function but the application never stop at this point
Here is a part of my code
class TCenteredPropertySheet : public TPropertySheet
{
public:
TCenteredPropertySheet(TWi ndow* parent, char* title, int startPage = 0, bool isWizard = false, uint32 flag = SH_DEFAULT );
protected:
void SetupWindow();
void ButtonClicked(WPARAM param);
public:
DECLARE_RESPONSE_TABLE(TCe nteredProp ertySheet) ;
};
DEFINE_RESPONSE_TABLE1( TCenteredPropertySheet, TPropertySheet)
EV_COMMAND_AND_ID(IDOK, ButtonClicked),
END_RESPONSE_TABLE;
TCenteredPropertySheet::TC enteredPro pertySheet ( TWindow* parent, char* title, int startPage, bool isWizard, uint32 flag ):
TPropertySheet( parent, title, startPage, isWizard, flag )
{
}
void TCenteredPropertySheet::Se tupWindow( )
{
TPropertySheet::SetupWindo w();
TRect rc;
GetWindowRect( rc );
TScreenDC dc;
int nX = dc.GetDeviceCaps(HORZRES) / 2 - rc.Width() / 2;
int nY = dc.GetDeviceCaps(VERTRES) / 2 - rc.Height() / 2;
SetWindowPos( HWND_TOP, nX, nY, 0, 0, SWP_NOSIZE );
}
void TCenteredPropertySheet::Bu ttonClicke d(WPARAM param)
{
if( param == IDOK )
CheckAllPage();
}
I really don't understand why !!!
...Before asking for help, I've tried to define a Reponse function but whith a wrong parameter type ( my french documentation is ::HandleFunction(uint param) and not HandleFunction(WPARAM param) )
I've tried your example but I still can't intercept OK Button
I've set a Breakpoint on the response function but the application never stop at this point
Here is a part of my code
class TCenteredPropertySheet : public TPropertySheet
{
public:
TCenteredPropertySheet(TWi
protected:
void SetupWindow();
void ButtonClicked(WPARAM param);
public:
DECLARE_RESPONSE_TABLE(TCe
};
DEFINE_RESPONSE_TABLE1( TCenteredPropertySheet, TPropertySheet)
EV_COMMAND_AND_ID(IDOK, ButtonClicked),
END_RESPONSE_TABLE;
TCenteredPropertySheet::TC
TPropertySheet( parent, title, startPage, isWizard, flag )
{
}
void TCenteredPropertySheet::Se
{
TPropertySheet::SetupWindo
TRect rc;
GetWindowRect( rc );
TScreenDC dc;
int nX = dc.GetDeviceCaps(HORZRES) / 2 - rc.Width() / 2;
int nY = dc.GetDeviceCaps(VERTRES) / 2 - rc.Height() / 2;
SetWindowPos( HWND_TOP, nX, nY, 0, 0, SWP_NOSIZE );
}
void TCenteredPropertySheet::Bu
{
if( param == IDOK )
CheckAllPage();
}
I really don't understand why !!!
Are you calling EnableSubclass(true); in the constructor of your Property Sheet?
ASKER
Hi
Thanks a lot for your help
That was the good answer I can now intercept Ok
You talk about a paper on Property Sheets in your previous answer and I'm really interrested to get that paper if it is posible..
Never mind your answer is Ok and I give you a good rate
Daniel
Thanks a lot for your help
That was the good answer I can now intercept Ok
You talk about a paper on Property Sheets in your previous answer and I'm really interrested to get that paper if it is posible..
Never mind your answer is Ok and I give you a good rate
Daniel
ASKER
Hi
Thanks a lot for your help
That was the good answer I can now intercept Ok
You talk about a paper on Property Sheets in your previous answer and I'm really interrested to get that paper if it is posible..
Never mind your answer is Ok and I give you a good rate
Daniel
Thanks a lot for your help
That was the good answer I can now intercept Ok
You talk about a paper on Property Sheets in your previous answer and I'm really interrested to get that paper if it is posible..
Never mind your answer is Ok and I give you a good rate
Daniel
Thanks for your comment, I appreciate it. Send me a mail at djfrazier@vendata.com, I'll see if I can dig up the paper somewhere.
Please Grade!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
What the F... is EnableSubclass ??? I grepped my entire set of includefiles, but there is no EnableSubclass.
Furthermore, why don't you use EV_COMMAND instead of EV_COMMAND_AND_ID.
please djfr help me!!
.luc.
Furthermore, why don't you use EV_COMMAND instead of EV_COMMAND_AND_ID.
please djfr help me!!
.luc.
What version of the Borland compiler are you running with? I am using 5.02. If your version is pre 5.x, I don't believe you'll find it. The reason I use EV_COMMAND_AND_ID is so that I can have one function that handles multiple WM_COMMAND messages.
DEFINE_RESPONSE_TABLE1(MyP
EV_COMMAND_AND_ID(IDOK, HandleOkButton),
END_RESPONSE_TABLE;
The handler would look like:
void TMyPropertySheetClass::Han
{
switch(wParam)
{
case IDOK:
// do something.....
Apply();
break;
}
}
Property Sheets aren't easy. I have a paper on them somewhere...
Hope this helps:-)
DJF