<html><head></head><body><div class="ydpc42334e2yahoo-style-wrap" style=""><div style="font-family: times new roman, new york, times, serif; font-size: 13px;"></div>
        <div style=""><div style="font-family: times new roman, new york, times, serif; font-size: 13px;">Hi Guys <br></div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;"><br></div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;">In a recent digest Michael asked what support we needed to organize ourselves better.</div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;"><br></div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;">My suggestion is that we need to understand the different features / objectives of the various UI component projects. Sometimes we may be duplicating each other’s work so could share the effort. Sometimes we may be aiming at very different objectives so projects can add value by existing in parallel.</div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;"><br></div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;">Can we have a wiki page somewhere with an overview or a comparison table that we could update giving the status and key features of each project identifying possible overlap (or missing features) where collaboration or shared code may be a good idea?</div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;"><br></div><div style="">As an initial entry on such a page I have attached below a draft description of the thinking behind our XComponents/XIDE project. I have also provided a HTML demo  to illustrate the current status and direction of the XIDE project.. (also see  Pas2js Digest, Vol 3, Issue 19 et seq for the Lazarus XComponent discussion)</div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;"><br></div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;">Regards Steve</div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;"><br></div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;">--------------------------------------------------------------------------------------------------------------------</div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;"><br></div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;">XComponents/XIDE</div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;"><br></div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;">Our Objective is to allow non-specialists to get started with Pascal programming for the Web (or elsewhere) with minimal installation or learning curve and then allow easy project migration to the desktop and Lazarus or full stack JavaScript development as user skills and project requirements mature.</div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;"><br></div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;">In order to achieve this we…..</div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;">1) Restrict layout  to only use  nested containers (simple Responsive Design)</div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;">2) Provide a run time module for each of Web/Mobile/Desktop etc which then allows programs to run on all of them without modification.  (This uses the Pascal compiler built in to the run time but is otherwise Similar to a subset of Silverlight/Flash functionality)</div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;">3) Build an “Entry Level” IDE using these components so it will also run on any of these environments. (see attached Browser example)</div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;">4) In that IDE, “everything is a tree”.  So the code footprint is minimized and it is as easy as possible to learn and extend the functionality ideally without needing to read the manual other than the Quick Start section..</div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;">5) All the components are native to HTML and have run time equivalents in Lazarus so projects can be extended in either web or desktop environments when they outgrow the entry-level stage.</div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;"><br></div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;">Our core interest is the entry level IDE issues. To work on this we have had to create a Lazarus component set that works consistently in the Lazarus IDE, as well as Windows/Unix at run time  and in the Browser.  It will be great if this can be superseded in due course by proper Lazarus controls that do the same thing (and more!).</div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;"><br></div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;">--------------------------------------------------------------------------------------------------------------------</div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;"><br></div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;">P.S.  The attached Web page shows our “XIDE” environment working in the Browser (Tested in Chrome). It is all very “Alpha Test”  at the moment but hopefully it will give you a good idea of where we are heading.  </div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;"><br></div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;">To view the demo, load the following DropBox directory…… </div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;"><br></div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;">https://www.dropbox.com/sh/401ua59t0qmossd/AACVS4j2NJoLnPivKhfL7S3fa?dl=0  </div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;"><br></div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;">……..Then load the Web page XIDEMain.HTML using Chrome. This will load the IDE. You can then just drag and drop components from the resources tree to the instance tree and use layout containers in this tree to control placement on the screen in a way that adapts to different screen sizes. </div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;"><br></div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;">Alternatively you can load a saved system by putting the text from DemoSystem.txt on the clipboard and selecting “System/Load” from the main menu. </div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;"><br></div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;">To see the event code behind the “Calculate Depth Plot” button hit the ellipsis button to the right of the “ButtonPress” event for that button  in the object inspector. </div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;"><br></div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;">To change the plot, modify one of the numbers in the string grid and re calculate the depth plot.</div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;"><br></div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;">PPS. The Pascal to Javascript transpiling we are using is a temporary fix pending Pas2JS being able to compile itself so please do not worry about loose ends in that area. If you get a message “JS SYNTAX ERROR: testit is not defined” when you switch from design mode to run mode this can be safely ignored.</div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;"> </div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;">----------------------------------------------------------------------------------------------------------------------------</div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;"><br></div></div><div style="font-family: times new roman, new york, times, serif; font-size: 13px;"><br></div>
        
        </div><div id="ydp8daf2490yahoo_quoted_1389882169" class="ydp8daf2490yahoo_quoted">
            <div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
                
                <div>
                    On Tuesday, 30 October 2018, 09:45:17 GMT,  <pas2js-request@lists.freepascal.org> wrote:
                </div>
                <div><br></div>
                <div><br></div>
                <div><div dir="ltr">Send Pas2js mailing list submissions to<br></div><div dir="ltr">    <a href="mailto:pas2js@lists.freepascal.org" rel="nofollow" target="_blank">pas2js@lists.freepascal.org</a><br></div><div dir="ltr"><br></div><div dir="ltr">To subscribe or unsubscribe via the World Wide Web, visit<br></div><div dir="ltr">    <a href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/pas2js" rel="nofollow" target="_blank">http://lists.freepascal.org/cgi-bin/mailman/listinfo/pas2js</a><br></div><div dir="ltr">or, via email, send a message with subject or body 'help' to<br></div><div dir="ltr">    <a href="mailto:pas2js-request@lists.freepascal.org" rel="nofollow" target="_blank">pas2js-request@lists.freepascal.org</a><br></div><div dir="ltr"><br></div><div dir="ltr">You can reach the person managing the list at<br></div><div dir="ltr">    <a href="mailto:pas2js-owner@lists.freepascal.org" rel="nofollow" target="_blank">pas2js-owner@lists.freepascal.org</a><br></div><div dir="ltr"><br></div><div dir="ltr">When replying, please edit your Subject line so it is more specific<br></div><div dir="ltr">than "Re: Contents of Pas2js digest..."<br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr">Today's Topics:<br></div><div dir="ltr"><br></div><div dir="ltr">   1. Re: Cases (Michael Van Canneyt)<br></div><div dir="ltr">   2. Re: Cases (cbsistem)<br></div><div dir="ltr">   3. Re: Cases (heliosroots)<br></div><div dir="ltr">   4. Re: Cases (heliosroots)<br></div><div dir="ltr">   5. Re: Cases (cbsistem)<br></div><div dir="ltr">   6. Re: Cases (heliosroots)<br></div><div dir="ltr">   7. Re: Cases (cbsistem)<br></div><div dir="ltr">   8. Re: Cases (heliosroots)<br></div><div dir="ltr">   9. Re: Cases (Michael Van Canneyt)<br></div><div dir="ltr">  10. Re: i18n (warleyalex)<br></div><div dir="ltr">  11. Re: i18n (Ulrich, Christian)<br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr">----------------------------------------------------------------------<br></div><div dir="ltr"><br></div><div dir="ltr">Message: 1<br></div><div dir="ltr">Date: Mon, 29 Oct 2018 12:19:05 +0100<br></div><div dir="ltr">From: "Michael Van Canneyt" <<a href="mailto:michael@freepascal.org" rel="nofollow" target="_blank">michael@freepascal.org</a>><br></div><div dir="ltr">To: "pas2js discussions" <<a href="mailto:pas2js@lists.freepascal.org" rel="nofollow" target="_blank">pas2js@lists.freepascal.org</a>><br></div><div dir="ltr">Subject: Re: [Pas2js] Cases<br></div><div dir="ltr">Message-ID:<br></div><div dir="ltr">    <<a href="mailto:51bca11ea731736a58d89362f66c9e58.squirrel@mail.freepascal.org" rel="nofollow" target="_blank">51bca11ea731736a58d89362f66c9e58.squirrel@mail.freepascal.org</a>><br></div><div dir="ltr">Content-Type: text/plain;charset=utf-8<br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr">> My questions: how lazarus core see the pas2js project? what is the path<br></div><div dir="ltr">> that<br></div><div dir="ltr">> this project will follow a component (ide plugin), or a lcl interface<br></div><div dir="ltr">> (Gtk,<br></div><div dir="ltr">> Win, Web)? the compiler (pas2js) will be integrated into the compiler<br></div><div dir="ltr">> (FPC)?<br></div><div dir="ltr">> are many doubts!<br></div><div dir="ltr"><br></div><div dir="ltr">Ideally, pas2js is just another FPC platform and a lazarus LCL Widgetset.<br></div><div dir="ltr">The problem is that then the LCL must be compilable by pas2js.<br></div><div dir="ltr">This is not yet the case.<br></div><div dir="ltr"><br></div><div dir="ltr">A lazarus LCL widgetset is based on a 'native' widgetset (Qt, Gtk etc)<br></div><div dir="ltr">That means  that first these native widgets must be created for Web.<br></div><div dir="ltr">Both your and warleyalex efforts can be used as a starting point, later<br></div><div dir="ltr">the LCL integration can be done on top of these widgets.<br></div><div dir="ltr"><br></div><div dir="ltr">> Which approaches are better mine or warleyalex, neither of the 2 are<br></div><div dir="ltr">> private<br></div><div dir="ltr">> ... the best approach would be a new one from the community.<br></div><div dir="ltr"><br></div><div dir="ltr">I didn't take a detailed look yet at the architecture of both approaches,<br></div><div dir="ltr">so I cannot yet comment on this in a detailed manner:<br></div><div dir="ltr">After my superficial look at the code, warleyalex' approach with the J*<br></div><div dir="ltr">units seems OK, but I still need to compare it with your files.<br></div><div dir="ltr"><br></div><div dir="ltr">So, from my perspective: both your and his code can serve as a basis for a<br></div><div dir="ltr">set of web widgets, on which a LCL widgetset can be built.<br></div><div dir="ltr"><br></div><div dir="ltr">At the same time, there is nothing stopping you from using the custom<br></div><div dir="ltr">designer approach in the IDE to design a HTML form today. or as an<br></div><div dir="ltr">alternative, the embedded chromium approach could be used to design the<br></div><div dir="ltr">form.<br></div><div dir="ltr"><br></div><div dir="ltr">There are many possible roads: which one is the best is still up for<br></div><div dir="ltr">discussion, I think.<br></div><div dir="ltr"><br></div><div dir="ltr">Michael.<br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr">------------------------------<br></div><div dir="ltr"><br></div><div dir="ltr">Message: 2<br></div><div dir="ltr">Date: Mon, 29 Oct 2018 07:09:26 -0500 (CDT)<br></div><div dir="ltr">From: cbsistem <<a href="mailto:cbsistem@yahoo.com.br" rel="nofollow" target="_blank">cbsistem@yahoo.com.br</a>><br></div><div dir="ltr">To: <a href="mailto:pas2js@lists.freepascal.org" rel="nofollow" target="_blank">pas2js@lists.freepascal.org</a><br></div><div dir="ltr">Subject: Re: [Pas2js] Cases<br></div><div dir="ltr">Message-ID: <<a href="mailto:1540814966315-0.post@n8.nabble.com" rel="nofollow" target="_blank">1540814966315-0.post@n8.nabble.com</a>><br></div><div dir="ltr">Content-Type: text/plain; charset=us-ascii<br></div><div dir="ltr"><br></div><div dir="ltr">@heliosroots <br></div><div dir="ltr">'Which approaches are better mine or warleyalex, neither of the 2 are<br></div><div dir="ltr">private <br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr">You said your project is not private. Is there a link to the download?<br></div><div dir="ltr"><br></div><div dir="ltr">Its component in runtime is based on <a href="https://github.com/FChrisF/LLCL. " rel="nofollow" target="_blank">https://github.com/FChrisF/LLCL. </a>OK .<br></div><div dir="ltr">And is WEBLib based on the TMS WEB Core or XComponents components or in<br></div><div dir="ltr">which?<br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr">Cristiano<br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr">--<br></div><div dir="ltr">Sent from: <a href="http://pas2js.38893.n8.nabble.com/" rel="nofollow" target="_blank">http://pas2js.38893.n8.nabble.com/</a><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr">------------------------------<br></div><div dir="ltr"><br></div><div dir="ltr">Message: 3<br></div><div dir="ltr">Date: Mon, 29 Oct 2018 07:34:10 -0500 (CDT)<br></div><div dir="ltr">From: heliosroots <<a href="mailto:heliosroots@gmail.com" rel="nofollow" target="_blank">heliosroots@gmail.com</a>><br></div><div dir="ltr">To: <a href="mailto:pas2js@lists.freepascal.org" rel="nofollow" target="_blank">pas2js@lists.freepascal.org</a><br></div><div dir="ltr">Subject: Re: [Pas2js] Cases<br></div><div dir="ltr">Message-ID: <<a href="mailto:1540816450756-0.post@n8.nabble.com" rel="nofollow" target="_blank">1540816450756-0.post@n8.nabble.com</a>><br></div><div dir="ltr">Content-Type: text/plain; charset=us-ascii<br></div><div dir="ltr"><br></div><div dir="ltr">No the project is private so far.<br></div><div dir="ltr"><br></div><div dir="ltr">Project and based on https://github.com/FChrisF/LLCL.<br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr">WEBLib, TMS WEB Core or XComponents I do not know them completely.<br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr">--<br></div><div dir="ltr">Sent from: <a href="http://pas2js.38893.n8.nabble.com/" rel="nofollow" target="_blank">http://pas2js.38893.n8.nabble.com/</a><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr">------------------------------<br></div><div dir="ltr"><br></div><div dir="ltr">Message: 4<br></div><div dir="ltr">Date: Mon, 29 Oct 2018 07:39:35 -0500 (CDT)<br></div><div dir="ltr">From: heliosroots <<a href="mailto:heliosroots@gmail.com" rel="nofollow" target="_blank">heliosroots@gmail.com</a>><br></div><div dir="ltr">To: <a href="mailto:pas2js@lists.freepascal.org" rel="nofollow" target="_blank">pas2js@lists.freepascal.org</a><br></div><div dir="ltr">Subject: Re: [Pas2js] Cases<br></div><div dir="ltr">Message-ID: <<a href="mailto:1540816775649-0.post@n8.nabble.com" rel="nofollow" target="_blank">1540816775649-0.post@n8.nabble.com</a>><br></div><div dir="ltr">Content-Type: text/plain; charset=us-ascii<br></div><div dir="ltr"><br></div><div dir="ltr">/// The problem is that LCL must be compiled by pas2js.<br></div><div dir="ltr">Exactly example is "Form.Showmodal" this has certain limitations in WEB,<br></div><div dir="ltr">there are many limitation, in my opinion a plugin / component would be the<br></div><div dir="ltr">best way today.<br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr">--<br></div><div dir="ltr">Sent from: <a href="http://pas2js.38893.n8.nabble.com/" rel="nofollow" target="_blank">http://pas2js.38893.n8.nabble.com/</a><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr">------------------------------<br></div><div dir="ltr"><br></div><div dir="ltr">Message: 5<br></div><div dir="ltr">Date: Mon, 29 Oct 2018 07:53:38 -0500 (CDT)<br></div><div dir="ltr">From: cbsistem <<a href="mailto:cbsistem@yahoo.com.br" rel="nofollow" target="_blank">cbsistem@yahoo.com.br</a>><br></div><div dir="ltr">To: <a href="mailto:pas2js@lists.freepascal.org" rel="nofollow" target="_blank">pas2js@lists.freepascal.org</a><br></div><div dir="ltr">Subject: Re: [Pas2js] Cases<br></div><div dir="ltr">Message-ID: <<a href="mailto:1540817618423-0.post@n8.nabble.com" rel="nofollow" target="_blank">1540817618423-0.post@n8.nabble.com</a>><br></div><div dir="ltr">Content-Type: text/plain; charset=UTF-8<br></div><div dir="ltr"><br></div><div dir="ltr">  an alternative to "Form.Showmodal" is to pass a CallBack function<br></div><div dir="ltr"><br></div><div dir="ltr">Function Form1.OnCloseCallback;<br></div><div dir="ltr">begin<br></div><div dir="ltr">   code<br></div><div dir="ltr">end;<br></div><div dir="ltr"><br></div><div dir="ltr">Form2.ShowModal (@OnCloseCallback);<br></div><div dir="ltr"><br></div><div dir="ltr">function Form2.OnClose;<br></div><div dir="ltr">begin<br></div><div dir="ltr">     if assigned (FOnCloseCallback) then<br></div><div dir="ltr">        OnCloseCallback;<br></div><div dir="ltr">end;<br></div><div dir="ltr"><br></div><div dir="ltr">in javascript we must always use Callback functions.<br></div><div dir="ltr"><br></div><div dir="ltr">Cristiano<br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr">--<br></div><div dir="ltr">Sent from: <a href="http://pas2js.38893.n8.nabble.com/" rel="nofollow" target="_blank">http://pas2js.38893.n8.nabble.com/</a><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr">------------------------------<br></div><div dir="ltr"><br></div><div dir="ltr">Message: 6<br></div><div dir="ltr">Date: Mon, 29 Oct 2018 07:58:13 -0500 (CDT)<br></div><div dir="ltr">From: heliosroots <<a href="mailto:heliosroots@gmail.com" rel="nofollow" target="_blank">heliosroots@gmail.com</a>><br></div><div dir="ltr">To: <a href="mailto:pas2js@lists.freepascal.org" rel="nofollow" target="_blank">pas2js@lists.freepascal.org</a><br></div><div dir="ltr">Subject: Re: [Pas2js] Cases<br></div><div dir="ltr">Message-ID: <<a href="mailto:1540817893220-0.post@n8.nabble.com" rel="nofollow" target="_blank">1540817893220-0.post@n8.nabble.com</a>><br></div><div dir="ltr">Content-Type: text/plain; charset=us-ascii<br></div><div dir="ltr"><br></div><div dir="ltr">Yes we use a similar solution ... more we are talking about compatibility<br></div><div dir="ltr">with LCL hj it does not support shomodal (proc) ... there are some<br></div><div dir="ltr">limitations.<br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr">--<br></div><div dir="ltr">Sent from: <a href="http://pas2js.38893.n8.nabble.com/" rel="nofollow" target="_blank">http://pas2js.38893.n8.nabble.com/</a><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr">------------------------------<br></div><div dir="ltr"><br></div><div dir="ltr">Message: 7<br></div><div dir="ltr">Date: Mon, 29 Oct 2018 08:35:04 -0500 (CDT)<br></div><div dir="ltr">From: cbsistem <<a href="mailto:cbsistem@yahoo.com.br" rel="nofollow" target="_blank">cbsistem@yahoo.com.br</a>><br></div><div dir="ltr">To: <a href="mailto:pas2js@lists.freepascal.org" rel="nofollow" target="_blank">pas2js@lists.freepascal.org</a><br></div><div dir="ltr">Subject: Re: [Pas2js] Cases<br></div><div dir="ltr">Message-ID: <<a href="mailto:1540820104539-0.post@n8.nabble.com" rel="nofollow" target="_blank">1540820104539-0.post@n8.nabble.com</a>><br></div><div dir="ltr">Content-Type: text/plain; charset=us-ascii<br></div><div dir="ltr"><br></div><div dir="ltr">In my ViewModal LCL view, it puts the processing into LOOP waiting for a<br></div><div dir="ltr">response, and processing does not continue until it is released. This<br></div><div dir="ltr">technique for javascript would not be acceptable. There is something about<br></div><div dir="ltr">this called PROMISE<br></div><div dir="ltr">(<a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise" rel="nofollow" target="_blank">https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise</a>)<br></div><div dir="ltr"><br></div><div dir="ltr">which is the promise to do something. That is at some point that code will<br></div><div dir="ltr">be executed.<br></div><div dir="ltr">Promisse basically uses two parameters, which would be 2 functions, one when<br></div><div dir="ltr">you have success and another when you have an error<br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr">TJSPromiseResolver<br></div><div dir="ltr"><br></div><div dir="ltr">You have demo \ promise \ utils.pp examples:<br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr">Cristiano<br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr">--<br></div><div dir="ltr">Sent from: <a href="http://pas2js.38893.n8.nabble.com/" rel="nofollow" target="_blank">http://pas2js.38893.n8.nabble.com/</a><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr">------------------------------<br></div><div dir="ltr"><br></div><div dir="ltr">Message: 8<br></div><div dir="ltr">Date: Mon, 29 Oct 2018 09:11:07 -0500 (CDT)<br></div><div dir="ltr">From: heliosroots <<a href="mailto:heliosroots@gmail.com" rel="nofollow" target="_blank">heliosroots@gmail.com</a>><br></div><div dir="ltr">To: <a href="mailto:pas2js@lists.freepascal.org" rel="nofollow" target="_blank">pas2js@lists.freepascal.org</a><br></div><div dir="ltr">Subject: Re: [Pas2js] Cases<br></div><div dir="ltr">Message-ID: <<a href="mailto:1540822267911-0.post@n8.nabble.com" rel="nofollow" target="_blank">1540822267911-0.post@n8.nabble.com</a>><br></div><div dir="ltr">Content-Type: text/plain; charset=us-ascii<br></div><div dir="ltr"><br></div><div dir="ltr">Yes I know and I use promise with Pas2JS ... Michael Van Canneyt said that it<br></div><div dir="ltr">is not yet possible to compile LCL with Pas2JS ... it is for these and other<br></div><div dir="ltr">limitations, so the initial doubt about which path the project is going to<br></div><div dir="ltr">follow has arisen.<br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr">--<br></div><div dir="ltr">Sent from: <a href="http://pas2js.38893.n8.nabble.com/" rel="nofollow" target="_blank">http://pas2js.38893.n8.nabble.com/</a><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr">------------------------------<br></div><div dir="ltr"><br></div><div dir="ltr">Message: 9<br></div><div dir="ltr">Date: Mon, 29 Oct 2018 21:03:04 +0100 (CET)<br></div><div dir="ltr">From: Michael Van Canneyt <<a href="mailto:michael@freepascal.org" rel="nofollow" target="_blank">michael@freepascal.org</a>><br></div><div dir="ltr">To: pas2js discussions <<a href="mailto:pas2js@lists.freepascal.org" rel="nofollow" target="_blank">pas2js@lists.freepascal.org</a>><br></div><div dir="ltr">Subject: Re: [Pas2js] Cases<br></div><div dir="ltr">Message-ID: <<a href="mailto:alpine.DEB.2.20.1810292057410.24324@home.telenet.be" rel="nofollow" target="_blank">alpine.DEB.2.20.1810292057410.24324@home.telenet.be</a>><br></div><div dir="ltr">Content-Type: text/plain; charset=US-ASCII; format=flowed<br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr">On Mon, 29 Oct 2018, heliosroots wrote:<br></div><div dir="ltr"><br></div><div dir="ltr">> Yes I know and I use promise with Pas2JS ... Michael Van Canneyt said that it<br></div><div dir="ltr">> is not yet possible to compile LCL with Pas2JS ... it is for these and other<br></div><div dir="ltr">> limitations, so the initial doubt about which path the project is going to<br></div><div dir="ltr">> follow has arisen.<br></div><div dir="ltr"><br></div><div dir="ltr">I think you should continue to create a web widgetset that is usable for web,<br></div><div dir="ltr">independent of LCL.<br></div><div dir="ltr"><br></div><div dir="ltr">For design-time support in the IDE, you can use 3 approaches<br></div><div dir="ltr">- Custom designer support (see the example provided in lazarus)<br></div><div dir="ltr">- CEF (Chromium Embedded)<br></div><div dir="ltr">- The TMS way of doing it: Design using LCL widgets, translate to  your widgetset.<br></div><div dir="ltr">  (the 'provides' support of lazarus packages can be useful here)<br></div><div dir="ltr"><br></div><div dir="ltr">Personally, I think CEF is the most powerful approach, bu Cudtom Designer is<br></div><div dir="ltr">probably the fastest (you can draw simply rectangles).<br></div><div dir="ltr"><br></div><div dir="ltr">At a later moment, an LCL widgetset can be built on top of the web widgetset.<br></div><div dir="ltr"><br></div><div dir="ltr">Michael.<br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr">------------------------------<br></div><div dir="ltr"><br></div><div dir="ltr">Message: 10<br></div><div dir="ltr">Date: Mon, 29 Oct 2018 21:18:02 -0500 (CDT)<br></div><div dir="ltr">From: warleyalex <<a href="mailto:warleyalex@yahoo.com.br" rel="nofollow" target="_blank">warleyalex@yahoo.com.br</a>><br></div><div dir="ltr">To: <a href="mailto:pas2js@lists.freepascal.org" rel="nofollow" target="_blank">pas2js@lists.freepascal.org</a><br></div><div dir="ltr">Subject: Re: [Pas2js] i18n<br></div><div dir="ltr">Message-ID: <<a href="mailto:1540865882299-0.post@n8.nabble.com" rel="nofollow" target="_blank">1540865882299-0.post@n8.nabble.com</a>><br></div><div dir="ltr">Content-Type: text/plain; charset=UTF-8<br></div><div dir="ltr"><br></div><div dir="ltr">An alternative way of doing it without recourceStrings would e.g. be create<br></div><div dir="ltr">JSON files per language, with a data attribute assigned used for each<br></div><div dir="ltr">component used, and a key for each string.<br></div><div dir="ltr"><br></div><div dir="ltr">unit uinternationalization;<br></div><div dir="ltr"><br></div><div dir="ltr">(* ╔══════════════════════════════════════╗<br></div><div dir="ltr">   ║  i18n PROJECT                        ║<br></div><div dir="ltr">   ║  ----------------------------------- ║<br></div><div dir="ltr">   ║  created by: warleyalex              ║<br></div><div dir="ltr">   ╚══════════════════════════════════════╝ *)<br></div><div dir="ltr">{$mode objfpc}{$H+}<br></div><div dir="ltr"><br></div><div dir="ltr">interface<br></div><div dir="ltr"><br></div><div dir="ltr">uses<br></div><div dir="ltr">  JS, Web, Types, Math, Classes, SysUtils, uutils, unit1;<br></div><div dir="ltr"><br></div><div dir="ltr">type<br></div><div dir="ltr">  { TJSi18n }<br></div><div dir="ltr">  TJSi18n = class(TObject)<br></div><div dir="ltr">  private<br></div><div dir="ltr">    (* Private declarations *)<br></div><div dir="ltr">    xhttp: TJSXMLHttpRequest;<br></div><div dir="ltr">    langDocument: JSValue;<br></div><div dir="ltr">    //procedure bindEvent(element: TJSElement; EventType: String; handler:<br></div><div dir="ltr">JEventListenerHandler);<br></div><div dir="ltr">  protected<br></div><div dir="ltr">    (* Protected declarations *)<br></div><div dir="ltr">    procedure init;<br></div><div dir="ltr">    procedure switchLanguage(language: JSValue);<br></div><div dir="ltr">    procedure processLangDocument;<br></div><div dir="ltr">  public<br></div><div dir="ltr">    (* Public declarations *)<br></div><div dir="ltr">    constructor Create;<br></div><div dir="ltr"><br></div><div dir="ltr">    function DoFormLoad(Event: TEventListenerEvent): boolean;<br></div><div dir="ltr">    function DoFormAbort(Event: TEventListenerEvent): boolean;<br></div><div dir="ltr">  published<br></div><div dir="ltr">    (* Published declarations *)<br></div><div dir="ltr">    procedure InitializeObject;<br></div><div dir="ltr">  end;<br></div><div dir="ltr"><br></div><div dir="ltr">implementation<br></div><div dir="ltr"><br></div><div dir="ltr">{ TJSi18n }<br></div><div dir="ltr"><br></div><div dir="ltr">constructor TJSi18n.Create;<br></div><div dir="ltr">begin<br></div><div dir="ltr"><br></div><div dir="ltr">end;<br></div><div dir="ltr"><br></div><div dir="ltr">procedure TJSi18n.processLangDocument;<br></div><div dir="ltr">var<br></div><div dir="ltr">  tags: TJSNodeList;<br></div><div dir="ltr">  l: TJSArray;<br></div><div dir="ltr">  i: integer;<br></div><div dir="ltr"><br></div><div dir="ltr">  function LforEach(value: JSValue; index: NativeInt; anArray : TJSArray) :<br></div><div dir="ltr">Boolean;<br></div><div dir="ltr">  var<br></div><div dir="ltr">    key: String;<br></div><div dir="ltr">  begin<br></div><div dir="ltr">    key := String(<br></div><div dir="ltr">TJSObject(TJSHTMLElement(value).dataset).Properties['languagekey'] );<br></div><div dir="ltr"><br></div><div dir="ltr">    if(  TJSObject(langDocument)[key] ) then<br></div><div dir="ltr">      TJSElement (l.Elements[index]).innerText:= String(<br></div><div dir="ltr">TJSObject(langDocument)[key] );<br></div><div dir="ltr">  end;<br></div><div dir="ltr"><br></div><div dir="ltr">begin<br></div><div dir="ltr">  tags :=<br></div><div dir="ltr">document.querySelectorAll('span,img,a,label,li,option,h1,h2,h3,h4,h5,h6');<br></div><div dir="ltr">  l:= TJSArray.new;<br></div><div dir="ltr">  for i:=0 to tags.length - 1 do<br></div><div dir="ltr">    l.push(tags[i]);<br></div><div dir="ltr">  l.forEach( @LforEach );<br></div><div dir="ltr">end;<br></div><div dir="ltr"><br></div><div dir="ltr">function TJSi18n.DoFormLoad(Event: TEventListenerEvent): boolean;<br></div><div dir="ltr">begin<br></div><div dir="ltr">  if (xhttp.status = 200) and (xhttp.readyState = 4) then<br></div><div dir="ltr">  begin<br></div><div dir="ltr">   // If successful<br></div><div dir="ltr">   langDocument := TJSJSON.parse(xhttp.responseText);<br></div><div dir="ltr">   processLangDocument();<br></div><div dir="ltr">  end;<br></div><div dir="ltr"><br></div><div dir="ltr">  result := true;<br></div><div dir="ltr">end;<br></div><div dir="ltr"><br></div><div dir="ltr">function TJSi18n.DoFormAbort(Event: TEventListenerEvent): boolean;<br></div><div dir="ltr">begin<br></div><div dir="ltr">  //ShowMessage('Failed to load form HTML template file');<br></div><div dir="ltr">  WriteLn('Failed to load form HTML template file');<br></div><div dir="ltr">  Result := true;<br></div><div dir="ltr">end;<br></div><div dir="ltr"><br></div><div dir="ltr">procedure TJSi18n.init;<br></div><div dir="ltr">var<br></div><div dir="ltr">  tmp: TJSHTMLCollection;<br></div><div dir="ltr">  languages: TJSArray;<br></div><div dir="ltr">  i: integer;<br></div><div dir="ltr">  el: TJSHTMLElement;<br></div><div dir="ltr"><br></div><div dir="ltr">  procedure languageCallBack(event: TJSEvent);<br></div><div dir="ltr">  begin<br></div><div dir="ltr">    switchLanguage (<br></div><div dir="ltr">      (TJSHTMLElement(event.target).dataset).Properties['lang']<br></div><div dir="ltr">    );<br></div><div dir="ltr">  end;<br></div><div dir="ltr"><br></div><div dir="ltr">  function languageforEach(value: JSValue; index: NativeInt; anArray :<br></div><div dir="ltr">TJSArray) : Boolean;<br></div><div dir="ltr">  begin<br></div><div dir="ltr">    JElement (languages.Elements[index]).addEventListener('click',<br></div><div dir="ltr">@languageCallBack);<br></div><div dir="ltr">  end;<br></div><div dir="ltr"><br></div><div dir="ltr">begin<br></div><div dir="ltr">  tmp := document.getElementsByClassName('language');<br></div><div dir="ltr">  languages := TJSArray.new();<br></div><div dir="ltr">  for i:=0 to tmp.Length - 1 do<br></div><div dir="ltr">  languages.push(tmp[i]);<br></div><div dir="ltr"><br></div><div dir="ltr">  languages.forEach( @languageforEach );<br></div><div dir="ltr">end;<br></div><div dir="ltr"><br></div><div dir="ltr">procedure TJSi18n.switchLanguage(language: JSValue);<br></div><div dir="ltr">begin<br></div><div dir="ltr">  xhttp := TJSXMLHttpRequest.new();<br></div><div dir="ltr">  xhttp.addEventListener('load', @DoFormLoad);<br></div><div dir="ltr">  xhttp.addEventListener('abort', @DoFormAbort);<br></div><div dir="ltr">  xhttp.open('GET', 'i18n/' + String(language) + '.json', true);<br></div><div dir="ltr">  xhttp.setRequestHeader('Content-type','application/json');<br></div><div dir="ltr">  xhttp.setRequestHeader('Cache-Control','no-cache');<br></div><div dir="ltr">  xhttp.send();<br></div><div dir="ltr">end;<br></div><div dir="ltr"><br></div><div dir="ltr">procedure TJSi18n.InitializeObject;<br></div><div dir="ltr">begin<br></div><div dir="ltr">  console.log('i18n1.InitializeObject');<br></div><div dir="ltr">  init;<br></div><div dir="ltr">end;<br></div><div dir="ltr"><br></div><div dir="ltr">end.<br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr">LIVE PREVIEW: <a href="https://pas2js.github.io/master/proji18n/index.html" rel="nofollow" target="_blank">https://pas2js.github.io/master/proji18n/index.html</a><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr">--<br></div><div dir="ltr">Sent from: <a href="http://pas2js.38893.n8.nabble.com/" rel="nofollow" target="_blank">http://pas2js.38893.n8.nabble.com/</a><br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr">------------------------------<br></div><div dir="ltr"><br></div><div dir="ltr">Message: 11<br></div><div dir="ltr">Date: Tue, 30 Oct 2018 09:45:03 +0000<br></div><div dir="ltr">From: "Ulrich, Christian" <<a href="mailto:christian.ulrich@tcsag.de" rel="nofollow" target="_blank">christian.ulrich@tcsag.de</a>><br></div><div dir="ltr">To: pas2js discussions <<a href="mailto:pas2js@lists.freepascal.org" rel="nofollow" target="_blank">pas2js@lists.freepascal.org</a>><br></div><div dir="ltr">Subject: Re: [Pas2js] i18n<br></div><div dir="ltr">Message-ID:<br></div><div dir="ltr">    <<a href="mailto:20072D672807864B91DBC370126A25E4224B04ED@Server22.tcs.biz" rel="nofollow" target="_blank">20072D672807864B91DBC370126A25E4224B04ED@Server22.tcs.biz</a>><br></div><div dir="ltr">Content-Type: text/plain; charset="utf-8"<br></div><div dir="ltr"><br></div><div dir="ltr">Sry Michael, i have re-subscribed with the other adress. I was not aware that our exchange replaces the sender address even when I send the mail explicit from the "old" address.<br></div><div dir="ltr"><br></div><div dir="ltr">-----Ursprüngliche Nachricht-----<br></div><div dir="ltr">Von: Pas2js [mailto:<a href="mailto:pas2js-bounces@lists.freepascal.org" rel="nofollow" target="_blank">pas2js-bounces@lists.freepascal.org</a>] Im Auftrag von Michael Van Canneyt<br></div><div dir="ltr">Gesendet: Samstag, 27. Oktober 2018 12:58<br></div><div dir="ltr">An: pas2js discussions<br></div><div dir="ltr">Cc: Ulrich, Christian<br></div><div dir="ltr">Betreff: Re: [Pas2js] i18n<br></div><div dir="ltr"><br></div><div dir="ltr"><br></div><div dir="ltr">Christian,<br></div><div dir="ltr"><br></div><div dir="ltr">Your address <a href="mailto:christian.ulrich@tcsag.de" rel="nofollow" target="_blank">christian.ulrich@tcsag.de</a> is not subscribed to the list, which means I must always manually moderate your mail.<br></div><div dir="ltr"><br></div><div dir="ltr">Please subscribe, or use the address with which you are subscribed to the list when posting (which would seem to be <a href="mailto:ulrich@tcs-germany.de" rel="nofollow" target="_blank">ulrich@tcs-germany.de</a> instead of <a href="mailto:christian.ulrich@tcsag.de" rel="nofollow" target="_blank">christian.ulrich@tcsag.de</a>)<br></div><div dir="ltr"><br></div><div dir="ltr">Michael.<br></div><div dir="ltr"><br></div><div dir="ltr">On Fri, 26 Oct 2018, Ulrich, Christian wrote:<br></div><div dir="ltr"><br></div><div dir="ltr">> When pas2js would generate .res files we could use lazarus tools to <br></div><div dir="ltr">> generate .po file Then an separate program or pas2js itself could generate separate .js files that replace .current with an new value.<br></div><div dir="ltr">><br></div><div dir="ltr">><br></div><div dir="ltr">><br></div><div dir="ltr">><br></div><div dir="ltr">> Christian Ulrich<br></div><div dir="ltr">> Teamleiter Prüfmittelbau<br></div><div dir="ltr">><br></div><div dir="ltr">> ______________________________________________________________________<br></div><div dir="ltr">><br></div><div dir="ltr">><br></div><div dir="ltr">> TCS TürControlSysteme AG Geschwister-Scholl-Str. 7 | D-39307 Genthin <br></div><div dir="ltr">> Telefon +49 3933 8799-433 | Fax +49 3933 8799-84 | Mail <br></div><div dir="ltr">> <a href="mailto:christian.ulrich@tcsag.de" rel="nofollow" target="_blank">christian.ulrich@tcsag.de</a> | www.tcsag.de<br></div><div dir="ltr">><br></div><div dir="ltr">> Vorstand: Dipl.-Ing. (FH) Otto Duffner (Vorsitzender), Florian Herth<br></div><div dir="ltr">> Aufsichtsrat: Dipl. El. Ing FH/ EMBA Jörg Stocker Sitz der <br></div><div dir="ltr">> Gesellschaft: Genthin | HRB 3909 AG Stendal -----Ursprüngliche <br></div><div dir="ltr">> Nachricht-----<br></div><div dir="ltr">> Von: Pas2js [mailto:<a href="mailto:pas2js-bounces@lists.freepascal.org" rel="nofollow" target="_blank">pas2js-bounces@lists.freepascal.org</a>] Im Auftrag <br></div><div dir="ltr">> von Michael Van Canneyt<br></div><div dir="ltr">> Gesendet: Donnerstag, 25. Oktober 2018 16:10<br></div><div dir="ltr">> An: pas2js discussions<br></div><div dir="ltr">> Betreff: Re: [Pas2js] i18n<br></div><div dir="ltr">><br></div><div dir="ltr">><br></div><div dir="ltr">><br></div><div dir="ltr">> On Tue, 23 Oct 2018, Ulrich, Christian wrote:<br></div><div dir="ltr">><br></div><div dir="ltr">>> Hi,<br></div><div dir="ltr">>><br></div><div dir="ltr">>> Is there actually already an way to translate resourcestrings ?<br></div><div dir="ltr">>> How should an translation be done at the moment ?<br></div><div dir="ltr">><br></div><div dir="ltr">><br></div><div dir="ltr">> A resourcestring is a javascript object literal with 2 members.<br></div><div dir="ltr">> "org" and "current". I think the names are self-describing :)<br></div><div dir="ltr">><br></div><div dir="ltr">> When getting a resourcestring value, The rtl will first check the "current"<br></div><div dir="ltr">> value, and if it is empty, use the "org" value. The "org" value is <br></div><div dir="ltr">> created by the compiler when it creates the compiled unit.<br></div><div dir="ltr">><br></div><div dir="ltr">> So, to translate, create a javascript file which does the following:<br></div><div dir="ltr">><br></div><div dir="ltr">> pas["yourunit"].$resourcestrings.YourResourcestring.current = "The <br></div><div dir="ltr">> Translated Value";<br></div><div dir="ltr">><br></div><div dir="ltr">> Where<br></div><div dir="ltr">> "yourunit" is the name of a unit and YourResourcestring is the name of the resource string.<br></div><div dir="ltr">><br></div><div dir="ltr">> It should not be too difficult to create a program which extracts all <br></div><div dir="ltr">> resourcestrings from a program and creates such a file, which you can <br></div><div dir="ltr">> then translate. I will add it to my todo list.<br></div><div dir="ltr">><br></div><div dir="ltr">> Michael.<br></div><div dir="ltr">> _______________________________________________<br></div><div dir="ltr">> Pas2js maillist  -  <a href="mailto:Pas2js@lists.freepascal.org" rel="nofollow" target="_blank">Pas2js@lists.freepascal.org</a> <br></div><div dir="ltr">> <a href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/pas2js" rel="nofollow" target="_blank">http://lists.freepascal.org/cgi-bin/mailman/listinfo/pas2js</a><br></div><div dir="ltr">> _______________________________________________<br></div><div dir="ltr">> Pas2js maillist  -  <a href="mailto:Pas2js@lists.freepascal.org" rel="nofollow" target="_blank">Pas2js@lists.freepascal.org</a> <br></div><div dir="ltr">> <a href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/pas2js" rel="nofollow" target="_blank">http://lists.freepascal.org/cgi-bin/mailman/listinfo/pas2js</a><br></div><div dir="ltr"><br></div><div dir="ltr">------------------------------<br></div><div dir="ltr"><br></div><div dir="ltr">Subject: Digest Footer<br></div><div dir="ltr"><br></div><div dir="ltr">_______________________________________________<br></div><div dir="ltr">Pas2js maillist  -  <a href="mailto:Pas2js@lists.freepascal.org" rel="nofollow" target="_blank">Pas2js@lists.freepascal.org</a><br></div><div dir="ltr"><a href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/pas2js" rel="nofollow" target="_blank">http://lists.freepascal.org/cgi-bin/mailman/listinfo/pas2js</a><br></div><div dir="ltr"><br></div><div dir="ltr">------------------------------<br></div><div dir="ltr"><br></div><div dir="ltr">End of Pas2js Digest, Vol 10, Issue 14<br></div><div dir="ltr">**************************************<br></div></div>
            </div>
        </div></body></html>