Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - how to add CXTPReportFilterEditControl to toolbar
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

how to add CXTPReportFilterEditControl to toolbar

 Post Reply Post Reply
Author
Message
ddlittle View Drop Down
Senior Member
Senior Member


Joined: 19 February 2004
Location: United States
Status: Offline
Points: 132
Post Options Post Options   Thanks (0) Thanks(0)   Quote ddlittle Quote  Post ReplyReply Direct Link To This Post Topic: how to add CXTPReportFilterEditControl to toolbar
    Posted: 09 February 2008 at 3:54pm
I am using a CXTPReportControl and i wanted to add a filter edit box to a toolbar, but CXTPReportFilterEditControl is derived from CEdit and isn't a CXTPControl.  I tried changing the pControl to a pointer to it, but got an access violation.
 
I couldn't find any help or examples.
 
Thanks!
 
- David
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 11 February 2008 at 5:11pm
Hi David,

But the example is available in a regular ReportSample application. Just enable menu Report Control / Filter window  -- it is implemented on the toolbar.

--
WBR,
Serge
Back to Top
ddlittle View Drop Down
Senior Member
Senior Member


Joined: 19 February 2004
Location: United States
Status: Offline
Points: 132
Post Options Post Options   Thanks (0) Thanks(0)   Quote ddlittle Quote  Post ReplyReply Direct Link To This Post Posted: 11 February 2008 at 5:19pm
Not exactly - the filter window is on a CDialogBar, not a CXTPToolbar.  A CDialogBar will dock, but it doesn't have any themes, so it looks ugly.  It needs to be creatable on a CXTPToolbar to get the right look - if there's a sample that shows how to get a CEdit (Not a CXTPControlItemEdit) on a toolbar, that would probably be sufficient.
 
 
Back to Top
Barto View Drop Down
Groupie
Groupie


Joined: 27 February 2005
Location: Germany
Status: Offline
Points: 60
Post Options Post Options   Thanks (0) Thanks(0)   Quote Barto Quote  Post ReplyReply Direct Link To This Post Posted: 19 February 2008 at 8:47am
Try a code like this:

int CCurveView::OnCreateControl(LPCREATECONTROLSTRUCT lpCreateControl)
{
 if(lpCreateControl->nID == ID_CEDCURVEVIEW_SCRIPT) {
 
  m_pScript = new CSingleLineScriptEdit();
  VERIFY(m_pScript->Create(WS_CHILD | WS_VISIBLE | WS_BORDER, CRect(0, 0, 200, 22), this, lpCreateControl->nID));
  m_pScript->CommonInit(XTPPaintManager()->GetCommandBarFont(lpCreateControl->pCommandBar), CScriptEditCtrl::LoadXMLResource(IDR_SCRIPT));
  m_pScript->SetOwner(this);

  CXTPControlCustom* pControl = CXTPControlCustom::CreateControlCustom(m_pScript);
  pControl->SetBorders(2, 0, 0, 0);
  pControl->SetFlags(xtpFlagManualUpdate);
  lpCreateControl->pControl = pControl;
  return TRUE;

just replace CSingleLineScriptEdit with CXTPReportFilterEditControl.. it should work
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.188 seconds.