ProEssentials v6 version 6.0.0.74 or later is needed as new property interfaces are used with the new UI API.
To implement the user interface DLL...
1) include PEUIMFCAPI.H
2) include latest PEGRPAPI.H (supplied with your license of ProEssentials)
3) project should reference libs, PEUIMFC.LIB and PEGRP32D.LIB (PEGRP32D.LIB supplied with your license of ProEssentials)
note: substitute PEGRPDS.LIB or PEGRPDL.LIB for ProEssentials Standard and Lite users.
4) Call functions within PEUIMFCAPI.H similar to respective PEGRP32D calls.
For example, PEUIlaunchcustommize is similar to PElaunchcustomize.
For example, within your project, respond to PEWM_DOUBLECLK notification event to call PEUIlaunchcustomize(m_hPE, 0)
See below for an example of duplicating ProEssentials current user interface mouse and keyboard triggers.
Disable built-in user interface with ...
PEnset(m_hPE, PEP_bUSINGUISOURCECODE, TRUE);
5) When the parent window of a ProEssentials chart is destroyed, call PEUIdestroy(hPE)
In your MFC app you are already calling PEdestroy(hPE), just add a call PEUIdestroy(hPE) prior.
Like..
PEUIdestroy(hPE);
PEdestroy(hPE);
This is needed to clean up menu resources.
You can should also call PEUIdestroy if changing chart properties which effect menu characteristics so
a new menu is allocated and constructed on next call to PEUIlaunchpopupmenu.
BOOL YourWindow::OnCommand(WPARAM wp, LPARAM lp)
{
POINT pt;
if (lp == (LPARAM) m_hPE)
{
if ((HIWORD(wp) == PEWN_RBUTTONCLK)) { PEvgetW(m_hPE, PEP_ptLASTMOUSEMOVE, &pt); PEUIlaunchpopupmenu(m_hPE, &pt); }
if ((HIWORD(wp) == PEWN_DBLCLICKED))
{
if (PEnget(m_hPE, PEP_nOBJECTTYPE) != PECONTROL_3D) // 3D objects usually rotate on double click
PEUIlaunchcustomize(m_hPE, 0);
}
if ((HIWORD(wp) == PEWN_KEYDOWN))
{
KEYDOWNDATA kdd;
PEvget(m_hPE, PEP_structKEYDOWNDATA, &kdd);
// 'Space' opens Customization Dialog //
if (kdd.nChar == ' ') { PEUIlaunchcustomize(m_hPE, 0); return TRUE; }
// 'X' opens Export Dialog //
if (kdd.nChar == 'X' || kdd.nChar == 'x' ) { PEUIlaunchexport(m_hPE); return FALSE; }
// 'P' opens Print Dialog //
if (kdd.nChar == 'P' || kdd.nChar == 'p' ) { PEUIlaunchprintdialog(m_hPE, TRUE, NULL); return TRUE; }
// 'D' opens Text Export Dialog //
if (kdd.nChar == 'D' || kdd.nChar == 'd' ) { PEUIlaunchtextexportW(m_hPE, FALSE, NULL); return TRUE; }
// 'M' opens Maximize Dialog //
if (kdd.nChar == 'M' || kdd.nChar == 'm' ) { PEUIlaunchmaximize(m_hPE); return TRUE; }
}
} // processing only m_hPE messages in this section
return CDialog::OnCommand(wp, lp);
}