Pat Foley
Members-
Content Count
403 -
Joined
-
Last visited
-
Days Won
2
Everything posted by Pat Foley
-
F2047 Circular unit reference.
Pat Foley replied to dmitrybv's topic in RTL and Delphi Object Pascal
Alternate way. Consider program schema to 'Broker' serving UI by listening to events In FMX you can use TControl where in VCL TWinControl usually needed. Meaning only deal with the components. The broker or server of Application sits in a Datamodule. This broker listens for User generated events and updates the Control UI in response. Also the broker updates the UI on timer events. Using java style to find controls ClassName 'TStringGrid' vs ClassType(TStringGrid) to find controls to assign the update. The FMX allows forms considered as TControls where in VCL screen.formname is used to find form needed. Stream in the forms dfm Controls change fixup~to bind the updates Need less timers Uwe's shows one cycle three deep on a project with 30 forms Alex's graph works well too. -
Looking for Coder in Gilbert, AZ
Pat Foley replied to Matt Nielsen's topic in Job Opportunities / Coder for Hire
For Gilbert AZ, I would visit the local maker spaces and visit with the people in each to find possible people looking for full time work. https://www.yelp.com/search?cflt=makerspaces&find_loc=Gilbert%2C+AZ The University down should have a space too. Crash one of their job fairs for students looking for work or contact their placement office for candidates. Plan B: Conduct training sessions at one of these spaces to roll your own enlightened employee. -
How to debug a Not Responding program element
Pat Foley replied to Willicious's topic in Delphi IDE and APIs
Another source is the source in Vcl.WinXCalendars.pas if your Delphi is new enough. Look at TBaseCalendarAnimation in how it updates on its timerevent. -
RAD Studio 12 Update 1 IDE Instability
Pat Foley replied to Navid Madani's topic in Delphi IDE and APIs
I had a path issue to my mycontrolLibrary. I fixed by making a hard path to it. Though this is on Windows and not ARM it still may useful. Is check if the IDE can "see" the namespaces in uses clause by hovering over them. If not try a syntax check or compile after manually loading unit not "seen" until the IDE shows the blue tag. After a few days the need to 'prime' the IDE went away and no more small empty blue tags. -
How to debug a Not Responding program element
Pat Foley replied to Willicious's topic in Delphi IDE and APIs
Pre-make may be a bad 'fork' 😞 Otherwise saving the treeview and and reloading the treeview could allow a game to be restarted at the level the game was when tree was saved. Rather than needing to play the game at lower levels each time starting the game. Loading the game saved at higher level would save the users time. Or does the menu already have this feature? -
How to debug a Not Responding program element
Pat Foley replied to Willicious's topic in Delphi IDE and APIs
One. Just load a pre made with TV.LoadFromFile(wellformedTV.txt) and hookup as needed. Two. Your onidle is missing the pausing and userpause Booleans used in other Lemmix repros. So a Pause can not exit the onidle event. -
How to debug a Not Responding program element
Pat Foley replied to Willicious's topic in Delphi IDE and APIs
What does the SetInfo do on the TV.onclick? I populate my treeview childnodes by finding all the menuitems at startup. Then assign the menuitems onclick to the TV. The TV then follows the menu settings. Emba has Space Rocks game on Getit. Jim M uses a list to animate the rocks as they created and destroyed. Treeview has savetofile and loadfromfile. How is the game paused? is it ctrl- C? In the future pause the game not the IDE, insert a breakpoint, and restart the game. The IDE will then pause at breakpoint. -
Also the 290 version should be given a new guid unless using the '280' source is wanted. A new interface needs a new guid.
-
I didn't know about tabcontrols. Just started styles last month. Here's my stab at it using 'Tabber' for the symbol of the TabControl Sender vs 'control' and an assignable TStylefont enum. procedure TForm7.TabControl1DrawTab(Tabber: TCustomTabControl; TabIndex: Integer; const Rect: TRect; Active: Boolean); var TabStr:String; Pt : TPoint; R: TRect; TabUnderMouse:Integer; JohnFontcolorStyle: TStyleFont; begin with Tabber do begin Pt := ScreenToClient(Mouse.CursorPos); TabUnderMouse := IndexOfTabAt(Pt.X, Pt.Y); // Setting default font color to normal JohnFontcolorStyle := sfTabTextActiveNormal; if (TabUnderMouse = TabIndex) and Active then JohnFontcolorStyle := sfTabTextActiveHot; if Active then JohnFontcolorStyle := sfTabTextActiveNormal; if TabUnderMouse = TabIndex then JohnFontcolorStyle := sfTabTextInActiveHot; with Canvas do begin R := Rect; Font.Color := TStyleManager.ActiveStyle.GetStyleFontColor (JohnFontcolorStyle); if TabIndex = 0 then Font.Style := [fsStrikeout]; TabStr := (Tabber as TTabControl).Tabs[TabIndex]; // ? Brush.Style := bsClear; DrawText(Handle, PChar(TabStr), Length(TabStr), R, DT_SINGLELINE or DT_VCENTER or DT_CENTER); end; end;
-
Set the DB to read only in viewing mode to prevent inadvertent record changes. Have the user log in when updating a record.
-
Insert/Repalce image in MS Word Document
Pat Foley replied to Jeff Steinkamp's topic in General Help
Inside of Word record a macro doing your steps. Then use the terms found in Word's macro source in your Delphi source. -
Delphi 12 - Breakpoint not work when use Rumtime Packages and Win64 platform
Pat Foley replied to giorgiobazzo's topic in Delphi IDE and APIs
uses Vcl.Forms, MyUnit, //From TrPartUnits.bpl, if remove, breakpoint works in win32 and win64 AppForm in 'AppForm.pas' {Form2}; {$R *.re Based on your info when the myunit is removed it compiles. Delphi 12 in debugger mode even with update often shows the dissembler first under a tab. To avoid compile the program and start the program using the browser in "attach to process" under the run button to start the executable and press f7-f9 buttons if hung up in the dissembler. If blue dots not lined up with the source check path.- 10 replies
-
- delphi 12
- rumtime packages
-
(and 2 more)
Tagged with:
-
Delphi 12 - Breakpoint not work when use Rumtime Packages and Win64 platform
Pat Foley replied to giorgiobazzo's topic in Delphi IDE and APIs
Reading between the lines means using a string for finding a form in runtime with the Screen. Or Each Library should just launch its own forms or class var singleton form as needed.- 10 replies
-
- delphi 12
- rumtime packages
-
(and 2 more)
Tagged with:
-
Delphi 12 - Breakpoint not work when use Rumtime Packages and Win64 platform
Pat Foley replied to giorgiobazzo's topic in Delphi IDE and APIs
program App; uses Vcl.Forms, MyUnit, //From TrPartUnits.bpl, if remove, breakpoint works in win32 and win64 = please don't put MyUnit here AppForm in 'AppForm.pas' {Form2}; {$R *.res} begin Application.Initialize; //Breakpoint here: on win32 is ok, but 64 the breakpoint dont stop! Application.MainFormOnTaskbar := True; Application.CreateForm(TForm2, Form2); Application.Run; end. If myunit is available in a library, it can't also be in the program's dpr. Access the Library myunit in each unit uses clause as needed! If the unit uses clause doesn't see myunit adjust the path. Putting my myunit in apps dpr will hide these issues and defeats the goodness of modular construction methods.- 10 replies
-
- delphi 12
- rumtime packages
-
(and 2 more)
Tagged with:
-
A gem from the past (Goto)
Pat Foley replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
Here is a dangerous example of Goto causing endless loop you never finish this gamebook's first edition. In the gamebook You Can Be The Stainless Steel Rat by Harrison. There's an example of a typo goto 290 should be goto 190. https://stainlesssteelrat.fandom.com/wiki/You_Can_Be_The_Stainless_Steel_Rat -
I try to use EM units say roughly a font of 72 would be one inch high, on a laser printer of 600 dpi you get one inch high lettering. Using CSS you can set the sizing to show the ... when the ... rule is set. Somehow windows can make small images when hovering over an icon or medium size images in task view. What's neat the image is animated. Now I just right-size the form and use units of "fat-finger" on custom control resize events. This resize event helps on the 4k machines.
-
Say with periodic stuff like TDateTime Trunc works well if it understood that right now is yesterday date + 0.xxxx fraction so Trunc not supposed be rounding up to zero when negative. Conversely On the Unit circle a truncated 1/4 turn needs one turn added to get a "reading" of 1 Now to turn back that turn added, we remove that turn when looking at "negative values" (-1/4 - 1) = Trunc(-1.25) = -1.
-
Viewing All the Digits of Pi in Real Time with Delphi
Pat Foley replied to Jim McKeeth's topic in I made this
In you missed it Two Pie day or Tau June 28 is coming! https://tauday.com/tau-manifesto Article about using Tau in schools.- 1 reply
-
- pi
- bigintegers
-
(and 3 more)
Tagged with:
-
Why not put a break point in it and use the call stack to see who needs it since you found the unit. Or comment out half the enums or settings in it. If it's only a dcu--view in a text editor. The graph tool does have a build order output that could in help placing a breakpoint when compiling when unit is renamed.
-
Style sludge and shadow it's hard to know which window is showmodal. I like to move the cursor to control being surfaced to help end user know which window has focus. Windows is flashing the active window though the smoke to alert you pushing buttons on inactive window.
-
I don't want to change anything about other controls, I just need a control to be on top of all others. Here's putting the label on a tabsheet. This allows giving a context to incoming label. By using tabsheets in the IDE you can group controls readily Then show only what is needed in runtime. var ts: TTabsheet; var labelNu: Integer = 1; procedure TForm1.AddLabelwithTabbedIndexClick(Sender: TObject); begin ts:= TTabsheet.Create(Self); ts.PageControl := PageControl1; ts.Caption := LabelNu.ToString; var llabel := TLabel.Create(Self); //was TStaticText llabel.Name := 'llabel' + LabelNu.ToString; lLabel.Caption := 'label&' + LabelNu.ToString; lLabel.Parent := ts; //LLabel.TabStop := True; ts.TabVisible := True; Inc(labelNu); end; procedure TForm1.RandomShowHideTabClick(Sender: TObject); begin ts := PageControl1.Pages[Random(PageControl1.PageCount)]; with ts do TabVisible := not tabVisible; end; procedure TForm1.Showllabel1Click(Sender: TObject); begin var lbl := FindComponent('llabel1'); (lbl as TControl).show; end;
-
You could hide the pagecontrol to show the label parented to the form or change the label parent to control on top. I would use a Tpanel set to top align that "pushes" the Tabsheet/pagecontrol down to mimic the banners used in MS's XL when showing.
-
A Memory Game in Delphi
Pat Foley replied to LaryRose's topic in Algorithms, Data Structures and Class Design
To find what is not connected, use the debugger. Switch from the form view ~design tab to the code view and insert a breakpoint on a line that has a blue dot on it in left gutter. Using F5 will cover the blue with red dot if the project is in debug mode selected in manager. Test the Button click it should halt program at the program line selected. Test the DrawGrid ondraw event next. If the program doesn't break at the breakpoint, inspect if the Drawgrid1 event ondraw is assigned using the object inspector Events tag. -
Observations 12 Patch vs 11.3 12 eats inifile lines commented out using ; Unsure if the IDE or program made is doing it. 12 IDE editor tabs get resized just like GEx tabs when hot switching from 4K to low resolution. Suggesting that Style needs applied for high DPI to work. An executable with style seems to "right" size readily:)
-
Delphi and "Use only memory safe languages"
Pat Foley replied to Die Holländer's topic in General Help
Just a shake down by the government. Consider the Tik-Tok uproar last year. The Tik-Tok lobbyists silenced the talk by talking to the complainers and voila Tik-Tok is good. If you want your stuff used get a good lobbyist!