Pat Foley
Members-
Content Count
403 -
Joined
-
Last visited
-
Days Won
2
Everything posted by Pat Foley
-
That can save 400K For big savings remove Classes 1.5 M and SysUtils .2 M from the uses clause for a smaller lib.
-
How about using buffer items in second--These would be blank or ad space :)--but stay at 30 for height unless there is a way to insert a 15 height buffer first to center second items displays. TWinStatus = (WSallin,WSsecondround..WSoverallwinner) TTeam = record name: string; Lastwin: TwinStatus end; Teams, Opposers, Winners: Tlist; end; Teams: tlist; //build the controls.items at runtime // round := WSallin; //add half height dummy to second list if possible with Teams do begin if TTteam(items[ii]).Lastwin := round then add to listbox1.items if TTteam(items[ii]).Lastwin := TwinStatus(round + 1) then begin add to listbox2.items add dummy to listbox2.items end; end;
-
Out parameter is read before set
Pat Foley replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
type TJobflag = (jfstart, jfAdd, jfLoaded, jfDone); Tcompareflag = (cfCaps, cfDupes); Jobs = set of TJobflag; Compares = set of Tcompareflag; function AddItems2(const aArray: array of string; var aList: TStrings; aCompareSet: Compares) : TJobflag; var jobSpecification: Tcompareflag; S: string; RC: Boolean; begin result := jfDone; RC := False; for S in aArray do begin for jobSpecification in aCompareSet do begin RC := (jobSpecification = cfCaps) // and // compare S for Caps; RC := RC or (jobSpecification = cfDupes) //and dupes found If RC then begin if not assigned(aList) then aList := TStringList.create aList.add(S); end; end; result := jfLoaded; end; end; try if AddItems2(['Hello', 'World'],lst, [cfCaps]) = jfLoaded then Writeln('True') else Writeln('False'); if lst <> nil then Writeln(lst.Text); finally { uncommenting this will raise an invalid pointer exception later } // lst.Free; end; Or procedure loadLists aList := TStringList.create result := jfDone; for S in aArray do begin for jobSpecification in aCompareSet do begin RC := (jobSpecification = cfCaps // and // compare S for Caps; RC := RC or (jobSpecification = cfDupes) //and dupes found If RC then aList.add(S); If RC then jobStatus := jfLoaded; end; end; end; // future Procedure processLists Abover my spin on it use enums to determine status testing for list = nil does not tell if list need was ever tested. -
Here's a book to read for 10.4 If Marco took the time to write it. We should take to time read it or at least read the stuff about connection and event and wrapping connect with try..finally. Also I would look for Cary Jensen He has books and videos about client data sets that may help your app.
-
I find that loading extra copy of 10.4 prevents the disappearing act. It prevents recompiling packages though. My vcl custom components when installed show only the non-visual components on the palette when making fmx application. But after making a fmx app switching to vcl app then a message box may appear stating that my components refer to Teechartxxx. Here's output of a component that runs in IDE as well as runtime. Using this in an app with timer.interval at 10 shows more stuff. // win32 works // in create of custom component if (csDesigning in ComponentState) then ticker.Enabled := true; //Tip by Delphian | 2014-08-13 at 17:05 function GetTitleOfActiveWindow: string; var AHandle: THandle; ATitle: string; ALen: Integer; begin Result := ''; AHandle := GetForegroundWindow; if AHandle <> 0 then begin ALen := GetWindowTextLength(AHandle) + 1; SetLength(ATitle, ALen); GetWindowText(AHandle, PChar(ATitle), ALen); result := Trim(ATitle); end; end; procedure TForm1.Timer1Timer(Sender: TObject); var awn: HWND; buf: array[0..1024] of Char; lng: longint; WinInstance: Thandle; WinModuleName: string; begin SetLength(WinModuleName,251); WinInstance := GetWindowLong(GetForegroundWindow(), GWL_hInstance); if WinInstance <> 0 then begin lng := GetModuleFileName(WinInstance, PChar(WinModuleName), Length(WinModuleName)); SetLength(WinModuleName, lng); end; awn := GetForegroundWindow; if awn <> 0 then begin GetClassName(awn, @buf, Length(buf)); if buf <> cacheAwn then begin Edit3.Text := buf; cacheAwn := buf; memo1.Lines.Add(cacheAwn); end; end else Edit3.Text := ''; Edit2.Text := GetTitleOfActiveWindow + ' ' + WinModuleName; end;
-
FMX TListView with dynamicappearance. Create progress bar as bitmap.
Pat Foley replied to skyzoframe[hun]'s topic in FMX
Runs OK! Good example of separation of units and runtime building. It may be easier to edit DFM file than drilling into Object Inspector. ItemAppearance.ItemHeight = 45 ItemAppearanceObjects.ItemObjects.ObjectsCollection = < item AppearanceObjectName = 'INDEX' AppearanceClassName = 'TTextObjectAppearance' Appearance.Width = 100.000000000000000000 Appearance.Height = 22.000000000000000000 Appearance.Align = Trailing end item AppearanceObjectName = 'VALUE' AppearanceClassName = 'TTextObjectAppearance' Appearance.Width = 100.000000000000000000 Appearance.Height = 22.000000000000000000 end item AppearanceObjectName = 'IMAGE' AppearanceClassName = 'TImageObjectAppearance' Appearance.ScalingMode = Original Appearance.Width = 200.000000000000000000 Appearance.Height = 5.000000000000000000 Appearance.PlaceOffset.Y = 32.000000000000000000 end>- 12 replies
-
- dynamicappearance
- tlistview
-
(and 2 more)
Tagged with:
-
FMX TListView with dynamicappearance. Create progress bar as bitmap.
Pat Foley replied to skyzoframe[hun]'s topic in FMX
Can't read RARs today. procedure TForm1.Button1Click(Sender: TObject); var I: integer; colorRect: TroundRect; begin for I := 1 to 100 do begin colorRect := TRoundRect.Create(self); with colorRect do begin Setbounds(0,10 * I, 34,34); //need to set size only parent := FlowLayout1; fill.color := Talphacolors.Gold; show; end; end; You could change the roundRect to other shapes as needed. the self in TRoundRect.Create(self) puts the object created in the forms list of Controls and/or Components for destruction later- 12 replies
-
- dynamicappearance
- tlistview
-
(and 2 more)
Tagged with:
-
FMX TListView with dynamicappearance. Create progress bar as bitmap.
Pat Foley replied to skyzoframe[hun]'s topic in FMX
1. Use FlowLayout and set properties of children controls. 2. Put a Progress bar over another.- 12 replies
-
- dynamicappearance
- tlistview
-
(and 2 more)
Tagged with:
-
Mixing vcl components into a fmx project group definely causes trouble. // CodeGear C++Builder // Copyright (c) 1995, 2021 by Embarcadero Technologies, Inc. // All rights reserved // (DO NOT EDIT: machine generated header) 'dclPat.dpk' rev: 34.00 (Windows) #ifndef DclpatHPP #define DclpatHPP #pragma delphiheader begin #pragma option push #pragma option -w- // All warnings off #pragma option -Vx // Zero-length empty class member #pragma pack(push,8) #include <System.hpp> // (rtl) #include <SysInit.hpp> #include <pfControllerB.hpp> #include <pattimerEX.hpp> ... #include <System.Messaging.hpp> // (rtl) #include <System.Actions.hpp> // (rtl) #include <Vcl.ActnList.hpp> // (vcl) #include <System.HelpIntfs.hpp> // (rtl) #include <System.SyncObjs.hpp> // (rtl) #include <Winapi.UxTheme.hpp> // (rtl) #include <Vcl.GraphUtil.hpp> // (vcl) #include <Vcl.StdCtrls.hpp> // (vcl) #include <Winapi.ShellAPI.hpp> // (rtl) #include <Vcl.Printers.hpp> // (vcl) #include <Vcl.Clipbrd.hpp> // (vcl) #include <Vcl.ComCtrls.hpp> // (vcl) #include <Vcl.Dialogs.hpp> // (vcl) #include <Vcl.ExtCtrls.hpp> // (vcl) #include <Vcl.Themes.hpp> // (vcl) #include <System.AnsiStrings.hpp> // (rtl) #include <System.Win.ComObj.hpp> // (rtl) #include <Winapi.FlatSB.hpp> // (rtl) #include <Vcl.Forms.hpp> // (vcl) #include <Vcl.Menus.hpp> // (vcl) #include <Winapi.MsCTF.hpp> // (rtl) #include <Vcl.Controls.hpp> // (vcl) #include <Vcl.Buttons.hpp> // (vcl) #include <VCLTee.TeeHtml.hpp> #include <VCLTee.TeeConst.hpp> #include <VCLTee.TeCanvas.hpp> #include <VCLTee.TeeFilters.hpp> #include <VCLTee.TeeProcs.hpp> #include <VCLTee.TeEngine.hpp> #include <VCLTee.Chart.hpp> #include <VCLTee.TeeSpline.hpp> #include <Consts_Gen.hpp> #include <pfTrackBar.hpp> #include <pfArrowButton.hpp> #include <sparkline.hpp> #include <VCLTee.Series.hpp> // SO_SFX: 270 // PRG_EXT: .bpl // BPI_DIR: C:\Users\Public\Documents\Embarcadero\Studio\21.0\Dcp // OBJ_DIR: C:\Users\Public\Documents\Embarcadero\Studio\21.0\Dcp // OBJ_EXT: .obj //-- user supplied ----------------------------------------------------------- namespace Dclpat { //-- forward type declarations ----------------------------------------------- //-- type declarations ------------------------------------------------------- //-- var, const, procedure --------------------------------------------------- } /* namespace Dclpat */ #if !defined(DELPHIHEADER_NO_IMPLICIT_NAMESPACE_USE) && !defined(NO_USING_NAMESPACE_DCLPAT) using namespace Dclpat; #endif #pragma pack(pop) #pragma option pop #pragma delphiheader end. //-- end unit ---------------------------------------------------------------- #endif // DclpatHPP Multi-device application chokes on the Tchart package in here. Short answer is don't mix vcl and fmx. I only have DX pro how's it making C++
-
If its not elevation In the past I seen Error code 5 after the machine is awakened from sleep mode.
-
Drilling into SysUtils shows SAccessDenied which is 'File access denied' so lost of elevation?
-
I suspect flooding in Texas. This map shows some outages down there. In Feb 2021 polar vortex may have caused similar issue.
-
virtualization VMWare Workstation PRO vs MS Hyper-V
Pat Foley replied to Drewsky's topic in Delphi IDE and APIs
Also your article on LIBSUFFIX https://www.finalbuilder.com/resources/blogs/advice-for-delphi-library-authors must be how the BDSs can find their vintage BPLs. My get by is putting shortcuts in the Desktop to select when using add Design Package. -
When I mentioned register I should have said install package. Open install packages under the Component menu. Use add to add Startpageidennn.bpl by clicking on it. Here's a table of version numbers. above didn't work. Delphi conditional VER<nnn> Product Product Version Package Version CompilerVersion VER340 Delphi 10.4 Sydney / C++Builder 10.4 Sydney 27 270 34.0 VER330 Delphi 10.3 Rio / C++Builder 10.3 Rio 26 260 33.0 VER320 Delphi 10.2 Tokyo / C++Builder 10.2 Tokyo 25 250 32.0 VER310 Delphi 10.1 Berlin / C++Builder 10.1 Berlin 24 240 31.0 VER300 Delphi 10 Seattle / C++Builder 10 Seattle 23 230 30.0
-
Main Menu on 10.3,10.4.2 Tabs has Welcome Page. 10.2 has a Toolbar for the code Browser. Selecting a dropdown brings up menu button for Welcome page.(It's tab is named Browser). 10.2 is where I got on. I wonder if you to register Startpageide260.bpl !!!! That's the version number for 20 or 10.3 You having older version 10.0 should be a smaller number.
-
Select Welcome Page menu item in view menu. Tested in !0.3 and 10.4
-
What about using Model View as a start and save each UML Class Diagram. In the past I put start up data in non visual components at design time and years later spent a little time trying to determine how the program was able to start... Looking at the DFM component's event assignments is another part of how the program works. Here's a program for cad files. https://www.iseekcorp.com//copy-of-cadseek-adviser
-
How can i retrive components from a dat file;
Pat Foley replied to azrael_11's topic in RTL and Delphi Object Pascal
Try streaming Tpanel with child objects in it object Panel1: TPanel Left = 536 Top = 24 Width = 251 Height = 106 Caption = 'Panel1' ParentBackground = False TabOrder = 0 object Button2: TButton Left = 24 Top = 16 Width = 75 Height = 25 Caption = 'Button1' TabOrder = 0 OnClick = Button1Click end object Edit1: TEdit Left = 112 Top = 72 Width = 121 Height = 21 TabOrder = 1 Text = 'Edit1' end end Simply copy paste these into a form in design window. then follow delphi - How to save and restore a form? - Stack Overflow -
There's some D5 code for adjusting 10MHz transmitters elsewhere on site https://vk4adc.com/web/index.php/software-projects/55-vk4adc-utils/181-gps2time
-
Disable the controls When data is loaded have future event enable controls. Rather than a progress bar have windows 10 olympic ring showing until future event happens.
-
Question Is the modal box selections touchable? Should be able to change settings just touching and tapping. I would only surface the keyboard for passwords and text edits The Tnumberbox should be just the ticket here.
-
After saving as new form name Go in Object inspector and change the name of the form. the form new name is applied in the implementation as well. Or simply show controls in sequence setting visibility as needed.
-
How to gracefully get rid of the use of dictionaries?
Pat Foley replied to Shrinavat's topic in General Help
You might consider white boarding or build simple model. Consider N,S,E,W as UI. Use a heading for instance. So the instance turns left West or right East when heading North. Heading South turning left means heading East on the UI. Then the business of quarter turns could be solved by quadants or (heading + 360 +/90) mod 360. Or given TDirection = (dirN, dirE, dirS, dirW) // note changed heading: TDirection; Const quarterTurn = 1 halfTurn = 2 //change direction by adding subtracting the turn Heading := TDirection((4 + ord(Heading) + quarterTurn)mod 4); -
How to compare performance between Delphi versions?
Pat Foley replied to Mike Torrettinni's topic in General Help
I run 10.3 together with 10.4.1 and now 10.4.2. 10.2 seems old school -
some of the trouble is the windows need destroyed downto in for loop. Destroying the top window first changes the indexes of the window. So with for LItem in LItem in FRegisteredStyleHooks do LItem.Value.Free; We need a "downin" source VCl.themes line 7510. My take.