Two VS issues

This forum is meant for questions and discussions about the X# language and tools
ic2
Posts: 1798
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Two VS issues

Post by ic2 »

I added a toolbarbutton on a Winforms form and doubleclicked on it.

In C# this would create a click event. This happens in a total random area in the .prg, but that is how VS works.
However, in X# it opens the "code behind" prg but does not create the click event. Is there anything I can do about that?

I also have a small request. If I enter a newline, starting a next method, behind code like this:

Code: Select all

Private Method Somebutton_Click(sender As System.Object, e As System.EventArgs) As Void Strict Class SomeWindow
// Some code
Return Nil
then the Return statements indents. That should not happen, it should stay aligned with the Method statement.

Dick
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Two VS issues

Post by Chris »

Hi Dick,

I don't see a "ToolbarButton" control in the windows forms toolbox, which control exactly did you add and how?
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
ic2
Posts: 1798
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Two VS issues

Post by ic2 »

Hello Chris,


You are right. It is called System.Windows.Forms.Toolstripbutton. I don't know how it's added (I have to ask Kees); there's an existing toolstrip with some buttons and there's a small drop down menu which allows me to add more buttons (or other controls) to it.
Toolstripbutton.jpg
Toolstripbutton.jpg (16.58 KiB) Viewed 347 times
It is indeed remarkable that the "indenting return issue" only occurs when I press <Enter> after a click event method as I posted.

Dick
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Two VS issues

Post by Chris »

Hi Dick,

Seems to work fine here, can you please create a sample showing the problem?
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
ic2
Posts: 1798
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Two VS issues

Post by ic2 »

Hello Chris,

You actually have one. Open the sample I sent this afternoon for the Zipextensions issue, open Functions.prg, move to the last line 102 where it says Return True , move the cursor to the end of the line and press <Enter>

The Return True in the line above also indents there - where it shouldn't.

Dick
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Two VS issues

Post by Chris »

Hi Dick,

Oh, I meant about the problem with creating the click event.

About the RETURN, this is as intended, since it is considered an "executable" command, so it gets indented like everything else. On the other hand, if you finish the method with "END METHOD", this should indent below "METHOD"indeed.

.
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
ic2
Posts: 1798
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Two VS issues

Post by ic2 »

Hello Chris,

Is there any way to prevent this, like a setting?

I don't need END METHOD. But I want Return statements to align with the METHOD...
I am wasting far to much time during programming to move everything back to where it should be, like the ENDIF (always requiring multiple backspaces).

More than once I start writing my new method in VO. Then at the end I copy it,. all perfectly aligned, in X#.
It would make quite a difference if I needn't do that...

Further I will check if I can modify the sample to show the non created event, and if I can't, to find out why it didn't t work in my life project.

Dick
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Two VS issues

Post by Chris »

Hi Dick,

I understand you, I don't like indentation working this way either. But even though you and I don't like it this way, still there are probably 100,000s of other developers (VS users) who do prefer it this way apparently, so we can't say much, but we just need to learn to work this way (well, or decide to develop a custom .Net IDE if someone is crazy enough to do it :))
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
ic2
Posts: 1798
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Two VS issues

Post by ic2 »

Hello Chris,

But isn't that something which can be set within X#?

In VS in C# (or VO) a return does not indent when I press <Enter>.

I think not it should not indent in X# and I think that could be set to work like that.

Like the endif (which does not indent for the rare, I would say, extremely cases where the users want type a variable starting with endif.

Why can't the user who is so stubborn to use a variable like that not correct the indent instead if the countless times X# users press endif?

I very well realize that you can not influence everything, and sometimes a change is conflicting with some other, equally met, interest but in case of the return and endif I find it highly unlikely that not the vast majority would want it the way I write. And which I would say, could be arranged within X#. Or am I wrong?

Dick
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Two VS issues

Post by Chris »

Hi Dick,

It's the way VS is supposed to work, when you hit enter, it aligns the code to the indentation it considers correct. Personally I don't like this at all, but VS works like that and X# is "playing nice" with VS, it is doing things the way VS developers expect them to be done. You could turn indentation completely off, but this way you would have to also manually indent IF and ENDIF...
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
Post Reply