New BLIde Plus update with getters and setters!

BlitzMax Forums/BlitzMax Programming/New BLIde Plus update with getters and setters!

ziggy(Posted 2009) [#1]
For newcomers, BLIde is an IDE (Integrated Development environment) for BlitzMax. It works on Windows. For more info http://www.blide.org

This is a small changelog:
•BLIde SDK engine is now 100% compatible with Visual Studio Express Edition 2008. More infor about this to come very very soon

•New Plugin included in the official 00.09.88-A distro. This plugin automates the getter and setter methods creation for fields, using the context menu

•Several important stability fixes on the internal BLIde SDK engine

•Fixed an issue with the BLIde debugger. It could stay on an infinite loop, on a non main thread, so it could potentially waste some resources if a concrete chain of debug requests was performed.

•Fixed a visual issue with the closing project window. The icon was not properly set and the window looked wrong.

•Fixed the tab-switching speed. Now it does not perform a re-parsing unless the leaving document has changes on its internal code tree


Updating is highly recommended.


GfK(Posted 2009) [#2]
Getters? Setters? What's that?


ziggy(Posted 2009) [#3]
When you declare a field that is suposed to be private:

Type MyClass
   Field X:Int = 0
End Type


And you want to perform speciffic actions when the value of this field changes, you usually end with:

Type MyClass
   Field _X:int
   Method Set_X(Value:int)
      'VALIDATE CODE
      _X = Vale
      'ADDITIONAL CODE
   End Method
   Method Get_X:int()
      'VALIDATE CODE
      Return _X
   End Method
End Type


BLIde now can automate this, select a field, open the context menu, and click on generate getter/setter. It's useful specially when writting modules.


byo(Posted 2009) [#4]
Really nice. Thank you for that.


plash(Posted 2009) [#5]
Can you specify the method's ouput format?

i.e.
Allowing the user to specify the name of the methods (after the "Set"/"Get").
I specify the name of the setter and getter for the field "m_name" to be "Name", and this gets generated:
Type TMyType
	Field m_name:String
	
	Method SetName(value:String)
		m_name = name
	End Method
	
	Method GetName:String()
		Return m_name
	End Method
	
End Type



ziggy(Posted 2009) [#6]
@Plash: Not Really, if you wish a different name than the given one, you'll need to modify it. It could be improved in future versions. Also, I'll release this plugin source code, so it can get improved by anyone.


Armitage 1982(Posted 2009) [#7]
If only I was having this nice feature one year before ^^
Very good work Ziggy :)


AlexO(Posted 2009) [#8]

...Also, I'll release this plugin source code, so it can get improved by anyone.


is it in the update or released yet?


ziggy(Posted 2009) [#9]
It is included in the latest update, in compiled form. I'll release the source code soon, as part of the new SDK documentation. I'm still writing it!


therevills(Posted 2009) [#10]
Cool!

Since I do a lot of web development at work (JEE), generating getters/setters in Eclipse is so handy! Its a shame BlitzMax doesnt have private/public fields...

I like the word highlighting, but could it be changed so when you double click a word it automatically activates? (Instead of rightclick > Highlight current word)

BTW Ziggy, I'm still getting the messed up picklists when I use the scrollbars...


GfK(Posted 2009) [#11]
The BLIde website needs a little tidy-up as it confusingly refers to three different version numbers all in the same news item. From the downloads area:

Current Official Version 00.09.87-A
A new BLIde version 00.09.84-A is available for BLIde Plus users.

The download link points to 00.09.88-a.


Pete Rigz(Posted 2009) [#12]
Nice. This will be very handy indeed. Can it be set up so that if you wish, a bbboc is inserted too? like

Rem
    bbdoc: 
    about:
end rem



ziggy(Posted 2009) [#13]
@Pete: that's exactly how it works:
Type TMyClass
	Field _Position:TDrawingPoint
End Type


Generates:
Type TMyClass
	Field _Position:TDrawingPoint
	Rem
		bbdoc: Get the Position value in this TMyClass object.
	End Rem
	Method Get_Position:TDrawingPoint()
		Return _Position
	End Method
	Rem
		bbdoc: Set the Position value for this TMyClass object.
	End Rem
	Method Set_Position(Value:TDrawingPoint)
		_Position = Value
	End Method
End Type



Pete Rigz(Posted 2009) [#14]
Cool, look forward to using that :)


ziggy(Posted 2009) [#15]
It is already available on latest BLIde Plus update


Armitage 1982(Posted 2009) [#16]
Hi Ziggy

Could it be possible to change the position of the "Generate Getter/Setter functions" from the contextual mouse menu ?
Because at top I'm used to "Jump to the definition of ..." !

It's not only a personal demanding but also a question of coherence:
You can jump to the definition of any functions outside a Type but in that case the first "Generate Getter/Setter functions" option obviously don't appear.

It's my ergonomics point of view :)
Hope you understand.
Thanks !


ziggy(Posted 2009) [#17]
@Armitage: Yes this ca be easilly changed.


plash(Posted 2009) [#18]
Suggestion (if it hasn't already been changed): Make BLIde re-open files that were previously opened in the same order as they were previously (this one kills me when I'm working on a large project).


ziggy(Posted 2009) [#19]
@Plash: I'm working on a new serialization system for all blide solutions that should allow this, but nothing available yet. Sorry.


Mahan(Posted 2009) [#20]
I got a real n00b question about BLide:

Why doesn't code completion (ctrl+space) display local variables in the suggestion drop-down?

I took a long break from bmx, so possibly i forgot the solution to this, but it's buggering me :-)

edit: spelling


xlsior(Posted 2009) [#21]
Wow, that's pretty bad.

(I think you meant to say "bugging me")


Mahan(Posted 2009) [#22]

Wow, that's pretty bad.



I think it should be possible to just turn on an option or something. BLide is a very smart IDE that parses and keeps a db of all the libs (function headers etc.), so maybe I just forgot or overlooked some option.


(I think you meant to say "bugging me")


Yep, I think so to. What I mean is that it's irritating, to not have it running, because when writing methods and functions the "closest" variables are often used the most (i.e. arguments and locals)

Another strange thing I've been thinking about:

I keep writing "Self."+<ctrl+space> in BLide just to get a list of methods and fields of the current class. If i just press <ctrl+space> (inside a method of the class) I don't get the methods and/or fields of the current class although this is how I usually write in all OOP languages. (i.e. implicit self)

I just want to know if I'm doing something wrong here or if I should write a suggestion to Ziggy about it :-)

And don't get me wrong. BLide is a joy to work in.


GfK(Posted 2009) [#23]
I found something wrong with the debugger pane. I have it docked at the top-right, with compiler options and unmanaged solution explorer.

When I go into Debug mode (via DebugStop), then drag the vertical scroll down to the bottom (in the debug pane), the debug pane freezes and the scroll gadget stops working. If I then click inside the debug pane, this happens:




ziggy(Posted 2009) [#24]
@Gfk: The treecontrol drawing is done by the OS, not sure what can be happening here. If I don't get it wrong, the pixelated area has been modified on the image, while the real problem is the treeview not being completely draw?
EDIT: Does modifing the size of the debug panel fixes anything (I mean making the panel bigger, not smaller)
EDIT2: Are you using Windows 7 RC? I've seen this kind of refreshing issues before on windows 7.


GfK(Posted 2009) [#25]
If I make the debug pane as wide as it'll go, the greyed out area on the right seems to stay the same size, regardless of the width of the debug window.

I just noticed that as I scroll up and down, the grey area is redrawn every time I let go of the mouse button.

I've also noticed that the problem goes away if I have a 'floating' debug window, i.e. not docked to the right side. No it doesn't, my bad.

I'm using Vista SP2.


ziggy(Posted 2009) [#26]
@Gfk: As I can't reproduce this here, I've added an additional invalidate message to windows, in order to force a 'redraw' of the tree on the next BLIde update. I hope this will fix it. Additionally, if you could be so kind to check if this is happening also when using another BLIde skin, this would be great in order for me to find any additional thing involved on this bug.


ziggy(Posted 2009) [#27]
New BLIde Plus 00.09.89 version available.
Changelog:
Fixed an issue that was making BLIde managed solution to mix relative paths with complete paths sometimes, when a new solution node was created.

Inline syntax analyzer is disabled while BLIde is loading or closing a project. This speeds up loading and closing big projects. The analyzer is enabled again at the end of the load/close process.


Fixed an issue that was making BLIde managed solution to mix relative paths with complete paths sometimes, when a new solution node was created.

Improved imports handling on managed solutions. When a imported library node is released, BLIde now also releases any reference to it in order to leave the files completely out of the scope of the managed solution.

BLIde no longer forces a tree-view sort of the managed solution tree after a solution node has been edited, unless text has been changed.


BLIde now prevents a crash that could happen when BLIde was being close at the same time a big project was being unloaded on a slow computer. (this was caused by a thread running slower than expected).

BLIde now inherits any available documentation when overloading a documented method or function from a parent class.


Fixed an issue that was disabling B3D files preview from an unmanaged solution.

Fixed an issue that was making TXT files not load properly on a managed solution.




TaskMaster(Posted 2009) [#28]
I have the same problem as GFK with that grey box appearing in the debug window.

I started only using my mousewheel to scroll the window so the grey box wouldn't cover it up.

Hopefully this update fixes it.


GfK(Posted 2009) [#29]
I still get this problem in 0.09.89A.

Tried other skins too, doesn't make any difference. I've also noticed that when I first drag the scrollbar down to the bottom, it jumps back up a little right before it freezes.

I've tried docking the panel in various positions, resizing it, undocking it completely, still get this odd behaviour.


ziggy(Posted 2009) [#30]
I'm trying to find what can be causing this and I'll release an urgent fix as soon as possible.
Can anybody provide a simple step by step way to replicate it? coud you provide OS and if Areo is on or off? also, could you tell me if changing area config makes any difference? does it happens when you scroll down of when the window is shown? when using the scroll bar is different to when using the mouse wheel? ??!!??


GfK(Posted 2009) [#31]
Step-by-step guide.

1. Open a large project - one with lots of globals that'll make sure the debug window can be scrolled.
2. Put a DebugStop anywhere in code.
3. Compile and run program.

...then in debug mode...

4. Grab the vertical slider on the scrollbar, and drag it down as far as it will go.
5. Release the mouse button, and the scrollbar will jump back up a bit, then freeze.
6. Click on the slider again and try to move it (up or down, doesn't matter which way). The right half of the debug window will become obliterated by a grey bar
7. Move the slider up or down again. They grey bar is redrawn each time you release the mouse button.

I'm using Vista Home Premium SP2, Aero is on. Rearranging the screen layout doesn't make any difference.


ziggy(Posted 2009) [#32]
@Gfk: Following your step-by-step description doesn't reproduce the issue here, so I'm sure there is something we're doing in a different way. Do you have latest .net service pack installed I supose... Could you tell me if aereo OFF does any difference? (I'm trying to find if there is any buffer's problem there).
do you mind if I send you a different build for you, using your BLIde Plus user email account?

@Gfk and Taskmaster: Can you confirm you're getting this problem when using this code file:
http://www.blide.org/posts/debug-test1.bmx


GfK(Posted 2009) [#33]
Sure, send it over.

I've just tried this on my laptop and get exactly the same issue. The systems I'm using are:

1. Athlon64 X2 5000+, 512MB 8500GT, 2GB RAM, Vista Home Premium SP2.
2. Pentium dualcore, 384MB GMA965 graphics, 2GB RAM, Vista Home Premium SP2.

I've tried turning off Aero but the problem is still happening.

You said you can't reproduce this issue - when you move the slider, make sure to click/drag it rather than clicking the arrows or any other method. After you drag it the first time and release the mouse button, the slider should jump back up. This not happening for you? What OS?

Here's the test code I just used - nothing special:
Global a:Int, b:Int, c:Int, d:Int, e:Int, f:Int, g:Int
Global a2:Int, b2:Int, c2:Int, d2:Int, e2:Int, f2:Int, g2:Int
Global a3:Int, b3:Int, c3:Int, d3:Int, e3:Int, f3:Int, g3:Int
Global a4:Int, b4:Int, c4:Int, d4:Int, e4:Int, f4:Int, g4:Int
 
DebugStop


You might have to run it a few times before it starts happening.


GfK(Posted 2009) [#34]
Ziggy - yes, it happens with that code, although to see the scroll bar jump you should probably use about 90 globals instead of 1000, otherwise the jumping will be so small you may not see it (I couldn't!). But I still get the grey bar.

As I said above, compile it a few times if you don't see it at first.

Also I've just noticed - when the program hits a debugstop, do you get a 'busy' mousepointer for about 5 seconds when you move over the debug window? I do.


ziggy(Posted 2009) [#35]
I'm using windows 7 RC now, but I will be testing it tomorrow in my dev studio with a vista home premium sp2 machine (hope to be able to reproduce it there.)
I can't reproduce. I see the scroll bar moving slightly up when I release the scroll slider, but no visual issues at all here. Not sure if it is a OS thing (it could be, as the control's refreshing is handled by windows).


TaskMaster(Posted 2009) [#36]
Still happens for me with that file as well.

For me, the gray bar appears the moment I grab the scrollbar. It happens even if I undock the debug window and just leave it floating.


ziggy(Posted 2009) [#37]
@TaskMaster: Can you provide your system specs (os, graphic card, Aereo on/off .net version and sp, etc?)
Thanks! If you don't want to post it here, send it to me by email (email on profile)


GfK(Posted 2009) [#38]
PS: I seem to have .NET 3.5 SP1 installed.


TaskMaster(Posted 2009) [#39]
Sure.

Vista Home Premium 32-bit SP2
Aero On
ATI Radeon 3200 HD
.Net 3.5 SP1

Anything else you wanna know?


TaskMaster(Posted 2009) [#40]
Here, I grabbed a screenshot of it and clipped the bug out.



The gray box appears the instant I click down on the scrollbar. If you look closely, it almost looks as if the little window is collapsing, or getting smaller in the horizontal direction.


ziggy(Posted 2009) [#41]
Thanks for the screenshot. It¡s very different to the Gfk one (I supose caused by the same issue) but this time it seems the whole treeview is clipped, while the gfk example only the activearea of the control was clipped, wich is far more weird!


Htbaa(Posted 2009) [#42]
Looks like the same bug I reported a while ago. It's extremely annoying.


ziggy(Posted 2009) [#43]
I've been trying to replicate the bug on my Vista SP2 machine without any success... I'm still investigating... arrrgs!!!


GfK(Posted 2009) [#44]
Thanks for the screenshot. It¡s very different to the Gfk one (I supose caused by the same issue) but this time it seems the whole treeview is clipped, while the gfk example only the activearea of the control was clipped, wich is far more weird!
Its pretty much identical. His debug window is not as wide as in my screenshot. Even if I drag the debug window as wide as it will go, the grey box stays about the same size.

You said you'd replicated the jumping thing? It surely shouldn't do that, then freeze up? Maybe if you fix that, this problem will go away too. Might be directly affected.


ziggy(Posted 2009) [#45]
@Gfk: while I can't replicate this here, I've added some security checks to a new BLIDe build I would like you to test, but I can't remember your registered name on the blide website and your email is not on your profile. Could you send me an email so I can reply to you with a new build in order for you to test it and tell me if it makes any difference?

@Taskmaster: test build sent to you, please tell me if it makes any difference.


GfK(Posted 2009) [#46]
Ziggy - check email. ;)


TaskMaster(Posted 2009) [#47]
I didn't get it. It may have been stopped by the company spam filter. I emailed you a different email address.


ziggy(Posted 2009) [#48]
@Gfk & Taskmaster: Still working on this, hope to have a new test version for you in a couple of hours or so. Now I *think* I have a way to solve this by inspecting windows messages, specialy the SW_VScroll message should force an invalidate, but this is not happening! (so I hope forcing it would do the trick). I'll send you a full new BLIde installation in a while.


ziggy(Posted 2009) [#49]
New version 00.09.90-a released.
New BLIde version 00.09.90-a change log:

Fixed a visualization issue that was affecting some TreeView controls in BLIde. This has been fixed with the help of Gfk and TaskMaster.

Memory leaks reduced.

Fixed bug with mouse wheel scrolling on some PCs.

Fixed bug with painting in page breaks/page view mode.

Fixed bug with drag-n-drop text.

Fixed bug with search-replace.

Minor issues with VB, C#, Parser and XML parsers fixed.

Fixed bug with deleting text when inserting item from code completing listbox.

Fixed bug with displaying generic types in code completion listbox.

Minor code completion issues fixed.




GfK(Posted 2009) [#50]
Just tested v0.00.90a - debug window is behaving very nicely now. Thanks for sorting this so quick.


ziggy(Posted 2009) [#51]
Glad to see it working as it should! If any of you are curious about what was causing this, you can take a look here: http://blideide.wordpress.com/2009/08/06/oh-lovely-winforms-framework/
And Thanks Gfk for testing all the never-ending builds!


TaskMaster(Posted 2009) [#52]
Yep, works for me as well. :)


ziggy(Posted 2009) [#53]
New update available with small improvements.
Note: I'll be out of my studio until september so any support request will be attended there. Any new purchase will get directly latest BLIde Plus version.


Volker(Posted 2009) [#54]
Hi ziggy,

I miss a function in Blide to insert text templates.
The autolist feature is nice, but I mean something
like entering 'pe' in the code, pressing F3 and
its automatically converted to 'positionentity'.
Would save a lot of typing.
Or is there already something like this I haven't seen?


TaskMaster(Posted 2009) [#55]
Ziggy, is BLide capable of allowing a custom preprocessor work on source files before they are passed tot he BlitzMax compiler?

There is another thread discussing the possibility of having user defined define statements using a preprocessor. Might fun to toy with. And if everytime I pressed the compile button, BLide ran the file(s) through the preprocessor first, it would be very cool.


Htbaa(Posted 2009) [#56]
Not sure if BLIde's plugin system supports it but perhaps it can be done with a plugin?


ziggy(Posted 2009) [#57]
This could be done due SDK, but there's no documentation on this yet.
I should finish the SDK documentation before october (as planned).

EDIT: Small code sample of a BLIde SDK file to handle any blitzmax compiler call, and perform any action BEFORE the compilation takes place:
Imports BLIde.SDK
Module PlugIn	
	Sub Main()
		AddHandler Events.BLIdeEvents.CallMaxCompiler ,AddressOf PreCompiler
	End Sub
	
	Sub PreCompiler(e As BLIde.SDK.Events.CallMaxCompilerEvent)
		IO.Write("Compiler called.", IO.eConsoleOutput.CompilerConsole)
		IO.Write("File to compile: " & e.CodeForm.filename, IO.eConsoleOutput.CompilerConsole)
		IO.Write("Compiler assembly: " & e.CompilerAssembly, IO.eConsoleOutput.CompilerConsole)
		IO.Write("Build only: " & e.NotRun, IO.eConsoleOutput.CompilerConsole)
		IO.Write("Compiler parameters: " & e.Parameters, IO.eConsoleOutput.CompilerConsole)
	End Sub
	
End Module


This event will be fired whenever a file is sent to the max compiler (as part of a project, or as a single file, or in any other possible circumstance), so if a preprocessor has to be called, it is on the CallMaxCompiler event. This event let's even handle the call and make your own compilation, if you want to!


_JIM(Posted 2009) [#58]
Funny, I extended my subscription with another 6 months and was about to ask you about this, ziggy :)


therevills(Posted 2009) [#59]
Hey Ziggy,

When running an application from BLide, you've made so you can't edit any files - which is fine. But could you add a pop-up message when someone tries to edit the files asking them if they want to stop the application.

I know you've got the button at the bottom of the screen saying "A program is running, press here to stop it", but I keep forgetting about it and think a pop-up message asking the same thing would be useful.

Thanks!


TaskMaster(Posted 2009) [#60]
I know that is a pain in the butt, but please, no pop-up windows that have to be clicked. I hate that.

Maybe a error beep, or flash something?!?!


therevills(Posted 2009) [#61]
I would have thought a small pop-up after you clicked on the file to make an edit wouldnt be that bad.

Im thinking on these lines:
1. Compile and Run program in BLide
2. Program is running and you go back to BLide and click the main edit section.
3. Message informing you "A program is running, do you want to stop it?" is display
4. Click OK to stop the program or cancel to keep it running (but you wont be able to edit the files still)


TaskMaster(Posted 2009) [#62]
Not when you click. I click all the time, while an app is running, you can select text, look at the source, etc. I don't want to be getting popups when I do that.

An error noise when you try to type would be good. I would think characters not appearing when you type would be indication enough ;) That is what always reminds me.


ziggy(Posted 2009) [#63]
@therevills: a message responding to mouse click is a bit too much intrusive. Specially when debugging code (where you would be actually seeing the code, maybe going from one segment to another, etc.). Other than that, I don't see any problem on making a configurable parameter (off by default) to make BLIde display a 'stop execution' message when the user is trying to write code and the program is executing but, isn't text not appearing enought? don't get me wrong, I can add this configurable parameter, it's just that I don't see it very very usefull.


therevills(Posted 2009) [#64]
Its just that sometimes I "think" I hit the button, then click where I want to type, start typing and nothing happens... then look down and find out the app is still running, although I "thought" I clicked the button! LOL

If you decide to do this dont make this happen in debug mode...


plash(Posted 2009) [#65]
Whatever 'feature' is added (relating to this), please make it a changeable option.


byo(Posted 2009) [#66]
Hey, ziggy. I just tested the new version and I must say that it's really faster than before. And it seems it's more stable than never. Keep up the good work.

The speed is like turning from water to wine.
Not that water was bad. ;)