Jump to content

Pat Foley

Members
  • Content Count

    427
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by Pat Foley


  1. 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!     

     

     


  2. My concern is this about every 15 years

     

    https://interestingengineering.com/science/genes-renamed-to-stop-microsoft-excel-from-mistaking-them-for-dates

     

    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.

      


  3. 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;

     

      


  4. The trouble with memo need to set word wrap to false to track lines.   

     

    Here's a way to simply output to image or Paintbox. Painting StringGrid is above my paygrade.  To call it pass self and a canvas when the view or the data is changed.

    procedure DrawCanvasPat(Sender: Tobject; Canvas: TCanvas);
    begin
      with Canvas do
      begin
        Pen.Width := 3;
        for var C in [0 .. 9] do // := Low to High do FAD here
        begin
          var
          R := 0;
          var
          fields := ['First', '', '', '', 'Mid', '', '', 'H', '', 'Last', 'Ten'];
          // ShowMessage(fields[0]);
    
          TextOut(C * 45 + 45, R + 23, fields[C]);
          for R in [CSVHeaderTopLine .. 9] do
          begin
            var
            value := (Random(20) - 10);
            if value > 0 then
              Pen.Color := clGreen
            else
              Pen.Color := clRed;
            Rectangle(C * 45 + 60, R * 23 + 30, C * 45 + 64, R * 23 + 33);
            TextOut(C * 45 + 45, R * 23 + 23, value.ToString);
    
            // ColorDrawItem2(sgUI, sgUI.Canvas,cellValue.tostring,Lrect,TRue);
          end;
        end;
      end;
    
    end;

        


  5. 5 hours ago, Michael Taylor said:

    I think it might be nice for Linux development if it worked on Raspberry Pis. Can I ask what you want to upgrade to Enterprise for?

    chiefly for the WSL stuff, that would allow learning/running Linux faster than running a Linux box? That was two days ago now I want buy a box to run win pro 11 on it to learn if remote debugging on windows 64 machine using a windows 32 machine would allow faster recompiling.  Still there is regret that I didn't jump on the 20% discount(When I bought the D10.2 with mobile on sale 2000 days ago.  In a month found a newer computer to install it on by then 10.3 was available.)

     

    Raspberry Pi it's just another mouth to feed not in the money involved but in time used in learning curve of what works and how it works.  Learning Python first maybe best for Linux development getting the Pi aspect for free that's my new plan. For windows I think I deserve a p16 or even an HP.                


  6. 1 hour ago, FabDev said:

    If I compile my software outside (command-line) the Delphi IDE I have never out of memory problems = And it's stay a lot of memory useable easy to compile more than 20 000 000 lines of code !

    Is the IDE set to save files on a compile? Does the error change to corrupted memory when compiling in 64 bit. I have 1.4 Compressed memory even with 8.2 available so I may reboot the machine to clear the Compressed or swap pages out this week. MS fixed some issues doing away with recently used file time line but putting the swap file back in is maddening :classic_angry:     


  7. 20 hours ago, Alkanium said:

    I just don't want to begin with a blank project.

    Start with a plan then! Good luck comes from months of careful planning. What about the database, the servers etc. For now, log the bugs to determine if the problem is data entry, codebase, or database design and queries used. Only should then you recompile the hpp files made in Delphi into C++. 

             


  8. 6 hours ago, Dalija Prasnikar said:

    The whole world does it is not much of an argument. 

    Just because a large number of people do something (Windows/MSDOS), does not make it right (MAC OS crew view).  Legacy support is lost in the Mac world a publishing program upgraded to the new flavor of Mac would happily wreck any book at page 65 or so. 

     

    Android Studio needs to run on Linux for good connection to google when it's working your phone over. It does have a Web app option now. 

     

    Visual Studio issues warning do not set root to internet on Linux. plus learning javascript. Boo!

     

    Lazarus I been unable to load on Linux for one, plus it's just a bunch of windows like D1-7.  

       

     


  9. I am using 11.3 a big improvement over 10.4 until the blue moon last month. Then the IDE began doing disappearing act like 10.3, after "upgrading" an event in a control in a package. In short recompiling my package of custom controls fixed the issue(s).  Looking at the output messages after a compile I may shut down the OneDrive business if the IDE crashes while hovering over the Search menu again.    

     

      

     

        


  10. On 9/15/2023 at 4:32 PM, JohnLM said:

    Im a beginner just learning a few things about Stream, how to Write and Read from it.

    One way to learn Stream is:

     

    1. Add a TMemo to a form in the Designer.
    2. Add lines of text to Memo1 in ObjectInspector usings Lines property editor.
    3. Select the Memo1 in design and cut/paste into notepad.
    4. Tinker with property settings streamed out in notepad.
    5. Stream the adjusted Memo1 back into the designer by pasting notepad text.
    6. Wow. 

     

    Next lesson 

    Place cut out of design window into code by pasting inside a buttonclick.

    modify the pasted so the runtime creates the memo at runtime.🙂

    ...

    Database can use record with fixed string size on one hand and can use JSON for streaming needs. 

     

    TStream  used like TStrings in procedure arguments. MS is passed as a TStream in the TreeView.SavetoStream.

     

    procedure TForm3.Button5Click(Sender: TObject);
    var
      MS: TmemoryStream;
    begin
      MS := TMemoryStream.Create;
      Try
        TV.SaveToStream(MS);  // TV isa TreeView
        MS.Position := 0;
        Memo1.Lines.LoadFromStream(MS);
      Finally
        MS.Free;
      End;
    end;

     

     

     

     


  11.    Here's a pascal example that simply replaces ProcessMessages with custom "message" calls to allow the sleep delays.

     

       assign this ClickEvent to several buttons onclick Event.  I would look media player source for dealing with updating several buttons state. 

      

    implementation
    
    {$R *.dfm}
    
    const
      Clickable = True; // alias for enabled = True
    
    procedure ButtonEnable(button: TButton; const aCaption: string;
      const isEnabled: Boolean); //inline;
    begin
      if button.Enabled <> isEnabled then
        button.Enabled := isEnabled;
      if button.Caption <> aCaption then
        button.Caption := aCaption;
    //  button.Enabled := isEnabled; order matters
      //Button.Repaint; //
    end;
    
    procedure SnoozedButton(button: TButton; MS: Integer); //inline;
    begin
      ButtonEnable(button, 'Snoozed', not Clickable);
      Sleep(MS);
    end;
    
    var inUse: Boolean = False;
    
    procedure TForm15.DealButtonClick(Sender: TObject);
    begin
      if inUse = not False
        then exit;
      inUse := True;//Sender as TButton;
    
      SnoozedButton(Sender as TButton, 3000);
      ButtonEnable(Sender as TButton, 'Hit me', not Clickable);
    
      Sleep(1500);
      (Sender as TButton).Caption := 'Hitted';
    
      sleep(1500);
      sleepControl(Sender, 2000); // Event driven call
    
      ButtonEnable(Sender as TButton, 'Deal', Clickable);
    
      inUse := False;//nil;
    end;
    
    procedure TForm15.sleepControl(Sender: TObject; const MS: Integer);
    begin
      var
      button := Sender as TButton;
      ButtonEnable(button, 'Sleeping', not Clickable);
      Sleep(MS);
      ButtonEnable(button, 'Stay', not Clickable);
      Sleep(MS);
    end;

     

    3 minutes ago, alank2 said:

    Is there a way to disable the highlighting that happens when you simply hover over a button?

    I think that's a feature🙂.  I would like the showhint to work when the button is disabled.

    • Like 1

  12. Quote

    IDE Startup Layout

    When you open the IDE, RAD Studio displays a startup layout with the Structure, Obect Inspector, Palette, and Projects tool windows collapsed. You can also select the Startup Layout or another pre-defined layout from the dropdown on the top bar.

     

    From the help, the Startup layout hides the "saddle bags." The edges of the embedded form designer use some screen for accessing slide outs but huge improvement over default layout for layout and text editing too!

     

    I added a second icon with this switch dpunaware for different resolutions.

     

    FMX has sizable viewer and shows the background of window behind in form window thumbnail. Either designer doesn't position the design in the thumbnail as designed. 

      


  13. 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

     

×