Jump to content

Czar

Members
  • Content Count

    445
  • Joined

  • Last visited

  • Days Won

    13

Everything posted by Czar

  1. Cheers Nico, the client app is as simple as I could make it. The creation app (not linked) has a bit more going for it. It is a bit rough but it is easy for my colleague to create new items with a minimum of fuss for franchisees to then customise and use for their social media requirements. It will save us many hours of work not having to customise on demand in Illustrator. I am in no way a fan of Edge - it is just that my years of educating our franchisees in using a real browser haven't paid 100% dividends. I will check out the links. I have insufficient understanding of javascri
  2. This app is now almost done https://numberworksnwords.com/adtoolkit/index.html However, it won't download the resulting image in MS Edge writeln('About to create image for downloading'); TW3URLObject.Download( LEncodedData, textbox[0].imagefilename); // only works in a external browser writeln('encoded '+LEncodedData); The LENcodedData is there but no image is created when TW3URLObject.Download is called. Works no probs with Chrome and Firefox Any ideas why edge is different and if there is possible to work around? I have attached simple exa
  3. Czar

    add preexisting pas/form

    The source is all external - I was simply trying to add a unit/form to my project - easy to add a unit but the form won't open. I did a work around - create new unit of same name - save and then copy the .pas and .smf over the newly created code
  4. It is easy to add a unit to an existing item. However, I cannot see how I can take a unit and form from one project and then add it to another. If you add the pas file the form is not available. How can this be done?
  5. Czar

    a basic JSON question

    Thanks @jarto and @lynkfs some very useful replies.
  6. Czar

    a basic JSON question

    Thanks, however that is the bit that I am not understanding how to do. So I need to put the records into the JSON string differently first so I can get them out.
  7. Czar

    a basic JSON question

    Sorry, my type Tr1 was supposed to be r1. I haven't tried your code yet - but the main problem I was trying to solve is that I have two records in the JSON and I need to retrieve them into two different variables. So if I put r1 and r2 (which are different record types) into single JSON how do I parse it back? If your code answer the question then please ignore I will have a play when I have a few quiet moments.
  8. I have a situation that I cannot figure out the answer to, yet I know it is probably straight forward. I can send off a JSON set with data - but I would like to know how can I parse it back into the two records? I don't follow how I can access the two records inside the data inside procedure HowDoIParseBack TMyRecord1 = record caption : string; x : integer; end; TMyRecord2 = record SomeText : string; end; r1 : TMyRecord1; r2 : TMyRecord1; Procedure SendJSONToServer; Begin var MyJSON := JSON.stringify(r1); MyJSON := MyJSON +','+JSON.stringify(r2); FHttp.Send(My
  9. You are a source of great knowledge - works perfectly. Thanks
  10. The function function TW3FontDetector.MeasureText(const FontName: string; const FontSize: integer; const Text: string): TW3TextMetric; in SmartCL.Fonts.Detector; replace spaces with _ resulting in spaces being way over estimated. The problem is when trying to right justify the measured width is much larger than the space required to render the font. So you cannot right justify text. Replacing the _ with a ! gives a closer result but it is still a hack - is there a proper solution to calculating the width a given text? I have attached a simple project to
  11. I am posting this little sample as it solves a problem we had and maybe it will be useful for someone sometime. We are making simple (sic.) app to allow our franchisees to add their own details to base images. The images can be quite big and don't fit nicely on the screen so I needed a way to translate mouse clicks from the image. I ran into problems when the images didn't fit the aspect ratio of the image container and the fscontain was screwing with my coordinates. The solution was simple, as it often is. Simply change the dimensions of the image container to fit the aspect ratio
  12. Czar

    memo lines ?

    Cheers, thanks for the explanation. As a user you are distanced from the practicalities underneath.
  13. Czar

    memo lines ?

    Sorry both the previous posts go over my head. I am a humble user and abuser of Smart Mobile Studio.
  14. Czar

    memo lines ?

    I believe it is a good example where Smart Pascal should mirror Delphi
  15. Czar

    memo lines ?

    Ok, just a bit confused as @lennart used .lines in his example code for item in w3memo1.lines do begin writeln(item); end;
  16. The users of this app I am trying to make have tendency to uploadf massive images 7000x4000 etc I can load the image but I would like to resize the actual image to a smaller size (i.e., less date) System.Types.Graphics, SmartCL.Legacy, LBitmap := TBitmap.Create; LBitmap.Allocate(W3Image2.PixelWidth, w3image2.PixelHeight); LRect := TRect.Create(0, 0, LBitmap.width-1, LBitmap.Height-1); LBitmap.canvas.Paste(0,0,w3image2.ToImageData); I have the whole image in w3image2 but I would like LBitmap to be much smaller but I cannot see any way to do
  17. Czar

    memo lines ?

    @lennart or @jarto can either one explain why w3memo1.lines do is not possible? The lines property does not actually exist. Lynkfs has a work around but it is a pretty strange solution to something that should be straightforward,
  18. Czar

    memo lines ?

    Hmmm, I am missing something. Lines does not exist for memo (TW3Memo) Syntax Error: There is no accessible member with name "lines" [line: 46, column: 23, file: Form1] procedure TForm1.InitializeForm; var item : string; begin inherited; // this is a good place to initialize components W3Memo1.Add('one'); W3Memo1.Add('one1'); W3Memo1.Add('one2'); W3Memo1.Add('one3'); for item in w3memo1.lines do begin W3Memo2.add(item); end; end;
  19. Czar

    memo lines ?

    memo and lines How can I access each line of text in a w3memo? Sort of like this in Delphi for i := 0 to memo1.Lines.Count -1 do mytest := memo1.Lines;
  20. You can't see this but I am doing a little dance. SMS just got even better - wow This will help enormously
  21. Yes the cdn version is 5 years newer - very cool library though. Thanks for your help
  22. @lennart- any chance of pushing this update out soon?
  23. Sorry, I tried getting your code to work but I haven't mage to I added W3C.HTML5, but .src and .onload were still unknown I would like to get it going locally function mathjs: Variant; external 'mathjs'; var FMathParser: THandle; But it appears mathsjs is no longer the function and it is unclear to me how to get functioning.
  24. Well that was unexpected That works a treat. The FMathParser.eval('1.2 / (2.3 + 0.7)') works nicely the otherfunctions like .simplify('2 * 3 * x', {x: 4}).toString()) // '24' Don't seem to be part of math.js and math.js file on the website doesn't want to work. But this will be very useful.
×
×
  • Create New...