Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by Magno

  1. I never had the real need for this but now I faced I really dunno how, making components are not my real business so here is my doubt, if one would like to help. Well, I have an unit (about.pas) that my compo will use, but this is everything I could do. I have no clue how do go forward. TAbout = Class(TComponent) Private fsAbout: TAbout; Public Procedure AboutDialog; //really? I dunno Published Property About: TAbout Read fsAbout Write fsAbout Stored False; End; procedure TAbout.AboutDialog; begin ShowMessage('Made by me =)'); end; ----- Now, my component has such: private { Private declarations } fsAbout: TAbout; ... published { Published declarations } property About: TAbout Read fsAbout Write fsAbout Stored False; end; And from here I don't know what to do. I would be happy with a read only label on my component too. Thank you for any help! ๐Ÿ˜ƒ
  2. Magno

    How to make an "About" for a simple component?

    Thank you guys for all these information! Very useful and one who need can dig on this to make it work for he needs. Remy I will check the Indy approach. My awesome component needs no more than a label informing the version or a ShowMessage() kind of dialog. Thanks again!
  3. Magno

    How to make an "About" for a simple component?

    Thank you!! This is the path I needed.
  4. Magno

    How to make an "About" for a simple component?

    I want that one of the Published properties show an About, with that I can show the user the component version once it get installed in the Delphi IDE. uses uAbout; type TMyComponent = class(TComponent) private { Private declarations } fsAbout: TAbout; FUser: String; protected { Protected declarations } public { Public declarations } published { Published declarations } property About: TAbout Read fsAbout Write fsAbout Stored False; property User: String read FUser write FUser; end; I am stuck here. The TAbout is an external unit, like I show in the OP. So, when installed the User property shows on the IDE and the About, but I don't even know what technique to make it show a dialog or become a read only text. Thanks for the reply!
  5. What I have: a frame with a semi-arc that represents a gauge for information like temperature. See the attached image. Each of these controls are into a frame which I create in runtime depending from what I receive from my server. The structure is: TFrame->TRectangle->TPaintBox. The issue: when I run with Windows the arcs are correctly drawn, I sent the Value so it draws fine the correct gauge. When I run with Android, using the example attached with 3 gauges, all the 3 gauges will get redraw with the same value, even I am pointing to only one. I am using a code I found a modified later, but most of it is close to the original, it will use anti-aliasing to draw the arc, the code is bellow: type TAAArcSettings = record AStart, AEnd, Opacity: single; AThickStart, AThinkEnd: integer; Color: TAlphaColor; end; procedure TframeGauge.DrawArcAA(AParams: TAAArcSettings); var path: TPathData; poly: TPolygon; begin path := TPathData.Create; path.AddArc(rect.CenterPoint, TPointF.Create(rw, rh), AParams.AStart, AParams.AEnd); path.AddArc(rect.CenterPoint(), TPointF.Create(rw - AParams.AThickStart, rh - AParams.AThinkEnd), AParams.AStart + AParams.AEnd, -AParams.AEnd); path.ClosePath(); path.FlattenToPolygon(poly); APaintBox.Canvas.Fill.DefaultColor := TAlphaColorRec.Blue; APaintBox.Canvas.Stroke.Kind := TBrushKind.Solid; APaintBox.Canvas.Fill.Color := AParams.Color; APaintBox.Canvas.FillPolygon(poly, AParams.Opacity); path.DisposeOf; end; I make some calculations to define the initial and final angle plus the percent for the value representation. To intent set a value the code below is used: ArcSetting.AEnd := AEndAngle; ArcSetting.AStart := START_ANGLE; Rectangle1.BeginUpdate; APaintBox.Canvas.BeginScene; APaintBox.Repaint; // this will trigger the PaintBoxPaint() method and there inside I can the DrawArcAAA() APaintBox.Canvas.EndScene; Rectangle1.EndUpdate; There is a procedure TframeGauge.setGaugeValue(Value: integer) which will make the code above. In the main form it detects the frame and will call this procedure, but as I say all of any gauges will be drawn with the new value. This won't happen with Windows (both 32 and 64 bit). Maybe FMX for Android it is required something else beyond I know ๐Ÿ˜ž Thanks for reading and any clue where I could search for?
  6. Yes, I understand that. Well, using const did not solved. Well, as I said, with Windows it works correctly. With Android once I draw it will replicate the value to any other gauge there. I think it somehow related to the painting method, I really dunno yet.
  7. There was no change on FMX. Maybe if I move to object component I could have more success but for this project I dunno...
  8. I will try move it, thanks but as they are different frames so one should not touch the other...
  9. Yes it is, thank you. I thinking to release it all source code later. The idea behind is simple and it is a quarantine project: I was thinking to monitor some of my computer sensors using WMI queries, but quickly I realise the information about GPU is device dependent on drivers and the time I would expend to accomplish won't be wort. I found a software called Open Hardware Monitor (https://github.com/openhardwaremonitor/openhardwaremonitor) that you can keep it running in background and expands the WMI. Now I have a server that read temps and loads so I can choose what I want to monitor. My computer case has a glass so I could put an old tablet or phone there inside ๐Ÿ˜„ Here's more decent screenshot of both client and server (still a WIP).
  10. I am starting a very new Datasnap REST server. Made a simple function to return a query but I am getting the error of the the title's post (Unknown storage format [BIN] ...) I dropped the Json storage for reflect, follow a lot of examples, that's simple, but simply does not works here. Any tip?
  11. The code bellow uses FireDac to create a new query object. The if not Assigned() sometimes will bring garbage and make the routine fail because as it reads something, so the "query" won't be created and crashes. procedure createMyQuery(var query: TFDQuery; Sql: String=''); begin if not Assigned(query) then // fail query := TFDQuery.Create(nil); query.Connection := myDatabase; query.SQL.Text := Sql; end; var myQuery: TFDQuery; begin createMyQuery(myQuery,'select * from table'); ... end; Anything I could make it ? The Delphi version is 10.2 update 3.
  12. Yep, but I think the helper with setting nil before is not so handy, but it is ok. This is the way, as I have spoken.
  13. I tried a simple new project, drop the required, following this example: http://docwiki.embarcadero.com/RADStudio/Rio/en/Tutorial:_Using_a_REST_DataSnap_Server_with_an_Application_and_FireDAC (same above) So I get an error (as the title of this thread suggests) when running the following method: function TServerMethods1.GetDepartmentNames: TFDJSONDataSets; begin // Clear active so that query will reexecute. FDQueryDepartmentNames.Active := False; Result := TFDJSONDataSets.Create; // The "TFDJSONDataSetsWriter" class provides static "ListAdd" method. // It uses reflection to convert results of the query into "TFDJSONDataSets". TFDJSONDataSetsWriter.ListAdd(Result, FDQueryDepartmentNames); end; The unique difference is that the FDQueryDepartmentNames has another name and points to a similar very simple table with a "select * from users".
  14. I thought someone could understand, I am trying this: http://docwiki.embarcadero.com/RADStudio/Rio/en/Tutorial:_Using_a_REST_DataSnap_Server_with_an_Application_and_FireDAC Have any table and need to create a function to return its result. The program is complaining that I should provide a valid standard storage (I am using http://docwiki.embarcadero.com/Libraries/Rio/en/FireDAC.Stan.StorageJSON.TFDStanStorageJSONLink) About the examples, there are a lot over there, as I told: not working. So whats the catch? Any tip?
  15. I need to "compress" a barcode type Code128 print with a termal printer. The size needed is 3.5cm. I have a TImage with a size that if I print it works as it should. The Printer form I am using has a kind of TImage so I can move the image using TImage.Picture, but I supposed that once I stretch the report form image it could be printed, but no. The final rendered image gets "cutted" or lost the quality. I really dunno how to fix it.
  16. As the printer is under Windows drivers, I will try do figure out how to get its DPI. Actually it is using the desktop VGA (72dpi). I've even tried setup to 300 and no changes. This is what I need to know how to.
  17. How does the TGeocoder really works? From where it get the address? Google API? I cannot found an answer. The doc is not sufficent: http://docwiki.embarcadero.com/RADStudio/Rio/en/Mobile_Tutorial:_Using_Location_Sensors_(iOS_and_Android) As the GPS only will deal with coordinates and not with address string stuff, so the app needs to convert from to and it is required a database (local, api, etc) to make the geo reverse.
  18. So, it uses the Google API at end, as I supposed. Thank you guys!!!
  19. I was already able to upload an appx to MS Store, but for some reason my building is now always done as Ad-hoc! How can I set again the correct distribution type? Should exist an easy way there at Configurations->Application Store | Ad-hoc | Normal Where do I change that options? At Project->Options->Deployment->Provisioning only let me configure, but not choose the correct build to go. Frustrating ๐Ÿ˜ž
  20. Magno

    Distribution type for Appx with Rio

    Ok, it seems to be a bug. I have to try more than one time (more than 10x) until it "fix" from ad hoc to app store. I did, but it is a pain.
  21. Magno

    Distribution type for Appx with Rio

    I simply cannot upload the new appx because even if I choose the provisioning to Application Store, save, build, deploy it is generated as Ad-hoc.... No one have a clue?
  22. Hello! I am trying this: NetHTTPClient1.ContentType := 'application/json; charset=utf-8;'; NetHTTPClient1.AcceptCharSet := 'ISO-8859-1'; NetHTTPClient1.Post(URL, PARAMS, nil, TEncoding.UTF8); To post to an URL. It works, but words like "aรงรฃo" are being received as "acao". How correctly I could fix that? Thank you! EDIT: Missing set UTF8Encode( text )
  23. Hello people! Well, this is new. With 10.3.0 my app was working fine, but now when I try to access an address like http://thewebsite..ddns.net the URL won't open and I get net::ERR_CLEARTEXT_NOT_PERMITTED. I will happen with some devices, mine is running Android Pie and work correctly, my friend and the client also running Android Pie and getting that error. Any clue?
  24. Thank you for all information!! I will test it and let you know! EDIT: Solved!!!! Thank you!