Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation since 11/12/2019 in all areas

  1. 5 points
    Things are looking good. Today I finished fixing timing-related bugs in the IDE. Those were a bit tricky as creating and freeing Embedded Chrome in Delphi is not the simplest thing in the world. The rest of the day went deep inside the RTL. There were some timing issues with TW3CheckBox. If it's Resize was done while the parent was not visible, the resize went south. I ended up solving that by creating a new version of TW3CheckBox, which uses only CSS for resizing. It made the control a lot simpler, faster and bullet proof. My work list is getting seriously short now, which means that the Alpha-version is really close.
  2. 4 points
    If everything goes according to plans, before Christmas. I can't tell you a fixed date as there is a little competition going on about which will be released first: The Alpha or my 3rd child 😀
  3. 4 points
    This week has been a bit slow as I've been sick. However, here's a little pic of the Menu Designer
  4. 4 points
    warleyalex

    KaTex

    //------ typescript definition ------- /** Documentation: https://katex.org/docs/options.html */ export interface KatexOptions { /** * If `true`, math will be rendered in display mode * (math in display style and center math on page) * * If `false`, math will be rendered in inline mode * @default false */ displayMode?: boolean; /** * If `true`, KaTeX will throw a `ParseError` when * it encounters an unsupported command or invalid LaTex * * If `false`, KaTeX will render unsupported commands as * text, and render invalid LaTeX as its source code with * hover text giving the error, in color given by errorColor * @default true */ throwOnError?: boolean; /** * A Color string given in format `#XXX` or `#XXXXXX` */ errorColor?: string; /** * A collection of custom macros. * * See `src/macros.js` for its usage */ macros?: any; /** * If `true`, `\color` will work like LaTeX's `\textcolor` * and takes 2 arguments * * If `false`, `\color` will work like LaTeX's `\color` * and takes 1 argument * * In both cases, `\textcolor` works as in LaTeX * * @default false */ colorIsTextColor?: boolean; /** * All user-specified sizes will be caped to `maxSize` ems * * If set to Infinity, users can make elements and space * arbitrarily large * * @default Infinity */ maxSize?: number; /** * Limit the number of macro expansions to specified number * * If set to `Infinity`, marco expander will try to fully expand * as in LaTex * * @default 1000 */ maxExpand?: number; /** * Allowed protocols in `\href` * * Use `_relative` to allow relative urls * * Use `*` to allow all protocols */ allowedProtocols?: string[]; /** * If `false` or `"ignore"`, allow features that make * writing in LaTex convenient but not supported by LaTex * * If `true` or `"error"`, throw an error for such transgressions * * If `"warn"`, warn about behavior via `console.warn` * * @default "warn" */ strict?: boolean | string | Function; } export class ParseError implements Error { constructor(message: string, lexer: any, position: number); name: string; message: string; position: number; } /** * Renders a TeX expression into the specified DOM element * @param tex A TeX expression * @param element The DOM element to render into * @param options KaTeX options */ export function render(tex: string, element: HTMLElement, options?: KatexOptions): void; /** * Renders a TeX expression into an HTML string * @param tex A TeX expression * @param options KaTeX options */ export function renderToString(tex: string, options?: KatexOptions): string; //---------------- // ====>- pascal external class definition <==== unit katex; interface uses System.Types, W3C.HTML5, W3C.DOM; type TJSKatexOptions = class external 'Object' displayMode: Boolean; // nullable throwOnError: Boolean; // nullable errorColor: String; // nullable macros: Variant; // nullable colorIsTextColor: Boolean; // nullable maxSize: Float; // nullable maxExpand: Float; // nullable allowedProtocols: TStrArray; // nullable &strict: Variant; {Boolean or String or JFunction} // nullable end; type TJSKatex = class external 'katex' public class procedure render(tex: String; element: JHTMLElement); overload; external 'render'; class procedure render(tex: String; element: JHTMLElement; options: TJSKatexOptions); overload; external 'render'; class function renderToString(tex: String): String; overload; external 'renderToString'; class function renderToString(tex: String; options: TJSKatexOptions): String; overload;external 'renderToString'; end; type TJSParseError = class external 'katex.ParseError' constructor Create(const msg: String; lexer: Variant; position: Float); name: String; &message: String; position: Float; end; implementation end. //---------------------------------------------------------------------
  5. 4 points
    jarto

    SMS and the Ionic Framework

    Hi Thomas, Thank you for an interesting idea. At the moment we are working on the new Visual Designer. Once it's finished, it's way easier to create beautiful and functional PWA apps without having to create all by code. So, the plan is: Finish the Designer and have it support all current Visual components. (90% ready) Add non-visual components to the component palette Release a version Once we have that out, we'll be able to plan our next steps.
  6. 3 points
    DavidRM

    License Serial Number invalid

    Just to mention it... I had this problem too. I never received an email with my new information. I was able to get it from clientarea.*, though. -David
  7. 3 points
    JimKueneman

    Converting a Lazarus/Delphi library

    With the help of Jarto and a few here I have almost 5000 lines of a Lazarus/Delphi library that implements a mature custom TCP protocol compiling with SMS with just a few {$IFDEF DWSCRIPT}'s required so far. I have about 1000 more line to go before I can give it a full test but I do have a Websocket connected to the library and have sent messages to the library from a Lazarus program and it received and decoded them correctly. I was only working on it for a few hours on and off yesterday so I am amazed and very happy. Hopefully it will all run correctly in the end but at least the compiler thinks it should. The key websites that have helped me get handle on thing are here but so far I have not used them directly, SMS has handled everything in the compile so far but I do have a few dynamic byte array that I need to mimic which will need this information.... https://jonlennartaasenden.wordpress.com/2017/06/04/smart-pascal-memory-and-pointers/ https://jonlennartaasenden.wordpress.com/2015/03/07/system-interop-how-to-for-smart-mobile-studio/ https://www.html5rocks.com/en/tutorials/webgl/typed_arrays/ The ultimate goal is to create phone apps Jim
  8. 3 points
    Well, I found a better solution: There will be two new properties that relate to the Anchors: AnchorGapRight AnchorGapBottom These are calculated and set by the Designer when Anchors are set. They represent the distance from bottom right corner of the component to the parent's bottom right corner. This is used by the RTL to resize the child component properly when Anchors are used. The great thing is that this makes handling Anchors a lot more simple and elegant. It will also work even if the form size happens to change while the form is being built.
  9. 3 points
    lynkfs

    KaTex

    and this works too var html : variant; asm @html = katex.renderToString("c = \\pm\\sqrt{a^3 + b^3}", { throwOnError: false }); end; W3Panel1.InnerHTML := html;
  10. 3 points
    lynkfs

    KaTex

    A quick solution : have a form with a panel and a button in the custom template add these lines <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.css" integrity="sha384-bsHo4/LA+lkZv61JspMDQB9QP1TtO4IgOf2yYS+J6VdAYLVyx1c3XKcsHh0Vy8Ws" crossorigin="anonymous"> <script defer src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.js" integrity="sha384-4z8mjH4yIpuK9dIQGR1JwbrfYsStrNK6MP+2Enhue4eyo0XlBDXOIPc8b6ZU0ajz" crossorigin="anonymous"></script> in the onclick handler of the button add this code procedure TForm1.W3Button1Click(Sender: TObject); begin var katexelement : variant; katexelement := W3Panel1.handle; asm katex.render("c = \\pm\\sqrt{a^2 + b^2}", @katexelement, { throwOnError: false }); end; end; which results in this : This code can be improved a bit. F.i. I like to load the js library under program control, so at least you know when it is ready
  11. 2 points
    Better get it out before third born arrives otherwise we will be waiting a while
  12. 2 points
    JimKueneman

    SMS Defines

    Seems to be a bug in the implementation: Do this: {$DEFINE SMS} {$IFNDEF SMS} frank; fadfsafsd adsfasdf asdfafds {$mode objfpc}{$H+} {$ENDIF} The compiler skips over the gibberish but get hung up on {$mode.....} and tries to evaluate it Jim
  13. 1 point
    If it is his third, he should be use to the schedule by now
  14. 1 point
    IElite

    License Serial Number invalid

    Even though I was just charged a couple of days ago for renewal......I get a "License Serial Number Invalid" Seems like this happens every year, yet no one seems to fix this issue If I run the non-devloper version, it tells me license expired on 11/18 and won't let the program run I have said this in the past, just because we don't renew doesn't mean the program should stop working. Should just not be able to get updates.
  15. 1 point
    JimKueneman

    64 Bit Types

    Beautiful, thank for those links.. I am sure I can do what I want with SMS now.
  16. 1 point
    jarto

    Float 16

    And here's a test of allocating a 8 byte buffer, change byte values in it and convert it to a 64 bit float: //Allocate 8 bytes var Addr8:=TMarshal.Allocmem(8); Writeln(Addr8.Size); //8 bytes Addr8.Segment[0]:=255; Addr8.Segment[1]:=56; Addr8.Segment[2]:=111; Addr8.Segment[3]:=10; Addr8.Segment[4]:=20; Addr8.Segment[5]:=30; Addr8.Segment[6]:=40; Addr8.Segment[7]:=50; WriteLn('Manipulation done'); WriteLn(TDataType.BytesToFloat64(TMarshal.ReadMemory(Addr8,8))); TMarshal.FreeMem(Addr8); If you want to see the memory contents in Chrome's developer tools, here's a neat trick: Compile and Execute Open DevTools, view source and search for "Manipulation" Put a breakpoint on the WriteLn-line Run again
  17. 1 point
    IgorSavkic

    64 Bit Types

    There's probably no documentation on that, only thing available as some samples and articles from Jon: https://jonlennartaasenden.wordpress.com/2015/03/07/system-interop-how-to-for-smart-mobile-studio/ https://jonlennartaasenden.wordpress.com/2017/06/04/smart-pascal-memory-and-pointers/ They are others on the memory matter (use seach option from above articles)
  18. 1 point
    lynkfs

    Accessing W3IFrameHTMLElement URL Clicks

    set <element>.NativeScrolling to true
  19. 1 point
    COMFIED

    Accessing W3IFrameHTMLElement URL Clicks

    Thanks jarto It works! Is there a way to make the W3DIVHtmlElement scroll vertically like a browser when there is more content than fits in display size - scroll just like W3IFrameHTMLElement?
  20. 1 point
    jarto

    Accessing W3IFrameHTMLElement URL Clicks

    uses W3C; ... MyDiv.InnerHtml:='<a id="MyLink1" href="www.example.com/whatever">Click in me</a>'; var MyHandle:=BrowserAPI.document.getElementById('MyLink1'); if (MyHandle) then begin MyHandle.onclick:=procedure(event: JEvent) begin WriteLn('Click!'); event.preventDefault; end; end; Edit: And you can get the link by accessing MyHandle.href when that event fires.
  21. 1 point
    jarto

    Class Browser Modal

    I can't tell you how happy I am to hear that. At the moment there's no way to make the Class Browser a dialog. Gonna add it on the work list.
  22. 1 point
    JimKueneman

    Class Browser Modal

    First let me say version 3 may have convinced to finally use SMS. I have been trying every version it since v1 and every time I get frustrated and walk away. Version 3 feels much more refined. I can find things and it all coming together for me now. If I can convert my library to run in SMS I will be making the purchase no question, right now it looks entirely possible but I will have to make a copy and modify the source files because of the Define bug but as long as that gets fixed so I can have one common code base for all my Pascal compilers I will be happy. Is there anyway to make the Class Browser a Non-Modal dialog so it can be placed on a second screen and referenced in parallel of working on the code? It would be so much more handy to have it as a reference at your finger tips. Thanks. Jim
  23. 1 point
    jarto

    New Visual Designer for Smart Mobile Studio

    Time to make a small update. I've now been working on small but tricky issues that are related to Anchors and Align. It all started from the fact that Smart Mobile Studio has not saved the form size anywhere and hence, it hasn't sent any form size in the compiled application either. That's been handled by the RTL, which has set the form size based on device/browser size. However, that also means that you can not handle Anchors inside an aligned panel right. I've decided to fix this all by actually introducing form size in the designer as well. So you can set the form to for example iPhone vertical and design the form based on that. When the app then starts, it will build the form using this "design form size" and resize it then later according to the device/browser window size.
×