I wish IDE with graphics

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Drago
New User
New User
Posts: 2
Joined: Thu Jan 27, 2011 3:54 pm

I wish IDE with graphics

Post 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
HanPBF
Enthusiast
Enthusiast
Posts: 570
Joined: Fri Feb 19, 2010 3:42 am

Re: I wish IDE with graphics

Post 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.
User avatar
Kukulkan
Addict
Addict
Posts: 1396
Joined: Mon Jun 06, 2005 2:35 pm
Location: germany
Contact:

Re: I wish IDE with graphics

Post 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!
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Re: I wish IDE with graphics

Post by GPI »

There is only one Problem: Scintilla doesn't support images in the soure code.
User avatar
RSBasic
Moderator
Moderator
Posts: 1228
Joined: Thu Dec 31, 2009 11:05 pm
Location: Gernsbach (Germany)
Contact:

Re: I wish IDE with graphics

Post 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.
Image
Image
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

Re: I wish IDE with graphics

Post 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?
User avatar
Kukulkan
Addict
Addict
Posts: 1396
Joined: Mon Jun 06, 2005 2:35 pm
Location: germany
Contact:

Re: I wish IDE with graphics

Post 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 :(
Dude
Addict
Addict
Posts: 1907
Joined: Mon Feb 16, 2015 2:49 pm

Re: I wish IDE with graphics

Post 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. ;)
User avatar
Kukulkan
Addict
Addict
Posts: 1396
Joined: Mon Jun 06, 2005 2:35 pm
Location: germany
Contact:

Re: I wish IDE with graphics

Post 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.
Little John
Addict
Addict
Posts: 4779
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: I wish IDE with graphics

Post 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"
User avatar
Blue
Addict
Addict
Posts: 964
Joined: Fri Oct 06, 2006 4:41 am
Location: Canada

Re: I wish IDE with graphics

Post 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"
PB Forums : Proof positive that 2 heads (or more...) are better than one :idea:
Post Reply