Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


lennart last won the day on August 5 2018

lennart had the most liked content!

1 Follower

About lennart

  • Rank

  • Birthday 09/21/1973

Contact Methods

  • Website URL

Profile Information

  • Gender
  • Location
    Vestfold, Norway


  • Company name
    The Smart Company AS
  • Sector
    Information technology
  • Position
    Lead developer

Smart Mobile Studio

  • Edition

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. This is a common Delphi problem. Virus killers etc. Are sloppy and quite a few get flagged with this, until they bother to check more than just the header checksum or verisign resource. The binaries are safe, and we refuse to pay microsoft for a verisign license, because they do this on purpose to force developers to buy expensive signing certificates. We oppose such things on principle. The binaries are clean, checked and double checked. They are buildt in isolation with both microsoft security + virus killers active. We use bought and valid Delphi editions, and the few components we use are likewise clean and properly licensed. So this is a false negative. Please report this to your virus-killer so they can mark it as safe. They just do a checksum compare and often windows will react if you dont have a verisign resource embedded. Most Delphi developers find MS forced policy on this completely unacceptable.
  2. lennart

    Demo competition 2018

    Better late than never, and the demo competition is now a fact! You can read the details here: https://jonlennartaasenden.wordpress.com/2018/09/28/delphi-developer-competition/ So you have a whole month to kick some serious butt and produce awesome demos! Let's show them what SMS can do
  3. lennart

    When is the next contest?

    Its on now https://jonlennartaasenden.wordpress.com/2018/09/28/delphi-developer-competition/
  4. Its time for another demo competition! With great prizes to win and even some official Embarcadero stuff lined up! Get the whole story here: https://jonlennartaasenden.wordpress.com/2018/09/28/delphi-developer-competition/ And remember to sign up ASAP!
  5. lennart

    Send an email ?

    You can force a click on a "a href:mailto" using RTL functionality, but for proper email sending i would write a micro-service in node and delegate it there.
  6. lennart

    Setting Label Cursor

    Ah yes this is a classic one. When we made the label control the whole font thing came up and bit us in the bottom. Because Delphi fonts and HTML fonts are very different. You have the "normal" font stuff, but you also have something called CSS fonts, which a lot of people uses. So to avoid killing the option for smart users using css-fonts (and glyphs) in their labels, I isolated the underline/bold etc as a function you call with the caption. If you look in the font class, all the way back to TW3CustomFont (unit System.Fonts), you find this function: function StyleText(const Text: string): string; virtual; What you do is the following: Set the font styles you need Assign the caption via the function above, like this: Label.Caption := StyleText("This is styled text"); I think its time we get rid of this and instead go for "normal" delphi styling. It will require a bit more scaffolding for CSS glyphs and fonts, but at least people can set styles as they are used to. As for the cursor, this is a bug. The label contains sub-constructs that somehow "hide" the underlying element where the cursor is set. So we just need to tell these constructs to inherit whatever cursor the parent has, and it will be gone. So Ill try to get this done in our next update
  7. lennart

    "inline" Keyword?

    Inline is interesting but we have no immediate plans for it. The way JS contexts work makes sub-procedures and anonymous procedures more or less the same thing. Macros in the C/C++ style or templates is much more interesting. Procedure TForm1.Something; var x, y, z: integer; procedure SomethingElse(const CB: TProcedureRef); begin if assigned(CB) then CB(); end; begin SomeThingElse( procedure () begin writeln("Not sure we need inline under JS"); end); end;
  8. lennart

    memo lines ?

    Look at the definition Memo.Lines is defined as an array of string. So you can do: for item in w3memo1.lines do begin writeln(item); end;
  9. lennart


    Awesome! Very interested in this! Cant wait to see more!
  10. lennart

    Tw3Sprite - flash problem

    TW3Sprite is not really meant for traditional game sprites like you and me know them. The first thing that comes to mind is wrapping the image-change in a TW3Dispatch.RequestAnimationFrame(), but there is no guarantee that it wont flicker. For "real sprites" I added a DrawTile() and DrawPart() functions in TW3Canvas. If you imagine a tile grid over a picture, say 32x32 pixels per tile, you can draw a spesific tile very quickly to the canvas. It will calculate the row/column based on the tile-size + tile number. So if you draw tile #32, and the tileset picture is 640 x 480 pixels in size, and the tile is 32x32 pixels, you get: rows := height div tileheight; if rows * tileheight < height then inc(Rows); cols:= width div tilewidth; if cols * tilewidth < width then inc(cols); RowEntry := tilenumber div rows; ColEntry := tilenumber mod cols; RowEntry := RowEntry * TileHeight; ColEntry := ColEntry * TileWidth; The above is done automatically for you, so you just need to count the tile# and use that. Here is an article predating the canvas update, but it gives some insight into where we took the ideas from. https://jonlennartaasenden.wordpress.com/2014/01/27/codef-for-smart-mobile-studio/
  11. lennart

    parseInt question

    I was about to write that the snippet simply copies 2 by 2 hex characters and then converts that to an integer number. In pure pascal it would be a bit messy since pascal's StrToInt doesnt support hex (unless prefixed by $). ASM sections are very much needed, they might not be pretty (not too fond on them myself) but there are some fundamental code sections that would never work if we used pascal only. Speed is also a factor to keep in mind, especially for procedures that you will call many times. But you seem all set so i'll leave you to it! Happy coding!
  12. lennart

    Compilation Question: Format command

    Use resourcestrings in a separate unit, easier
  13. Omg.. i am now a shade of pink. I am so sorry about that, ill have it removed asap!
  14. lennart

    TMemo-like Control with Colored Text?

    Hi David! The good news is that all the ordinary rules of html apply, everywhere. So you can for example set the text of a line with inline html (see listbox.items.add or listbox.add depending on version): ’<p style=«background-color: #ff0000»>hello red</p>’ The DOM will recognize this and inject it as is, which is both easy and fun. If you need more elaborate styling you might want to check the SmartCL.%css% units. There is a global stylesheet where you can inject full styles and then use that instead of inline styling. let me know if you run into difficulty
  15. lennart

    Save tw3image to desktop?

    This we found our culprit: procedure TW3CanvasFont.ReadFontInfo; begin end; It doesnt parse the font information and expects to inherit from the container. This works fine on visual controls (TW3GraphicControl) but will naturally be a problem on a raw device context