Hello. I am not good in organizing, categorizing and writing wiki. But I have collected a list of demos in the forum, which I believe some will find it useful. I gave them a short title and a one-line description. If you find any of them is not fit with the content, please modify them. All of them are downloadable except the
item #52, which is interesting and very short.
Total 65 items. It is not finished, if you find any new downloadable interesting code in this forum, please add to the list.
Here I start with the demos I wrote:
#1.
Simple Form TransitionsCategory: UIMake your UI looks interesting by adding some simple transition effects.
https://forum.lazarus.freepascal.org/index.php/topic,37943.msg256549.html#msg256549#2.
Drawing, Moving, Make Connection Between ShapesCategory: GeneralIt shows TShape can be use for simple diagram drawing.
https://forum.lazarus.freepascal.org/index.php/topic,41036.msg284131.html#msg284131#3.
Generate Huge Text FileCategory: GeneralNothing special but there user can see a small trick reducing program responsiveness to
improve performance, try it to see it yourself the difference.
https://forum.lazarus.freepascal.org/index.php/topic,43806.msg307101.html#msg307101#4.
Get Pixel Color of an ImageCategory: GraphicsIt may sound easy but actually it is not so easy.
https://forum.lazarus.freepascal.org/index.php/topic,37242.msg252828.html#msg252828#5.
Searchable StringGridCategory: UIRequirement:
DBFLazLoad data from a dbf, show it on a TStringGrid, search and highlight the cells.
https://forum.lazarus.freepascal.org/index.php/topic,37181.msg249361.html#msg249361https://forum.lazarus.freepascal.org/index.php/topic,37181.msg249208.html#msg249208#6.
Drag and Drop ShapeCategory: GeneralDrag and drop without using the built-in drag and drop feature.
https://forum.lazarus.freepascal.org/index.php/topic,38844.msg265130.html#msg265130#7.
Simple Pong GameCategory: GraphicsA very simple single player Pong game.
https://forum.lazarus.freepascal.org/index.php/topic,42439.msg297949.html#msg297949#8.
Binary File DemoCategory: GeneralThis demo shows how to show, append and delete data from a binary file.
https://forum.lazarus.freepascal.org/index.php/topic,43045.msg307111.html#msg307111#9.
Text File DemoCategory: GeneralThis demo shows how to read and append data to a text file.
https://forum.lazarus.freepascal.org/index.php/topic,37766.msg254800.html#msg254800#10.
Text File Demo #2Category: GeneralAnother demo showing how to read and append data to a text file.
https://forum.lazarus.freepascal.org/index.php/topic,39769.msg274036.html#msg274036#11.
Popup With ListBoxCategory: UIA custom popup form with a list box.
https://forum.lazarus.freepascal.org/index.php/topic,37369.msg250939.html#msg250939#12.
OpenGL ES2 CircleCategory: AndroidRequirement:
LAMWDrawing a circle using jCanvasES2.DrawLine instead of DrawCircle.
https://forum.lazarus.freepascal.org/index.php/topic,44811.msg315311.html#msg315311#13.
Frameless PopupCategory: UIAn alternative for ShowMessage.
https://forum.lazarus.freepascal.org/index.php/topic,48291.msg348084.html#msg348084#14.
Drag a Button to a PanelCategory: UIA short demo showing how to do drag and drop.
https://forum.lazarus.freepascal.org/index.php/topic,45346.msg320626.html#msg320626#15.
Checkbox in StringGridCategory: UIMaybe you haven’t known TStringGrid can show checkbox instead of text.
https://forum.lazarus.freepascal.org/index.php/topic,45080.msg317949.html#msg317949#16.
OpenGL ES2 RectangleCategory: AndroidRequirement:
LAMWDrawing a rectangle using jCanvasES2.DrawPolyFill instead of DrawRect.
https://forum.lazarus.freepascal.org/index.php/topic,44708.msg314630.html#msg314630#17.
Simple Polygon AnimationCategory: AndroidRequirement:
LAMWA simple animation using jCanvas.
https://forum.lazarus.freepascal.org/index.php/topic,44241.msg310991.html#msg310991#18.
Game Map EditorCategory: GraphicsA very basic load and edit map for game.
https://forum.lazarus.freepascal.org/index.php/topic,43999.msg309134.html#msg309134#19.
Fading Images Using BGRABitmapCategory: GraphicsRequirement:
BGRABitmapBuild your own slideshow, there you also learn doing proportional scaling using aspect ratio of the picture.
https://forum.lazarus.freepascal.org/index.php/topic,43823.msg307918.html#msg307918#20.
Center Resize Image on ScreenCategory: GraphicsResize an image at the center position of the image.
https://forum.lazarus.freepascal.org/index.php/topic,43424.msg303879.html#msg303879#21.
Color Fade ProgressBarCategory: UIRequirement:
BGRAControlsShort demo showing how to use TBGRAFlashProgressBar.
https://forum.lazarus.freepascal.org/index.php/topic,42610.msg297603.html#msg297603#22.
Save Component Values to a FileCategory: GeneralYou can save text data easily using TStringList.SaveToFile.
https://forum.lazarus.freepascal.org/index.php/topic,42293.msg295057.html#msg295057#23.
Load & Show Image From Resource StreamCategory: GeneralLearn how to add image to project resource and load it.
https://forum.lazarus.freepascal.org/index.php/topic,42144.msg293579.html#msg293579#24.
Minimize to TaskBar or TrayCategory: GeneralA workaround to minimize to tray, not the best solution but works.
https://forum.lazarus.freepascal.org/index.php/topic,42124.msg293401.html#msg293401#25.
Darkening a FormCategory: UIRequirement:
BGRAControlsDarkening the mainform when modal window is shown.
https://forum.lazarus.freepascal.org/index.php/topic,42107.msg293295.html#msg293295#26.
TMyCircle ComponentCategory: GeneralA short demo showing how to write your own component, the OOP way.
https://forum.lazarus.freepascal.org/index.php/topic,42106.msg293281.html#msg293281#27.
Open a Form Beside The Current FormCategory: UIProgrammatically open and close a form.
https://forum.lazarus.freepascal.org/index.php/topic,42058.msg292943.html#msg292943#28.
Simple AnimationCategory: GraphicsA very basic animation using a TTimer.
https://forum.lazarus.freepascal.org/index.php/topic,41135.msg284936.html#msg284936#29.
Moving Object By Pressing a KeyCategory: GeneralHow to detect left/right shift key pressing.
https://forum.lazarus.freepascal.org/index.php/topic,41089.msg284614.html#msg284614#30.
Pausing & Continuing An AnimationCategory: GeneralAnimation demo showing how to pause and continue the animation.
https://forum.lazarus.freepascal.org/index.php/topic,39790.msg274096.html#msg274096#31.
Scaling a FormCategory: UIYou can easily scale a form by using TForm.ScaleBy, unfortunately it does not work correctly on Linux.
https://forum.lazarus.freepascal.org/index.php/topic,39477.msg271075.html#msg271075#32.
Moving CirclesCategory: GraphicsThese 2 demos showing what is and how to fix a flickering effect.
https://forum.lazarus.freepascal.org/index.php/topic,38136.msg263143.html#msg263143#33.
Convert Unicode to TBytesCategory: GeneralA demo showing how to use WideBytesOf and WideString functions.
https://forum.lazarus.freepascal.org/index.php/topic,37887.msg256019.html#msg256019#34.
Vertical MenuCategory: UIShowing how to make vertical menu using TPanel and TScrollBox.
https://forum.lazarus.freepascal.org/index.php/topic,37537.msg252573.html#msg252573#35.
Load a Picture and Show ItCategory: GeneralA very short demo showing how to use OpenPictureDialog and LoadFromFile.
https://forum.lazarus.freepascal.org/index.php/topic,37442.msg251587.html#msg251587#36.
Colorful PanelsCategory: UIThis simple demo show how to use TControl.Align.
https://forum.lazarus.freepascal.org/index.php/topic,37397.msg251208.html#msg251208#37.
Button With AnimationCategory: UIShowing a TBitButton with animation images.
https://forum.lazarus.freepascal.org/index.php/topic,11656.msg251161.html#msg251161#38.
A Small Icon On TEditCategory: UIA trick showing how to put an icon on TEdit.
https://forum.lazarus.freepascal.org/index.php/topic,37346.msg250750.html#msg250750#39.
StringGrid Cell ValidationCategory: UIAutomatically set focus on the cell if it provide wrong input.
https://forum.lazarus.freepascal.org/index.php/topic,37286.msg250687.html#msg250687#40.
Change Background Color of an ImageCategory: GraphicsA not so accurate colorshift on an image.
https://forum.lazarus.freepascal.org/index.php/topic,37251.msg249962.html#msg249962#41.
Control Object Moving Direction Using KeyboardCategory: GeneralIt shows how to detect user keyboard input.
https://forum.lazarus.freepascal.org/index.php/topic,36306.msg241818.html#msg241818#42.
OpenGL 2D Text Using TexturesCategory: GraphicsRequirement:
LazOpenGLContextIt shows how to write text in OpenGL using textures loaded from an image file.
https://forum.lazarus.freepascal.org/index.php/topic,35850.msg238019.html#msg238019#43.
ListBox Work as Tabs For StringGridCategory: UIIt shows how to add items to ListBox and StringGrid at runtime.
https://forum.lazarus.freepascal.org/index.php/topic,47651.msg341708.html#msg341708#44.
TCanvas TextCategory: GraphicsDraw superscript and subscript text using TCanvas.
https://forum.lazarus.freepascal.org/index.php/topic,46775.msg333936.html#msg333936#45.
Sticky BallsCategory: GraphicsNot so accurate inverse kinematics demo.
https://forum.lazarus.freepascal.org/index.php/topic,38511.msg262706.html#msg262706
And these are from other fellows:
#46.
Vertical MenuCategory: UITVerticalMenu, by
howardpc.
https://forum.lazarus.freepascal.org/index.php/topic,37537.msg252612.html#msg252612#47.
GradientFill RectangleCategory: GraphicsA demo showing how to use gradientfill, by
josh (improved by GetMem).
https://forum.lazarus.freepascal.org/index.php/topic,41265.msg286208.html#msg286208#48.
Rock, Paper, ScissorsCategory: GraphicsA simple game, by
x2nie.
Note for Linux Users: need to change the path delimiter to make the code work.
https://forum.lazarus.freepascal.org/index.php/topic,41135.msg284928.html#msg284928#49.
Darkening a FormCategory: GraphicsRequirement:
BGRAControlsHow to darken a form, by
lainz.
https://forum.lazarus.freepascal.org/index.php/topic,42107.msg293431.html#msg293431#50.
Color Fade ProgressBarCategory: UIColor fade progress without using third party component, by
sash.
https://forum.lazarus.freepascal.org/index.php/topic,42610.msg297651.html#msg297651#51.
Bullet and Asteroid Collision Detection DemoCategory: GraphicsIt shows how to do collision detection between bullet and a polygonal object, by
IroncrossBG.
https://forum.lazarus.freepascal.org/index.php/topic,45729.msg323878.html#msg323878#52.
ShowMessage on Console ModeCategory: UIRequirement:
LCL needed to be in the project’s required packages
It is possible to use ShowMessage on console mode program, by
Thaddy.
https://forum.lazarus.freepascal.org/index.php/topic,37425.msg251457.html#msg251457#53.
Draw Circles Using CSMFLCategory: GraphicsRequirement:
SFML/CSFML headers binding and CSFML librariesThe demo shows how to use CSFML in FPC, by
DJMaster.
https://forum.lazarus.freepascal.org/index.php/topic,37425.msg259245.html#msg259245#54.
Get Pixel Color of an ImageCategory: GraphicsLoad an image, show its information and the pixel color under the mouse pointer, by
Molly.
https://forum.lazarus.freepascal.org/index.php/topic,37242.msg253349.html#msg253349#55.
Move Shape With Mouse by Mouse MoveCategory: GraphicsMove the rectangles using mouse, by
furious programming.
https://forum.lazarus.freepascal.org/index.php/topic,43376.msg303582.html#msg303582#56.
Selection DemoCategory: GraphicsA movable and resizeable selection, by
furious programming.
https://forum.lazarus.freepascal.org/index.php/topic,43474.msg304454.html#msg304454#57.
Sprite Picking and MovingCategory: GraphicsHit Testing - a must learn topic for every graphics programmer, by
Mr.Madguy.
https://forum.lazarus.freepascal.org/index.php/topic,36871.msg246309.html#msg246309#58.
Dancing BallsCategory: GraphicsBalls that connect to each others, by
rvk.
https://forum.lazarus.freepascal.org/index.php/topic,38511.msg262692.html#msg262692#59.
FTP ConnectCategory: NetworkRequirement:
Synapse (can be installed using OPM)
Demo showing how to connect to a FTP server, by
wp.
https://forum.lazarus.freepascal.org/index.php/topic,47015.msg336047.html#msg336047#60.
HTML to TextCategory: NetworkRequirement:
fasthtmlparserExtract data from a webpage, by
wp.
https://forum.lazarus.freepascal.org/index.php/topic,35980.msg239199.html#msg239199#61.
Game Client and ServerCategory: NetworkDemo showing the basic for building client and server program, by
rvk.
https://forum.lazarus.freepascal.org/index.php/topic,38866.msg266673.html#msg266673#62.
Screenshot CaptureCategory: GraphicsScreenshot capture and crop, by
howardpc.
https://forum.lazarus.freepascal.org/index.php/topic,33138.msg214178.html#msg214178#63.
Communicate Between 2 ProgramsCategory: GeneralThis demo showing how to use simpleipc, by
wp.
https://forum.lazarus.freepascal.org/index.php/topic,43489.msg304434.html#msg304434#64.
Save & Restore StringGridCategory: UIYou can easily save/load a grid’s content, by
wp.
https://forum.lazarus.freepascal.org/index.php/topic,48241.msg347340.html#msg347340#65.
StringGrid With Autosum ColumnCategory: UIHow to create column that can auto calculate row sum, by
wp.
https://forum.lazarus.freepascal.org/index.php/topic,45816.msg324502.html#msg324502