Rick Brewster

CodeLab v4.3 (for advanced users) Released July 13, 2019

Recommended Posts

CodeLab 3.3 Released

This is only for Paint.NET 4.0.6+!

 

Big update today...

 

Changes:

▪ Added Posterize to File > New Template (BoltBait)
▪ Comments in the UICode region are ignored (BoltBait)
▪ Added "Auto" to the View > Theme menu. CodeLab now tries to match your paint.net theme. (BoltBait)

▪ On the UI Builder screen, relaxed the validation of the Min, Default, and Max fields. (BoltBait)
▪ Added and fixed some snippets (toe_head2001)
▪ Added Debug Output window (toe_head2001)
▪ Fixed the AutoComplete box erroneously showing after typing var and void (toe_head2001)
▪ Fixed syntax highlighting within #if blocks (toe_head2001)
▪ Fixed some issues in Autocomplete (toe_head2001)
▪ Updated to the latest ScintillaNET editor (toe_head2001)
▪ Fixed Format Document and gave it a shortcut key (Ctrl+M) (toe_head2001)
▪ Other small bug fixes and code refactoring (toe_head2001 and BoltBait)

 

Grab the CodeLab DLL here:

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

 

 

Also, for those people stuck in the past (wearing bell bottom pants, running Windows XP with Paint.NET 3.5.11), I ported all of the features from CodeLab version 1.9 through 3.3 into CodeLab version 1.8.  Details here: http://boltbait.com/pdn/CodeLab/History.asp#v1.8f

 

Screenshots:

CodeLab33UI.png

 

  • Upvote 6

Share this post


Link to post
Share on other sites

The easy workaround, of course, is to define your variables separately.

 

After working on CodeLab v3.0-3.3 and v1.8f, user toe_head2001 and I are a little burned out on CodeLab development right now.  So, I imagine version 3.3 will live for a while.

 

(I'm going to be working on rewriting my tutorials, updating my plugins, and trying to get my plugins into the Windows Store.)

 

  • Upvote 4

Share this post


Link to post
Share on other sites

Hi @BoltBait, You should take some rest, Changes between Codelab 3.0 & 2.x is as drastic as between pdn 3.x and 4.0. I have a question how to use radio button from codelab.

Also, can you help how to use radio button, when there are more and one options. This time I did it using if-else since it was only two option, but can you explain how more options can be included in coding.

Share this post


Link to post
Share on other sites
5 minutes ago, Pratyush said:

Also, can you help how to use radio button, when there are more and one options. This time I did it using if-else since it was only two option, but can you explain how more options can be included in coding.

 

Use a switch.

switch (Amount3)
{
  case 0:
    // do something cool
    break;
  case 1:
    // do something cooler
    break;    
  case 2:
    // do something more cooler
    break;
  case 3:
    // do the coolest thing
    break;
}
  • Like 1

Share this post


Link to post
Share on other sites
2 minutes ago, toe_head2001 said:

Use a switch.

 

Thanks @toe_head2001. That's exactly what I needed. I was not sure so I simply copied 'Amount3 = 0' from UI on If else block, did my work. I was not sure what to use in switch case i.e. use "case first option, case 2nd option" or was it like "use case 1, case 2 or".

Many thank.

Share this post


Link to post
Share on other sites
On 2/2/2018 at 10:28 AM, BoltBait said:

After working on CodeLab v3.0-3.3 and v1.8f, user toe_head2001 and I are a little burned out on CodeLab development right now.  So, I imagine version 3.3 will live for a while.

 

Lies.

 

I purchased a new laptop last week.  It has a 4K screen which looks amazing.  However, it requires me to run at 200% (minimum, 300% comfortably).  This has uncovered some high DPI issues within CodeLab.

 

I fixed some of those and toe_head2001 is working on the others... plus a cool new feature.

 

So, expect a new build sometime soon.  (This week?)

  • Like 1
  • Upvote 2

Share this post


Link to post
Share on other sites
4 minutes ago, Ego Eram Reputo said:

 

It makes coffee??

 

I'll defer to toe_head2001 to post a screenshot.

  • Upvote 1

Share this post


Link to post
Share on other sites

Concerning variables declared in sequence... I got the variable parser to successfully detect them.

 

It even works on complex cases like this:

PointF selCenter = new PointF
{
    X = selection.Left + selection.Width / 2f,
    Y = selection.Top + selection.Height / 2f
},
VP = new PointF
{
    X = (float)(selCenter.X + Amount4.First * selCenter.X),
    Y = (float)(selCenter.Y + Amount4.Second * selCenter.Y),
};

selCenter and VP both detected, without any false positives. B)

 

@Pratyush

  • Like 1

Share this post


Link to post
Share on other sites

I have implemented proper detection of Method overloads.

 

Here are some screenshots:

Spoiler

First, here's how it works in v3.3.  It always shows the return type of the 1st overload, and lists no parameters.

oldOverloads.png

 

Here's how it will work in v3.4. It shows the proper return type, and lists parameters.

newOverloads.png

 

Here's another example showing two different overloads for Graphics.FillPolygon()

fillPolyOverloads.png

 

That was the last item on my ToDo list for CodeLab.  ✔️

  • Like 2

Share this post


Link to post
Share on other sites
14 hours ago, toe_head2001 said:

That was the last item on my ToDo list for CodeLab.  ✔️

 

Time for a request then :) I tried the new Switch/Case logic included with C#7.

 

switch (mystring.length)
{
    case int n when (n >= 0 && n <= 25):
    //do this
    break;

    case int n when (n >= 26 && n <= 50 ):
    //do this
    break;
}

 

Didn't work. Any chance this could be implemented please?

 

Thank you for all your work updating CodeLab!

 

 

Share this post


Link to post
Share on other sites
48 minutes ago, Ego Eram Reputo said:

Any chance this could be implemented please?

 

Nope.

 

Here's why:

 

CodeLab relies on the compiler that ships with the .NET framework and NOT the compiler that ships with Visual Studio.  This allows CodeLab to work on systems that do not have Visual Studio installed.

 

The .NET compiler (csc.exe) is stuck at C# version 5.0 or 6.0 (I can't remember which).

Share this post


Link to post
Share on other sites

I wanted to move a project to outside Codelab in my IDE but got following error

 

"The primary reference "PaintDotNet.Base" could not be resolved because it was built against the ".NETFramework,Version=v4.7" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.5.2". (MSB3274)"

Share this post


Link to post
Share on other sites
3 minutes ago, Pratyush said:

"The primary reference "PaintDotNet.Base" could not be resolved because it was built against the ".NETFramework,Version=v4.7" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.5.2". (MSB3274)"

 

In Visual Studio, you need to open the project properties, and change the Target Framework to .NET v4.7.

Share this post


Link to post
Share on other sites

When I start a project and device to choose a .NET version in latest visual studio, the latest .NET framework version I have is 4.6.2.  Seems some trouble shooting is needed before I start. 

Edited by Pratyush

Share this post


Link to post
Share on other sites

Also, in the Visual Studio project properties, as the last item in the list of frameworks, there's an entry "Install other frameworks..." As I recall, it just opens in your browser about the same thing that toe_head2001 linked to. I also recall it was kind of confusing, because there are two things I could do, and I wasn't sure which was the right one to install the framework.

Share this post


Link to post
Share on other sites

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.