Dialog, Classes, not using MFC
Hi,
I would like to known if it''s possible to declare a class for a DialogBox.
I want to have, all initialisation code, DialogProc, and all of the controls, options of this dialogbox in this class.
How i do it ?!
Something like :
class ConfigDialog
{
public:
ConfigDialog (); //Where i want to call the Dialog, show it !!
~ConfigDialog (); //Kill the class
//Some in/out, to retrieve value from the DialogBoxes
private:
DialogProc; // Control the behavior of the dialog
// Some bool, and value of the Control in the DialogBox
}
This is the way i would like it to look like !!
But i dunno if it''s possible ?! And, i''m not using MFC !!
Thanks,
LowRad
May I ask why you want to create a class?
I think in the end, you''ll be overriding the DialogProc, and you still have the same, plus an extra class...why do you wanno do that?
But if you really want to make it OO, you can The above looks good.
Best to look out with the DialogProc. This one won''t mix easily with OO.
I think in the end, you''ll be overriding the DialogProc, and you still have the same, plus an extra class...why do you wanno do that?
But if you really want to make it OO, you can The above looks good.
Best to look out with the DialogProc. This one won''t mix easily with OO.
OK,
So can you tell me how can i work with a DialogBox, with all those buttons on it, special button, special effects on the DialogBox !!
PLz tell me it''s will help me.
And Dont forget, i dont want to include MFC in my 3D Engine !!! (i let you think of the why of this !!)
Happy Coding ...
LowRad
So can you tell me how can i work with a DialogBox, with all those buttons on it, special button, special effects on the DialogBox !!
PLz tell me it''s will help me.
And Dont forget, i dont want to include MFC in my 3D Engine !!! (i let you think of the why of this !!)
Happy Coding ...
LowRad
//---------------------------------------------------------------------------BOOL CALLBACK DlgProcAbout(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam){ switch(uMsg) { case WM_INITDIALOG: { return TRUE; } case WM_COMMAND: switch(LOWORD(wParam)) //HIWORD(wParam)==BN_CLICKED { case IDOK: case IDCANCEL: EndDialog(hDlg, 0); return TRUE; } break; } return FALSE;}//--------------------------------------------------------------------------- case WM_COMMAND: switch(LOWORD(wParam)) { case ID_HELP_ABOUT: DialogBox((HINSTANCE)GetWindowLong(hWnd,GWL_HINSTANCE), MAKEINTRESOURCE(IDD_ABOUT), hWnd, (DLGPROC)DlgProcAbout); return 0; }
Make sure you''ve created a dialog resource and named it IDD_ABOUT.
You can these functions to change controls in DialogBoxes:
- GetDlgCtrlID()
- Set/GetDlgItemInt();
- Set/GetDlgItemText();
- CheckDlgButton();
- ...etc...etc...
Get yourself a copy of Win32 help files and lookup "Dialog Boxes".
Weird, I just gave this information to a guy who probably didn''t want it.
Anyway, you can use Dialog Templates to create a dialog box on the fly, set all the controls the way you want them at run time, whatever. It''s sort of a pain. However, you''re still going to need a dialog proc to run it as listed in one of the above posts. If it''s just the appearance of the box you want to control, that will do it - else I''m not sure what you''re looking for.
I just went and checked - dlgtemplate is what I''m talking about - ''dialog template'' is used a little differently. The help for it is in the platform sdk. If you don''t have that you can probably find it on Microsoft''s site.
information is the illusion of knowledge
Anyway, you can use Dialog Templates to create a dialog box on the fly, set all the controls the way you want them at run time, whatever. It''s sort of a pain. However, you''re still going to need a dialog proc to run it as listed in one of the above posts. If it''s just the appearance of the box you want to control, that will do it - else I''m not sure what you''re looking for.
I just went and checked - dlgtemplate is what I''m talking about - ''dialog template'' is used a little differently. The help for it is in the platform sdk. If you don''t have that you can probably find it on Microsoft''s site.
information is the illusion of knowledge
"It's obvious isn't it Miller? Curiosity killed these cats!"
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement