![]()  | 
 
CXTPSyntaxEditCtrl in a Dialog | 
 
    Post Reply  
   | 
  
| Author | |
   
   rodneyh  
   
   Newbie  
   Joined: 09 June 2007 Location: United States Status: Offline Points: 1  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Topic: CXTPSyntaxEditCtrl in a DialogPosted: 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? 
    | 
 |
![]()  | 
 |
   
   AndreiM  
   
   Moderator Group  
   Joined: 18 August 2007 Status: Offline Points: 132  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 28 September 2007 at 3:28am | 
 
| 
   
    
   In version 11.2 it works for dialog. 
 
   
  The sample provided at ExtendedSamples\SyntaxEditOnDialog.zip 
    | 
 |
![]()  | 
 |
   
   lfumery  
   
   Newbie  
   Joined: 02 January 2008 Location: France Status: Offline Points: 1  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     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  | 
 |
![]()  | 
 |
   
   AndreiM  
   
   Moderator Group  
   Joined: 18 August 2007 Status: Offline Points: 132  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 02 January 2008 at 1:47pm | 
 
| 
   
    
   You can get it here:
    
   
   | 
 |
![]()  | 
 |
   
   skanikdale  
   
   Newbie  
   Joined: 18 November 2008 Location: India Status: Offline Points: 4  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Posted: 18 November 2008 at 8:29am | 
 
| 
   
    
   Hi,
 
   
  Can someone tell me how to add multiple syntax edit control on a dialog? 
Thanks 
    | 
 |
![]()  | 
 |
   
   mdoubson  
   
   Senior Member  
   Joined: 17 November 2008 Status: Offline Points: 1705  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     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 Components2 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  | 
 |
![]()  | 
 |
   
   mdoubson  
   
   Senior Member  
   Joined: 17 November 2008 Status: Offline Points: 1705  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     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); } }  | 
 |
![]()  | 
 |
    Post Reply  
   | 
  |
|       
  
  Tweet   	
    | 
 
| Forum Jump | Forum Permissions  ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum  |