Jump to content

Czar

Members
  • Content Count

    445
  • Joined

  • Last visited

  • Days Won

    13

Posts posted by Czar

  1. For me the most frustrating aspect of using SMS is layouts. Putting together anything beyond a trivial UI takes ages and is very frustrating to achieve.

    The Tlayout is not intuitive, it has weird and unexplainable side effects and takes a long time to get it right. Once you have it working then generally it is fine.

    We really need to have a more intuitive system to allow easy to create and maintain UI.

    I believe simple anchor (left, top, right, bottom)m, Align and "alignWithMargin" like Delphi has would be a great bonus to SMS.

    I have no idea what would be involved, or how much work it would be, but I would love to see this being developed.

     

  2. I concur renaming a project is buggy.

     

    I would also love to be able to add a search path for units. At the moment we have to create a symlink inside the RTL folder to a network folder to store our common units. However, it would be much nicer if we could add a path to the IDE which is read when the RTL units are loaded.

    It would also be very excellent if when you go "open" it opens the last folder you were in rather than the SMS folder. We keep our projects on a network drive and it takes a significant number of clicks to take us back to the folder where are working.

  3. I just read the news and I believe you are correct IELite. Without Jon's major input the project feels like it will fold. Jarto is the only other member that I am aware of. If the other shareholder's don't show some significant leadership then it will flounder. Personally I hope it doesn't disappear and perhaps a better solution would be to opensource everything.

    SMS is a product we use everyday and it fits very well into part of our development requirements. Shame to see it end.

  4. There have been a few threads about this topic but I couldn't get any of them to work with my current challenge.

     

    My challenge was accessing a label (child) on a panel. The problem I was having was GetChildCount and GetChildObject are not accessible from the objects so I cast them a Tw3TagContainer instead, probably ok to cast as something else. I will post my solution as an example. 

    procedure TForm1.InitializeForm;
    begin
      inherited;
      // this is a good place to initialize components
    
      var W3Panel1 := tw3panel.create(self);
      W3Panel1.setbounds(10,10,400,400);
    
      var mylbl := TW3Label.create(W3Panel1);
      mylbl.SetBounds(10,10,80,30);
      mylbl.caption := 'label on panel';
      mylbl.tagvalue := 2;
    
    
      for var i := TW3TagContainer(W3Panel1).GetChildCount -1 downto 0 do
      begin
       var obj := TW3TagContainer(W3Panel1).GetChildObject(i);
       if obj is TW3Label then
              tw3label(obj).caption := 'IT WORKED';
      end;
    end;

     

     

     

  5. I managed to a solution which is probably better

     

      var Context := JCanvasRenderingContext2D(LBitmap.canvas.context.handle.getContext('2d'));


        Context.font:="75px verdana";
    Context.shadowColor:="black";
    Context.shadowBlur:=7;
    Context.lineWidth:=5;
    Context.strokeText("TEstMe",25,100);
    Context.shadowBlur:=0;
    Context.fillStyle:="white";
    Context.fillText("TEstMe",25,100);

  6. I have been working on rendering fonts onto the canvas. After getting a few pointers I managed to get what I am after.

    However, I have been hacking direct into the smartcl.legacy

    procedure TCanvas.TextOut(dx,dy: integer;aText: string;aColor:TColor);
    var
      mTemp:  Variant;
    begin
      mTemp:=FDC.fillStyle;
      FDC.fillStyle:=ColorToWebStr(aColor);
    
      FDC.lineWidth:=4;
      FDC.shadowBlur := 7;
      FDC.shadowColor := 'black';
    
      FDC.strokeText(aText,dx,dy);
      FDC.shadowBlur:=0;
      FDC.fillStyle:="white";
      FDC.FillText(aText,dx,dy);
      FDC.fillStyle:=mTemp;

    I thought i could simply inherit

     

    type TMyCanvas = class(Tcanvas)
          procedure MyTextOut(dx,dy: integer;aText: string;aColor:TColor);
          end;

    procedure TMyCanvas.MyTextOut(dx,dy: integer;aText: string;aColor:TColor);
    var
      mTemp:  Variant;
    begin
      FDC.lineWidth:=4;
      FDC.shadowBlur := 7;
      FDC.shadowColor := 'black';
    
      FDC.strokeText(aText,dx,dy);
      FDC.shadowBlur:=0;
      FDC.fillStyle:="white";
      FDC.FillText(aText,dx,dy);
      FDC.fillStyle:=mTemp;
    end;

    However, I get an error FDC not visible in this scope. What basic 101 am I violating?

     

    Syntax Error: Member symbol "FDC" is not visible from this scope [line: 54, column: 10, file: Form1]

     

  7. The bit that I don't follow is how do I go from say this

     

    function drawStroked(text, x, y) {
        ctx.font = "80px Sans-serif"
        ctx.strokeStyle = 'black';
        ctx.lineWidth = 8;
        ctx.strokeText(text, x, y);
        ctx.fillStyle = 'white';
        ctx.fillText(text, x, y);
    }
    
    
    drawStroked("37°", 50, 150);

    to this

    LBitmap.Canvas.Context.DC.font := 'bold 24px  verdana ';

     

    where can I find out what "'bold 24px  verdana '; " can be replaced with?

  8. Hi

     

    I am trying to understand what my options are when I textout to canvas.

     

    LBitmap.Canvas.Context.DC.font := 'bold 24px  verdana ';

    When I google I get lots of results for CSS but that is presumably not quite the same as above. I am looking to understand what this type of definition is referred to.

     

    Why because I would like to  render with a text-shadow or blur or some other nice effect. I am struggling with some basic gaps in understanding.

     

    Is this referred to context.font?

     

    https://www.w3schools.com/Tags/canvas_font.asp

     

  9. Suggestion - the fxmove etc are very good - easy to use. However, there doesn't appear to be a simple rotation effect. You can go the whole rotation system using TW3RotateCSSAnimation however, if you simply want to adjust the angle a bit, like a rocking boat of swaying palm trees then you appear to have to make your own. 

     

    procedure TForm1.RockBoat;
    begin
      visual.boatangle := visual.boatangle +0.2;
      visual.boatimg.Angle := sin(visual.boatangle);
      TW3Dispatch.Execute( procedure begin RockBoat end, 75);
    end;

    2018-09-12_11-53-55.gif

×
×
  • Create New...