Rick Brewster

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

Recommended Posts

3 minutes ago, TrevorOutlaw said:

is it possible for CodeLab to access and store variable in array?

 

If I understand you correctly, yes.

int[] myIntArray = new int[5];

//set
myIntArray[3] = 9999;

// get
int myInt = myIntArray[3];

 

Share this post


Link to post
Share on other sites
4 minutes ago, TrevorOutlaw said:

Would that give me the ability to add RGB color one by one?

Sure, if that's how you want to do it.

Color[] myColorArray = new Color[5];

myColorArray[0] = Color.Black;
myColorArray[1] = Color.Red;
myColorArray[2] = Color.Blue;
myColorArray[3] = Color.Green;
myColorArray[4] = Color.White;

I don't really understand what you're wanting to do.

Arrays are fixed in size. Maybe you want to use List instead? I don't know. This really isn't the place to learn C#.

Share this post


Link to post
Share on other sites

Hello.

 

Plugin have terrible code assistance (auto indent etc.). Please, create option for disable this function (or tell me where this function).

When i write 'if( ' he write 'if(if('.

All variables with 'b' names, he renamed on 'bright'.

and many others 'crazy' behaviors

 

(I C++ developer, not C#. Most of the things we write ourselves. Without any helpers.)

Share this post


Link to post
Share on other sites
16 minutes ago, GustavMahler said:

Plugin have terrible code assistance

Now there's an exaggeration.

 

16 minutes ago, GustavMahler said:

When i write 'if( ' he write 'if(if('

You can can easily avoid that, but I'll make it more idiot proof so you won't have to.

 

16 minutes ago, GustavMahler said:

All variables with 'b' names, he renamed on 'bright'.

Please give me the steps to reproduce this behavior.

 

16 minutes ago, GustavMahler said:

and many others 'crazy' behaviors

Oh yeah? Feel free to list them. No one is going to fix them otherwise.

 

Thanks for the feedback.

Share this post


Link to post
Share on other sites
40 minutes ago, GustavMahler said:

All variables with 'b' names, he renamed on 'bright'.

Left-click at the end of your variable when you stop typing it - the hint will disappear.

 

40 minutes ago, GustavMahler said:

When i write 'if( ' he write 'if(if('.

I couldn't reproduce this 'crazy' behaviors.

Share this post


Link to post
Share on other sites

Type the code using space between symbols and texts

 

    int b1 = 0;
    int b2 = 1;
    if(b1 == 1) b2 = b1 + 1;

when I typed it, Ihave got on the last line b2 =b2 +1;

 

add a new line to type b1 = b2 + 3;

 

codelabautocompletion.png

 

the space changes b1 and b2 into

BadImageFormatException = BadImageFormatException + 3;

Share this post


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

When i write 'if( ' he write 'if(if('.

 

To me, this only happens when I type "if(" followed by the tab key twice.

 

If you type "if" followed by tab key twice, it works fine.

 

EDIT: typing Madjik's code above...

 

int b1 = 0;
int b1 = 1;
if (b1 == b2)

After pressing ")" on the last line, press the space bar.  The result is:

 

int b1 = 0;
int b2 = 1;
if (b1 == b2)b2 

 

@MadJik, I could not reproduce your issue.  Are you sure b1 and b2 are in scope where you're typing?

 

Reproduced: This happens when you type those lines outside of a function, like the Render() function.  That is, on the same level as the Render function itself.  It is not valid to write code at that level, only define variables.

Share this post


Link to post
Share on other sites
20 minutes ago, BoltBait said:

After pressing ")" on the last line, press the space bar.  The result is:

Yeah, well, we'll just have the ")" character close the AutoComplete box, and call it a day.

 

21 minutes ago, BoltBait said:

Reproduced: This happens when you type those lines outside of a function, like the Render() function.  That is, on the same level as the Render function itself.  It is not valid to write code at that level, only define variables.

Thus those are fields, not local variables. Newly typed Fields are not enumerated into the Intelligent Assistance features, until after a successful Build. So, wait a few seconds, or just click the Build button.

Share this post


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

After pressing ")" on the last line, press the space bar.  The result is:

Yeah, well, we'll just have the ")" character close the AutoComplete box, and call it a day.

 

 

Probably have to also include "(" for when starting a function.

Share this post


Link to post
Share on other sites

Is anyone interested in having an Output Console in CodeLab?

It would work like the one in Visual Studio: print messages, evaluate values, do traces, ect. The alternative is, of course, drawing the values/messages to the Canvas.

 

I got this proof-of-concept working this afternoon:

Output-wip.png

 

Is it worth my time to continue working on this?

  • Like 4

Share this post


Link to post
Share on other sites

That certainly seems like a useful idea to me. Much more practical then writing to the canvas. It would be very helpful for debugging.

Share this post


Link to post
Share on other sites
1 minute ago, xod said:

I think the 'View Source' button has a wrong anchor.
And the text is not visible in Dark Theme.

 

Consider it fixed for the next release.

  • Like 1

Share this post


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

I think the 'View Source' button has a wrong anchor.
And the text is not visible in Dark Theme.

 

Consider it fixed for the next release.

 

My fault. I can't believe I did that. :roll:

Share this post


Link to post
Share on other sites

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

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.