Jump to content

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


Recommended Posts

Thank you for giving us this great tool for free!

 

Another useful thing would be, in my opinion, the insertion of a space after a comma when formatting the code.

 

For example the next line:

using (Pen pen = new Pen(Color.FromArgb(80,0,0,255)))

it will look like this:

using (Pen pen = new Pen(Color.FromArgb(80, 0, 0, 255)))


 

 

 

Link to post
Share on other sites
11 minutes ago, NSD said:

Thank you for giving us this great tool for free!

 

Donations help keep developers motivated. :D

Donate to BoltBait

Donate to toe_head2001

 

14 minutes ago, NSD said:

Another useful thing would be, in my opinion, the insertion of a space after a comma when formatting the code.

 

Yes, proper spacing around commas and operators would be ideal.  I've been meaning to do that, but it's tricky, with lots of corner cases.

  • Upvote 1
Link to post
Share on other sites

@NSD, I've fixed a few of the scaling issues. However, I don't experience the issue with the Labels overlapping other UI elements.

 

Which version of Windows 10 are you using? I'm using Windows 10 2004.  I'm not sure if that matters...

 

@BoltBait, do you see the issue with the overlapping Labels?

 

 

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

@BoltBait, do you see the issue with the overlapping Labels?

 

 

No, I do not.  The dialog boxes all work fine for me at all scaling factors.

 

Maybe he has some other setting that is affecting the layout.

 

It looks to me like @NSD has changed his system font to Verdana and I'm not going to code around that. He can just fix his system back to normal.

 

  • Upvote 1
Link to post
Share on other sites
4 hours ago, toe_head2001 said:

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

Open Effects/Advanced/CodeLab..., File/Open..., selecting a .cs source I previously saved from the plugin, I explicitly set C# Code Files (*.CS), press Open and it opens it as a text file, so you cannot build, design, preview and so on. My .cs files are not associated with any program.

4 hours ago, toe_head2001 said:

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

I mean a tab with any spaces width.

4 hours ago, toe_head2001 said:

Possible? Yes.

Please explain why you would want to do that.

Because to use the plugin you need to unzip it and move it to the plugin directory.

4 hours ago, toe_head2001 said:

Maybe.

I write the code in a text editor, because the build in is not configurable and flexible even that the autocomplete might be useful.

4 hours ago, toe_head2001 said:

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

I do not have Visual Studio, I use simple command in a .bat file that is enough.

csc.exe^
 -nologo -unsafe^
 -lib:"C:\Program Files\paint.net"^
 -reference:PaintDotNet.Base.dll^
 -reference:PaintDotNet.Core.dll^
 -reference:PaintDotNet.Data.dll^
 -reference:PaintDotNet.Effects.dll^
 -reference:PaintDotNet.Framework.dll^
 -reference:PaintDotNet.Resources.dll^
 -target:library -optimize -out:"%~dpn1.dll" "%~1"
@pause

What makes me suggest this is the fact that you can't add using statement so you have to type the full namespaces. The editor blocks you from the preview if you try to access the class, methods, types and fields of the plugin. You cannot really access the source code unless everything you typed is correct for the user code region. You can for example add ReadOnlyBoundToValueRule for the dropdowns and preview it on the moment. The possibilities will expand tremendously when you give full access to the user, especially when the user already is required to know the basics. I just assume from a beginner's point of view that spending few minutes to learn from a code block is way better than never having the opportunity to do so and of course the ability to prototype and experiment directly in the environment is just an additional plus.

Edited by anon3
Link to post
Share on other sites
18 minutes ago, anon3 said:

Open Effects/Advanced/CodeLab..., File/Open..., selecting a .cs source I previously saved from the plugin, I explicitly set C# Code Files (*.CS), press Open and it opens it as a text file, so you cannot build, design, preview and so on. My .cs files are not associated with any program.

 

That means your .CS file was not recognized as an Effect or a FileType.

If that is a mistake, please share your .CS file so we can identify where the issue is coming from.

 

20 minutes ago, anon3 said:

I mean a tab with any spaces width.

 

You mean an arbitrary (user-defined) amount of spaces?

 

21 minutes ago, anon3 said:

Because to use the plugin you need to unzip it and move it to the plugin directory.

 

We might add an option for this in the future. No guarantees.

 

24 minutes ago, anon3 said:

I write the code in a text editor, because the build in is not configurable and flexible even that the autocomplete might be useful.

 

What other build configuration do you need?

Link to post
Share on other sites
2 hours ago, toe_head2001 said:
3 hours ago, anon3 said:

Because to use the plugin you need to unzip it and move it to the plugin directory.

 

We might add an option for this in the future. No guarantees.

 

Nope. Not doing this.

 

If you want to test your plugin, just use the live preview right inside of CodeLab.

 

3 hours ago, anon3 said:
8 hours ago, toe_head2001 said:

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

I do not have Visual Studio, I use simple command in a .bat file that is enough.

 

"that is enough"? I don't think so, otherwise you wouldn't be complaining.  Look, Visual Studio is free; download it.  We give you full access to the entire code CodeLab generates by the button on the build screen that makes your script into a VS project; use it.

 

 

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

If that is a mistake, please share your .CS file so we can identify where the issue is coming from.

It's coming from renaming the parameter of the Render method.

//from
public void Render(Surface dst, Surface src, Rectangle rect)
//to
public void Render(Surface destination, Surface source, Rectangle rectangle)

All is on me, I didn't know about the new rules.

8 hours ago, toe_head2001 said:

You mean an arbitrary (user-defined) amount of spaces?

 

If CodeLab uses Scintilla then it would be fairly easy to use tab, set tab size and ident size.

8 hours ago, toe_head2001 said:

What other build configuration do you need?

I was talking about the build in editor. If you refer to the template creation of a new source code, I haven't use it beside copying the initial Render method, the UICode region and the comments above. On the template creation under Element panel it says "Catagory" instead of "Category".

5 hours ago, BoltBait said:

just use the live preview

The example code was my reason of using the plugin to begin with. The preview could be useful too.

5 hours ago, BoltBait said:

"that is enough"? I don't think so

I don't see any advantages of using Visual Studio than using a text editor since you already have to use example code as reference or decompile the .dll files to use them as a documentation. Autocompletion and debugging aren't really worth the hassle of such an environment.

I was saying if you have the means to offer bigger possibilities at figuratively no cost you probably should instead of restricting the users, who can use them in the same day of learning about them. The users are everyone who tries the plugin tutorials. But that's my way of seeing it and I won't dwell on it as you seem hostile to such thoughts.

Edited by anon3
Link to post
Share on other sites
23 minutes ago, anon3 said:

I didn't know about the new rules.

 

Not really a new rule. There's a technical reason behind it.

Because we added support for FileType projects, we needed a way to differentiate different .CS files (is it a Effect or a FileType?).  The easiest way was to search for the standard Render method.

 

21 minutes ago, anon3 said:

If CodeLab uses Scintilla then it would be fairly easy to use tab, set tab size and ident size.

 

Correct; very easy indeed.

 

21 minutes ago, anon3 said:

I was talking about the build in editor.

 

That's what I was referring to as well.

 

27 minutes ago, anon3 said:

under Element panel it says "Catagory" instead of "Category".

 

Fun typo. :lol:  We'll fix that.

 

29 minutes ago, anon3 said:

aren't really worth the hassle of such an environment.

 

I fail to see the hassle of Visual Studio. It has lots of tooling for many languages and project types.

Link to post
Share on other sites
2 hours ago, anon3 said:

you seem hostile

 

Deceptive impression of a newbies.


If you had the opportunity to compare the source code of CodeLab 1.8 (not Codelab 1.8 f) with the source code of Codelab 5.0, you would see the Titanic work done by @BoltBait and @toe_head2001 to provide encoders with huge opportunities to create effects.
I don't want to sound like a visionary, but I foresee further development of CodeLab to make it easier to create Shapes, and even use plain text to create Effects and Shapes.

 

Simple my two cents.

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

I fail to see the hassle of Visual Studio. It has lots of tooling for many languages and project types.

To be fair, it is impossible or difficult to get some FOSS projects to work with visual studio. I heard that there's quirks with compiling, but can't confirm. There's other solutions if anon does not want to use Visual Studio. I actually code with KDE Kate editor myself. Not completely great with generic language like c++, but very easy with scripting languages.

Edited by Reptillian
Link to post
Share on other sites
16 minutes ago, Reptillian said:

To be fair, it is impossible or difficult to get some FOSS projects to work with visual studio. I heard that there's quirks with compiling, but can't confirm.

 

If there are issues, they're with MSVC or MSBuild.  You aren't force to use those compilers (or build system) if you use Visual Studio though.  In fact, you can use the Terminal that's built into Visual Studio to execute a GCC compilation.

Link to post
Share on other sites

My apologies. The display errors are wholly mine.
I forgot that I changed the font size with the System Font Size Changer application.
Going back to the default settings, everything is fine.
Once again, my apologies and thank you for this wonderful tool.

  • Upvote 1
Link to post
Share on other sites
21 hours ago, toe_head2001 said:

JetBrains Mono

 

Anyone using these?

 

JetBrains Mono is really pretty.

 

If we can convince our editor to display Ligatures, we should add all three to our supported fonts list.

 

But, honestly, I'm not a big fan of Ligatures as they are not what you actually type... can enabling them be an option or is it just by font?

.

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

Yeah. I might have a look at jetbrains. I found it easier to read in side-by-side comparisons.

 

I'm a big fan of Verdana for the same reason I like JetBrains... the increased lower case 'x' height.

Link to post
Share on other sites

Scintilla has an option to use DirectWrite, which supports Ligatures by default.

However, I'm not sure how to switch off Ligatures when using DirectWrite.   Well, there is a 'font options' setting in DirectWrite to do disable them, but Scintilla doesn't have some easy abstraction for it.

So, I guess if you didn't want Ligatures, you have to switch back to GDI text.

Link to post
Share on other sites

CodeLab 5.1 Released

This is only for Paint.NET 4.2+!

 

Small (but important) update today...

 

Changes:
▪ Fix user selected blend op in File New Templates (BoltBait)

▪ Add user selected color to File New Templates (BoltBait)

▪ Fix the fill function with primary/secondary colors (BoltBait)

▪ Add separate word wrap option to TXT documents (toe_head2001)

▪ Add auto complete brace pairs (toe_head2001)

▪ Fix bug in Autocomplete (toe_head2001)

▪ Added 3 new fonts to the View Font menu (toe_head2001)

▪ Cascadia Code, Fira Code, and JetBrains Mono support Programming Ligatures in CodeLab (toe_head2001)

▪ Added help to the View Font menu with links to fonts (BoltBait)


Grab the CodeLab DLL here:

 

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

 

Screenshots:
 

New fonts added to the View Font menu:

FontsMenu.png

 

A new help screen in the View > Fonts menu:

FontHelp.png

 

The bug in Autocomplete that toe_head2001 fixed was quite annoying.  Sometimes when typing code, autocomplete wouldn't offer local variables in the list which caused you to have to Esc the list to continue typing.  In previous releases he had put some workarounds in to deal with the issue, but they were less than perfect. For this release he took out the workarounds and fixed it properly. Yea!

.

Link to post
Share on other sites
  • BoltBait changed the title to CodeLab v5.1 (for advanced users) Released January 19, 2020

Thank you for your update.

 

BTW, in my environment "Pan Slider" control cannot be added.

After adding "Pan Slider", UI cannot be previewed or executed.

 

That problem happened with CodeLab v5.0 and v5.1 both.

And, in my home and in my office, same error messages were shown.

 

I'm using Windows 10 Pro(My office and my home both) x64 1909(18363.592).

.Net Framework 4.8 was installed with Windows update.

Paint.net version is 4.2.8.

(All of them are up-to-date)

 

Could you give me any hint to fix them?

error.png

registry.png

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

BTW, in my environment "Pan Slider" control cannot be added.

After adding "Pan Slider", UI cannot be previewed or executed.

That problem happened with CodeLab v5.0 and v5.1 both.

 

I wish you had report the issue when you first encountered it, instead of waiting until after v5.1 was released.

I'll bisect the revision history, and find out how this broke.  :(

Thank you for reporting it though.

Link to post
Share on other sites

If you create a pan slider:

 

PanSlider.png

 

It creates it like this:

 

PanSliderControl Amount4 = Pair.Create(0); // Slider 1 Description

Because of the default.

 

If you then...

 

press Ctrl+I to go into the interface designer again and press Enter, it will update the script and it will work fine.

 

EDIT: I have fixed this for the next release.  In the mean time, just do this :LayersMoveLayerUp:

 

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...