ClipXConfigPage Service
Header: #include
<ClipXConfigPage.h>
Ancestor: ClipXConfigPage
Member Events:
virtual const char *getPageTitle() { return "Page Name"; }
This callback function is called when ClipX needs to know the name of your configuration page. The returned (UTF8) string is inserted in the configuration list.
virtual void copySettings() {}
This callback function is called when the main configuration dialog is created. You should copy your settings into temporary variables in response to this event.
virtual void applySettings() {}
This callback function is called when the user has clicked OK or APPLY in the main configuration dialog. You should copy the temporary settings that were modified by the config page back into the actual settings, therefore applying the changes.
virtual HWND createPage(HWND parent) { return CreateDialog(the->getOSModuleHandle(), MAKEINTRESOURCE(ID), parent, dlgProc.); }
This callback function is called when the configuration user interface needs to instantiate your dialog. The above typical response creates the dialog from resources, using ID as an identifier and dlgProc as a dialog procedure (note that depending on your project settings, you may have to use CreateDialogW instead if you need your dialog to show international character sets). A typical dialog procedure will look like this :
BOOL CALLBACK
dlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg) {
case
WM_INITDIALOG:
// initialize
your widgets
return
TRUE;
case WM_COMMAND:
//
handle your widget callbacks:
switch
(LOWORD(wParam)) {
case
IDC_MYCONTROL:
//
handle your widget command, then notify clipx that the Apply button
should be
enabled:
g_clipx->config_allowApply();
return
0;
}
return
0;
}
return 0;
}
Your dialog procedure should only operate on the temporary settings that were previously copied in copySettings, and never on the actual settings themselves.
virtual void saveSettings(const char *inifile, const char *section) {}
This callback function is called when you should save your (actual, not temporary) settings. Use WritePrivateProfileString with the parameters given.
inifile
The name of the ini file you should use with WritePrivateProfileString.
section
The name of the ini section you should use with WritePrivateProfileString
virtual void loadSettings(const char *inifile, const char *section) {}
This callback function is called when you should load your (actual, not temporary) settings. Use GetPrivateProfileString or GetPrivateProfileInt with the parameters given.
inifile
The name of the ini file you should use with GetPrivateProfile*.
section
The name of the ini section you should use with GetPrivateProfile*
virtual void onDestroyPage(HWND dialog)
This callback function is called when the config page is going away.
HWND dialog
The window handle of the dialog for the config page.