the Colorer

Everything else that doesn't fall into one of the other PB categories.
User avatar
dobro
Enthusiast
Enthusiast
Posts: 766
Joined: Sun Oct 31, 2004 10:54 am
Location: France
Contact:

the Colorer

Post by dobro »

good then if you want to be able to put listing coloured in the forum such as for example this




; code by Dobro http://michel.dobro.free.fr/

#dobro=1
#Police=1
#Sprite=1
; ***********************************
Resultat = InitSprite ()
FontID = LoadFont ( #Police , "arial", 50, #PB_Font_Bold )
EcranX = GetSystemMetrics_( #SM_CXSCREEN ): ;=largeur de l'ecran
EcranY = GetSystemMetrics_( #SM_CYSCREEN ): ;=hauteur de l'ecran
WindowID = OpenWindow (1, 0, 0, EcranX, EcranY, #PB_Window_SystemMenu | #PB_Window_BorderLess | #PB_Window_ScreenCentered , "hello")
WindowID = WindowID (1)
Result = OpenWindowedScreen (WindowID,0,0, EcranX, EcranY, 1, 0,0)
Resultat = InitMouse ()
taille_du_cercle=20
nombre_de_point=360 ; ceci determine la resolution (nombre de points)
Repeat
ExamineMouse ()
Event= WaitWindowEvent ()

StartDrawing ( ScreenOutput ())
compt+1
If compt=nombre_de_point :compt=0: Endif ; on a fait le tour ??

x=taille_du_cercle* Cos ( compt*(2*3.1415926/nombre_de_point)) + (EcranX / 2) ; la formule du cercle /360 = 360 points
y=taille_du_cercle * Sin ( compt*(2*3.1415926/nombre_de_point)) + (EcranY / 2) ; la formule du cercle
Box (x, y,2, 2 , RGB (255,255,255))
taille_du_cercle+ Sin ( compt*(2*3.1415926/nombre_de_point))+ Cos ( compt*(2*3.1415926/nombre_de_point))
StopDrawing ()
FlipBuffers (): ; affiche l'ecran
Event= WindowEvent ()
If MouseButton (2)
End
Endif
Until Event= #PB_Event_CloseWindow




this prg can be put in the tools of Japbe, or to be to launch in way individual the use very simple to you is made your block of code has to stick in the forum as usual except that before sticking it in the forum,
you click on the button "puts color" of my prg!
then you stick directly in the editor of the forum without putting of beacon Code and /code !!
my prg deals with putting good the beacons! (Quote) in short you stick directly where you want that the code appears (after a comentaire for example!
to test is to adopt it!
the decalage of the lines is not possible, because the forum justifies the line has left!
I can nothing make :?
Note how the color are prevu to be seen under the theme "Subsilver"
but also passes under other topics, and at all under others! do not use it for Large listing!
because one is limited in a number of characteres, and the color does not add any badly!! :D
Last edited by dobro on Tue Dec 27, 2005 6:57 pm, edited 1 time in total.
Image
Windows 98/7/10 - PB 5.42
■ sites : http://michel.dobro.free.fr/
jack
Addict
Addict
Posts: 1358
Joined: Fri Apr 25, 2003 11:10 pm

Post by jack »

interesting, you state to not use for large listings - it crashes , also there's a small bug, if the source has a ';' without any text after it, your program does not close the [ color] or the [ b].
User avatar
dobro
Enthusiast
Enthusiast
Posts: 766
Joined: Sun Oct 31, 2004 10:54 am
Location: France
Contact:

Post by dobro »

Fixed ! :D

thank you :D
Image
Windows 98/7/10 - PB 5.42
■ sites : http://michel.dobro.free.fr/
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

Post by Hroudtwolf »

Cool.

I made a programm with the same function some months ago.
http://hroudtwolf.cybton.com/projekte/pb2bbcode.exe
http://www.purebasic-lounge.de/viewtopic.php?t=1054


But, good work colleague :-)
Post Reply