Print Page | Close Window

Right-click bug in SyntaxEdit

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=11875
Printed Date: 21 November 2024 at 3:57pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Right-click bug in SyntaxEdit
Posted By: PPL1
Subject: Right-click bug in SyntaxEdit
Date Posted: 18 August 2008 at 3:46pm
SyntaxEdit seems to have a problem with right-click and tabs.
 
If the line contains a tab character, the right-click does not move the focus to the correct position. Tabs seem to count as 1 chr.

1-Take the Syntax Edit sample. Add 2 lines:
Function
[tab]Function
2- Right-click at the end of the first line. Focus goes to the end as expected
3- Right-click at the end of the Second line. Focus goes to the ''t'' of Function.

With this bug, context menus become useless for copy/paste



Replies:
Posted By: PPL1
Date Posted: 25 August 2008 at 4:20pm
This is a major problem and not fixed in the latest 12.0.2!!! How can one provide such basic feature as context menu with this major bug !!!
 
Even your sample app has this bug:
http://www.codejock.com/downloads/samples/syntaxedit.asp#syntaxedit_MDITextEditor - http://www.codejock.com/downloads/samples/syntaxedit.asp#syntaxedit_MDITextEditor
 
Is anyone using the SyntaxEditor ???


Posted By: ijwelch
Date Posted: 25 August 2008 at 9:00pm
Think need to email to support to have chance to get fixed. Not everything in forum is dealt with it seems.


Posted By: PPL1
Date Posted: 25 August 2008 at 9:10pm
This was done on Aug 12th, nearly 2 weeks ago. Assigned, but no reply
 
I'm curious how many people are actually using SyntaxEdit in a production environment? And how they are handling context menus ?...
 
(or are they simply saying to customers: "Folks, don't hit the Tab key to indent (and edit all your code files to remove them) otherwise, your copy/paste operations will corrupt your code" )


Posted By: peerschindel
Date Posted: 28 August 2008 at 12:18pm
Hi PPL1,

we plan to use it in our software in the next version.
We have always been thinking about programing syntax coloring on
our own, but it seemed too much work (would have taken several
months, I guess)
So we downloaded the demo and it looked very nice at the 1st moment
So we bought it and integrated it in our software
(took ca. 1 week).
Then I found all the small bugs (took me altogether 2 weeks to make
it work fine).
Regarding the tab problem:
In the MFC version it can be easily fixed by replacing:
"CalcValidDispCol" with "CalcDispCol" in
"CXTPSyntaxEditCtrl::OnRButtonDown" and compiling the Lib/Dll
(or by overriding the message handler, copy the original source code
and make the replacement - then you don't need to compile the Lib/dll)
 
Now a small request:
I bought version 12.0.1. Do you have a list of things that were
changed/fixed in 12.0.2 or were I can get it? Because I would like to
know what other problems, that I don't know until now, I have to expect.
Best regards



Posted By: PPL1
Date Posted: 04 September 2008 at 8:10am
bump


Posted By: PPL1
Date Posted: 15 September 2008 at 9:16am
bump (again)


Posted By: Aaron
Date Posted: 15 September 2008 at 9:55am
Hi,
 
I'm glad I don't use SyntaxEdit control...
 
I think SyntaxEdit developers are on their holiday (for a few months...) It's really annoying when you have to wait for an answer that long. If I were you I would post one in the Commandbar forum, Oleg will wake some developers who are in charge of SyntaxEdit control
 
Good luck
 


-------------
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....


Posted By: PPL1
Date Posted: 22 September 2008 at 12:48pm
Bump...
 
One more week and still no answer from CJ (neither here nor through support). I looks like SyntaxEdit is dead.
 
As I need a VBScript editor, I may need to start looking at the competition (BCGSoft and free Scintilla are the ones that comes to mind...)


Posted By: PPL1
Date Posted: 24 September 2008 at 10:26am

This has been proposed as a solution (for those using the MFC version):

-----------------------
In the MFC version it can be easily fixed by replacing:
"CalcValidDispCol" with "CalcDispCol" in
"CXTPSyntaxEditCtrl::OnRButtonDown" and compiling the Lib/Dll
(or by overriding the message handler, copy the original source code

and make the replacement - then you don't need to compile the Lib/dll)
 
------------------------
 
For the ActiveX, could monitoring the mousedown (or right-click) Windows message and cancelling it be used to trick the control?


Posted By: PPL1
Date Posted: 03 October 2008 at 9:16am
Bump again...  6 weeks and no reply from CJ (here or in customer support).
 
A simple acknowledgement would be nice...


Posted By: jpbro
Date Posted: 03 October 2008 at 12:25pm
Hi PPL1...

I took a look at the SyntaxEditor (I don't use it myself) to see if I could come up with a workaround, and I may have found one. I noticed that the control responds correctly to LEFT mouse button clicks, so I thought that I would try to simulate a left click during a right click, and it seems to work. Please note that I have only done limited testing, so there may be other problems to solve yet...

Try this code on a form with a SyntaxEdit (SyntaxEdit1) control:


Option Explicit

Private Type POINTAPI
        x As Long
        y As Long
End Type

Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)

Private Const MOUSEEVENTF_ABSOLUTE = &H8000 '  absolute move
Private Const MOUSEEVENTF_LEFTDOWN = &H2 '  left button down
Private Const MOUSEEVENTF_LEFTUP = &H4 '  left button up

Private m_IgnoreMouseDown As Boolean

Private Sub SyntaxEdit1_MouseDown(Button As Integer, Shift As Integer, x As Long, y As Long)
   If Not m_IgnoreMouseDown Then
      ' Not a simulated mouse click, so process click as required
      Select Case Button
      Case vbRightButton
         ' Hide caret to prevent flickering
         Me.SyntaxEdit1.HideCaret = True
      Case vbLeftButton
         ' Perform Left button processing here
      End Select
   End If
End Sub

Private Sub SyntaxEdit1_MouseUp(Button As Integer, Shift As Integer, x As Long, y As Long)
   Dim l_Mouse As POINTAPI
  
   Select Case Button
   Case vbRightButton
     
      m_IgnoreMouseDown = True   ' Set flag to ignore simulated mouse click
  
      Me.SyntaxEdit1.HideCaret = False ' Show the caret
           
      ' Simulate mouse click
      mouse_event MOUSEEVENTF_ABSOLUTE + MOUSEEVENTF_LEFTDOWN, l_Mouse.x, l_Mouse.y, 0, 0
      mouse_event MOUSEEVENTF_ABSOLUTE + MOUSEEVENTF_LEFTUP, l_Mouse.x, l_Mouse.y, 0, 0
     
      m_IgnoreMouseDown = False  ' Set flag to process mouse clicks normally
     
   End Select
End Sub





-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6



Posted By: Oleg
Date Posted: 06 October 2008 at 3:20am
Hello,
 
Thanks, Pierre, fixed for 12.1 release. Sorry for such delay.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



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