* * *

Author Topic: Visual Pascal Community Edition  (Read 3001 times)

Researching

  • New member
  • *
  • Posts: 9
Visual Pascal Community Edition
« on: April 24, 2018, 05:38:46 pm »
Good day to evreyone!
Want to make a kind of visual coding tool for FPC:
Basically:
Input: TextFiles with/without text
Inside: Diagram
Output: TextFiles in folders. with/without text.

Need Help With: get appropriate libraries/components, knowledge of visual programming with Lazarus.

Features:
    set language buildBlocks (syntaxis elements)
    make function/procedure calls visually ( set type aka value / pointer, type of return)
    make decomposition of blocks
    design packages
Milestone1 - program makes cmd/shell line applications and saves ad Lazarus project.
In future: up to: set target platform(s), round trip.

Why: there are good tools alowing to make separate functions or classes for FPC, but if it goes to a larger project - nothing.
UML... not bad... but not "all-purpose".

What is needed:
    Library for drawing block shapes like flowchart - and knowledge how to make it work.
    Library (?) for deploying blockShapes to TextFiles
    Knowledge of Lazarus basics like source file structure, libraries linking.
    Knowledge / libraries to make a parser for code-to visual.

Please, any help, as I'm a newbie to Lazarus.
« Last Edit: April 24, 2018, 05:51:57 pm by Researching »

Handoko

  • Hero Member
  • *****
  • Posts: 2305
  • My goal: build my own game engine using Lazarus
Re: Visual Pascal Community Edition
« Reply #1 on: April 24, 2018, 07:45:05 pm »
Hello Researching,
Welcome to the forum.

I think you may not get the answers you want because I and also I believe most people here do not fully understand your question.

Did you mean you want to make a program that like the visual programming language as mentioned on the wiki page in the link below?
https://en.wikipedia.org/wiki/Visual_programming_language

What did you meant about "textfiles without text"?

You said your milestone1 is an application that save the result as Lazarus project, but at the beginning you mentioned that the visual coding tool is for FPC. It is a bit confusing. FPC and Lazarus are closely related but they're different.

About the drawing libraries, I think you can use TECSheme or fpVectorial or BGRABitmap, they support vector drawing. Read more here:
http://wiki.freepascal.org/Eye-Candy_Controls#TECScheme
http://wiki.freepascal.org/Graphics_libraries

About the file saving, maybe you can study how ZCAD does. It is written using Lazarus/FPC:
https://forum.lazarus.freepascal.org/index.php?topic=16665.0
https://sourceforge.net/projects/zcad/

Or you can consider to save it to xml file:
http://wiki.freepascal.org/XML

Or maybe you can try component streaming, which can both for saving and loading:
http://wiki.freepascal.org/Streaming_components

And this is the documentation of FPC:
https://www.freepascal.org/docs.var

Edson

  • Hero Member
  • *****
  • Posts: 905
Re: Visual Pascal Community Edition
« Reply #2 on: April 24, 2018, 11:30:08 pm »
I was thinking on doing too, some tool for Visual Programming (like Scratch) for my compiler: https://github.com/t-edson/PicPas, but there ara some issues to solve first.

    Library for drawing block shapes like flowchart - and knowledge how to make it work.

Maybe you can use my library: https://github.com/t-edson/ogEditGraf
It includes a Graphic engine to manipulate shapes on screen and recently I have included support for 1-D shapes (connectors).

    Library (?) for deploying blockShapes to TextFiles

Serialize? It's possible to move object data to files, with more or less work.

    Knowledge of Lazarus basics like source file structure, libraries linking.

Some people here have deep knowlegdge about it.

    Knowledge / libraries to make a parser for code-to visual.

That's the difficult part. If you need a lexer, you can use my highlighter https://github.com/t-edson/SynFacilSyn, and if you want a Parser/Syntax Tree, you can use my framework https://github.com/t-edson/t-Xpres
« Last Edit: April 24, 2018, 11:33:00 pm by Edson »
Lazarus 1.6 - FPC 3.0.0 - x86_64-win64 on  Windows 7

valdir.marcos

  • Sr. Member
  • ****
  • Posts: 381
Re: Visual Pascal Community Edition
« Reply #3 on: April 24, 2018, 11:32:47 pm »
Want to make a kind of visual coding tool for FPC:
Basically:
Input: TextFiles with/without text
Inside: Diagram
Output: TextFiles in folders. with/without text.

Why: there are good tools alowing to make separate functions or classes for FPC, but if it goes to a larger project - nothing.
UML... not bad... but not "all-purpose".

What is needed:
    Library for drawing block shapes like flowchart - and knowledge how to make it work.
    Library (?) for deploying blockShapes to TextFiles
    Knowledge of Lazarus basics like source file structure, libraries linking.
    Knowledge / libraries to make a parser for code-to visual.

Please, any help, as I'm a newbie to Lazarus.

Since you are a newbie to Lazarus, lets start by the basic:
https://www.freepascal.org/docs.var
https://www.freepascal.org/moreinfo.var
http://wiki.freepascal.org/Object_Pascal_Tutorial
http://wiki.freepascal.org/Lazarus_Tutorial
http://wiki.freepascal.org/
http://wiki.freepascal.org/FPCDocs_Tutorial

Marco Cantu's "Object Pascal Handbook"
http://www.marcocantu.com/objectpascalhandbook/

SchoolFreeware
https://www.youtube.com/user/SchoolFreeware
http://www.schoolfreeware.com/Free_Pascal_Tutorials.html
http://www.schoolfreeware.com/Free_Pascal_Lazarus_App_GUI_Tutorials_With_Example_Code.html

Lazarus - The Complete Guide - 2nd edition
http://forum.lazarus.freepascal.org/index.php/topic,22143.msg130245.html#msg130245

Tutorial or book on OOP, DAO, MVC, MVP, MVVM, MGM, editable dbgrid
http://forum.lazarus.freepascal.org/index.php/topic,22142.msg130242.html#msg130242


About file handling in Free Pascal
wiki.freepascal.org/File_Handling_In_Pascal


About drawing with Canvas:
http://wiki.freepascal.org/Drawing_with_canvas
http://wiki.freepascal.org/Canvas_line
http://www.pp4s.co.uk/main/tu-oop-inbuilt-lcanvas-prog.html



About developing graphical design tools in Lazarus, specially for UML:

Roundtrip UML Tool for Lazarus and FPC
http://forum.lazarus.freepascal.org/index.php/topic,20340.msg117291.html

UML for freepascal
http://forum.lazarus.freepascal.org/index.php/topic,4580.msg96209.html

ODMG Diagram designer
http://forum.lazarus.freepascal.org/index.php/topic,18580.msg104980.html

TStateMachine
http://forum.lazarus.freepascal.org/index.php/topic,17688.msg98008.html
http://www.jfreesoft.com/JMerise/index.html

ESS-Model again
http://forum.lazarus.freepascal.org/index.php/topic,35136.0.html

Diagram Editor
http://forum.lazarus.freepascal.org/index.php/topic,26944.msg166484.html

[ANN] Eye-Candy Controls 0.9.2
http://forum.lazarus.freepascal.org/index.php/topic,27996.msg184454.html#msg184454

UML tools for Object Pascal
http://forum.lazarus.freepascal.org/index.php/topic,33858.msg220489.html

New Visual Components for Lazarus
http://forum.lazarus.freepascal.org/index.php/topic,8560.msg44685.html

Project planning/managing software
http://forum.lazarus.freepascal.org/index.php/topic,27992.msg173965.html

Is it possible to use FP to produce SW documentation from Delphi 7 source code?
http://forum.lazarus.freepascal.org/index.php/topic,33387.msg216298.html

How to solve this coding problem?
http://forum.lazarus.freepascal.org/index.php/topic,40921.msg283183.html

Porting a Delphi Project
http://forum.lazarus.freepascal.org/index.php/topic,33830.msg220092.html

Recommended way to split out code?
Logical or functional groups is what I use. For example designer is a functional group which has uml designer, ERD designer, mind map designer as logical subgroups. every one of those might have its own functional/logical groups there are no rules or limits.
http://forum.lazarus.freepascal.org/index.php/topic,32552.msg210037.html#msg210037

OOP open source project reccomendation
http://forum.lazarus.freepascal.org/index.php/topic,26928.msg166265.html

how to code more efficiently?
http://forum.lazarus.freepascal.org/index.php/topic,30360.msg193151.html

[ANN] LiteZarus (alpha)
http://forum.lazarus.freepascal.org/index.php/topic,24661.msg148697.html

LHELP as a standalone?
http://forum.lazarus.freepascal.org/index.php/topic,20422.msg117997.html#msg117997

Porting StarUML ???
http://forum.lazarus.freepascal.org/index.php/topic,4754.msg24865.html#msg24865
https://umbrello.kde.org/
https://umbrello.kde.org/documentation.php

Researching

  • New member
  • *
  • Posts: 9
Re: Visual Pascal Community Edition
« Reply #4 on: April 25, 2018, 12:11:03 am »
OK, people. Let me start, like valdir.marcos said.
Glad for response.

Point one - I'll  reviev what you pointed to me and select a library to work with or a project to continue.
The MAIN function finally must be "drill down" Like in XMind.
And I remember that some version of Delphi had a long design but straight and short coding.

I'll try a kind of short life cycle like Agile(am I correct?) beginning with GUI to files deployment.
I yet dont' mind this tool  to be integrated inside Lazarus. But also I'd like to have it separate also.

At the end visually it should be like a combination of Ramus, yEd (? and Xmind).
As of Files it should be exporting almost exactly like XMind and/or Freeplane, only with
Project folder/file structure.

I would appreciate if someone gave an estimate of this project in human hours.

Concepting is what I know, and programming/coding is what I only imagine yet.
so I feel more like a "team leader" khe-khe,  than an appropriate deployer.
So if many people would be interested in bringing this project to life - this would be highly appreciated. In other case, I feel now, that I'll have to work under the tight supervision of respected and distinguished Lazarus Forum Team.

Any way, thanks for these materials, that'll take me .... 1-2 month to get accuanted with. Khe-khe...  ;)

And Best Regards.
See you...!

valdir.marcos

  • Sr. Member
  • ****
  • Posts: 381
Re: Visual Pascal Community Edition
« Reply #5 on: April 25, 2018, 02:03:05 am »
Ramus: создание диаграммы  (creating a chart)
https://www.youtube.com/watch?v=EESnTCtaNgU

https://github.com/Vitaliy-Yakovchuk/ramus

https://www.yworks.com/products/yed

http://www.xmind.net/

https://www.freeplane.org/wiki/index.php/Home


I would appreciate if someone gave an estimate of this project in human hours.
If you think in a professional project, it won't take less than one year, with a team leader and three experienced full time programmers:
- 1 programmer for the graphical part;
- 1 programmer for reading text source code and transform it into graphical information;
- 1 programmer for reading graphical information and transform it into text source code.

3 programmers x 8 hours a day x 22 working days for month x 12 months = 6,336 human hours.

The programmers are paid by hour or month, but the team leader is paid by month or project.

Researching

  • New member
  • *
  • Posts: 9
Re: Visual Pascal Community Edition
« Reply #6 on: April 25, 2018, 08:03:16 am »
Good day, to everyone!!
 
I'd like to figure out how to make this project in a time of a month. :o
Well...
1. I'd like to find the work sequence, by which making this project will speed up it's own making.
2. GUI would consist of four parts:
--- Class to draw graphical entity (based on parameters). Entites given in a form of library with text files, so you can easily add/change them.
--- Class? to drillDown current entity / convert link to entity.
--- Class to drop present level to files (recursive)
--- Class Class to solve drawing and distributing entites and connectors on the drawing space. (would be the main trouble) it get's data from parser, and also sends data to DeployPackage.

3. DeployPackage:
(like a class ?) It monitors the "list" of entites in realtime and deploys it to file structure or back.
4. LanguageKeeper (class? or a long recursive(?) function)
It reads/writes LanguageSetting.ini and gives the DeployPackage instructions/data to convert graphicals to dirs/files.
5. Parser, that takes LanguageSetting.ini and converts it to DeplyPackage compatible format.
Actually, would be perfect, to reverse the source of Ramus and convert it visually to Lazarus source.


Another aproach to speed up the project developmnet, would be to create a parser for an existing UML tool (Would perfect - for BOUML ) or the same Ramus and then make an initial roundtrip with it.

how diffucult would it be to "convert" Ramus to Pascal?

About manHours... Is it possible, that in case a clear WBS  would be made for this project - it's implementation could attract many users of Lazarus to make separate parts of it?

If yes, I'd consider making the WBS like an XMnid mindmap for the whole project or may be a class diagram in any UML tool. then -> gitHub and start Community work.

Among others - huge problem for me would be to learn certain libraries and approaches. But may be there are professionals on the forum, that know the needed sources on they're fingertips ?
ANother question is... WM5/6 seem to be not suported anymore (since Laz 1.6.4) So what is the difference betw. 1.6.4 and 1.8.2 ... or later? I'd like to have a version of this tool in my pocket in future. Could the same source be used in different versions of Lazarus?

Researching

  • New member
  • *
  • Posts: 9
Re: Visual Pascal Community Edition
« Reply #7 on: April 25, 2018, 08:07:32 am »
An yes, taking some base from ZCAD, mantioned by Handoko - looks attractive.

Researching

  • New member
  • *
  • Posts: 9
Re: Visual Pascal Community Edition
« Reply #8 on: April 25, 2018, 08:18:54 am »
Edson,
Does it look sensible, to combine all your projects, to make a kind of visual IDE with modular structure on the base of them?
Will it be possible to shift to Lazarus later? Or it can stand just in parallel?
And yes, your native language is Spanish? em-m-m May be translation would be needed.

You mentioned some issues? Of what kind?.
BRGD

Handoko

  • Hero Member
  • *****
  • Posts: 2305
  • My goal: build my own game engine using Lazarus
Re: Visual Pascal Community Edition
« Reply #9 on: April 25, 2018, 12:32:04 pm »
Among others - huge problem for me would be to learn certain libraries and approaches.
Me too, too lazy to learn new libraries. It's been a long time I wanted to learn BGRABitmap, but still haven't started. :-[

Here I wrote a quick demo showing how to do drawing, moving and make connection. You can download the source for testing.

Code: Pascal  [Select]
  1. unit Unit1;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. interface
  6.  
  7. uses
  8.   Classes, sysutils, Forms, Controls, Graphics, Menus, ExtCtrls, ComCtrls;
  9.  
  10. type
  11.  
  12.   { VisualTree }
  13.   TVTComponentType = (Box, Circle, Connection);
  14.   TVTComponent = record
  15.     ComponentType  : TVTComponentType;
  16.     ComponentImage : TShape;
  17.     Connection1    : TShape;
  18.     Connection2    : TShape;
  19.   end;
  20.  
  21.   { TForm1 }
  22.  
  23.   TForm1 = class(TForm)
  24.     mniClearConnections: TMenuItem;
  25.     mniConnectTo: TMenuItem;
  26.     mniClearAll: TMenuItem;
  27.     mniSep: TMenuItem;
  28.     mniNewCircle: TMenuItem;
  29.     mniNewBox: TMenuItem;
  30.     mnuNew: TPopupMenu;
  31.     mnuComponent: TPopupMenu;
  32.     StatusBar1: TStatusBar;
  33.     procedure FormCreate(Sender: TObject);
  34.     procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
  35.       Shift: TShiftState; X, Y: Integer);
  36.     procedure FormPaint(Sender: TObject);
  37.     procedure mniClearAllClick(Sender: TObject);
  38.     procedure mniClearConnectionsClick(Sender: TObject);
  39.     procedure mniConnectToClick(Sender: TObject);
  40.     procedure mniNewBoxClick(Sender: TObject);
  41.     procedure mniNewCircleClick(Sender: TObject);
  42.   private
  43.     VTComponents: array of TVTComponent;
  44.     procedure VTCreateConnection(ConnectTo: TShape);
  45.  
  46.     // TShape events
  47.     var
  48.       TSMouseClicked: Boolean;
  49.       TSMouseClickedX: Integer;
  50.       TSMouseClickedY: Integer;
  51.       TSMouseConnectionStart: TShape;
  52.       TSMouseSelected: TShape;
  53.     procedure TSMouseDown(Sender: TObject; Button: TMouseButton;
  54.       Shift: TShiftState; X, Y: Integer);
  55.     procedure TSMouseEnter(Sender: TObject);
  56.     procedure TSMouseLeave(Sender: TObject);
  57.     procedure TSMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
  58.     procedure TSMouseUp(Sender: TObject; Button: TMouseButton;
  59.       Shift: TShiftState; X, Y: Integer);
  60.   end;
  61.  
  62. var
  63.   Form1: TForm1;
  64.  
  65. implementation
  66.  
  67. {$R *.lfm}
  68.  
  69. { TForm1 }
  70.  
  71. procedure TForm1.FormCreate(Sender: TObject);
  72. begin
  73.   SetLength(VTComponents, 0);
  74.   TSMouseClicked         := False;
  75.   TSMouseConnectionStart := nil;
  76. end;
  77.  
  78. // Show a popup menu
  79. procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
  80.   Shift: TShiftState; X, Y: Integer);
  81. begin
  82.   if (TSMouseConnectionStart <> nil) then Exit;
  83.   mnuNew.PopUp(Left + X, Top + Y);
  84. end;
  85.  
  86. // Draw all connections
  87. procedure TForm1.FormPaint(Sender: TObject);
  88. var
  89.   i: Integer;
  90. begin
  91.   for i := 0 to Length(VTComponents)-1 do
  92.     with VTComponents[i] do begin
  93.       if ComponentType <> Connection then Continue;
  94.       Self.Canvas.Line(Connection1.Left+30, Connection1.Top+30,
  95.         Connection2.Left+30, Connection2.Top+30);
  96.     end;
  97. end;
  98.  
  99. // Remove all VTComponents
  100. procedure TForm1.mniClearAllClick(Sender: TObject);
  101. var
  102.   i: Integer;
  103. begin
  104.   for i := 0 to Length(VTComponents)-1 do
  105.     VTComponents[i].ComponentImage.Free;
  106.   SetLength(VTComponents, 0);
  107.   Invalidate;
  108. end;
  109.  
  110. // Remove connections of the selected component
  111. procedure TForm1.mniClearConnectionsClick(Sender: TObject);
  112. var
  113.   Index : Integer;
  114.   i     : Integer;
  115. begin
  116.   repeat
  117.     Index := -1;
  118.     for i := 0 to Length(VTComponents)-1 do
  119.       with VTComponents[i] do begin
  120.         if ComponentType = Connection then
  121.           if (Connection1 = TSMouseSelected) or (Connection2 = TSMouseSelected) then begin
  122.             Index := i;
  123.             Break;
  124.           end;
  125.       end;
  126.     if (index >= 0) then begin
  127.       for i := Index to Length(VTComponents)-2 do
  128.         VTComponents[i] := VTComponents[i+1];
  129.       SetLength(VTComponents, Length(VTComponents) - 1);
  130.     end;
  131.   until (Index = -1);
  132.   Invalidate;
  133. end;
  134.  
  135. // Start a new connection
  136. procedure TForm1.mniConnectToClick(Sender: TObject);
  137. begin
  138.   TSMouseConnectionStart             := TSMouseSelected;
  139.   TSMouseConnectionStart.Brush.Color := clGreen;
  140.   StatusBar1.SimpleText              := 'Click the target component or the green one to cancel.';
  141. end;
  142.  
  143. // Create a box component
  144. procedure TForm1.mniNewBoxClick(Sender: TObject);
  145. var
  146.   NewBox : TShape;
  147.   Index  : Integer;
  148. begin
  149.   NewBox := TShape.Create(Self);
  150.   with NewBox do begin
  151.     Left         := Mouse.CursorPos.x - Self.ClientOrigin.x;
  152.     Top          := Mouse.CursorPos.y - Self.ClientOrigin.y;
  153.     Width        := 60;
  154.     Height       := 60;
  155.     Parent       := Self;
  156.     OnMouseDown  := @TSMouseDown;
  157.     OnMouseEnter := @TSMouseEnter;
  158.     OnMouseLeave := @TSMouseLeave;
  159.     OnMouseMove  := @TSMouseMove;
  160.     OnMouseUp    := @TSMouseUp;
  161.   end;
  162.   Index := Length(VTComponents);
  163.   SetLength(VTComponents, Index + 1);
  164.   with VTComponents[Index] do begin
  165.     ComponentType  := Box;
  166.     ComponentImage := NewBox;
  167.     Connection1    := nil;
  168.     Connection2    := nil;
  169.   end;
  170. end;
  171.  
  172. // Create a circle component
  173. procedure TForm1.mniNewCircleClick(Sender: TObject);
  174. var
  175.   NewCircle : TShape;
  176.   Index     : Integer;
  177. begin
  178.   NewCircle := TShape.Create(Self);
  179.   with NewCircle do begin
  180.     Left         := Mouse.CursorPos.x - Self.ClientOrigin.x;
  181.     Top          := Mouse.CursorPos.y - Self.ClientOrigin.y;
  182.     Width        := 60;
  183.     Height       := 60;
  184.     Shape        := stCircle;
  185.     Parent       := Self;
  186.     OnMouseDown  := @TSMouseDown;
  187.     OnMouseEnter := @TSMouseEnter;
  188.     OnMouseLeave := @TSMouseLeave;
  189.     OnMouseMove  := @TSMouseMove;
  190.     OnMouseUp    := @TSMouseUp;
  191.   end;
  192.   Index := Length(VTComponents);
  193.   SetLength(VTComponents, Index + 1);
  194.   with VTComponents[Index] do begin
  195.     ComponentType  := Box;
  196.     ComponentImage := NewCircle;
  197.     Connection1    := nil;
  198.     Connection2    := nil;
  199.   end;
  200. end;
  201.  
  202. // Create a new connection
  203. procedure TForm1.VTCreateConnection(ConnectTo: TShape);
  204. var
  205.   Count, i, j: Integer;
  206. begin
  207.  
  208.   TSMouseConnectionStart.Brush.Color := clWhite;
  209.   StatusBar1.SimpleText              := '';
  210.   Count                              := Length(VTComponents);
  211.  
  212.   // Make sure the connection hasn't already created
  213.   for i := 0 to Count-1 do
  214.     for j := 0 to Count-1 do
  215.       if ((VTComponents[i].Connection1 = TSMouseConnectionStart) and (VTComponents[j].Connection2 = ConnectTo)) or
  216.        ((VTComponents[j].Connection1 = TSMouseConnectionStart) and (VTComponents[i].Connection2 = ConnectTo)) then begin
  217.           TSMouseConnectionStart := nil;
  218.           Exit;
  219.         end;
  220.  
  221.   SetLength(VTComponents, Count + 1);
  222.   with VTComponents[Count] do begin
  223.     ComponentType  := Connection;
  224.     ComponentImage := nil;
  225.     Connection1    := TSMouseConnectionStart;
  226.     Connection2    := ConnectTo;
  227.   end;
  228.   TSMouseConnectionStart := nil;
  229.   Invalidate;
  230.  
  231. end;
  232.  
  233. // Show a popup menu or create a new connection or start dragging
  234. procedure TForm1.TSMouseDown(Sender: TObject; Button: TMouseButton;
  235.   Shift: TShiftState; X, Y: Integer);
  236. begin
  237.  
  238.   if not(Sender is TShape) then Exit;
  239.   TSMouseSelected := (Sender as TShape);
  240.  
  241.   // Right click
  242.   if (Shift = [ssRight]) and (TSMouseConnectionStart = nil) and (Length(VTComponents) > 1) then
  243.     mnuComponent.PopUp(Mouse.CursorPos.x, Mouse.CursorPos.y);
  244.  
  245.   // Left click
  246.   if (Shift = [ssLeft]) then begin
  247.     if (TSMouseConnectionStart <> nil) then
  248.       VTCreateConnection(TSMouseSelected);
  249.     TSMouseClickedX := X;
  250.     TSMouseClickedY := Y;
  251.     TSMouseClicked  := True;
  252.   end;
  253.  
  254. end;
  255.  
  256. // Highlight the TShape
  257. procedure TForm1.TSMouseEnter(Sender: TObject);
  258. begin
  259.   if not(Sender is TShape) then Exit;
  260.   if (Sender = TSMouseConnectionStart) then Exit;
  261.   (Sender as TShape).Brush.Color := clRed;
  262. end;
  263.  
  264. // Remove the highlight
  265. procedure TForm1.TSMouseLeave(Sender: TObject);
  266. begin
  267.   if not(Sender is TShape) then Exit;
  268.   if (Sender = TSMouseConnectionStart) then Exit;
  269.   (Sender as TShape).Brush.Color := clWhite;
  270. end;
  271.  
  272. // Dragging a TShape
  273. procedure TForm1.TSMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer
  274.   );
  275. begin
  276.   if not(Sender is TShape) or not(TSMouseClicked) then Exit;
  277.   (Sender as TShape).Left := (Sender as TShape).Left + X - TSMouseClickedX;
  278.   (Sender as TShape).Top  := (Sender as TShape).Top  + Y - TSMouseClickedY;
  279.   if (TSMouseClicked) then Invalidate; // Redraw connections
  280. end;
  281.  
  282. // Mouse release
  283. procedure TForm1.TSMouseUp(Sender: TObject; Button: TMouseButton;
  284.   Shift: TShiftState; X, Y: Integer);
  285. begin
  286.   TSMouseClicked := False;
  287. end;
  288.  
  289. end.

The code is easy to understand, it's less than 300 LOC. It uses TShape to solve the object picking problem, most parts of the code are for handling the TShape's mouse events.

It is not optimized and not suitable for professional use. I just want to show the idea that simple TShape can be used to solve the diagram drawing issue. Maybe some newbies can learn something from the code.

taazz

  • Hero Member
  • *****
  • Posts: 5081
Re: Visual Pascal Community Edition
« Reply #10 on: April 25, 2018, 02:35:18 pm »
an other library for diagram design is https://github.com/taazz/evssimplegraph
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

valdir.marcos

  • Sr. Member
  • ****
  • Posts: 381
Re: Visual Pascal Community Edition
« Reply #11 on: April 25, 2018, 07:38:01 pm »
I'd like to figure out how to make this project in a time of a month.

@Researching, please read my previous links...
Having an UML tool for Free Pascal and Lazarus is being discussed in this forum for more than 10 years and nothing is ready so far...
I also agree that it is important tool, but it is a very complex project demanding a bunch of work for a long time.
You can do it yourself by improving your skills or by paying some people already skilled for, but don't hope people doing it for free for you in a short time frame.

Porting StarUML ???
December 19, 2007
http://forum.lazarus.freepascal.org/index.php/topic,4754.msg24865.html#msg24865

RAW

  • Hero Member
  • *****
  • Posts: 664
Re: Visual Pascal Community Edition
« Reply #12 on: April 25, 2018, 08:10:09 pm »
Quote
an other library for diagram design is https://github.com/taazz/evssimplegraph

hmmm... nice component... not as good as the colorpicker but very nice...  :) :P
Windows 7 Pro (x64 Sp1) And Windows XP Pro (x86 Sp3) - LAZARUS 1.8.2 FPC 3.0.4 // 1.7 FPC 3.1.1

Researching

  • New member
  • *
  • Posts: 9
Re: Visual Pascal Community Edition
« Reply #13 on: April 25, 2018, 11:26:32 pm »
EvsSimpleGraph.v1 - looks to be the most mature of all by now.
At least: onCreate Vizard, labels for objects. my TODO: learn src.

It would be allmost ready for the flowchart level.
« Last Edit: April 25, 2018, 11:28:07 pm by Researching »

Researching

  • New member
  • *
  • Posts: 9
Re: Visual Pascal Community Edition
« Reply #14 on: April 25, 2018, 11:42:07 pm »
EvsSimpleGraph.v1 - looks to be the most mature of all by now.
At least: onCreate Vizard, labels for objects. my TODO: learn src.
It would be allmost ready for the flowchart level.

To Valdir.Marcos,

I actually know that the problem exists. My point of view is:
Escape from being bond to standards. There is a concept what you actually need (I mentioned in first 2 posts) and it is not UML.
It should make thing simple. UML has been discussed as "complicated". So why to do?
People don't think in UML natively. The tool must either implement the whole methodology protocol (which IS complicated), or go KISS, to represent native thinking. With some (most simple and robust) methodology elements. BUT with capabilities to adopt. to particular requirements.

there are actually three things:
text implementation level
graphix representation level
connecting bidirectional deploying process.

And the main is the last. If I'd like to implement it for particular methodology - yes it would be huge work.
But if I go to make the system customizable? so you can set shape properties and text generating/parsing options on the go?
Ok, regExps would be needed for parser...
But then you actually have a tool, that can graphically handle virtually any methodology... and any language...
The main question is to be able to control textFiles-graph linkage.

Right?







« Last Edit: April 25, 2018, 11:44:22 pm by Researching »

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus