Recent

Author Topic: Tutorial page web/wiki  (Read 11390 times)

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2023
  • Former Delphi 1-7, 10.2 user
Re: Tutorial page web/wiki
« Reply #15 on: March 05, 2020, 02:07:13 pm »

dbannon

  • Hero Member
  • *****
  • Posts: 2802
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Tutorial page web/wiki
« Reply #16 on: March 06, 2020, 06:31:23 am »
Some good stuff in Category "Code Snippets".  I sometimes post forum snippets there.

https://wiki.lazarus.freepascal.org/Category:Code_Snippets
Yep, I agree. Its good but I did not know it even existed. It is inconsistent with Handoko's original suggestion, but does work well. Its better for larger blocks and maybe a bit wasteful of the smaller ones Handoko had in mind ?

Should we do both ?  I do think we should make a point of posting, in a forum thread "I added this trick to the wiki LINK" in either case, thus ensuring people looking for such things know that snippets (of either type) exist and can be found on the wiki.

Trev, I think your link is to larger scale demos (also under promoted)  but not what Handoko's suggestion was all about, perhaps ???

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2023
  • Former Delphi 1-7, 10.2 user
Re: Tutorial page web/wiki
« Reply #17 on: March 06, 2020, 12:57:54 pm »
What I've been doing, generally for macOS related code, is:

* Larger items: creating new pages in the wiki and adding the category code snippets and linking them from the Mac Portal; and
* Smaller items: adding them to the macOS Programming Tips page.

There are portals and programming tips pages (linked from the respective portal) for the common platforms as well as topic themed portals.

Portals: https://wiki.freepascal.org/Category:Portals

The Linux and Windows portals do not seem to receive much love, unlike the macOS portal :)

Quote
Trev, I think your link is to larger scale demos (also under promoted)  but not what Handoko's suggestion was all about, perhaps ???

Short demos could be classified as either Code Snippets or Example Programs and have their own Wiki pages and be like to the relevant portal - they're probably too large to be considered for the programming tips pages (I split a lot of larger items out of those pages because otherwise they tended to grow exponentially).

Of course, the bottom line is that the harvest is plentiful, but the labourers are few :( I think Martin was alluding to this in his post.

Handoko

  • Hero Member
  • *****
  • Posts: 5158
  • My goal: build my own game engine using Lazarus
Re: Tutorial page web/wiki
« Reply #18 on: March 07, 2020, 07:45:46 pm »
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 Transitions
Category: UI
Make 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 Shapes
Category: General
It 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 File
Category: General
Nothing 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 Image
Category: Graphics
It may sound easy but actually it is not so easy.
https://forum.lazarus.freepascal.org/index.php/topic,37242.msg252828.html#msg252828

#5. Searchable StringGrid
Category: UI
Requirement: DBFLaz
Load 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#msg249361
https://forum.lazarus.freepascal.org/index.php/topic,37181.msg249208.html#msg249208

#6. Drag and Drop Shape
Category: General
Drag 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 Game
Category: Graphics
A very simple single player Pong game.
https://forum.lazarus.freepascal.org/index.php/topic,42439.msg297949.html#msg297949

#8. Binary File Demo
Category: General
This 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 Demo
Category: General
This 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 #2
Category: General
Another 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 ListBox
Category: UI
A custom popup form with a list box.
https://forum.lazarus.freepascal.org/index.php/topic,37369.msg250939.html#msg250939

#12. OpenGL ES2 Circle
Category: Android
Requirement: LAMW
Drawing a circle using jCanvasES2.DrawLine instead of DrawCircle.
https://forum.lazarus.freepascal.org/index.php/topic,44811.msg315311.html#msg315311

#13. Frameless Popup
Category: UI
An alternative for ShowMessage.
https://forum.lazarus.freepascal.org/index.php/topic,48291.msg348084.html#msg348084

#14. Drag a Button to a Panel
Category: UI
A short demo showing how to do drag and drop.
https://forum.lazarus.freepascal.org/index.php/topic,45346.msg320626.html#msg320626

#15. Checkbox in StringGrid
Category: UI
Maybe 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 Rectangle
Category: Android
Requirement: LAMW
Drawing a rectangle using jCanvasES2.DrawPolyFill instead of DrawRect.
https://forum.lazarus.freepascal.org/index.php/topic,44708.msg314630.html#msg314630

#17. Simple Polygon Animation
Category: Android
Requirement: LAMW
A simple animation using jCanvas.
https://forum.lazarus.freepascal.org/index.php/topic,44241.msg310991.html#msg310991

#18. Game Map Editor
Category: Graphics
A very basic load and edit map for game.
https://forum.lazarus.freepascal.org/index.php/topic,43999.msg309134.html#msg309134

#19. Fading Images Using BGRABitmap
Category: Graphics
Requirement: BGRABitmap
Build 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 Screen
Category: Graphics
Resize an image at the center position of the image.
https://forum.lazarus.freepascal.org/index.php/topic,43424.msg303879.html#msg303879

#21. Color Fade ProgressBar
Category: UI
Requirement: BGRAControls
Short demo showing how to use TBGRAFlashProgressBar.
https://forum.lazarus.freepascal.org/index.php/topic,42610.msg297603.html#msg297603

#22. Save Component Values to a File
Category: General
You 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 Stream
Category: General
Learn 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 Tray
Category: General
A 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 Form
Category: UI
Requirement: BGRAControls
Darkening the mainform when modal window is shown.
https://forum.lazarus.freepascal.org/index.php/topic,42107.msg293295.html#msg293295

#26. TMyCircle Component
Category: General
A 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 Form
Category: UI
Programmatically open and close a form.
https://forum.lazarus.freepascal.org/index.php/topic,42058.msg292943.html#msg292943

#28. Simple Animation
Category: Graphics
A very basic animation using a TTimer.
https://forum.lazarus.freepascal.org/index.php/topic,41135.msg284936.html#msg284936

#29. Moving Object By Pressing a Key
Category: General
How to detect left/right shift key pressing.
https://forum.lazarus.freepascal.org/index.php/topic,41089.msg284614.html#msg284614

#30. Pausing & Continuing An Animation
Category: General
Animation demo showing how to pause and continue the animation.
https://forum.lazarus.freepascal.org/index.php/topic,39790.msg274096.html#msg274096

#31. Scaling a Form
Category: UI
You 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 Circles
Category: Graphics
These 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 TBytes
Category: General
A demo showing how to use WideBytesOf and WideString functions.
https://forum.lazarus.freepascal.org/index.php/topic,37887.msg256019.html#msg256019

#34. Vertical Menu
Category: UI
Showing 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 It
Category: General
A very short demo showing how to use OpenPictureDialog and LoadFromFile.
https://forum.lazarus.freepascal.org/index.php/topic,37442.msg251587.html#msg251587

#36. Colorful Panels
Category: UI
This simple demo show how to use TControl.Align.
https://forum.lazarus.freepascal.org/index.php/topic,37397.msg251208.html#msg251208

#37. Button With Animation
Category: UI
Showing a TBitButton with animation images.
https://forum.lazarus.freepascal.org/index.php/topic,11656.msg251161.html#msg251161

#38. A Small Icon On TEdit
Category: UI
A trick showing how to put an icon on TEdit.
https://forum.lazarus.freepascal.org/index.php/topic,37346.msg250750.html#msg250750

#39. StringGrid Cell Validation
Category: UI
Automatically 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 Image
Category: Graphics
A 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 Keyboard
Category: General
It shows how to detect user keyboard input.
https://forum.lazarus.freepascal.org/index.php/topic,36306.msg241818.html#msg241818

#42. OpenGL 2D Text Using Textures
Category: Graphics
Requirement: LazOpenGLContext
It 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 StringGrid
Category: UI
It 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 Text
Category: Graphics
Draw superscript and subscript text using TCanvas.
https://forum.lazarus.freepascal.org/index.php/topic,46775.msg333936.html#msg333936

#45. Sticky Balls
Category: Graphics
Not 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 Menu
Category: UI
TVerticalMenu, by howardpc.
https://forum.lazarus.freepascal.org/index.php/topic,37537.msg252612.html#msg252612

#47. GradientFill Rectangle
Category: Graphics
A 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, Scissors
Category: Graphics
A 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 Form
Category: Graphics
Requirement: BGRAControls
How to darken a form, by lainz.
https://forum.lazarus.freepascal.org/index.php/topic,42107.msg293431.html#msg293431

#50. Color Fade ProgressBar
Category: UI
Color 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 Demo
Category: Graphics
It 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 Mode
Category: UI
Requirement: 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 CSMFL
Category: Graphics
Requirement: SFML/CSFML headers binding and CSFML libraries
The 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 Image
Category: Graphics
Load 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 Move
Category: Graphics
Move the rectangles using mouse, by furious programming.
https://forum.lazarus.freepascal.org/index.php/topic,43376.msg303582.html#msg303582

#56. Selection Demo
Category: Graphics
A movable and resizeable selection, by furious programming.
https://forum.lazarus.freepascal.org/index.php/topic,43474.msg304454.html#msg304454

#57. Sprite Picking and Moving
Category: Graphics
Hit 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 Balls
Category: Graphics
Balls that connect to each others, by rvk.
https://forum.lazarus.freepascal.org/index.php/topic,38511.msg262692.html#msg262692

#59. FTP Connect
Category: Network
Requirement: 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 Text
Category: Network
Requirement: fasthtmlparser
Extract data from a webpage, by wp.
https://forum.lazarus.freepascal.org/index.php/topic,35980.msg239199.html#msg239199

#61. Game Client and Server
Category: Network
Demo 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 Capture
Category: Graphics
Screenshot capture and crop, by howardpc.
https://forum.lazarus.freepascal.org/index.php/topic,33138.msg214178.html#msg214178

#63. Communicate Between 2 Programs
Category: General
This demo showing how to use simpleipc, by wp.
https://forum.lazarus.freepascal.org/index.php/topic,43489.msg304434.html#msg304434

#64. Save & Restore StringGrid
Category: UI
You 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 Column
Category: UI
How to create column that can auto calculate row sum, by wp.
https://forum.lazarus.freepascal.org/index.php/topic,45816.msg324502.html#msg324502

dbannon

  • Hero Member
  • *****
  • Posts: 2802
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Tutorial page web/wiki
« Reply #19 on: March 08, 2020, 12:17:36 am »
Oh, wow, thats some list Handoko, some list !

And just scrolling through it, a very useful collection of things !

But too long and diverse for one page, would 65 extra entries swamp the Code Snippets page that Trev and minesadorada mention ?

I now think its a case of several new wiki pages with headings such as (taken from Handoko's list) -

General Programming Snippets
Graphics Snippets
UI Snippets
Android Snippets
....
Forum Snippets
....

etc and list those pages in the Code Snippets page. The term "Snippets" in the title indicating its a collection.  And, maybe a "Forum Snippets" page where we can quickly link something interesting, maybe, hopefully, to later make a wiki page of ?  is that step one ?

A lot of Handoko's links do point to content that is substantial enough to require its own dedicated page.

(I'm going to now have a sit and browse through all this links ....)

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2023
  • Former Delphi 1-7, 10.2 user
Re: Tutorial page web/wiki
« Reply #20 on: March 08, 2020, 01:41:41 am »
Great work Handoko! In return for all your work,  I just spent the last couple of hours creating the HowTo Demos Portal in the Wiki using your  content.

Note: I broke a few of the HowTos out of the General category and made a new category: File Handling.

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: Tutorial page web/wiki
« Reply #21 on: March 08, 2020, 02:49:53 am »
Thanx Handoko, Thanx Trev

Very helpful

Winni

440bx

  • Hero Member
  • *****
  • Posts: 4065
Re: Tutorial page web/wiki
« Reply #22 on: March 08, 2020, 02:55:47 am »
Great work Handoko!
+1

I second that.  Thank you Handoko.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

kapibara

  • Hero Member
  • *****
  • Posts: 610
Re: Tutorial page web/wiki
« Reply #23 on: March 08, 2020, 07:46:29 am »
When I was learning TAChart I ended up writing a wiki Treeview for better overview. But I never maintained it for lack of time. I dont know, maybe it can be of use as an idea or whatever.

https://wiki.lazarus.freepascal.org/TAChart_User_Guide
Lazarus trunk / fpc 3.2.2 / Kubuntu 22.04 - 64 bit

Handoko

  • Hero Member
  • *****
  • Posts: 5158
  • My goal: build my own game engine using Lazarus
Re: Tutorial page web/wiki
« Reply #24 on: March 08, 2020, 08:06:57 am »
+1 for kapibara

That looks nice.

Zath

  • Sr. Member
  • ****
  • Posts: 391
Re: Tutorial page web/wiki
« Reply #25 on: March 08, 2020, 08:25:22 am »
Nice idea and nice list Handoko.

I would certainly use such a resource.
It doesn't have to be perfect from day one, it can be an evolving resource.

You could then have a separate section here devoted to questions about using the code on the resource. Users refer to the example/code/app number and then state their question.
This would remove some of the randomness of questions throughout the sections.

Great work people.

nouzi

  • Sr. Member
  • ****
  • Posts: 298
Re: Tutorial page web/wiki
« Reply #26 on: March 08, 2020, 09:57:03 am »
thanks @Handoko
thanks @Trev
very good
My English is  bad
Lazarus last version free pascal last version
Lazarus trunk  free pascal trunk 
System : Linux mint  64bit  Windows 7 64bit

dbannon

  • Hero Member
  • *****
  • Posts: 2802
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Tutorial page web/wiki
« Reply #27 on: March 08, 2020, 11:40:24 pm »
Very well done Trev.

I note you say "that have been posted on the Free Pascal and Lazarus Forums".  Is it your intention that that particular Portal list only forum content ?

For example, kapibara's TChart demo is mentioned under the Tutorials category, there is some cross over between Portals and Categories and new (or old) users may not see structure. Fortunately you mention several relevant categories on the new Portal page  so new users can see the full range.

I wonder, if its a Forum only Portal, would it be better to include the word 'Forum' in the title ?

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2023
  • Former Delphi 1-7, 10.2 user
Re: Tutorial page web/wiki
« Reply #28 on: March 09, 2020, 12:25:25 am »
I note you say "that have been posted on the Free Pascal and Lazarus Forums".  Is it your intention that that particular Portal list only forum content ?

Yes, that was the intention as per Handoko's original post.

Quote
For example, kapibara's TChart demo is mentioned under the Tutorials category, there is some cross over between Portals and Categories and new (or old) users may not see structure. Fortunately you mention several relevant categories on the new Portal page  so new users can see the full range.

Yes, I quite deliberately mentioned the Code, Code Snippets, Example programs and Tutorials categories so that anyone who reaches the HowTo Demos page can discover them too.

Quote
I wonder, if its a Forum only Portal, would it be better to include the word 'Forum' in the title ?

Been there, done that :) I originally had Forum in the title, but as time went by it didn't seem quite right somehow and so I settled on the current name. Given the number of Wiki labourers, I'm not too worried about the floodgates being opened to non-Forum demos or having to police that eventuality.

In other news, the various platform and topic portals will soon be appearing on the Wiki's main page to make it a lot easier for users, new and old, to:

* see more of what's available in the Wiki;
* locate Wiki information more easily;
* encourage new contributors and contributions to the Wiki.

The Linux and Windows Portals could do with some love as could the Linux Programming Tips and Windows Programmng Tips pages. Hint, hint  ;D

dbannon

  • Hero Member
  • *****
  • Posts: 2802
    • tomboy-ng, a rewrite of the classic Tomboy
Re: Tutorial page web/wiki
« Reply #29 on: March 09, 2020, 09:32:00 am »
Been there, done that :) I originally had Forum in the title, but as time went by it didn't seem quite right somehow .....

Your call, you have put the effort in.
Quote
In other news, the various platform and topic portals will soon be appearing on the Wiki's main page to make it a lot easier ....

Main page ?  good, as long as it keeps it reasonably short.  The Documentation page is far too long and not organized in a new user focus.  The links they need are certainly there but they are unlikely to find them.  Whats needed is a "New User Start Here" that takes them to a small number of beginner suitable tutorials.

Quote
The Linux and Windows Portals could do with some love as could the Linux Programming Tips and Windows Programmng Tips pages. Hint, hint  ;D

Yeah, probably. I don't tend to focus on platform specific pages, my code is cross platform so, when I hack into a wiki page (except the Installing pages I've done) I tend to write platform agnostic content with embedded notes about platform idiosyncrasies if necessary.

I have spent a fair bit of time following various links from the examples and Tutorials pages, have learnt heaps !  But notice a lot of out of date comments.  Things like "If using the current Lazarus which is  0.9.2, ...." - In a lot of cases, the content is still correct but the message to new user is neglect.  Sigh ....

Anyway, love the job you, Trev and Handoko have done here. A real step forward.

Davo 
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

 

TinyPortal © 2005-2018