Pat Foley
-
Content Count
367 -
Joined
-
Last visited
-
Days Won
2
Posts posted by Pat Foley
-
-
Hey, the only I know about Pix is the spanking received after burning a hole in Leica shutter curtain during an eclipse of the sun event. So would this SO help Daytime sunny color 6300 vs limelight and night shots? https://stackoverflow.com/questions/38876429/how-to-convert-from-rgb-values-to-color-temperature Then add entropy(S) Squished or Stripped and say 3/5 DOF Degrees of Liberty/Freedom to allow/justify different coefficients?
-
4 hours ago, Uwe Raabe said:Well, FormatFloat acts as expected;
for var I := 1 to 10 do Writeln(FormatFloat('', I/10)); for var I := 1 to 10 do Writeln(FormatFloat('', I*Power10(1, 14)));
That works for pH Scale. Closer range, scale and offset yields:
procedure TForm21.Button1Click(Sender: TObject); const ZeroOffset = 7; var X: double; I: Integer; begin for I := -7 to 7 do begin X:= Power(10,I); Memo1.lines.add(Format('pH %d oh %G',[i + ZeroOffset,x])); end; end; (** pH 0 oh 1E-007 pH 1 oh 1E-006 pH 2 oh 1E-005 pH 3 oh 0.0001 pH 4 oh 0.001 pH 5 oh 0.01 pH 6 oh 0.1 pH 7 oh 1 pH 8 oh 10 pH 9 oh 100 pH 10 oh 1000 pH 11 oh 10000 pH 12 oh 100000 pH 13 oh 1000000 pH 14 oh 10000000 **)
-
2 hours ago, Gord P said:It's not the end of the world to have to implement something like this. Not looking for a ton of performance at this place in the program. You can change order_of_mag to any order of magitude you want to start using scientific notation. Haven't tested it thoroughly yet to see if captures every scenario.
That's a good start! Say if you running a chemical treatment controller for million gallons of drinking water per day. You set the Chart scale at 0 to 10 parts per million and gpm scaled zero to 1000 gpm either by fitting to your scale or add axis as needed . Look at the graphs in white papers in the field you are working in to determine if part per million or part per billion. Note Engineering Unit is SI or in US USCS known to some as field units requiring additional scaling need.
-
I made the assumption that my D1-7 custom controls were only 32 bit x86 so made all new controls for 64 bit x64 on D10.2 several years ago. (Naive and fear, uncertainty and dread caused by the marketing and not staying current.
lately, I found some of the custom TGraphiccontrols actually work better on a touch screen and readily cast to TV with Bluetooth. (Albeit a new win11 machine)
In 32 x86
- The question is under D7 is there any warnings or hints as each library or package is compiled?
- The question is under D10 is there any warnings or hints as each library or package is compiled?
In 32/64 x64
- have dcu64 directories to prevent error 2048 found x86 wanting x64 before trying to compile 64*.
- use NativeInt vs integer for offsets if using pointers.
- after a build all check the dcu filedatetimes to verify all the code actually compiled.
*In case the 64 compile ever needs to be recompiled.
-
38 minutes ago, Uwe Raabe said:And, no, you can't write [Button1..Button5] here
Put in a FlowPanel to make visual collection and Buttons are listed as FlowPanel.Controls. 🚋
42 minutes ago, Uwe Raabe said:While suggesting to have descriptive names for the buttons
Here's sample based on Cantu's 10.4 guide. Button renamed Karma operates two checkboxes with descriptive event handlers.
Type TKarma = 0..10; const KarmaRatingCutoff = 7; //allow good Karma when good most of the time was 8 var Goody: Boolean = False; KarmaRange: TKarma = High(TKarma); KarmaNow: TKarma = 0; procedure TForm21.KarmaChange(Sender: TObject); begin Screen.Cursor := crAppStart; //calm the user with phone like spinner Karma.OnClick := nil; Bad.OnMouseDown := nil; Good.OnMouseDown := nil; //snuff the event handlers Karma.Enabled := False; Bad.Enabled := False; Good.Enabled := False; //prevent user input KarmaNow := Random(KarmaRange); Goody := KarmaNow > KarmaRatingCutoff; //direct assignment no ifs + Ranged to conserve the KarmaBase sleep(7); // Good.Checked := Goody; Bad.Checked := not Goody; if Goody then Karma.Hint := 'Yaa' else Karma.Hint := 'Yuch'; Karma.ShowHint := True; Screen.Cursor := crDefault; // Bad.OnMouseDown := BadmdEvent; // Good.OnMouseDown := GoodmouseEvent; restore one at a time to find bad actors Karma.onClick := KarmaChange; Karma.Enabled := True; end;
-
So inside an application with many forms and Controls you could build a list of Controls addresses by searching by form name and then component name and use list later with getparentform is easy to bringtofront and show needed controls. Or realizing the list when custom controls or even standard controls are loaded at runtime.
- 1
-
deleted
-
The dproj has a Guid assigned to it. It rhymes with Gui-de cheese most of the time. but when it used as interface* that once named can't be changed or need to be renamed if the Interface* is changed. If not then Guid rhymes with Squid.
The question is when the project is not compiling--OK to just index the Projects Guid until the bad code is removed or repaired? I bumped the projects Guid 3 times to fix a boo-boo. But likely not a good practice to share.
Or say some naive person like me lays out a blank project with its directory and sub directories laid out, then copies the layout to new directory for a new project, finds out later there's two projects with same Guid.
*If is used as an Interface not just a marker.
Pat
Note seen an eye catcher at line 4689 in System.Classes Putting 4690 first would read better
-
I installed GExperts on primary machine with intent of loading the source to test how a background program sees it... Short answer 10 days out. Question is type "svn commands paths as needed" at cmd prompt or in the Navigator of a browser? Liking to do on secondary machine which SSD is 8 years old so plan archiving disk and get machine with win11 pro before winter. Sorry, Boss 😞
Here's how my program sees the GExpert ASCII Table. The blank line is the taskbar. Regardless of desktop the program focuses to instance clicked. The user working on D11 in Desktop4 can click on the line ASCII Chart and windows surfaces ASCIITABLE window in DeskTop1 where say 10.4 is opened.
hr 12.453 MTD - Delphi 11 - frmMultiDee [Running] [Built] hr 12.470 frmMultiMain hr 12.476 ASCII Chart hr 12.477 frmMultiMain hr 12.489 hr 12.492 frmMultiMain
-
-
When the main form is minimized it will hide the other forms so users can work on other Applications. Clicking on the taskbar will surface the windows again as they were before the application was minimized. It may be the main form was set in the object inspector to be topmost window. And/or bring secondary form to front and then just show over the other forms virtually hiding them. Then simply hide said form and other windows will still be there.
-
10 minutes ago, Jeff Steinkamp said:But, when I minimize the main form
Try hiding the mainform
-
9 minutes ago, Remy Lebeau said:The CreateParams() method is called by the TWinControl.Handle property getter whenever the TForm's HWND window is being created
I did look at the source of TCustomForm to be sent to TScrollingControl did not find the stuff. I did stumble into a Menu & decider a while back 🙂
7 hours ago, Remy Lebeau said:there is a lot of decision-making going on in that method to decide which owner window to use.
-
2 minutes ago, Jeff Steinkamp said:If you read the code I posted, TSelectContest is NOT the issue. the Issue with
TMyContest.Create(nil, tablename);
Try tablename := TMyContest.Create(Application);
-
1 hour ago, Jeff Steinkamp said:and here is the calling code from the main form:
dlg := TSelectContest.CreateNew(self, false);
CreateNew is AFAIK is for forms without .dfm. That may hiding your Create! You should able to show and hide forms once created. and use windows task bar to navigate.
-
I to use this on a show modal
class procedure Taboutbox.showme; begin aboutbox := Taboutbox.Create(nil);
and this on other form now I pass the sender so that the Sender is the owner. The owner has a list of controls that it frees on closing.
Class procedure TSCSForm.showme(const AText:string; const ATime:integer); begin if not assigned(SCSForm) then SCSForm := TSCSForm.Create(nil); // should have used sender for the owner with SCSForm do begin if ATime > 0 then TimedStop := True; timer1.Interval:= Atime; Label1.caption:=Label1.caption + CR + AText; if not SCSForm.Showing then begin Show;
Are you using a DataModule?
-
How about reducing the number of ifs needed. Or Less ifs = less need for else ifs ending with an else 😞! The need for formatting to get "readable" code is reduced. Debugging is readily done if or when needed.
I used on jobs in XL on a Mac in the eighties and consider the flyover case copyrighted in the Excel realm.
- Set each Boolean state first with assignments then use these "Uwe's" or Explainer variables in the if assignments.
- Assignments with a Nil state implementing default short circuit are more visible.
-
Example case statement repeatedly steps though an enumerated Type setting states in the order of the Enum.
/// <summary> Beep when A and B are true</summary> /// <remarks> /// Or allows R to retain true result of each lines test; /// Set R to False start of logic and apply the braces as and/or if needed in the assignments! /// </remarks> procedure latchingLogic(A,B: Boolean); var R: Boolean; begin R := False; R := R or A and B; R := R or A and not B; R := R or not A and B; R := R or not A and not B; if R then // One if and zero elses = readable +++ Beep; //needs expanded to beep(freq, MS) IDE compiles anyway end; Type // <-- more true precedent inversion to allow fitting to OP example TabTrueFalse = (abTrueTrue, abTrueFalse,abFalseTrue, abFalseFalse); var A: Boolean = False; //example only these become class variables plus typed constants in 11.3 B: Boolean = True; procedure SetAThenBtoTrue(var A, B: Boolean); var I: Integer; abTest: TabTrueFalse; begin repeat // could be reentrant I := ord(not A) * 2 + ord(not B); // not allows present enumtype order abTest := TabTrueFalse(I); case abTest of // abTrueTrue: 'yaa'; abTrueFalse: B := True; // since A is True Ok to set B to True abFalseTrue: B := False; // We want A True first abFalseFalse: A := True; // set A true first end; until abTest = abTrueTrue; latchingLogic(A,B); // use for UI output end;
-
So, in short you could use Toprow first visible row.
The example adds an event to allow a progress bar to move with the grid as rows are used. The example sets the rowcount at 3600 then "adds" commatext. But I will admit I was thinking about a stringlist.
procedure SGAdjustView(Sender: TObject; const AIndex: Integer; PB: TProgressBar); begin if Sender is TStringGrid and (AIndex > 4) then with (Sender as TStringGrid) do begin TopRow := AIndex - 4; end; PB.Position := AIndex; end; procedure TbaseMainForm.AddrowClick(Sender: TObject); begin var LIndex := 0; var pastTick := GetTickCount64; SG.Rows[0].CommaText:= ('RowCount,Index,Time'); SG.RowCount := 60 * 60;//seconds in minutes per hour ProgressBar1.Max := SG.RowCount; while LIndex < (120 * 30) do begin Inc(LIndex); SG.rows[Lindex].CommaText :=(SG.RowCount.ToString +',' + LIndex.ToString +',' + (GetTickCount64 - pastTick).ToString); SGAdjustView(SG, Lindex, ProgressBar1); // moves the view each by calling event outside begin..end end; end;
-
I was thinking about Fixing BDSLauncher topic I followed this topic and my launcher started working. I was just saying the last IDE worked in should the one getting the file.
-
32 minutes ago, azrael_11 said:s there anyway to open this file at runtime from the specific Delphi IDE that i want and not the last one that opens?
Sure. Go to the IDE you want the file loaded to and give last focus to it then do your double click business. Most users would want IDE last worked in to get incoming files. Note not tested across Desktops!
-
My concern is this about every 15 years
Well, that is a deep subject ~possible reply in conversation when "Well?" is asked.
In XL use the extended paste methods value, ref, blah, transpose from the ribbon, or a right click when over the target cell or range to get the number and not the text. Like a well you would dig deep into subject matter (floats integers strings) to get "water" from copy/paste schemes.
-
Why are you changing the rowcount it's done for you when you add a row?
Here's an example of updating/overwriting all the cell's each UI update in case old information became stale!
The SG column count is the Magic number 16 or the number of double fields in "atom". When the atom count is increased the SG Row count is bumped if needed.
There's a Conway's game of life in the /samples that may yield better results.
procedure TForm1.updateSG; var ii, R, C: integer; fPointer: Pdouble; //was^ not P begin for ii := 0 to Atoms.Count - 1 do begin C := 2 + ii mod 16; R := 3 + ii div 16; fPointer := Pdouble(Atoms.Objects[ii]); Screen2.StringGrid1.Cells[C, R] := format('%2.1f',[FPointer^]); end;
Here's more modern example in a customized generic class (TList<PApp>) that has a SG assigned to it. Here the SG in a form some where gets its rowcount touched when needed. In the UI clicking on SG causes that row's app to surface even on a different desktop.
procedure TptrApps.updateSG(inTool: ptrApp; inRow: Integer); begin if sgGrid.RowCount < inRow then sgGrid.RowCount := inRow + 1; var i := InRow; sgGrid.Cells[0, i] := inTool.Name;//sFirstTime; sgGrid.Cells[1, i] := inTool.Title; sgGrid.Cells[2, i] := inTool.ClassName; sgGrid.Cells[3, i] := inTool.Used.ToString; ///sgGrid.Cells[4, i] := inTool.sTime; sgGrid.Cells[5, i] := inTool.sVersion; end;
-
CategoryPanel or Tabsheets in pagecontrol with tabs left side. Or try the samples in /Samples for ideas. Ray K site https://delphibydesign.com/ has a few samples under downloads. I look at his generics samples from time to refresh how generics and even how to set earlier object list code.
-
Delphi 11.3 : FORSAKEN
in Delphi IDE and APIs
Posted
Hard to do when phone numbers lead to full messages or simply when other sales reps are "poaching the order" with invalid phone number. If an order is paid early or in cash probably should be adjusted. The email of invoice does not have mail address preventing mailing a signed invoice back. Is improved that the poach operation is before renewal offer is sent. Several years before deals were sent after paying renewal offer.
I think the company should treat subscribers as in a guild. This guild probably not as good as dock workers(stevedores) or longshoreman (operating engineer) guild would cover the senior members with a small stipend.😀