Print Page | Close Window

CXTPSyntaxEditCtrl in a Dialog

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Syntax Edit
Forum Description: Topics Related to Codejock Syntax Edit
URL: http://forum.codejock.com/forum_posts.asp?TID=7350
Printed Date: 28 March 2024 at 7:44am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPSyntaxEditCtrl in a Dialog
Posted By: rodneyh
Subject: CXTPSyntaxEditCtrl in a Dialog
Date Posted: 09 June 2007 at 11:52pm

Has anyone got the SyntaxEditCtrl to work in a dialog clas in version 11.1.3? 

If so can you provide sample code?



Replies:
Posted By: AndreiM
Date Posted: 28 September 2007 at 3:28am
In version 11.2 it works for dialog.
The sample provided at ExtendedSamples\SyntaxEditOnDialog.zip


-------------
Regards,
Andrei Melnik


Posted By: lfumery
Date Posted: 02 January 2008 at 1:28pm
Hello,

Is it possible to download this sample somewhere ? I'm currently playing with the eval version of 11.2.2.

(my last registered version is 10.3.1, quite old, so without SyntaxEdit)

Thank you for your help...
Lionel


Posted By: AndreiM
Date Posted: 02 January 2008 at 1:47pm
You can get it here:
https://forum.codejock.com/uploads/20071009_104114_SyntaxEditOnDia.zip - uploads/20071009_104114_SyntaxEditOnDia.zip


-------------
Regards,
Andrei Melnik


Posted By: skanikdale
Date Posted: 18 November 2008 at 8:29am
Hi,
 
Can someone tell me how to add multiple syntax edit control on a dialog?
 
Thanks


Posted By: mdoubson
Date Posted: 27 January 2009 at 12:35pm
About linked sampe code -
1. You need to add one line in stdafx.h file to compile

#define _XTP_INCLUDE_SYNTAXEDIT_LEXER

#include <XTToolkitPro.h> // Codejock Software Components

2 comment include

//#include "SyntaxEditOnDialogDlg2.h"

and body of 2nd dialog function or add your implementation
void CSyntaxEditOnDialogDlg::OnToolsDialog2()
{
// CSyntaxEditOnDialogDlg2 dlg(this);

// dlg.DoModal();

}
missing implemenation in zip-file


Posted By: mdoubson
Date Posted: 27 January 2009 at 1:23pm
Multiple (2 for example) sample based on CSyntaxEditOnDialogDlg:
add in header file:

CXTPSyntaxEditCtrl m_ctrlSynEdit;

CXTPSyntaxEditCtrl m_ctrlSynEdit2;

in cpp file

BOOL CSyntaxEditOnDialogDlg::OnInitDialog()

{

CDialog::OnInitDialog();

CRect rcEdit;

GetClientRect(&rcEdit);

rcEdit.DeflateRect(3, 3);

BOOL bCreate = m_ctrlSynEdit.Create(this, TRUE, TRUE);

m_ctrlSynEdit.ModifyStyleEx(0, WS_EX_CLIENTEDGE);

//m_ctrlSynEdit.ModifyStyle(0, WS_BORDER);

int h = rcEdit.Height() - 10;

rcEdit.bottom = rcEdit.top + h / 2;

m_ctrlSynEdit.MoveWindow(&rcEdit);

bCreate = m_ctrlSynEdit2.Create(this, TRUE, TRUE);

m_ctrlSynEdit2.ModifyStyleEx(0, WS_EX_CLIENTEDGE);

//m_ctrlSynEdit.ModifyStyle(0, WS_BORDER);

rcEdit.top = rcEdit.bottom + 5;

rcEdit.bottom = rcEdit.top + h / 2;

m_ctrlSynEdit2.MoveWindow(&rcEdit);

CXTPSyntaxEditBufferManager* pDataMan = m_ctrlSynEdit.GetEditBuffer();

ASSERT(pDataMan);

if (pDataMan)

{

pDataMan->InsertText(_T(""), 1,1, FALSE);

}

m_ctrlSynEdit.SetFocus();

m_ctrlSynEdit.SetConfigFile(CXTPSyntaxEditCtrl::GetModulePath() + _T("EditConfig\\SyntaxEdit.ini"));

CXTPSyntaxEditBufferManager* pDataMan2 = m_ctrlSynEdit2.GetEditBuffer();

ASSERT(pDataMan2);

if (pDataMan2)

{

pDataMan2->InsertText(_T(""), 1,1, FALSE);

}

......................
 
void CSyntaxEditOnDialogDlg::OnSize(UINT nType, int cx, int cy)

{

CDialog::OnSize(nType, cx, cy);

if (m_ctrlSynEdit.m_hWnd && IsWindow(m_ctrlSynEdit.m_hWnd))

{

CRect rcEdit;

GetClientRect(&rcEdit);

rcEdit.DeflateRect(3, 3);

int h = rcEdit.Height() - 10;

rcEdit.bottom = rcEdit.top + h / 2;

m_ctrlSynEdit.MoveWindow(&rcEdit);

rcEdit.top = rcEdit.bottom + 5;

rcEdit.bottom = rcEdit.top + h / 2;

m_ctrlSynEdit2.MoveWindow(&rcEdit);

}

}




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