Jump to content

Rollo62

Members
  • Content Count

    1674
  • Joined

  • Last visited

  • Days Won

    22

Everything posted by Rollo62

  1. Rollo62

    How to rotate a RoundRect on click

    Ok, ok, here is a short demo maybe what you are looking for, additionally with some mouse drag-and-drop for the knob.. I would really recommend that you look into some books and the help before continuing, as well as checking out all the samples. Maybe that small demo helps for a start, but you should begin with the basics first. T465_Rotation_001.zip
  2. Rollo62

    How to rotate a RoundRect on click

    What I spot without too much looking into details: Your inside TForm7 declaration, so don't write TForm7. here private { Private declarations } public { Public declarations } //function TForm7.KnobLabelStationAngle(const AAngle : Single) : String; overload; function KnobLabelStationAngle(const AAngle : Single) : String; overload; //function TForm7.KnobLabelFreqAngle(const AAngle : Single ) : Single; overload; function KnobLabelFreqAngle(const AAngle : Single ) : Single; overload; end;
  3. Rollo62

    How to rotate a RoundRect on click

    You can simply add your function declaration and definition in the code window, similar like this: unit UMain_Form; interface uses System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.Layouts ; type TForm1 = class(TForm) private { Private declarations } public { Public declarations } function MakeANewFunction( const AParam : Single ) : String; end; var Form1: TForm1; implementation {$R *.fmx} { TForm1 } function TForm1.MakeANewFunction(const AParam: Single): String; begin if AParam > 100.0 then Result := 'Large' else if AParam >= 0.0 then Result := 'Small' else Result := 'Negative'; end; end. For these kind of questions you better look into a good, basic Delphi book, like this one from Marco Cantu.
  4. Rollo62

    How to rotate a RoundRect on click

    function TForm7.GetMyStationNameFromAngleMethod( const AAngle : Single ) : String; const CStations : array[0..24-1] of String = ( 'New York, 'Honolulu', 'Tokyo' ... 'Paris' ); var LIdx : Integer; begin LIdx := AAngle div 15.0; // 0 ... 360 to 0 ... 23 Result := CStations[ LIdx ]; end; function TForm7.GetMyStationFreqFromAngleMethod( const AAngle : Single ) : Single; begin Result := (AAngle / 360.0) * 200.0; // 0 ... 360 to 0 ... 200.0 MHz end; procedure TForm7.KnobLeftClick(Sender: TObject); begin MyRoundRect.RotationAngle := MyRoundRect.RotationAngle - 15.0; Label1.Text := Format( 'My station is %s at %4.0f MHz, [ GetMyStationNameFromAngleMethod( MyRoundRect.RotationAngle ), GetMyStationFreqFromAngleMethod( MyRoundRect.RotationAngle ) ] ); end; procedure TForm7.KnobRightClick(Sender: TObject); begin MyRoundRect.RotationAngle := MyRoundRect.RotationAngle + 15.0; Label1.Text := Format( 'My station is %s at %4.0f MHz, [ GetMyStationNameFromAngleMethod( MyRoundRect.RotationAngle ), GetMyStationFreqFromAngleMethod( MyRoundRect.RotationAngle ) ] ); end; I assume you want to display the station name and frequency, right ? Just a rough idea, its already very late here ... Since I don't know exactly what you need this is a wild guess 🙂
  5. Rollo62

    How to rotate a RoundRect on click

    procedure TForm7.FormCreate(Sender: TObject); begin MyRoundRect.RotationCenter.Point( Pointf( MyRoundRect.Position.X + MyRoundRect.Width / 2.0, MyRoundRect.Position.Y + MyRoundRect.Height / 2.0 ) ); end; procedure TForm7.KnobLeftClick(Sender: TObject); begin MyRoundRect.RotationAngle := MyRoundRect.RotationAngle - 15.0; end; procedure TForm7.KnobRightClick(Sender: TObject); begin MyRoundRect.RotationAngle := MyRoundRect.RotationAngle + 15.0; end; Something similar like this (Untested) ? Or even adding some smooth animation by TFloatAnimation, like this.
  6. Rollo62

    How to rotate a RoundRect on click

    In FMX you have RotationAngle and RotationCenter, that should be doing it.
  7. Since its about rhymes, probably the phonetic abstraction on the trailing parts of the words might be interesting, and maybe can more or less looked up in a DB. Playing around with this tool, Like: into But you're right, its hard to predict its general outcome without deeper knowledge of semantics, orthography, etc. On the other hand, is the phonetic transcription not all about the phonetic representation of spoken words ? So it would be my first candidate for the job.
  8. Yes, serialgames is a nice tool, I used that before too, but I'm not sure how well that is maintained. There would be also a solution from DelphiWorlds: DeviceLens
  9. Rollo62

    Zip Compression library

    I also have not measured, but I'm well aware that 7-Zip with *.7z format, also with the original 7-Zip binary, is encoding much slower than using other ZIP encoder. I'm not so sure about the decoding speed, probably its on par or even faster than ZIP there, but my critical path was the encoding side in an older project. It's very likely that compiled with pure Delphi its even slower, that is true.
  10. Rollo62

    Zip Compression library

    @shineworld Thanks, thats an interesting solution 👍 Unfortunately it seems that is not very well maintained, maybe from 2013/14, I can only find some references from here: http://www.lab-z.com/lzma-压缩的例子/ http://www.birtles.org.uk/programming/ Do you know any more recent repository where the sources were maintained ?
  11. Rollo62

    Zip Compression library

    7-Zip with using the *.7z format is able to produce compressed files larger than 2GB and can be integrated into Delphi app as well, by using the 7z.dll. I think 7-Zip with using the *.zip format also stops at 2GB, but I haven't checked this with recent versions.
  12. Rollo62

    Split String

    How about something like TStringHelper.Split ? use System.SysUtils , System.Generics.Collections ; ... var LInput : String; LArray : TArray<String>; LElem : String; LStrQuo : String; begin LInput := '22-1, 22-2, 22-3'; LArray := LInput.Split( [ ',' ], TStringSplitOptions.ExcludeEmpty ); // Ignore empty elements for LElem in LArray do begin LStrQuo := LElem.Trim.QuotedString( '"' ); ... // Do something with the quoted in SQL end; end.
  13. Maybe this database is helpful too, with real pronounciation examples and theoretical background. https://englishexplorations.check.uni-hamburg.de/basic-concepts-of-english-phonetics-and-pronunciation/ https://en.wikipedia.org/wiki/International_Phonetic_Alphabet https://www.internationalphoneticassociation.org/IPAcharts/IPA_chart_orig/pdfs/IPA_Kiel_2020_full.pdf If you use such IPA alphabet in the DB, then maybe its possible to find and run a specific soundex algorithm on that. I would doubt that the original soundex for the usual alphabet might help here, but its worth a try.
  14. Rollo62

    First Python + DelphiVCL Program

    Thanks, yes I know. But I'm afraid this would be simply getting too heavy for my app. Moreover Python alone doesn't come with OpenCV and OpenCV is too heavy as well. I hope the portions for marker detection could be stripped off separately, like using simple filters for that goal. My consideration is that simple, specific marker-shapes might exist that have simple, specific detection algorithms as well, to allow easy and simple detetion and location.
  15. Rollo62

    First Python + DelphiVCL Program

    @Brian Evans Yes, but I hope that shirneworld has found any other stable marker detection without even OpenCV, which is not that Cross-Plattform too. OpenCV is of course perfect in this case. I still hope to find some simple algorithm for marker detection, like e.g. QR-Code detection, to be able to locate them on pictures without much external stuff. Yes, QR-Code detection algorithm was one of my favorites too, but maybe there could be even more optimized algorithms just fpr that purpose. The markes itself were not critical, can be any shape.
  16. I'm not an expert with that, but I guess you have to structure the database with a phonetic interpretation of words. When you look at this https://www.rhymedb.com/ Moreover, how to handle other languages, I assume also there a phonetic interpretation might cover a few languages at once.
  17. Rollo62

    First Python + DelphiVCL Program

    Thats a great application, I was looking for a similar option to find and exactly locate markers and their positions in an image, but I'm afraid I cannot use P4D since this has to be CrossPlatform. Maybe you have evaluated and tested some pure Pascal or Algorithmic solutions to find markers and you could share it with us ? ( and I don't want to use Cloud-KI solutions either ).
  18. I think the main question here is: Which granularity of a single step the user really needs for setting something ? Is it full 0...255 or is 0...100 sufficient ? This can be depending on the application, the formulas above only make it more readable to the user in %
  19. Rollo62

    The Delphi 11.2 release thread

    Uwe Raabe had shown a proposal howto Kill LSP in the German DP, maybe that is more convenient.
  20. Rollo62

    Issue with TDialogService.InputQuery fmx for IOS

    I'm a little unsure about this fix is repairing now all cases. I had implemented some fixes in the FMX.Dialogs.iOS.pas file at different spots ( under constructor TFMXAlertViewInputDelegate.Create ) and have seen that Dave Nottage provided a fix RSP-37702 under "class function TCocoaDialogsService.CreateAlertView(". This fix now seems to be implemented in the original Delphi unit in Rx11.2 Patch1. I would remove this patched FMX.Dialogs.iOS.pas unit now from my "patched units" list, if there were no other known sideeffects with this unit. Still I'm trying to check all the places where this error might occur, but its a little hard to test all that. Has somebody maybe found any other dialog sideeffects, related where the buttons are mixed up, or is this original Delphi unit now 100% OK ?
  21. Rollo62

    Mockup mobile

    Do you know this introducion about Balsamiq and FMX Stencils from Sarina Du Pont ? https://blogs.embarcadero.com/prototyping-from-vision-to-ux-design/ I dont know if this is still valid, because its already older. Presonally I think Delphi FMX is "mockup" enough for me, using other tools inbetween FMX Designer and Code is only another dependency layer added, but I understand the urge to want that.
  22. You don't need to be a registered user, just download the ZIP file under "Code" button
  23. Rollo62

    SSL in IOS Simulator

    Maybe it helps what Uwe suggests in the German DP. Check according to Delphi Compiler - Conditions simply enter $(Platform) and in the program check with {$IFDEF iOSSimARM64 } https://docwiki.embarcadero.com/RADStudio/Sydney/en/Memory_Management
  24. Rollo62

    Windows 11 22H2 lost batch file association

    By .DMG ??? ..... NOOOOT
  25. Right, I also try to do keep the balance right. Usually I see modular units that define one functionality as "implementation details" of an interface, which may or maybe not involve one or more Units to do its implementation. When accessing this "functionality" through the interface, yes there may be a few units involved behind the scene, but not from the caller perspective ( he only needs one clean, simplified interface unit ). Higher complexity may arise from the implementation side, but thats worth it in my opinion, to keep such details separate whereever it make sense. For me it is most important to have a clean consumer side, which can be used many times in many places, while the implementation side is defined and tested only once mostly. You may call it imbalance, but I think the consumer side has higher weight than producer side.
×