Page 1 of 2

For PB editor, allow graph images in source code

Posted: Sun May 22, 2005 9:46 am
by Psychophanta
Hi,
Should be possible for the PB editor to allow graphic images in the source for explaining some codes??????

Pleeeease, this would be GREAT!

Posted: Sun May 22, 2005 2:22 pm
by freak
Sorry, i do not understand what you mean.

Posted: Sun May 22, 2005 2:38 pm
by Polo
He mean if we can include a picture in the sourcecode. Which is useful when posting code here.
Psychophanta -> How much you bet you'll get somebody who'll give you a workaround :)

Posted: Sun May 22, 2005 4:58 pm
by Psychophanta
Freak, sometimes words are not enough to explain what the hell is doing some sourcecode, so my request consists in possibility to add pictures besides of remarks and general commented explaining texts in sources' codes.
There is a proverb which says: "A picture is better than 1000 words!"
Polo wrote:Psychophanta -> How much you bet you'll get somebody who'll give you a workaround :)
hahaha! I don't bet anything, hehe! :roll: :wink:

Posted: Sun May 22, 2005 6:50 pm
by Hroudtwolf
Use this way....

Code: Select all

;DataSprite
;2005 by Hroudtwolf
;PureBasic-Lounge.de
;
If InitSprite()=0 Or InitKeyboard()=0:End:EndIf
If OpenScreen (800,600,16,"DataSprite")
CreateSprite (1,15,15)
If StartDrawing (SpriteOutput (1))

;Hier werden die Daten aus den DATAs gelesen
For x=1 To 15
For  y=1 To 15
Read pixel.l
If pixel.l=1:Plot (y,x,RGB(255,255,255)):EndIf
Next y
Next x
StopDrawing ()
EndIf
;<-----------------------------------------------<<

Repeat
FlipBuffers()
ClearScreen(0,0,0)
DisplaySprite (1,100,100)
ExamineKeyboard()

Until KeyboardPushed(#pb_key_escape)
CloseScreen()
End
EndIf


DataSection
Data.l 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0
Data.l 0,0,0,0,0,0,1,1,1,0,0,0,0,0,0
Data.l 0,0,0,0,0,1,1,1,1,1,0,0,0,0,0
Data.l 0,0,0,0,1,1,1,0,1,1,1,0,0,0,0
Data.l 0,0,0,1,1,1,1,0,1,1,1,1,0,0,0
Data.l 0,0,1,1,1,0,0,0,0,0,1,1,1,0,0
Data.l 0,1,1,1,1,1,1,0,1,1,1,1,1,1,0
Data.l 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1
Data.l 0,0,0,0,0,0,1,1,1,0,0,0,0,0,0
Data.l 0,0,0,0,0,0,1,1,1,0,0,0,0,0,0
Data.l 0,0,0,0,0,0,1,1,1,0,0,0,0,0,0
Data.l 0,0,0,0,0,0,1,1,1,0,0,0,0,0,0
Data.l 0,0,0,0,0,0,1,1,1,0,0,0,0,0,0
Data.l 0,0,0,0,0,0,1,1,1,0,0,0,0,0,0
Data.l 0,0,0,0,0,0,1,1,1,0,0,0,0,0,0
EndDataSection 
Or use this way...

Code: Select all


;#############################################################################
;#############################################################################
;Procedure!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
;#############################################################################
;#############################################################################
;2005 Leo
;PureBasic-Lounge.de
;
Procedure GetSpriteFromData(id,*ptr,Zoom)
    Enumeration
        #BLA
        #BLU
        #GRE
        #ROT
        #GRA
    EndEnumeration
    *a.LONG = *ptr
    Breite = *a\l
    *a + 4
    Hoehe = *a\l
    *a + 4
    ; Zoom = *a\l
    ; *a + 4
    ret = CreateSprite(id,Breite*Zoom+Zoom,Hoehe*Zoom+Zoom)
    StartDrawing(SpriteOutput(id))
    For Y = 0 To Hoehe
        For X = 0 To Breite
            Select *a\l
                Case 0 : Color = RGB(0,0,0)       ;Schwarz
                Case 1 : Color = RGB(0,0,255)     ;Blau
                Case 2 : Color = RGB(0,255,0)     ;GrĂ¼n
                Case 3 : Color = RGB(255,0,0)     ;Rot
                Case 4 : Color = RGB(128,128,128) ;Grau
            EndSelect
            Box(X*Zoom,Y*Zoom,Zoom,Zoom,Color)
            *a + 4
        Next
    Next
    StopDrawing()
    ProcedureReturn ret
EndProcedure

;#############################################################################
;#############################################################################
;Beispiel!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
;#############################################################################
;#############################################################################
InitSprite()
#ScrWidth=1024:#ScrHeight=768
OpenScreen(#ScrWidth,#ScrHeight,32,"Bild ohne externe Dateien!")

GetSpriteFromData(0,?Bild1,5)
GetSpriteFromData(1,?Bild2,30)

Repeat
    ExamineKeyboard()
    ClearScreen(0,0,0)
   
    If KeyboardPushed(1)
        Quit = #True
    EndIf
   
    For X = 0 To #ScrWidth/SpriteWidth(0)
        For Y = 0 To #ScrHeight/SpriteHeight(0)
            DisplaySprite(0,X*SpriteWidth(0),Y*SpriteHeight(0))
        Next
    Next
    DisplaySprite(1,#ScrWidth/2-SpriteWidth(1)/2,#ScrHeight/2-SpriteHeight(1)/2)
   
    FlipBuffers()
Until Quit = #True

DataSection
Bild1:
Data.l 9,8 ;Breite,Hoehe
Data.l 1,1,1,1,1,1,1,1,1,1
Data.l 1,1,1,1,0,0,1,1,1,1
Data.l 1,1,1,0,0,0,0,1,1,1
Data.l 1,1,0,0,0,0,0,0,1,1
Data.l 1,0,0,0,2,2,0,0,0,1
Data.l 1,1,0,0,0,0,0,0,1,1
Data.l 1,1,1,0,0,0,0,1,1,1
Data.l 1,1,1,1,0,0,1,1,1,1
Data.l 1,1,1,1,1,1,1,1,1,1
Bild2:
Data.l 9,8 ;Breite,Hoehe
Data.l 4,4,4,4,4,4,4,4,4,4
Data.l 4,1,1,1,1,1,1,1,1,4
Data.l 4,1,1,0,3,3,0,1,1,4
Data.l 4,1,0,0,3,3,0,0,1,4
Data.l 4,1,3,3,3,3,3,3,1,4
Data.l 4,1,0,0,3,3,0,0,1,4
Data.l 4,1,1,0,3,3,0,1,1,4
Data.l 4,1,1,1,1,1,1,1,1,4
Data.l 4,4,4,4,4,4,4,4,4,4
EndDataSection


Posted: Sun May 22, 2005 7:11 pm
by Polo
Hroudtwolf wrote:Use this way....
[...]
You see Psychomanta ? :) One workaround, one !
It's good to have it, BUT :
this is a feature requests and wishlists forum, as you can see in the title.
But everytime we're making a request, we just get a workaround.
As I said, Psychomanta can use this, but when you read what he wrote :
Should be possible for the PB editor to allow graphic images in the source for explaining some codes??????
He's asking if the PB Editor could have this feature. He's not asking how to do it, he's asking to be able to do it from the editor.
Big difference.

Posted: Sun May 22, 2005 7:15 pm
by Psychophanta
Polo wrote:
Hroudtwolf wrote:Use this way....
[...]
You see Psychomanta ? :) One workaround, one !
It's good to have it, BUT :
this is a feature requests and wishlists forum, as you can see in the title.
But everytime we're making a request, we just get a workaround.
Should be possible for the PB editor to allow graphic images in the source for explaining some codes??????
He's asking if the PB Editor could have this feature. He's not asking how to do it, he's asking to be able to do it from the editor.
Big difference.
Ohhh! Polo,
you are one of the very few few few guys in this forum with common sense.
Pity you are not a lady to say you: I love you :!:
Thanks!!!!!!

Hroudtwolf:
...but i don't see any pic in the sourcecode.
Both ways are not what i meant :!:
Ohhh! it is too easy to understand.
Have you ever seen MS Wordpad? There you can insert into the editor a graphic picture, and you can edit it into the editor.
So, after that, anyone can see it just watching at the sourcecode.
Mmmmhh! i hope now it is enough :)

Posted: Sun May 22, 2005 7:29 pm
by Fred
Polo: please be more respectful for people who actually spend time to help by providing the so 'evil' workaround instead of just complaining.

Posted: Sun May 22, 2005 7:41 pm
by Polo
Psychomanta: lol :lol: :)
Fred: I'm not complaining, just wondering why some people post things where they should not. When we ask a feature, generally, we don't want a workaround, we want the feature :)

Posted: Sun May 22, 2005 7:49 pm
by traumatic
Oh dear...

Posted: Sun May 22, 2005 7:50 pm
by Fred
Polo: may be because everyone is free to try to help another one. We don't plan to add all features of the wishlist forum, so you don't need to be upset when we don't agree with you. It seems you have been affected with a negative answer as you are actually complaining about the same topic on several threads, which is really annoying to read. So please stop.

Posted: Sun May 22, 2005 7:55 pm
by Polo
Fred wrote:Polo: may be because everyone is free to try to help another one. We don't plan to add all features of the wishlist forum, so you don't need to be upset when we don't agree with you. It seems you have been affected with a negative answer as you are actually complaining about the same topic on several threads, which is really annoying to read. So please stop.
Not really...
I just don't like the way the feature requests are handled. If you don't want to add a feature, you just need to say it. For example, you haven't make any comment on Psychomanta's feature request...

Posted: Sun May 22, 2005 8:04 pm
by Psychophanta
Hroudtwolf:
I see and appreciate the time spent by you in this case, and i am grateful to you cause it.
But on the other hand, i invite you to realize of ... well, you know :)
Polo wrote:I just don't like the way the feature requests are handled. If you don't want to add a feature, you just need to say it. For example, you haven't make any comment on Psychomanta's feature request...
Sorry, but i can not say any other thing but that i'm agree with this, at least in part :roll:

Posted: Sun May 22, 2005 8:08 pm
by Fred
Psychophanta: we don't plan to support image integration in a code source editor. May be it's possible to use 'Word' with a macro to compile the code ?

Posted: Sun May 22, 2005 8:11 pm
by freak
Polo:

If you do not like the way the request are handled, then do not post any.

Let me make something clear here. This is a "Wishlist" forum.. which means
you can tell us your wishes! Wether or not we implement them, or even
comment them is not your decision.
We use this forum to see what is most wanted, and to get new ideas.
However, the requests are so numerous (and sometimes really odd) that we will never implement them all.
We are not here for just your personal weird wishes... live with it!

About your so much hated workarounds:
Comments, input and solutions by other people in here are very much welcome.
If we decide not to implement someting, the posted solutions can help
the original poster to do it himself. Also, the discussion can help us
find the best way for a possible implementation.
More than once, we have done thinks very similar to the way it has
been proposed as a "workaround" here, and this is a good thing.

Your reaction to people that try to help you will lead to only one thing:
People will no longer bother to even read your future posts, and you
will be on your own once you really need help.

As a note to this very request:
The IDE is a code editor, not MS Word. I see no sense in inserting images into sourcecode.
(besides, this is not even possible with Scintilla afaik)