Print Page | Close Window

how to add CXTPReportFilterEditControl to toolbar

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=9543
Printed Date: 01 July 2024 at 3:04am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: how to add CXTPReportFilterEditControl to toolbar
Posted By: ddlittle
Subject: how to add CXTPReportFilterEditControl to toolbar
Date 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



Replies:
Posted By: sserge
Date 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


Posted By: ddlittle
Date 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.
 
 


Posted By: Barto
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net