Page 1 of 1

I wish IDE with graphics

Posted: Wed Sep 30, 2015 11:54 pm
by Drago
Hello Boy's...

My Englisch is very bad, but i Think you understand, wat I want.
I think it would be nice and it helps more to understand the Code.

Picture say more than Words....

Image

Re: I wish IDE with graphics

Posted: Thu Oct 01, 2015 8:00 am
by HanPBF
Hello Drago,

Delphi has or had this in the IDE to embed table views in the editor which is a great idea.

But, this is really very difficult to implement I assume.
IDE/Editor is as fast cause of text based implementation.

A rich content editor would help here; but that one must map/convert to native PB source.
Look at Altovas XML tools; You can edit styled documents and of course convert them in any way.

Jetbrains MPS is also a full featured AST-Editor (https://www.jetbrains.com/mps/).
There, the editor shows the AST itself.

All solutions including precompilers have the disadvantege that You don't have the native autocompletion behaviour from the PB IDE which is a great help for me.

An editor could work the same as UMlet in one view (http://www.umlet.com/).
That would mean to show different levels in editor (exg. macro levels expanded/unexpanded).



Regards.

Re: I wish IDE with graphics

Posted: Thu Oct 01, 2015 8:01 am
by Kukulkan
+1

That would be great, indeed. Internally, the IDE should store it in the source like this (just an idea):

Code: Select all

;{graphics;format:jpg;width:120;height:120;dataB64:VHlwZSAob3IgcGFz ... mUuLi5iZ2Z}
This way, it stays compatible with any text editor, always belongs to the code and does not affect compilation. It should be able to insert such images by menu (insert graphics) using file or clipboard.

Nice idea!

Re: I wish IDE with graphics

Posted: Thu Oct 01, 2015 8:07 am
by GPI
There is only one Problem: Scintilla doesn't support images in the soure code.

Re: I wish IDE with graphics

Posted: Thu Oct 01, 2015 11:29 am
by RSBasic
Alternative: You can write:

Code: Select all

;IncludeBinary "D:\Images\YourImage.png"
You can double click on "IncludeBinary" to open the image in the preview window of PureBasic.

Re: I wish IDE with graphics

Posted: Thu Oct 01, 2015 12:21 pm
by Dude
RSBasic wrote:You can double click on "IncludeBinary" to open the image in the preview window of PureBasic.
What the? That's awesome! :shock: I never knew this. Thanks! Why is this not mentioned in the manual?

Re: I wish IDE with graphics

Posted: Thu Oct 01, 2015 1:12 pm
by Kukulkan
RSBasic wrote:Alternative: You can write:

Code: Select all

;IncludeBinary "D:\Images\YourImage.png"
Sadly, the files need to be located somewhere else. If the path changes, all images will fail. This is why I suggest to place it into the source directly using base64 encoding.
GPI wrote:There is only one Problem: Scintilla doesn't support images in the soure code.
Too bad :(

Re: I wish IDE with graphics

Posted: Thu Oct 01, 2015 1:47 pm
by Dude
Kukulkan wrote:If the path changes, all images will fail.
Not if you use the DOS "subst" command to set up a virtual drive letter to point to the target folder. :)

That way, a single letter (like "Z:") will always point to wherever the images are, even if you change their folder, and you just do this in your code to always view them:

Code: Select all

;IncludeBinary "Z:\Pic1.jpg"
No need to ever change the IncludeBinary path in your source code. ;)

Re: I wish IDE with graphics

Posted: Thu Oct 01, 2015 2:18 pm
by Kukulkan
Hello Dude,

yes, this works for a single developer. But with a crew of developers synchronizing their source using CVS (we use GIT) it becomes hard to handle. We would need to setup an extra location (eg Repository) for such images and every developer needs to assign a drive letter etc. Seems not practicable for me. Would be much better if it is included to the source.

But anyway, if the editor does not support images (Scintilla), there is no chance of getting this feature. For me, it is not a tragedy. Just a nice to have but not really mandatory.

Re: I wish IDE with graphics

Posted: Thu Oct 01, 2015 2:55 pm
by Little John
@RSBasic:
That's the coolest tip of the year! 8) Thank you very much!
Kukulkan wrote:Sadly, the files need to be located somewhere else. If the path changes, all images will fail.
The following works fine here (PB 5.31 on Windows 10), when the file "flowers.jpg" is in the same directory as the PB source file:

Code: Select all

;IncludeBinary "flowers.jpg"
You can also use other relative paths such as

Code: Select all

;IncludeBinary "subfolder/flowers.jpg"

Re: I wish IDE with graphics

Posted: Thu Oct 01, 2015 6:00 pm
by Blue
RSBasic wrote:Alternative: You can write:

Code: Select all

;IncludeBinary "D:\Images\YourImage.png"
Thanks RSBasic.

I've been using this feature for a long time now, to quickly access related documentation (text files),
but it never occurred to me to use it with pictures. :oops:
BTW : UTF-8 text files opened in this fashion are not rendered properly.

What i didn't realize is that it's not well-known, or well-understood.
So i fully second Dude's proposition that it be clearly documented in the Help file;
along with the many Editor shortcuts, it would do nicely in a section called something like "useful everyday working tips"