Recent

Author Topic: FreePascal text mode dialog designer for Free Vision  (Read 44962 times)

x2nie

  • Sr. Member
  • ****
  • Posts: 478
  • Impossible=I don't know the way
    • impossible is nothing - www.x2nie.com
Re: FreePascal text mode dialog designer for Free Vision
« Reply #45 on: April 25, 2017, 01:24:19 pm »
and here is what if it run (in windows):

(actually it is debugging inside Lazarus, just like another normal CONSOLE applications)
« Last Edit: April 25, 2017, 01:35:49 pm by x2nie »
When you were logged in, you can see attachments.
Lazarus Trunk @ Windows7 64bit, XP 32bit, Debian under VirtualMachine

x2nie

  • Sr. Member
  • ****
  • Posts: 478
  • Impossible=I don't know the way
    • impossible is nothing - www.x2nie.com
Re: FreePascal text mode dialog designer for Free Vision
« Reply #46 on: April 25, 2017, 01:33:32 pm »
BTW: I also work on something like FV2
- using classes not objects,
- using Enumerators instead of Callbacks.
- objpas support
... if someone like
very interesting !!
If you put the source code somewhere (sourceforge or github), I may quickly adapt my `TUI` widgets to yours.
Currently I am stuck with TUI, since it just experimental approach, not yet completed.
For example, TUI didnt support mouse, even it is able to.




Now that is awesome news!!! I believe that was on many peoples wish lists - mine included
agree. me too.
When you were logged in, you can see attachments.
Lazarus Trunk @ Windows7 64bit, XP 32bit, Debian under VirtualMachine

avra

  • Hero Member
  • *****
  • Posts: 1663
    • Additional info
Re: FreePascal text mode dialog designer for Free Vision
« Reply #47 on: April 25, 2017, 02:00:16 pm »
Ok, after getting used to it all components work except ListBox. Here is generated code for a dialog with Buttons, StaticText, ParamText, InputLine, RadioButtons, CheckBoxes and MultiCheckBoxes:

Code: Pascal  [Select]
  1. unit ComplexDialog;
  2.  
  3. interface
  4.  
  5. uses Objects, Views, Dialogs;
  6.  
  7. { TestDialog }
  8.  
  9. type
  10.         PTestDialog = ^TTestDialog;
  11.         TTestDialog = object(TDialog)
  12.                 constructor Init;
  13.         end;
  14.  
  15.         PTestData = ^TTestData;
  16.         TTestData = record
  17.                 ParName1: ;
  18.                 LabelDataName: string[80];
  19.                 Mode: word;
  20.                 Options: word;
  21.                 Choices: longint;
  22.         end;
  23.  
  24. implementation
  25.  
  26. uses Menus;
  27.  
  28. { TestDialog }
  29.  
  30. constructor TTestDialog.Init;
  31. var
  32.         R: TRect;
  33.         RB: PRadioButtons;
  34.         CB: PCheckBoxes;
  35.         MB: PMultiCheckBoxes;
  36. begin
  37.         R.Assign(4, 4, 65, 47);
  38.         inherited Init(R, 'Test Dialog');
  39.         Options:= Options or ofCentered;
  40.  
  41.         R.Assign(48, 39, 58, 41);
  42.         Insert(New(PButton, Init(R, '~O~k', cmOK, bfDefault)));
  43.  
  44.         R.Assign(36, 39, 46, 41);
  45.         Insert(New(PButton, Init(R, 'C~a~ncel', cmCancel, bfNormal)));
  46.  
  47.         R.Assign(2, 2, 15, 3);
  48.         Insert(New(PStaticText, Init(R, 'MyStaticText1')));
  49.  
  50.         R.Assign(18, 2, 30, 3);
  51.         Insert(New(PParamText, Init(R, 'MyParamText1', 0)));
  52.  
  53.         R.Assign(3, 39, 26, 41);
  54.         Insert(New(PButton, Init(R, '~M~yButton', cmMyButton, bfBroadcast)));
  55.  
  56.         R.Assign(2, 5, 57, 6);
  57.         IL:= New(PInputLine, Init(R, 80));  Insert(IL);
  58.         R.Assign(2, 4, 14, 5);
  59.         Insert(New(PLabel, Init(R, '~L~abel name', IL)));
  60.  
  61.         R.Assign(2, 8, 17, 10);
  62.         RB:= New(PRadioButtons, Init(R,
  63.                 NewSItem('Radio1',
  64.                 NewSItem('Radio2',
  65.                 nil))
  66.         ));  Insert(RB);
  67.         R.Assign(2, 7, 8, 8);
  68.         Insert(New(PLabel, Init(R, '~M~ode', RB)));
  69.  
  70.         R.Assign(2, 12, 22, 15);
  71.         CB:= New(PCheckBoxes, Init(R,
  72.                 NewSItem('Checkbox1',
  73.                 NewSItem('Checkbox2',
  74.                 NewSItem('Checkbox3',
  75.                 nil)))
  76.         ));  Insert(CB);
  77.         R.Assign(2, 11, 11, 12);
  78.         Insert(New(PLabel, Init(R, '~O~ptions', CB)));
  79.  
  80.         R.Assign(2, 18, 25, 22);
  81.         MB:= New(PMultiCheckBoxes, Init(R,
  82.                 NewSItem('MultiCharacter1',
  83.                 NewSItem('MultiCharacter2',
  84.                 NewSItem('MultiCharacter3',
  85.                 NewSItem('MultiCharacter4',
  86.                 nil)))), 5, cfFourBits, '@#$%&'));
  87.         Insert(MB);
  88.         R.Assign(2, 17, 11, 18);
  89.         Insert(New(PLabel, Init(R, '~C~hoices', MB)));
  90. end; {TTestDialog.Init}
  91.  
  92. begin end.
  93.  
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

Graeme

  • Hero Member
  • *****
  • Posts: 1430
    • Graeme on the web
Re: FreePascal text mode dialog designer for Free Vision
« Reply #48 on: April 26, 2017, 10:28:23 am »
I proof that TextMode is not problem for Lazarus (see picture below)
Pretty much what I was trying to explain is possible with fpGUI's UIDesigner. :)

There are some finer details to work out, but nothing to serious. eg: I would also add that you can't do component positioning in pixels, so I would use fpGUI's UIDesigners "snap to grid" setting (eg: where it snaps components to an invisible grid every 4 or 8 etc pixels - user defined) and use that to convert pixels dimensions and positioning information into text dimensions and positioning.
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

jc99

  • Hero Member
  • *****
  • Posts: 527
    • My private Site
Re: FreePascal text mode dialog designer for Free Vision
« Reply #49 on: April 27, 2017, 04:30:26 pm »
So first here is my patched FV version ...
OS: Win XP x64, Win 7, Win 7 x64, Win 10, Win 10 x64, Suse Linux 13.2
Laz: 1.4 - 1.8.4, 2.0
https://github.com/joecare99/public
'~|    /''
,_|oe \_,are
If you want to do something for the environment: Twitter: #reduceCO2 or
https://www.betterplace.me/klimawandel-stoppen-co-ueber-preis-reduzieren

jc99

  • Hero Member
  • *****
  • Posts: 527
    • My private Site
Re: FreePascal text mode dialog designer for Free Vision
« Reply #50 on: April 27, 2017, 04:58:11 pm »
I also got the IDE running with objfpc-mode
with this patch
OS: Win XP x64, Win 7, Win 7 x64, Win 10, Win 10 x64, Suse Linux 13.2
Laz: 1.4 - 1.8.4, 2.0
https://github.com/joecare99/public
'~|    /''
,_|oe \_,are
If you want to do something for the environment: Twitter: #reduceCO2 or
https://www.betterplace.me/klimawandel-stoppen-co-ueber-preis-reduzieren

jc99

  • Hero Member
  • *****
  • Posts: 527
    • My private Site
Re: FreePascal text mode dialog designer for Free Vision
« Reply #51 on: April 27, 2017, 06:04:27 pm »
@Graeme:
You have a nice piece of work with you fpGUI and the UIDesigner.
My goal here with DialEdit is that it can be integrated in the IDE.
OS: Win XP x64, Win 7, Win 7 x64, Win 10, Win 10 x64, Suse Linux 13.2
Laz: 1.4 - 1.8.4, 2.0
https://github.com/joecare99/public
'~|    /''
,_|oe \_,are
If you want to do something for the environment: Twitter: #reduceCO2 or
https://www.betterplace.me/klimawandel-stoppen-co-ueber-preis-reduzieren

avra

  • Hero Member
  • *****
  • Posts: 1663
    • Additional info
Re: FreePascal text mode dialog designer for Free Vision
« Reply #52 on: April 29, 2017, 12:52:30 am »
Maybe someone following this topic will find this TUI framework useful:
http://forum.lazarus.freepascal.org/index.php/topic,22894.msg135893.html
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

x2nie

  • Sr. Member
  • ****
  • Posts: 478
  • Impossible=I don't know the way
    • impossible is nothing - www.x2nie.com
Re: FreePascal text mode dialog designer for Free Vision
« Reply #53 on: April 29, 2017, 10:33:09 am »
Maybe someone following this topic will find this TUI framework useful:
http://forum.lazarus.freepascal.org/index.php/topic,22894.msg135893.html


Yes, very useful to know JATUIF (the link), even it was confused me in first time, because he (re)introduced a vital class: TComponent in unit JATUIF_Component.pas
Bytheway, it is the first working console app I knew, that uses "visual" component that didn't use FreepascalVision (view.pas) completely,
meaning that we can learn how if "FV" built in another implementation.


@avra, thanks for that nice info 8-)
« Last Edit: April 29, 2017, 10:34:48 am by x2nie »
When you were logged in, you can see attachments.
Lazarus Trunk @ Windows7 64bit, XP 32bit, Debian under VirtualMachine

korba812

  • Full Member
  • ***
  • Posts: 104
Re: FreePascal text mode dialog designer for Free Vision
« Reply #54 on: April 29, 2017, 03:33:43 pm »
I would start with redesigning backend. Currently, FV supports only single-byte character set. I think support for multibyte character set (utf8, utf16) should be added. And (if I remember correctly) FV has a strictly limited maximum buffer size (160x160 or something like that). In addition, I proposes to get rid of "ifdef mess" and design drivers in object-oriented way.

I currently manage the code written in old Clipper / Harbor. There is a GT system (Graphics Terminal) where you can select a terminal driver. For example, the same program can be run in the console or run in graphical mode (eg. A standard window that emulates text mode). It would be nice to have something like this in pascal tui.

jc99

  • Hero Member
  • *****
  • Posts: 527
    • My private Site
Re: FreePascal text mode dialog designer for Free Vision
« Reply #55 on: April 29, 2017, 04:00:09 pm »
@korba812
That's what I try to do with FV2.

@x2nie
If it's only about a working console app with visual design elements & mouse support, then look at my K_Vision System...
 
« Last Edit: April 29, 2017, 04:04:27 pm by jc99 »
OS: Win XP x64, Win 7, Win 7 x64, Win 10, Win 10 x64, Suse Linux 13.2
Laz: 1.4 - 1.8.4, 2.0
https://github.com/joecare99/public
'~|    /''
,_|oe \_,are
If you want to do something for the environment: Twitter: #reduceCO2 or
https://www.betterplace.me/klimawandel-stoppen-co-ueber-preis-reduzieren

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7356
Re: FreePascal text mode dialog designer for Free Vision
« Reply #56 on: April 29, 2017, 04:17:01 pm »
BTW: I also work on something like FV2
- using classes not objects,
- using Enumerators instead of Callbacks.
- objpas support
... if someone like

Some Errors in DialEdit are due to the fact that i upgraded my fv to be objpas compatible
e.G: string_var[0] -> length(string_var)

And automated rather than manual streaming?  I pretty much reached the same conclusion about 10 years ago, except for the enumerators bit(which I assume is an attempt at multicast events?), but both Florian and I considered it too hard to rewrite the current codebase with so much changes, and starting over would be better.

... which I put off till retirement :-)

avra

  • Hero Member
  • *****
  • Posts: 1663
    • Additional info
Re: FreePascal text mode dialog designer for Free Vision
« Reply #57 on: April 29, 2017, 09:35:20 pm »
If it's only about a working console app with visual design elements & mouse support, then look at my K_Vision System...
I looked at your github projects but couldn't find it. Am I missing something obvious?
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

x2nie

  • Sr. Member
  • ****
  • Posts: 478
  • Impossible=I don't know the way
    • impossible is nothing - www.x2nie.com
Re: FreePascal text mode dialog designer for Free Vision
« Reply #58 on: April 30, 2017, 08:20:21 am »
@x2nie
If it's only about a working console app with visual design elements & mouse support, then look at my K_Vision System...
Ooops, I was very bad with that my very limited english words.
Perhaps I must said: "Wow, JATUIF run out of the box, his `TComponent` is not the common known `TComponent`, and he reinvent the wheel by reintroducing the new way of how trigger events and how to use the properties. No offense, but it just run well out of the box."


@jc99, yeah. your K_Vision System look as good ! 8)


...
I currently manage the code written in old Clipper / Harbor. There is a GT system (Graphics Terminal) where you can select a terminal driver. For example, the same program can be run in the console or run in graphical mode (eg. A standard window that emulates text mode). It would be nice to have something like this in pascal tui.
@korba812, any screenshot we can see?
When you were logged in, you can see attachments.
Lazarus Trunk @ Windows7 64bit, XP 32bit, Debian under VirtualMachine

jc99

  • Hero Member
  • *****
  • Posts: 527
    • My private Site
off topic !
@avra
You are right, the K_Vision system is not public it's closed source because it has copyrighted material in it.
However i have the source, the Original was from 1996, but I managed to get it working on modern compilers. ( fpc/lazarus & various delphi versions)
at the moment the delphi version is stuck the keyboard-events are not fired anymore, but the lazarus version is fine.
both versions compile 32/64-bit.
on topic !
but there is no designer with it...
« Last Edit: April 30, 2017, 08:28:05 am by jc99 »
OS: Win XP x64, Win 7, Win 7 x64, Win 10, Win 10 x64, Suse Linux 13.2
Laz: 1.4 - 1.8.4, 2.0
https://github.com/joecare99/public
'~|    /''
,_|oe \_,are
If you want to do something for the environment: Twitter: #reduceCO2 or
https://www.betterplace.me/klimawandel-stoppen-co-ueber-preis-reduzieren