Posted 12 years ago by Matt Whitfield
Version: 4.0.0262
Platform: .NET 2.0
Environment: Windows XP (32-bit)
Avatar
Hello

I have a user of my app who insists on using incredibly large font size (20+), and in my app, when the memberlist is shown, the size of each item is still only 16 pixels, and so the font is truncated.

I have tried this in the test application, by adding:

editor.Font = new Font("Lucida Console", 20F);
editor.IntelliPrompt.MemberList.Font = editor.Font;
But in the test application the Memberlist shows up with each item the right height for the font. So I looked at how you set up the member list, and noticed that it's significantly different to how i do it (I add new items manually).

So I added the following code to the memberlist trigger (I've included a few lines above to give you some context):

switch (editor.Document.Language.Key) {
    case "C#": {
        switch (e.Trigger.Key) {
            case "MemberListTrigger": {

                editor.IntelliPrompt.MemberList.Add(new IntelliPromptMemberListItem("hello", 1, "wow", "yeah", "no way"));
                editor.IntelliPrompt.MemberList.Show();
                return;
And... Hey presto... it does the same thing - i get a small item which isn't the height of the font it's being drawn in...

So...

Is this actually a bug, or am I missing something?

Thanks for your excellent support (i'm confident that i will receive a good answer - such is the service i've come to expect from you guys!)

Comments (10)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Thanks Matt, it's now fixed for the next maintenance release. To workaround the issue in the current build, try setting the member list's ImageList property to a non-null value after setting the font size. That will trigger the code that should occur when the Font is set.


Actipro Software Support

Posted 12 years ago by Matt Whitfield
Avatar
Thanks very much - workaround works nicely - thanks for that.

I do have another request though (he's pushing his luck!!!)

Very much appreciative of the changes you made to AutoReplace to make it possible to cancel the key press - but I am wondering whether it would be possible to make AutoReplaceEntry settable in the event args too?

The reason is that if I want to replace BEGIN with

BEGIN
x
END
(x marks the spot for the cursor)

Then that is fine when the BEGIN is at the very left of the editor - but if the BEGIN is indented, then the END really needs to be indented as well. So I wanted to use some code like this:

                    DocumentPosition dp = shtb.Document.OffsetToPosition(e.Offset);
                    StringBuilder sb = new StringBuilder(32);
                    sb.Append("\n");
                    for (int i = 0; i < dp.Character; i++)
                    {
                        sb.Append(" ");
                    }
                    e.AutoReplaceEntry.ReplaceText = e.AutoReplaceEntry.ReplaceText.Replace("\n", sb.ToString());
Otherwise I end up with (edit -> this bit doesn't show up right, so you'll have to imagine two spaces before the first begin!)
BEGIN
x
END

I am sure that code is not exactly right - and I wouldn't mind replacing the entire auto replace entry with a new auto replace entry object - that would be fine.

Hope it makes sense to you guys what i'm trying to achieve here.

Once again thanks for a very fine product - love it.

[Modified at 11/01/2007 03:07 PM]
Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Ok, a setter has been added for the next maintenance release.


Actipro Software Support

Posted 12 years ago by Matt Whitfield
Avatar
You guys have my ultimate respect, thank you.
Posted 12 years ago by Matt Whitfield
Avatar
Sorry it took me so long to use this - but the setter seems to do nothing...

DocumentPosition dp = shtb.Document.OffsetToPosition(e.Offset);
StringBuilder sb = new StringBuilder(32);
sb.Append("\r\n");
sb.Append(new string(' ', dp.Character));
e.AutoReplaceEntry = new AutoReplaceEntry(e.AutoReplaceEntry.FindText, e.AutoReplaceEntry.ReplaceText.Replace("\r\n", sb.ToString()));
Using the above code - what gets replaced in the document is still the old ReplaceText from the original object...

I have checked and the new AutoReplaceEntry is being correctly created - am I missing something?
Posted 12 years ago by Matt Whitfield
Avatar
Hmmm... I think the name of the event gives it away slightly - AutoReplacePerformed

Which makes the setter pretty useless...

Any chance of an AutoReplacePerforming event or similar? The only other alternative I can think of is to re-create the auto replace entries every time a keytyping event is fired with the relevant character... but that seems pretty inefficient to me?
Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Ha, good point. I completely missed that myself! :) If we add an AutoReplacePerforming event, would you be willing to test a preview build to ensure it works before we do an official maintenance release with it in it? Please email our support if you can. Thanks!


Actipro Software Support

Posted 12 years ago by Matt Whitfield
Avatar
Don't suppose you guys know when .272 will be out do you?

My app is in a bit of a limbo state now because I have the preview version installed...

Thanks for the update anyway!
Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hoping to possibly get it out tomorrow if things go ok.


Actipro Software Support

Posted 12 years ago by Matt Whitfield
Avatar
Brilliant, looking forward to it :)
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.