RickStrahl / MarkdownMonster

An extensible Markdown Editor, Viewer and Weblog Publisher for Windows
https://markdownmonster.west-wind.com
Other
1.59k stars 235 forks source link

The ability to add a frame to the bottom, so that enhanced parsers can report "Real-time" Logging in a "Wide" window. #611

Closed Smurf-IV closed 4 years ago

RickStrahl commented 4 years ago

I'm not sure that this is needed.

If you're creating an addin you can create your own window and I would argue that it's better to display any sort of console info in that window rather than on the main window.

What would you want to display there? We do have the status bar for basic messages and notifications.

Smurf-IV commented 4 years ago

The plugin I want to run takes the MetaData (attributes) from the object-blocks and validates its:

RickStrahl commented 4 years ago

Ok... I've added a console window:

image

Which is accessible via an Addin's Model.Console property or in the Commander addin (as above) in Model.AppModel.Console There are Write(), WriteLine(), Clear(), Show(), Hide() methods on the console (beyond UI properties for the panel control).

Writing to the console will open it. There's also a toggle menu option on the View menu now as well as buttons on the window to close and clear content.

Smurf-IV commented 4 years ago

Thanks for this. Just had an exception when trying to call this during Load: image Should this cache the message, or return a useful error, as everything that is being used (i.e. even Console) is not null therefore not testable via plugin code.

Smurf-IV commented 4 years ago

Also: (Should this be raised as a separate [Bug] as this is not a released feature yet?) If you dump a large amount of text on the first API call (i.e.WriteLine with lot's of lines and carriage return within it!), the Console Window fills the entire app screen. It does not limit it's size to 10 lines etc.

Smurf-IV commented 4 years ago

Also: Each new line written the Console makes the console window size increase (Probably the cause of the previous comment) This is the version i am using: image

Smurf-IV commented 4 years ago

Setting the MaxHeight to 40 has a weird effect:

RickStrahl commented 4 years ago

Please try 1.20.10. There have been several updates to the console panel.

Smurf-IV commented 4 years ago

Without specifics, of what 1.2.10.1 gave; I just tested the window height, after each add. It filled the screen as before: image

RickStrahl commented 4 years ago

I don't understand what you're saying. Are you saying the window grows each time you add something when the window is full?

I don't see that here. The console should scroll down with new entries showing the last entry.

image

Smurf-IV commented 4 years ago

I don't understand what you're saying. Are you saying the window grows each time you add something when the window is full?

Yes, It starts small, and then continues to grow up the screen until it occupies the whole of the MM app area as each line is added.

Code snippet below:

public class AddItAll : MarkdownMonster.AddIns.MarkdownMonsterAddin
{
...
        public override void OnDocumentUpdated()
        {
            base.OnDocumentUpdated();
            var doc = Model.ActiveDocument;
            if ((doc != null)
                && doc.IsActive
                )
            {
                ...
                Model.Console.WriteLine(text);
                ...
            }
        }
...
}
Smurf-IV commented 4 years ago

I have just recreated the scroll bar, and now I know Why you may not be seeing the issue.

If I resize the console window after it has been created (By using the mouse) I get a scrollbar and everything is as you describe.

BUT, If I do nothing but just edit away inside the editor without resizing the console after it has displayed, then I get the problem as i have described. HTH.

Smurf-IV commented 4 years ago

Why was this closed? It's still an issue!

RickStrahl commented 4 years ago

Because it's fixed with the above fix. Grab 1.20.10.3...

It auto-closed with the commit.

Smurf-IV commented 4 years ago

I can confirm that the scrollbar is on by default and works as expected with v1.20.10.3. Thanks