Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Syntax Edit
  New Posts New Posts RSS Feed - CXTPSyntaxEditCtrl in a Dialog
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPSyntaxEditCtrl in a Dialog

 Post Reply Post Reply
Author
Message
rodneyh View Drop Down
Newbie
Newbie


Joined: 09 June 2007
Location: United States
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote rodneyh Quote  Post ReplyReply Direct Link To This Post Topic: CXTPSyntaxEditCtrl in a Dialog
    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?
Back to Top
AndreiM View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 18 August 2007
Status: Offline
Points: 132
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndreiM Quote  Post ReplyReply Direct Link To This Post Posted: 28 September 2007 at 3:28am
In version 11.2 it works for dialog.
The sample provided at ExtendedSamples\SyntaxEditOnDialog.zip
Back to Top
lfumery View Drop Down
Newbie
Newbie


Joined: 02 January 2008
Location: France
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote lfumery Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
AndreiM View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 18 August 2007
Status: Offline
Points: 132
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndreiM Quote  Post ReplyReply Direct Link To This Post Posted: 02 January 2008 at 1:47pm
Back to Top
skanikdale View Drop Down
Newbie
Newbie


Joined: 18 November 2008
Location: India
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote skanikdale Quote  Post ReplyReply Direct Link To This Post Posted: 18 November 2008 at 8:29am
Hi,
 
Can someone tell me how to add multiple syntax edit control on a dialog?
 
Thanks
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post 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);

}

}

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.172 seconds.