-
Content Count
1406 -
Joined
-
Last visited
-
Days Won
22
Everything posted by programmerdelphi2k
-
How can I enlarge the font of a Combobox in Delphi FMX?
programmerdelphi2k replied to MikeZ87's topic in FMX
A "ComboBox" is a container to items = ListBoxItems, for that the styles is applyed on items, not necessary in the container! try use Styles customizations on Combobox -> right-click on ComboBox and Edit Styles customs... and do the changes...- 13 replies
-
- fmx
- firemonkey
-
(and 5 more)
Tagged with:
-
BlockRead & BlockWrite - E2010 error
programmerdelphi2k replied to Jud's topic in RTL and Delphi Object Pascal
All installed by default!!! including Help updated! can you see post the BlockWRITE/READ sources here? ( not _BlockWrite/Read ) -
BlockRead & BlockWrite - E2010 error
programmerdelphi2k replied to Jud's topic in RTL and Delphi Object Pascal
in my RAD 11.3 patch 1 ... I DONT HAVE any reference to sources for BlockWrite/BlockRead function!... Find Declaration show nothing!!! System.pas, line 12283, function _BlockWrite(var F: TFileRec; Buffer: Pointer; RecCnt: Integer; RecsWritten: PInteger): Integer; -
BlockRead & BlockWrite - E2010 error
programmerdelphi2k replied to Jud's topic in RTL and Delphi Object Pascal
@Jud I think that this is +1 error on current Documentation ... in https://www.delphibasics.co.uk/RTL.php?Name=BlockWrite / BlockRead you'll see that BlockWrite/BlockRead is a "PROCEDURE"... not a function! including in FreePascal https://www.freepascal.org/docs-html/rtl/system/blockwrite.html // blockread.html -
No Call Stack in CPU window, or App hangs, and what to do next?
programmerdelphi2k replied to terran's topic in General Help
no code, no (possible) solution! basic infos it's necessary to start how is it ( environment: O.S./platform/etc...) how is it (DLL/ how is it called/ etc..) etc.. etc.. etc... -
BlockRead & BlockWrite - E2010 error
programmerdelphi2k replied to Jud's topic in RTL and Delphi Object Pascal
better read the "warning" and decide if "you should really still with it" -
"natural" compare function for sort
programmerdelphi2k replied to Tommi Prami's topic in Algorithms, Data Structures and Class Design
@Ian Branch I think that the Natural Order (to computer) is based on "symbol's" numerical value on the table used not? (normally ASCII table) Which would come first for you: the letter "a=97 / A=65" (lowercase or uppercase), or the number "0 = 48" (zero)? me(...) X StrCmpLogicalW(...) -
Is there a Sunday between 2 dates ?
programmerdelphi2k replied to Henry Olive's topic in RTL and Delphi Object Pascal
I can also interpret that, with advancing age, many things become difficult to interpret or "accept", so, to finish the succinct question and disagreements: YOU WON and I lost! Period! the said for the unspoken, and, we're all going to have a smooth and cold beer to cool the neurons! -
Is there a Sunday between 2 dates ?
programmerdelphi2k replied to Henry Olive's topic in RTL and Delphi Object Pascal
while YOU ARE in the "date", there is not any Mid-night... otherwise you would be in the next day! -
Is there a Sunday between 2 dates ?
programmerdelphi2k replied to Henry Olive's topic in RTL and Delphi Object Pascal
I think that is "well refined" not? any way... -
Is there a Sunday between 2 dates ?
programmerdelphi2k replied to Henry Olive's topic in RTL and Delphi Object Pascal
@Henry Olive When evaluating how many "Sundays" between two dates, we must take into account the following: sundays between the two dates: 25, 26, 27, 28, 29, 30, 01, 02 = 0 sundays between 2 dates D1 = Jun/25 2023 = Sunday D2 = Jul/02 2023 = Sunday How many "Sundays" are there "BETWEEN" the two dates? A: 0 sundays Using AWE's answer, then, I think it needs revision, no? *answer = 2 sundays That is, as we want to know "how many Sundays exist between two dates, then, we could not take into account the initial and final date, even if they were Sundays, because we are looking for "Sundays between dates", not "Sundays in dates ". -
Looking for a tutorial for taking picture ios, android Permissions
programmerdelphi2k replied to grantful's topic in Cross-platform
here you can study how do it in Android, BUT ... in Android some changes was implemented for new versions, mainly "disk access/folders". you can use "compiler directives" to separate Android / iOS / WINDOWS codes. https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Conditional_compilation_(Delphi) https://en.delphipraxis.net/topic/4168-fmx-android-using-cam-on-mobile-to-capture-video-and-target-to-timage-permissions-use/?tab=comments#comment-35707 -
IDE - Delphi 11.1 "View Unit" and "View Form" buttons stopped working.
programmerdelphi2k replied to Louis Kriel's topic in Delphi IDE and APIs
another way, you can try this: copy your problematic text in a any new unit (.PAS) --> you can create using your Notepad/Notepad++/ etc... or saving your "pasted text" in your current unit in the Editor now, try open this file in your IDE normally, the RAD identify that exists some line-feeds non-default (like used in Unix files) and try solve it! -
TListBox - grouping of items and horizontal scroll bar
programmerdelphi2k replied to kaarigar's topic in FMX
code fixed!!! -
TListBox - grouping of items and horizontal scroll bar
programmerdelphi2k replied to kaarigar's topic in FMX
@kaarigar you can try some like this: FIXED implementation {$R *.fmx} procedure TForm1.Btn_Create_ItemsClick(Sender: TObject); const LHeaders: array [0 .. 2] of string = ('Header1', 'Header2', 'Header3'); var LBGHeader : TListBoxGroupHeader; LBGHeaderHeight: single; LBItem : TListBoxItem; LBItemHeight : single; LItemHeight : single; LHowManyItems : integer; begin // reset all default values... ListBox1.Clear; ListBox1.ItemHeight := 0; ListBox1.ListStyle := TListStyle.Vertical; ListBox1.Columns := 1; // LBGHeaderHeight := 19; // default values LBItemHeight := 19; LHowManyItems := 1; // for var i: integer := 0 to high(LHeaders) do // if headers with distinct height, then needs some calc... begin LBGHeader := TListBoxGroupHeader.Create(Self); LBGHeader.Text := LHeaders[i]; ListBox1.AddObject(LBGHeader); LBGHeaderHeight := LBGHeader.Height; // here you can verify if a Header is > than before // LHowManyItems := Trunc(SpinBox1.Value); // for var j: integer := 1 to LHowManyItems do begin LBItem := TListBoxItem.Create(Self); LBItem.Text := '... Item' + j.ToString; ListBox1.AddObject(LBItem); LBItemHeight := LBItem.Height; // if Item with distinct height, then needs some calc... end; end; // LItemHeight := ListBox1.ClientHeight - (LBGHeaderHeight + 1); // (LBGHeaderHeight + 1 = line-separator LItemHeight := (LItemHeight / (LHowManyItems + 1)); // LHowManyItems + Header // ListBox1.ItemHeight := LItemHeight; ListBox1.ListStyle := TListStyle.Horizontal; end; initialization ReportMemoryLeaksOnShutdown := true; end. -
"natural" compare function for sort
programmerdelphi2k replied to Tommi Prami's topic in Algorithms, Data Structures and Class Design
@Tommi Prami in time, (almost 3 year is nothing... isn't) my sample no-dependences of DLL, then you can use it in any platform! https://en.delphipraxis.net/topic/9276-my-tstringlist-custom-sorting-trying-to-mimic-windows-explorer-way/ -
@Johansy in fact, you dont needs any 3rd components, you can use native controls in FMX RAD.. RAD 11.3 1 TImage to load original image / 1 to preview / 1 to cropping (for my tests) 1 TSelection to "select your area" on screen (in case, in my TImage Original image) a little code to work! if needs more actions, just do it... for example: rotations, Image1.RotationAngle := 90; ... when cropping you needs rotate the values in Rect( L,T, R, B) etc... nothing complicated at all. for "Position" on Preview or Cropping TImage, just use the coordenates X,Y... not "0,0" ... to Mobiles, use (in Selection control) a TGestureManager + events as Mouse events! type TForm1 = class(TForm) imgOriginal: TImage; Selection1: TSelection; Rectangle1: TRectangle; imgPreview: TImage; Label1: TLabel; Rectangle2: TRectangle; imgCropping: TImage; Label2: TLabel; Btn_Cropping: TButton; procedure Btn_CroppingClick(Sender: TObject); procedure Selection1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Single); procedure FormCreate(Sender: TObject); procedure Selection1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single); procedure Selection1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single); private public end; var Form1: TForm1; implementation uses FMX.MultiResBitmap; {$R *.fmx} var LRect : TRect; LMovingMouse: boolean = false; procedure MyCroppingBitmap(ASelX, ASelY, ASelW, ASelH: Single; AImgSrc, AImgTrg: TImage); var LCBItem: TCustomBitmapItem; begin LRect := Rect(Trunc(ASelX), Trunc(ASelY), Trunc(ASelW), Trunc(ASelH)); // if AImgTrg.MultiResBitmap.Count > 1 then AImgTrg.MultiResBitmap.Clear; // always you'll have 1 Item!!! // LCBItem := AImgTrg.MultiResBitmap.Items[0]; // note: Always exists 1 item!!! LCBItem.Bitmap.Width := Trunc(ASelX + ASelW); LCBItem.Bitmap.Height := Trunc(ASelY + ASelH); LCBItem.Bitmap.CopyFromBitmap(AImgSrc.Bitmap, LRect, 0, 0); end; procedure TForm1.FormCreate(Sender: TObject); begin imgOriginal.WrapMode := TImageWrapMode.Original; // ? imgPreview.WrapMode := TImageWrapMode.Original; // ? imgCropping.WrapMode := TImageWrapMode.Original; // ? end; procedure TForm1.Selection1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single); begin LMovingMouse := true; end; procedure TForm1.Selection1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single); begin LMovingMouse := false; end; procedure TForm1.Selection1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Single); begin if LMovingMouse then MyCroppingBitmap( { } Selection1.Position.X, { } Selection1.Position.Y, { } Selection1.Position.X + Selection1.Width, { } Selection1.Position.Y + Selection1.Height, { } imgOriginal, { } imgPreview { } ); end; procedure TForm1.Btn_CroppingClick(Sender: TObject); begin MyCroppingBitmap( { } Selection1.Position.X, { } Selection1.Position.Y, { } Selection1.Position.X + Selection1.Width, { } Selection1.Position.Y + Selection1.Height, { } imgOriginal, { } imgCropping { } ); end; initialization ReportMemoryLeaksOnShutdown := true; end.
-
@Gonzalo Fernandez another suite can be GrijjyCloudLogger, remote logging for Windows, iOS, Android, macOS and Linux https://blog.grijjy.com/2017/08/22/grijjycloudlogger-remote-logging-for-windows-ios-android-macos-and-linux/
-
@Uwe Raabe https://community.embarcadero.com/blogs/entry/using-app-tethering-to-enable-codesite-for-tracing-mobile-apps-with-bob-swart Look this:
-
My TStringList custom SORTing, trying to mimic Windows Explorer way
programmerdelphi2k replied to programmerdelphi2k's topic in Algorithms, Data Structures and Class Design
I think that no really needs "MyReCreatingMyString( ... )" at all... you can delete it!!! Now, let's study "Natural Sort Order..." ... 🙂 unit uMyTools; interface function MyNormalizeString(AStr: string; AValLength: byte = 10): string; implementation uses System.SysUtils, System.StrUtils; const LMyDigits: TSysCharSet = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']; function MyNormalizeString(AStr: string; AValLength: byte = 10): string; var LStr: string; LVal: string; LEnd: integer; begin LStr := ''; LVal := ''; LEnd := AStr.Length; // { ex. Text1 and Text1234567890 and Text123456789012345 = part complex!!! AValLength := ? Text0000000001 Text1234567890 Text123456789012345 // ... we can have it with distinct length, then we use an arbitrary value! } if (AValLength < 10) then AValLength := 10 else if (AValLength > 20) then AValLength := 20; // for var i: integer := 1 to LEnd do begin if CharInSet(AStr[i], LMyDigits) then begin LVal := LVal + AStr[i]; // if ((i + 1) <= LEnd) and not(CharInSet(AStr[i + 1], LMyDigits)) then begin LStr := LStr + DupeString('0', AValLength - LVal.Length) + LVal; LVal := ''; end; end else LStr := LStr + AStr[i]; end; // if not LVal.IsEmpty then LVal := DupeString('0', AValLength - LVal.Length) + LVal; // result := LStr + LVal; end; end. function MyStringListCustomSort(SL: TStringList; ALeft, ARight: integer): integer; var LCLeft, LCRight : string; CmpLeft, CmpRight: string; begin LCLeft := LowerCase(SL[ALeft]); LCRight := LowerCase(SL[ARight]); // CmpLeft := MyNormalizeString(LCLeft); CmpRight := MyNormalizeString(LCRight); // result := CompareStr(CmpLeft, CmpRight); // if (result = 0) then result := CompareStr(LCLeft, LCRight); end;- 5 replies
-
- tstinglist
- sort
-
(and 2 more)
Tagged with:
-
on site said: 03/27/2023 laste updates... then, I think that is working
-
W1057 during D7 -> D11 conversion
programmerdelphi2k replied to Bart Verbakel's topic in Algorithms, Data Structures and Class Design
@Bart Verbakel did you see this: https://docwiki.embarcadero.com/RADStudio/Alexandria/en/W1057_Implicit_string_cast_from_'%s'_to_'%s'_(Delphi) <your_target_string> := string(<your_ansi_source); // explicitly before usage, avoid implicity convertion NOTE: See too https://docwiki.embarcadero.com/RADStudio/Alexandria/en/W1059_Explicit_string_cast_from_'%s'_to_'%s'_(Delphi) (Explictiy: warning ) As rule: avoid ShortString in new IDE! or use "compiler directives" {$IFDEF VER350} xxxx {$ELSE} wwww {$ENDIF} https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Compiler_Versions https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Conditional_compilation_(Delphi) -
How to Sort TStringList ?
programmerdelphi2k replied to amit's topic in RTL and Delphi Object Pascal
@amit try my sample https://en.delphipraxis.net/topic/9276-my-tstringlist-custom-sorting-trying-to-mimic-windows-explorer-way/ -
Change Target Application Name depended on DIRECTIVE setting.
programmerdelphi2k replied to amit's topic in Delphi IDE and APIs
@amit you can try this way: create a bat file with your logic ( you'll need define a enviroment var with your new-name, for example...) using the Post-Build event you can call it rem --- OldName = full path + filename = c:\...\MyOldName.exe set OldName=%1 rem --- NewName = new file name = MyNewName.txt set NewName=MyNewName.exe rem ---------- renaming file ----------- ren %OldName% %NewName% > texto.txt -
How to Sort TStringList ?
programmerdelphi2k replied to amit's topic in RTL and Delphi Object Pascal
sorry, all wrong !!!