Jump to content

CodeLab v6.0 (for advanced users) Released June 25, 2020


Recommended Posts

CodeLab 4.4 Released

This is only for Paint.NET 4.2+!

 

Small update today...

 

(This was all @toe_head2001 as I've been super busy with a new job.)

 

Changes:
▪ Added a Snippet Manager
▪ Added suggested names to autocomplete
▪ Added keyboard shortcut ( Ctrl+] ) to go to matching brace
▪ Added option to specify an Enum on RadioButtonControl and ListBoxControlControl
▪ Added argument constraints to tooltips for generic methods and classes
▪ Improved method overload detection: detection of method parameter modifiers (out, ref, params); detection of inferred generic methods
▪ Lots of bug fixes, refactorings, and optimizations


Grab the CodeLab DLL here:

 

https://www.boltbait.com/pdn/CodeLab/

 

  • Upvote 4

Click to play:
j.pngs.pngd.pnga.pngp.png
Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game

Link to post
Share on other sites
  • BoltBait changed the title to CodeLab v4.4 (for advanced users) Released November 23, 2019

Here's some commentary for the items that may not be obvious:

 

Snippet Manager

 

This can be accessed from the toolbar. The icon for it is on the far right.

 

Snippets can be shared. They are Imported and Exported in the JSON format.

Here's an example you can import:

{
  "preRender": "void PreRender(Surface dst, Surface src)\r\n{\r\n    $\r\n}",
  "dw": "Debug.WriteLine($);",
  "curPal": "IReadOnlyList<ColorBgra> currentPalette = Services.GetService<IPalettesService>().CurrentPalette;"
}

 

A dollar sign ($) can used to control the placement of the text caret.

 

RadioButtonControl<TEnum> and ListBoxControlControl<TEnum>

 

This is kind of a hidden feature, since the UI Designer doesn't generate them for you.  If you want to take advantage of this feature, you just need to know it exists and how to use it.

Here's an example:

#region UICode
RadioButtonControl<Positions> position = Positions.Center; // Image Position|On the Left|In the Center|On the Right
#endregion

enum Positions
{
    Left,
    Center,
    Right
}

void Render(Surface dst, Surface src, Rectangle rect)
{
    switch (position)
    {
        case Positions.Left:
            // Code Here
            break;
        case Positions.Center:
            // Code Here
            break;
        case Positions.Right:
            // Code Here
            break;
    }

    dst.CopySurface(src, rect.Location, rect);
}

 

Q. Doesn't this just add more code to my plugin, since it now has to include an extra Enum and the RadioButtonControl<TEnum> generic class?

A. No.

1) CodeLab would have to generated an Enum behind-the-scenes anyway. Your user-defined Enum negates the need for CodeLab to generate one.

2) A RadioButtonControl<TEnum> generic class doesn't exist. This is implemented as "syntax sugar". When the code is compiled, RadioButtonControl<> is stripped away leaving just your enum.

 

Argument Constraints for Generics in Tooltips

 

Not too many of the Generics you see in CodeLab have constraints, so here's a screenshot:

constraints.png

 

Edited by toe_head2001
typos
  • Upvote 3
Link to post
Share on other sites

Excellent update! Thanks guys.

 

I have to say I'm also a BIG fan of the icon in the installer! It looks great!

Link to post
Share on other sites
  • 2 weeks later...
  • 1 month later...

CodeLab 5.0 Released

This is only for Paint.NET 4.2+!

 

HUGE update today...

 

Changes:
▪ Added TXT file support (toe_head2001)
▪ Added File Type plugin development support (toe_head2001)
▪ Added Shape (xaml) editing support (toe_head2001)
▪ File New Templates completely rewritten to allow multi-effect pipeline (BoltBait)
▪ Lots of bug fixes, refactorings, and optimizations


Grab the CodeLab DLL here:

 

https://www.boltbait.com/pdn/CodeLab/

 

Screenshots:
 

How to access the new features we added to CodeLab:

NewMenu.png

 

New Effect screen:

 

FileNewUI.png

It is now possible to string together as many Effects, Pixel Ops, Blend Modes, Surface Fills, and Surface Copies as you want. CodeLab will then write the code for you to combine all this into an effect.

 

Now, we understand that this is going to lead to an explosion of new plugins that just throw everything together into one UI.  As mods, we will be reviewing plugins posted in the Plugin Forum and deleting those that just aren't up to standards.  We don't want to discourage everyone from making their own plugins for their own machine. But, let's keep the quality up in our plugin forum. (Remember, noobs should be using plugins, not writing them.)

 

New Shape screen:

 

NewShapeUI.png

This is not an inclusion of the Shape Maker plugin. This is simply an editor for the actual .xaml shape files that Paint.NET uses.

It includes syntax highlighting and code completion.  CodeLab is now a complete replacement for the KAXAML editor in this tutorial.

 

 

Editing text files (nothing special, no syntax highlighting, just a place to keep notes, etc.):

 

NewTextUI.png

 

Designing and Implementing File Type Plugins:

 

FileTypeEditing.png

 

And, with this release, MY wish list for CodeLab is complete.

 

Enjoy! 😎 :beer: 

 

  • Like 2
  • Upvote 4

Click to play:
j.pngs.pngd.pnga.pngp.png
Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game

Link to post
Share on other sites
  • BoltBait changed the title to CodeLab v5.0 (for advanced users) Released January 9, 2020
27 minutes ago, ReMake said:

we have another error

 

Yes we do!

 

Thanks, I will fix it right now.

 

Keep looking for errors!  When I rewrote the File New screen it was over 2,000 lines of all new code. So, finding an error or two in that section is not surprising.

Click to play:
j.pngs.pngd.pnga.pngp.png
Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game

Link to post
Share on other sites

Codelab has had an astonishing overhaul. BoltBait and toe_head2001 have made an awesome tool into something quite incredible.

 

I still want them to write a book on it....

  • Like 1
Link to post
Share on other sites

Working title  "learn to code in C# using...Codelab and paint.net!" :mrgreen:

 

Link to post
Share on other sites
7 hours ago, Ego Eram Reputo said:

Working title  "learn to code in C# using...Codelab and paint.net!" :mrgreen:

 

I'd read it @BoltBait

 

Link to post
Share on other sites

The new version removed the ability to open a file and build a dll. Now the only way to do it is to copy the file content into the editor and save it to a file to be allowed to build a dll, preview the plugin and etc.

Is there possibility to be added character for identation and space width of it (like 1 tab with width of 2 spaces)? Could you add ability to save the dll directly and to a directory instead to zipping it to the desktop? Can you allow reloading of a tab if you edit it from outside the editor, because now reopening it will cause a creation of a new tab? The last one is a bit tricky probably, but I see the generated code in the region "User Entered Code". Can you add ability to see the full source in the editor and directly change it. It can be done easily with user regions inside the generated code or vice versa.

Link to post
Share on other sites
1 hour ago, anon3 said:

The new version removed the ability to open a file and build a dll. Now the only way to do it is to copy the file content into the editor and save it to a file to be allowed to build a dll, preview the plugin and etc.

 

It works for me.  Can you give the specific steps that demonstrate the issue?

 

1 hour ago, anon3 said:

Is there possibility to be added character for identation and space width of it (like 1 tab with width of 2 spaces)?

 

A tab width of 2 spaces instead of 4 spaces?  Yes, it would be very easy to add that option.

 

1 hour ago, anon3 said:

Could you add ability to save the dll directly and to a directory instead to zipping it to the desktop?

 

Possible? Yes.

Please explain why you would want to do that.

 

1 hour ago, anon3 said:

Can you allow reloading of a tab if you edit it from outside the editor, because now reopening it will cause a creation of a new tab?

 

Maybe.

 

1 hour ago, anon3 said:

The last one is a bit tricky probably, but I see the generated code in the region "User Entered Code". Can you add ability to see the full source in the editor and directly change it. It can be done easily with user regions inside the generated code or vice versa.

 

Absolutely not. That would defeat the purpose of using CodeLab. If you want the full source code, you should be using Visual Studio.

Link to post
Share on other sites
  • BoltBait changed the title to CodeLab v6.0 (for advanced users) Released June 25, 2020

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...