Rick Brewster

CodeLab v4.2 (for advanced users) Released March 18, 2019

Recommended Posts

On 12/27/2017 at 4:05 AM, toe_head2001 said:
On 12/2/2017 at 4:43 PM, MadJik said:

I'm having trouble with radiobuttons (same for dropdownlist).

In CodeLab I can change the value in the UI part of the code

Once built the Radiobutton is set to 0 ('None')

 

Howdy, I've fixed this for the next release.

However, anytime you use the UI Designer, it will revert the number back to 0 in your script. You'll need to make sure it's correct before building a DLL.

 

I've fully fixed this: Using the UI Designer will no longer revert the value back to 0.

Share this post


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

I've fully fixed this: Using the UI Designer will no longer revert the value back to 0.

 

Where could I download the updated version? CodeLab from BoltBait site still reverts the value to 0.

 

Share this post


Link to post
Share on other sites
7 hours ago, MadJik said:

Where could I download the updated version? CodeLab from BoltBait site still reverts the value to 0.

 

@toe_head2001 and I work together on CodeLab.  So, when he says he fixed something it means it will show up in the next official release of CodeLab.

 

When will the next official release happen?  I'm not sure.  Generally, we both work on stuff until we feel that we have a "release full" of stuff done.  Currently, there's only a "handfull" of stuff done.  But, I'm sure it won't be too long.

Share this post


Link to post
Share on other sites
6 minutes ago, Sonario648 said:

Does this work as a text editor using nodepad/notepad++ ?

 

Yes, CodeLab is essentially a text editor.

Both CodeLab and Notepad++ use the Scintilla component for the actual text editing.

 

7 minutes ago, Sonario648 said:

Problem is...I have no idea how to code.

 

You'll need to know how to code, if you want to make meaningful changes to the Speech Bubble effect.

It's not to late to learn though. :)

Share this post


Link to post
Share on other sites
Just now, toe_head2001 said:

 

Yes, CodeLab is essentially a text editor.

Both CodeLab and Notepad++ use the Scintilla component for the actual text editing.

 

 

You'll need to know how to code, if you want to make meaningful changes to the Speech Bubble effect.

It's not to late to learn though. :)

Even if I simply want to add a few more directions for the....tail that's used to show who is talking and where the speech is coming from?

Edited by Sonario648
Just found out finally that the thingamabob line thingy is called a tail.

Share this post


Link to post
Share on other sites

CodeLab 4.1 Released

This is only for Paint.NET 4.1.2+!

 

Small update today...

 

Changes:

▪ Added a 'Find Next' button to the Find panel. (toe_head2001)
▪ Ensure the .rtz file is part of the generated Solution. (toe_head2001)
▪ Retain default values when using UI Designer. (toe_head2001)
▪ Changed "while" snippet. (toe_head2001)
▪ Fixed generated OnDispose code. (BoltBait)
▪ Fixed a bug in Install.BAT files for the Store versions of PdN. (BoltBait)
▪ Lots of code cleanup, minor fixes, and HiDPI fixes. (toe_head2001 and BoltBait)

 

Grab the CodeLab DLL here:

 

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

 

 

OnDispose code fix:

 

In previous builds of CodeLab, if you used the File>New templates to generate a CodeLab script and you used an effect or a working surface, CodeLab would generate an OnDispose method like this:

 

protected override void OnDispose(bool disposing)
{
    // Release any surfaces or effects you've created.
    if (wrk != null) wrk.Dispose();
    wrk = null;
    if (blurEffect != null) blurEffect.Dispose();
    blurEffect = null;

    base.OnDispose(disposing);
}

This is no good because it will dispose your effects and work surface without looking at the "disposing" flag variable.

 

This release of CodeLab corrects the generated code to the following:

 

protected override void OnDispose(bool disposing)
{
    if (disposing)
    {
        // Release any surfaces or effects you've created.
        if (wrk != null) wrk.Dispose();
        wrk = null;
        if (blurEffect != null) blurEffect.Dispose();
        blurEffect = null;
    }

    base.OnDispose(disposing);
}

Notice that it is now checking the "disposing" variable before actually disposing the work surface and effect.

 

You may need to revisit any effects you've written in the past to be sure the OnDispose code is written properly.

 

  • Like 1
  • Upvote 3

Share this post


Link to post
Share on other sites

Also in CodeLab v4.1

You can now set the Min/Max range for the AngleChooser control.

angleRange.png

 

Previously, you'd have to export the project to Visual Studio if you wanted to do this.

  • Like 1
  • Upvote 3

Share this post


Link to post
Share on other sites

First of all, thank you very much for your work.

 

Secondly, about AngleChooser, sometimes it's useful to set a zero-trigonometric value to +90 degrees. This could be added as an option in the Style drop-down list.
Default: trigonometric zeros
Custom: zeros to +90 degree

 

I don't know how much work this option requires and that's why I don't want to insist. Anyway, I can live without it. ?

Edited by xod

Share this post


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

Secondly, sometimes it's useful to set a zero-trigonometric value to +90 degrees.

 

My trigonometry is a bit "rusty"; what's a zero-trigonometric value?

Share this post


Link to post
Share on other sites

Apologies if I missed a link somewhere. Is there a zip for CodeLab 4.1 that is not an installer?

Alternatively is there a why to have the CodeLabInstaller exe work with the Windows Store version of Paint.net?

Share this post


Link to post
Share on other sites

I've created some work-in-progress documentation for CodeLab.  This covers the actual features of CodeLab; nothing code related.

It is written in markdown files, and then MkDocs is used to build those files into a website.

 

https://toehead2001.github.io/codelab-docs/

 

Each page has an edit icon in the top right corner. Feel free to fill in any missing content.

A GitHub account to required to submit changes though.

 

  • Upvote 1

Share this post


Link to post
Share on other sites

I don't know if this is intentional behavior or a bug.

 

b23bteT.png

 

Also, for Display setting to 125% if the UI becomes too high and the scroll bar appears, the control is not properly resized and the color rectangle is not entirely visible.

 

KiXBtYm.png

Edited by xod

Share this post


Link to post
Share on other sites
6 hours ago, xod said:

 

I don't know if this is intentional behavior or a bug.

 

 

What at do you expect to happen?

 

Currently, the selection is displayed in the control so the + is constrained to the selection. 

 

BTW, 125% is an evil abomination that shouldn’t exist. Only 100 or 200 should be chosen. 

  • Like 1

Share this post


Link to post
Share on other sites

Ok, I understand, thanks.
I don't know why I had the impression that this was not happening in previous versions of CodeLab.

Share this post


Link to post
Share on other sites

I have a problem when opening CodeLab ( I am a beginer):

I get the error message: Full error message: System.ArgumentException: Font 'Verdana' does not support style 'Regular'........

I have run the Consolas and Hack font installers and had a go at running the registry thing with Envy Code R

Any thoughts?

Many thanks.

 

Edited by Chas
spelling

Share this post


Link to post
Share on other sites
36 minutes ago, Chas said:

I get the error message: Full error message: System.ArgumentException: Font 'Verdana' does not support style 'Regular'

 

Install the Verdana font?

 

https://www.google.com/search?q=verdana+font+download

 

Verdana is one of the fonts that comes with Windows.  Are you running Windows in a language other than English?

 

Share this post


Link to post
Share on other sites

That's pretty strange. CodeLab should only fallback to the Verdana font if none of the other fonts (Consolas, Courier New, ect.) are available.

Given that Consolas, Courier New, and Verdana are all included with Windows 7, those fonts must have been uninstalled from your computer at some point.

Share this post


Link to post
Share on other sites

CodeLab 4.2 Released

This is only for Paint.NET 4.1.6+!

 

Big update today...

 

Changes:

▪ New Icons! (toe_head2001)

▪ Improved the 'unsaved changes' dialog for when there's only one tab open, and also changed the wording in the dialog when there's multiple tabs open, to be less confusing (toe_head2001)

▪ The search box (in Find & Replace) now turns red when there are no matches (toe_head2001)

▪ When using Save As, the "//Name: " comment is now parsed to try to create a default filename. If it's unsuccessful, it will fall back to "MyScript.cs" (toe_head2001)

▪ Minor fixes to Format Document (toe_head2001)

▪ Files (with .cs extension) can now be dropped (drag and drop) into CodeLab to open them. (toe_head2001)

▪ Options to use force SingleRenderCall and Legacy ROI when Building DLL (toe_head2001 and BoltBait)

▪ Added three additional menu items to the Effects menu to start CodeLab with specific parameters (EffectsFlags, EffectRendingSchedule). (toe_head2001)

▪ Scripts with "//Submenu: Adjustments" will be put in the Adjustments menu instead of the Effects menu (BoltBait)

▪ If your effect has a sample image for The Plugin Browser, it will be shown on the Build to DLL form (BoltBait)

▪ Added a new high res icon for when CodeLab is running higher than 96dpi (BoltBait)

▪ Added new build options (Legacy ROI, Single Render Call) to File New template screen (BoltBait)

▪ Added the following script comments to control build options: (BoltBait)
// Force Legacy ROI
// Force Single Render Call

▪ CodeLab can now be installed to the Store version of Paint.NET. However, when running the Store version you can not create a Visual Studio project from your CodeLab script. Building a DLL still works fine. (toe_head2001 and BoltBait)

▪ Assortment of bugfixes, cleanups, refactorings (toe_head2001 and BoltBait)

 

Grab the CodeLab DLL here:

 

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

 

Screenshots:

 

New icons:

NewIcons.png

 

When developing a CodeLab script that utilizes special rendering commands, CodeLab now has the ability to run under those conditions while you are developing your script:

CodeLabMenu.png

 

There are some new options on the File New screen:

FileNew.png

 

Here are the new features of the Save as DLL screen:

BuildingDLL.png

 

You can now install CodeLab when using the Microsoft Store version of Paint.NET.  The only limitation is that you can't generate a Visual Studio solution of your CodeLab script.  If you click the button, nothing bad happens, it just tells you of the limitation.

 

New Options:

 

Legacy ROI... Here is a good description of how the ROI's work:

https://forums.getpaint.net/topic/113917-effectoptions/?do=findComment&comment=555790

 

Single Threaded vs. Single Render Call...

SingleThreaded only uses 1 thread to make calls into Render. It'll still be called many, many times, just like if you didn't use the flag, but without any multithreading. Progress bar still works here.

SingleRenderCall only calls Render once, and it's done with 1 array with all of the roi's. That this is effectively SingleThreaded is just a corollary. You won't see any progress bar updating here because the progress bar is updated as each Render call finishes, and there's no side-channel for reporting progress.

 

 

 

  • Like 3
  • Upvote 3

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.