Jump to content

Pat Foley

Members
  • Content Count

    403
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Pat Foley

  1. https://docwiki.embarcadero.com/CodeExamples/Sydney/en/PtInRect_(Delphi) The rectangle passed to PtInRect example could be a one wide "solid wall" adjusting Height with Y or a "water trap" adjusting width with X.
  2. Pat Foley

    Project Options -> Version Info aka. dproj madness

    To view the dproj file more readily, I used treeview's save to file to remove some of the nesting of xml files. Output << Memo << Treeview.save << TreeView from xml file. // Only 64 release information checked. DCC still shows// ... PropertyGroup DCC_DcuOutput .\$(Platform)\$(Config) ... VerInfo_Locale 1033 VerInfo_Keys CompanyName=;// DCC still outputs regardless of switch // ... PropertyGroup AppDPIAwarenessMode PerMonitorV2 VerInfo_MajorVer 2\ VerInfo_Keys CompanyName=Pat set memo to word wrap;// ... VerInfo_IncludeVerInfo true
  3. Pat Foley

    New mystery of freezing IDE.

    When the Num Lock is set the DEL key adds a period . which can be backed out of with a control-z or two.
  4. Pat Foley

    Is there a Sunday between 2 dates ?

    No, Midnight starts new day!
  5. Pat Foley

    SDI <-> MDI forms

    The minimized MDI children even when showing are confusing except for the well seasoned operator who is using them to find a minimized window in an Excel workspace display. Any MDI application should have the task bar menu synched up to the showing windows. Allowing the user to readily select windows in different running apps. As for snap hovering--good luck.
  6. Pat Foley

    delphi 10.4.2 invalid compiler directive

    Use form.caption here. You can use Application.Title in .dpr.
  7. Now it's needed to explain so AI can understand it and not make an EOW. (End of World).๐Ÿ™‚ By making the program data driven that is each event of the assets is recorded. We can fish out the UI and/or answers later. Complex flat files and top-down approach not needed for every problem. I added a variant record to post above which isn't used much so removed it. unit SoccerDB; interface uses // use only whats needed Generics.Collections; //System.Classes, Vcl.ExtCtrls, needed for tying into UI type TGameStatus = (gsLeftScheduled, gsRightScheduled, gsPlaying, gameWon, gameLost, gameIssue); TTeam = record TLA, Country: String; Flag: NativeInt; //pointer to flag end; PGame = ^TGame; TGame = Record Team: TTeam; Location: string; Time, Over: TDateTime; // rather than messing with variant records Status: TGameStatus; Key: integer; Avator: NativeInt; //pointer to Bitmap of location End; TGames = class(Tlist<PGame>) //UIin, UIout: TControls here procedure GetTeamsPlayingBetweenTheseTimes(Start, Stop: TDateTime;var theTeams: Tarray<string>); procedure SetTeamPlayingatthisTime(Start: TDateTime; ATeam: TTeam); end; implementation { TGames } procedure TGames.GetTeamsPlayingBetweenTheseTimes(Start, Stop: TDateTime; var theTeams: Tarray<string>); begin SetLength(TheTeams,2); TheTeams[0] := 'USA'; TheTeams[1] := 'Brazil'; //first get teams playing in time slice // then sort by location end; procedure TGames.SetTeamPlayingatthisTime(Start: TDateTime; ATeam: TTeam); begin // make event records here. end; end. Call it here implementation {$R *.dfm} uses SoccerDB; var Soccer2023: TGames; procedure TForm6.Button1Click(Sender: TObject); var aOutPut: TArray<string>; s: string; begin Soccer2023:= TGames.Create; Soccer2023.GetTeamsPlayingBetweenTheseTimes(0,0,aoutPut); for s in AOutpUt do ListBox1.Items.add(s); ListBox1.Items.add('Done'); end;
  8. I would go data driven ie bottom up * //who, what, when and where TeamPlayEvent = record Stadium, Date: Variant Case Scheduled: Boolean; else Lost: Boolean; end; Eachteam = Tlist<TeamPlayEvent> *Proposed Top down could easily write these future games to said scheme.
  9. Pat Foley

    Click a link in EDGE Browser

    Just don't set root to Internet! ๐Ÿ™‚ That JS is scary stuff.
  10. Pat Foley

    TProcessList issue.

    Something like this? It's like Borland's old 'side kick' only expanded to switch between different desktops. The thing can focus GE stuff so very handy. Here's a good start on it. Applister const hour2dot3 ='hr %2.3f '; //hour meter style hour2dot3wS ='hr %2.3f %s'; GoodApps: Tarray<string> = ['Notepad', 'TAppBuilder', 'Window', 'Chrome_WidgetWin_1', 'Notepad++', 'TfrmMultiMain']; type ptrApp = ^TApp; TApp = record Handle: HWnd; ... end; TptrApps = class(Tlist<ptrApp>) AppBuilderCount: Integer; // mark BDS's as loaded slLog: TStrings; //ref to CB.Items sBanner: PString; sgGrid: TStringGrid; //ref to Sg ChBx: TCheckListBox; //ref to chLB ... end;
  11. Pat Foley

    Something like SimpleNote with an API?

    Use Android Studio and select Web App ๐Ÿ™‚ I like to use SMS since most phone message apps can dial the phone number or map the street address in the incoming text. You just send a text to your phone number to start. To connect from email use (Pho)-Num-ber@phonecompanytxtservice.com which most companies provide. Pat
  12. Pat Foley

    General Help Indeed...a long-shot here....

    Still should follow National Fire Code and National Electric Codes. Should able to type in a desired color number vs messing with editor. Copying controls off the design screen into Notepad++ allows an easy compare of contents. The coloring of the controls was changed when a door interlock was added which caused the original 20 displays to lose their ability to reflect the status. The added control's status colors magic numbers were used to code the status color value somewhat then status color changes were commented out for original displays. Reverting to original intent colors reflecting status for all depictions could readily implemented. Attached shows Two of Tee's added following their status settings all the controls are having their Color0 set. I added a diamond and alert kind. Pat
  13. Pat Foley

    Open IDE in DPI Unaware??

    You could load a second copy of Delphi as a tool in tool options.
  14. I am thinking you may still have on change events connected to the buttons. If so set a break point in a change event to see what can happen! procedure TForm4.RadioGroup1Click(Sender: TObject); begin var rg := sender as TRadioGroup; case TuserSound(rg.itemIndex) of usHarsh: bTreble := True; usWarm: bBose := True; usBoomy: bSubwoofers := True; end; end;
  15. Try this user friendly code with enum type like ~TuserSettings = (spHash, spWarm, usJustRight) to line up the friendly strings. Save load the radiogroups item index. Use the enumtype with a case to set any Booleans object RadioGroup1: TRadioGroup Left = 136 Top = 232 Width = 185 Height = 105 Caption = 'Settings' Items.Strings = ( 'Harsh' 'Accurate' 'Warm' 'Fuzzy') TabOrder = 2 end
  16. Pat Foley

    General Help Indeed...a long-shot here....

    I suppose the D5 copy is the owner's. My concern are the gas trains meeting ASME codes for the interlocks to work properly.* I been in a plant where an intern changed the overall 16 color scheme and some things quit working. This image is marked up with where to click at to bring the color property editor. Also a text box shows effect of copying a shape control and pasting it into a text editor. * Not jumper wired or modified to prevent Tripping.
  17. Alt method for showing forms is using createparams in the forms. Then you can reinstate the OnTaskbar switch. protected procedure CreateParams(var Params: TCreateParams) ; override; ... // This fixes alt tab issue showing selected form on top! procedure TfrmView.CreateParams(var Params: TCreateParams); begin inherited; Params.ExStyle := Params.ExStyle or WS_EX_APPWINDOW; end;
  18. Pat Foley

    General Help Indeed...a long-shot here....

    Yes, but it appears that the dfm was saved in binary. Reading in text editor is enhanced when saving dfm as text. Besides the standard TButton and TControls like VB, Delphi user could build or be provided a custom Control to drop on form (even nonvisual controls). The package or library is *.dpk that puts the Control on the rail and registers the control so IDE "knows" what is dropped in design window. These components are streamed in and their events connected at runtime.
  19. Pat Foley

    General Help Indeed...a long-shot here....

    Check the .dfm files by using a text editor. Most likely the classes you are looking were dropped on the form back in '97. If so, you load those into IDE using package(s) *.dpks before opening the unit.pas The unit's dfm loads with the {$rec *.dfm} directive in the implementation, or the classes could be loaded at runtime If available and pathed as p'2K mentions. I think I have an Omron under the bench somewhere but it uses a 232 port. Sorry. Pat
  20. Pat Foley

    Not Threadsafe??

    I like that I have used just a showmessage when CanClose is false;
  21. Pat Foley

    String literals more then 255 chars

    I am getting weary of 16/9 screens. To get by I use the Tmemo. object Memo1: TMemo Left = 528 Top = 66 Width = 701 Height = 569 Lines.Strings = ( 'SELECT'#65279 'DATE_FORMAT(co.order_date, '#39'%Y-%m'#39') AS order_month,' 'DATE_FORMAT(co.order_date, '#39'%Y-%m-%d'#39') AS order_day,' 'COUNT(DISTINCT co.order_id) AS num_orders,' 'COUNT(ol.book_id) AS num_books,' 'SUM(ol.price) AS total_price,' 'SUM(COUNT(ol.book_id)) OVER (' ' ORDER BY DATE_FORMAT(co.order_date, '#39'%Y-%m-%d'#39')' ') AS running_total_num_books' 'FROM cust_order co' 'INNER JOIN order_line ol ON co.order_id = ol.order_id' 'GROUP BY ' ' DATE_FORMAT(co.order_date, '#39'%Y-%m'#39'),' ' DATE_FORMAT(co.order_date, '#39'%Y-%m-%d'#39')' 'ORDER BY co.order_date ASC;' '' 'end') TabOrder = 6 end From the .dfm
  22. Pat Foley

    Edits not saved??

    When saving said open file in one IDE, the other open IDE when focused will show fileXXX timedate changed update? A Change in the DFM is called a in memory change as well! Doing that will synchronize or import the changes to that IDE. // A change in a custom component needs a little more to see changes in the dfm. Control-b will show the pathed files
  23. Pat Foley

    Methods from Libraries (bpl or pas) in Apps??

    {$WEAKLINKRTTI ON} {$RTTI EXPLICIT METHODS([]) PROPERTIES([]) FIELDS([])} To get the line count to Lines: 1277, Types: 482, Others: 784 insert above switches in the dpr. This works even on the Emb and Cantu examples.
  24. I have noticed that Delphi adds Ios and Android deploy information even for packages. What switch adds this to .dproj <Import Project="$(MSBuildProjectName).deployproj" Condition="Exists('$(MSBuildProjectName).deployproj')"/> How to set the unit output for 32 and 64 in a MyPackage? I tried the codegear dslusr and it would not allow dropping the control on a form in 64 mode. Controls could be placed on form in 32 mode though. I removed and made a fresh package that allows the controls to be placed on form. ๐Ÿ™‚ And what about Versioning? The following always brings 1.0.0 for myapp. function TptrApps.getVersionasString(inAppName: string): string; var Major, Minor, Build: Cardinal; begin Try Major := 6; Minor := 6; Build := 6; GetProductVersion(inAppName, Major, Minor, Build); result := Format('%d.%d.%d', [Major, Minor, Build]); Except on E: Exception do result := E.ClassName + ':' + E.Message else result := 'Trouble '; End; end; Thanks, Pat
ร—