Posted 13 years ago by Charles W. Hooks
Version: 4.0.0236
Platform: .NET 2.0
Environment: Windows XP (32-bit)
Avatar
ToggleOverwriteModeCommand - Using this key when something is selected will delete selection, differnet behavior from MS.

Hightlight some text and hit the insert key, *poof* selection is deleted.

TransposeWordsCommand - Flat out unpredicetable. Some times it deletes rather than transpose.

type: foo bar

hightlight foo bar
run command CTRL-SHIFT-T
nothing transposed, but cursor between foo and bar
run command CTRL-SHIFT-T
words are transposed : bar foo
position cursor at the start of the line
run command CTRL-SHIFT-T
bar is repalced by foo: foo foo

Comments (16)

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Charles,

I'm trying to dupe both of these things in the sample project's SDI editor and am unable. They both appear to be working as expected.

Are you sure you don't have some other code in your app kicking in in response to those keystrokes?

Please post exactly how to dupe these in the sample project so we can debug it if needed.

Thanks!


Actipro Software Support

Posted 13 years ago by Charles W. Hooks
Avatar
Below is the code from my two objects. You don't have an HTML editor in your samples and the C# editors works quite a bit differently.

For our HTML editor we're just using the basic editor with the example HTML xml langauge with a few key bindings and commands added.

namespace KaliEditorControl {
public partial class KaliEditor : UserControl {
static KaliEditor() {
// Start the parser service (only call this once at the start of your application)
SemanticParserService.Start();
}

public KaliEditor() {
InitializeComponent();

// Show line numbers
syntaxEditor.LineNumberMarginVisible = true;

//
// Bind search/replace dialog to CTRL-F
//
syntaxEditor.CommandLinks.Add(new CommandLink(new SearchReplaceCommand(),
new KeyBinding(ActiproSoftware.WinUICore.Input.ModifierKeys.Control, Keys.F)));
//
// Bind toggle line numbers to CTRL-SHIFT-3
//
syntaxEditor.CommandLinks.Add(new CommandLink(new ToggleLineNumberCommand(),
new KeyBinding(ActiproSoftware.WinUICore.Input.ModifierKeys.ControlShift, Keys.D3)));
//
// Bind find next to CTRL-N and F3
//
syntaxEditor.CommandLinks.Add(new CommandLink(new IncrementalSearchCommand(),
new KeyBinding(ActiproSoftware.WinUICore.Input.ModifierKeys.Control, Keys.N)));

syntaxEditor.CommandLinks.Add(new CommandLink(new IncrementalSearchCommand(),
new KeyBinding(ActiproSoftware.WinUICore.Input.ModifierKeys.None, Keys.F3)));
//
// Bind reverse find next to CTRL-SHIFT-N and CTRL-SHIFT-I
//
syntaxEditor.CommandLinks.Add(new CommandLink(new ReverseIncrementalSearchCommand(),
new KeyBinding(ActiproSoftware.WinUICore.Input.ModifierKeys.ControlShift, Keys.N)));


//
// Unbind those commands that are buggy and/or dangerous to users.
//
UnbindCommands();
}

public virtual void InitEditor(string langFilePath) {
//
// Add the langauge to the editor.
//
syntaxEditor.Document.LoadLanguageFromXml(langFilePath, 0);
//
// This is very important to call, when using inheritance the designer will add this call
// automatically, when wrapped you must call it yourself of the syntax editor will not function
// correctly.
//
syntaxEditor.InitializeLifetimeService();
}

public void SetScript(string script) {
syntaxEditor.Document.Text = script;
}

public string GetScript() {
return syntaxEditor.Document.Text;
}

private void UnbindCommands() {
for (int index = syntaxEditor.CommandLinks.Count - 1; index >= 0; index--) {
//
// Unbind the Insert hot key since it deletes selected text when clicked.
//
if (HotKeysMatch(syntaxEditor.CommandLinks[index],
ActiproSoftware.WinUICore.Input.ModifierKeys.None, Keys.Insert))
{
syntaxEditor.CommandLinks.RemoveAt(index);
}
//
// Ubind transpose lines as it is buggy
//
if (HotKeysMatch(syntaxEditor.CommandLinks[index],
ActiproSoftware.WinUICore.Input.ModifierKeys.ControlShiftAlt, Keys.T))
{
syntaxEditor.CommandLinks.RemoveAt(index);
}
//
// Ubind transpose words as it is buggy
//
if (HotKeysMatch(syntaxEditor.CommandLinks[index],
ActiproSoftware.WinUICore.Input.ModifierKeys.ControlShift, Keys.T))
{
syntaxEditor.CommandLinks.RemoveAt(index);
}
}
syntaxEditor.Focus();
}

private bool HotKeysMatch(CommandLink commandLink, ActiproSoftware.WinUICore.Input.ModifierKeys modiferKey, Keys key) {
if (commandLink.KeyBinding.Modifiers != modiferKey || (commandLink.KeyBinding.Key != key)) {
return false;
}
return true;
}
}
}

namespace KaliHtmlEditor {
public partial class TestEditorForm : Form {

private string script;

public TestEditorForm() {
//
// Required for Windows Form Designer support
//
InitializeComponent();

//
// Couple of different test patterns.
//
kaliEditor.InitEditor("../../ActiproSoftware.HTML.xml");

script = LoadScript();
}
//
// Hard coded for testing purposes only.
//
private string LoadScript() {
FileStream file = new FileStream("../../TestJsp.htm", FileMode.Open, FileAccess.Read);
StreamReader reader = new StreamReader(file);

string script = reader.ReadToEnd();

reader.Close();
file.Close();

return script;
}


private void buttonLoad_Click(object sender, EventArgs e) {
kaliEditor.SetScript(script);
}

private void buttonOk_Click(object sender, EventArgs e) {
script = kaliEditor.GetScript();

kaliEditor.SetScript(null);
}
}
}
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Charles,

Can you ZIP up a simple fully-working project that shows this and email it over instead? That often works better than us building the code from a message. Thanks!


Actipro Software Support

Posted 13 years ago by Charles W. Hooks
Avatar
Or you could just start an syntaxEditor using "ActiproSoftware.HTML.xml" with the dependancey on the assembly line removed.

i.e. SyntaxLanguageTypeName="TestApplication.HtmlDynamicSyntaxLanguage, TestApplication"

That is all I did.


For example:

//
// Add the langauge to the editor.
//
syntaxEditor.Document.LoadLanguageFromXml("../../ActiproSoftware.HTML.xml", 0);
//
// This is very important to call, when using inheritance the designer will add this call
// automatically, when wrapped you must call it yourself of the syntax editor will not function
// correctly.
//
syntaxEditor.InitializeLifetimeService();

[Modified at 12/12/2006 04:03 PM]
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
If I take out SyntaxLanguageTypeName from the XML definition and run our SDI editor and load HTML I still don't see any problems with any of those commands. It would be best if you email over a project that shows it. Thanks.


Actipro Software Support

Posted 13 years ago by Charles W. Hooks
Avatar
Since I posted the bug my HTML editor has gotten quite a bit more complex and is non functional at the moment, but I sent you my KaliSciptEditor project which is still fairly simple and has the same problem. I also included a Readme file with the list of steps to reproduce the problem. I left the readme file open when I closed down the solution I created for you, so you should see that file opened when you open the project.
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Charles,

Sorry but we never seemed to receive the email. I even checked our spam folder. Can you please resend and double check the email address you used?


Actipro Software Support

Posted 13 years ago by Charles W. Hooks
Avatar
Sent to Support [at actipro].

[Modified at 12/13/2006 11:31 AM]
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
I don't understand, we're not getting your email. Are you ZIPing the attachments? How large is it? Can you try sending a simple email without any attachments?


Actipro Software Support

Posted 13 years ago by Charles W. Hooks
Avatar
This is what I see in my sent folder, went out into the either last night.




You requested a zipped up project file showing bad commands...
Charles Hooks
To: 'Support at actipro'
Attachments: Bad_commands.zip (638KB)
-------------------------------------------------
Intructions to replicate the word swapping problem.

Click: F5
Click: Load
goto the end of the document
type: return
type: foo bar
hightlight: foo bar
press: CTRL-SHIFT-T
nothing transposed, but cursor between foo and bar
press: CTRL-SHIFT-T
words are transposed: bar foo
press: Home
press: CTRL-SHIFT-T
bar is replaced by foo: foo foo



Charles W. Hooks
Senior Developer
Trans World Health Services, Inc.
10315 Professional Circle Suite 101
Reno, NV 89521 USA
+1 775 852-9440
cwh@transworldhealth.com

[Modified at 12/13/2006 12:46 PM]
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
This is really odd, perhaps the first time we haven't gotten emails from a customer. Like I said I am checking our spam folder too but it's not there either.

Could you try one of two things:
1) Try sending it from like a hotmail account instead.
2) Or upload to a URL on your server and I can download it from there.

Also please do try sending a small test e-mail (without attachments) to us so we can see if we are getting anything from you. Let us know once you do.


Actipro Software Support

Posted 13 years ago by Charles W. Hooks
Avatar
I have already sent an test e-mail with no attachements early this morning.

The URL option is not open to me.

As for using another e-mail account, I only have the one work account.
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Try sending a small e-mail with no attachments again. I added your domain to our safe senders list but I'm not sure it will make a difference since your other emails weren't even in our spam folders.

Are you sure e-mails are going out from your end?


Actipro Software Support

Posted 13 years ago by Charles W. Hooks
Avatar
I am positive the e-mail are going out on my end. Verified the exchange queues as well, I am also getting replies back to other e-mail sent out last night and this morning.
Posted 13 years ago by Charles W. Hooks
Avatar
Your provider wouldn't happen to be verizon, would it? If so your provider might be blocking our IP address. They were blocking our IP addresses for a while when BEA started the data center on the entire 2nd floor above us...
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
We use ThePlanet for web hosting and that is where our mail server is. This is the first time that I'm aware of that we were unable to receive e-mail from a customer.

Could you possibly sign up real quick for a hotmail or gmail account and try e-mailing us with that?


Actipro Software Support

The latest build of this product (v2018.1 build 0342) was released 11 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.