Jump to content

Mike Torrettinni

Members
  • Content Count

    1509
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Mike Torrettinni

  1. Mike Torrettinni

    How to synchronize splitters?

    I need to use rsPattern because of annoying flicker. I have multiple VirtualStringTrees and Scrollbox with multiple Frames and controls. But now I do see that OnMoved actually works when using rsUpdate or rsPattern. I prefer interposer solution, and no matter what control the Splitters resize, it just works when synched.
  2. Mike Torrettinni

    Is there enable/disable MMX option?

    I used MMX in the past and all was good, but since yesterday I can't 'switch it off', so it doesn't show up every time I switch from form designer to code. So, as soon as I open and close a Form designer the MMX explorer window shows up. Switching F12 between code and Form, the MMX always show up even after I close the MMX, every time. This happens on new empty project or in my projects. Since yesterday I installed/uninstalled it at least 3 times, and was happening on every install. So, is there an option I can use to show only when I want it, so I select it from the menu? Do I have any of these options set incorrectly: Thanks!
  3. Mike Torrettinni

    Is there enable/disable MMX option?

    One minor thing (to not open new topic), there are different icons displayed for ModelMaker Code Explorer:
  4. Mike Torrettinni

    Is there enable/disable MMX option?

    Great, works!
  5. Mike Torrettinni

    Is there enable/disable MMX option?

    Aha, seems to be OK now. What I did: 1. Uninstall MMX 2. in IDE create new layout and set it as default 3. Install MMX 4. all good, no MMX when switching between code and form. This works for now. Thanks!
  6. Mike Torrettinni

    Is there enable/disable MMX option?

    I did all the steps above and it still shows up every time switching from form to code. New layout. Yes, IDE windows behave like that, until you save the new layout without them, then they don't appear anymore. I remember now, the change I made yesterday was to show Breakpoints debug window in normal layout. Perhaps this messed it up for MMX. But removing Breakpoints window is not fixing it, unfortunately, I only use MMX sporadically, usually for cycling usage view feature. Not everyday usage, at this moment. I also have GExperts and CnPack and their experts/windows only show up on command. Not sure if MMX could use such a 'switch'. I searched for 'closing MMX' and no hits, so I guess is just my way of doing things, so no worries.
  7. Mike Torrettinni

    How to synchronize splitters?

    Nice and clean. Thanks!
  8. Mike Torrettinni

    Tip of day glitch

    Aha, it only happens in RDP session. All good then.
  9. Mike Torrettinni

    How to synchronize splitters?

    thanks @Remy Lebeau I went a little different - with TSplitter interposer: // Splitter interposer TSplitter = class(Vcl.ExtCtrls.TSplitter) private var fOriginalWindowProc: TWndMethod; var fOtherSplitter: TSplitter; var fMovingControl: TSplitter; public procedure MoveOtherSplitter(var aMsg: TMessage); end; procedure TSplitter.MoveOtherSplitter(var aMsg: TMessage); begin if (fMovingControl = nil) or (fMovingControl = Self) then Case aMsg.Msg Of WM_MOUSEFIRST..WM_MOUSELAST: begin fMovingControl := Self; fOtherSplitter.fMovingControl := Self; fOtherSplitter.Perform(aMsg.Msg, aMsg.WParam, aMsg.LParam); fMovingControl := nil; fOtherSplitter.fMovingControl := nil; end; end; fOriginalWindowProc(aMsg); end; And assigning method: procedure LinkSplitters(aSplitter1, aSplitter2: TSplitter); begin aSplitter1.fOriginalWindowProc := aSplitter1.WindowProc; aSplitter1.WindowProc := aSplitter1.MoveOtherSplitter; aSplitter1.fOtherSplitter := aSplitter2; aSplitter2.fOriginalWindowProc := aSplitter2.WindowProc; aSplitter2.WindowProc := aSplitter2.MoveOtherSplitter; aSplitter2.fOtherSplitter := aSplitter1; end; the I can just use simple LinkSplitters: LinkSplitters(Splitter1, Splitter2);
  10. Mike Torrettinni

    How to synchronize splitters?

    It could be improved, but this if how I made it work: new variable that gets assigned by moving control: var fMovingControl: TObject; and new move methods: procedure TForm1.MoveOtherSplitter(var aMsg: TMessage); begin if (fMovingControl = nil) or (fMovingControl = Splitter1) then Case aMsg.Msg Of WM_MOUSEFIRST..WM_MOUSELAST: begin fMovingControl := Splitter1; Splitter2.Perform(aMsg.Msg, aMsg.WParam, aMsg.LParam); fMovingControl := nil end; end; fOriginalWindowProc(aMsg); end; procedure TForm1.MoveOtherSplitter2(var aMsg: TMessage); begin if (fMovingControl = nil) or (fMovingControl = Splitter2) then Case aMsg.Msg Of WM_MOUSEFIRST..WM_MOUSELAST: begin fMovingControl := Splitter2; Splitter1.Perform(aMsg.Msg, aMsg.WParam, aMsg.LParam); fMovingControl := nil; end; end; fOriginalWindowProc2(aMsg); end; I tried to make it more generic, but TMessage doesn't have Sender, so I can't identify which control send the Perform message.
  11. Mike Torrettinni

    How to synchronize splitters?

    I think these suggestions will not work because I want the both splitters to move at the same time, not when moving is done. See the behavior:
  12. I noticed a difference how code completion shows types in some cases. Here I have example of difference between types for variables and arguments: Especially for TLst to shows as class(class(TObject) is quite different than TList<integer>. In some of my code, that I can't replicate, the type for TArray<TRec> is shown as array of TRec. Not a big deal, I guess. I would expect in D11 that TArray and TList would resolve correctly, as defined. Or is this behavior correct and code completion works as expected, I just don't have the knowledge to understand it? Test code: program Project1; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils, System.Generics.Collections; type TRec = record end; TArr = TArray<TRec>; TArrInt = TArray<integer>; TLst = TList<TRec>; TLstInt = TList<integer>; procedure Test(arr: TArr; lst: TLst); begin end; var xArr: TArr; xArrInt: TArrInt; xLst: TLst; xLstInt: TLstInt; begin //Test( end.
  13. I'm not sure how to even ask this, so let me try explain: I noticed that even if you cast variable as parameter, it works - the value is returned (I was sure casting will just pass a value): function FillStrings(aStrings: TStringList): boolean; begin aStrings.Add('a'); aStrings.Add('b'); end; ... FillStrings(TStringlist(Memo1.Lines)); This works, and this doesn't: FillStrings(Memo1.Lines); So I was trying to see if CPU debug window will show anything how the Lines were casted. Of course not. So, is it possible to see how compiler saves info about the parameters, to see what information it has on parameter when casting and when not?
  14. Mike Torrettinni

    Is it possible to see how compiler defines parameters?

    Thanks, I do have correct version as you pointed out, but this was a test if it works. casting with AS fails, but this one worked and just wanted to try to figure out why. Was testing what is good general option for lists and with TStrings works pretty well: procedure TForm1.FormCreate(Sender: TObject); var vStrings: TStringList; begin vStrings := TStringList.Create; try if FillStrings(vStrings) then Label1.Caption := vStrings.DelimitedText; finally vStrings.Free; end; FillStrings(Memo1.Lines); FillStrings(ListBox1.Items); end; Then I set a test with TStringList as parameter and of course Memo and ListBox were failing. Thanks, I didn't know how this info is called. Perhaps it would be useful if IDE had optional debug window with VTM data, like CPU window. (Reading this I assume it's possible https://hallvards.blogspot.com/2006/03/hack-8-explicit-vmt-calls.html)
  15. Mike Torrettinni

    SynEdit just got a major uplift

    Thank for pointing this out! I was looking into why so sluggish on my text files (108 MB file size, 1Mio lines), but in release mode is still pretty fast. 🙂
  16. Mike Torrettinni

    [DCC Warning] W1013 Constant 0 converted to NIL

    I noticed this a few days ago, when by mistake assigned 0 to array: var arr: array of integer; begin arr := 0; end. It gives the same W1013 warning.
  17. Mike Torrettinni

    2022 StackOverflow dev survey - salary results

    Interesting. I know for a few eastern European countries do have these 13th+ salaries as bonuses, if company does well. I guess the more west you go, the less bonus is really a bonus. I know UK doesn't have 13th month pay.
  18. Mike Torrettinni

    2022 StackOverflow dev survey - salary results

    That's very common in US, it's a big country and you can't expect Silicon Valley to have same salaries as some other states. And in this Covid era, I see $60K to be acceptable offer for beginners positions, or a part-time job, if full remote. Unlikely the bonuses are included in reported as a yearly salary, since it varies from year to year and also usually you don't know you get it until you actually do. I'm sure you probably know Austria has quite common the 13th and 14th month bonus (and 15th! in rare cases). Such bonuses are quite common in European companies doing well. In US, when companies are doing well, you get free coffee and donuts and team building days. A 35% increase in salary in 1 year... yeah right 🙂
  19. Mike Torrettinni

    Delphi 11.1 - a month later

    Pretty impressed by Delphi 11.1! Upgraded most of my projects from 10.2 and finally I can say that this is version stable enough to move from 10.2. Versions 10.3 and 10.4 were just not ready. A few observations: - IDE crashes a lot less (perhaps only 2 crash & close so far) - still occasional F2084 Internal Error, but at least it doesn't close IDE and you can just compile again (10.2 would crash and close most of the time on these errors) - The LSP works pretty good, there's constant delay, but is worth waiting because it works correctly most of the time - I was hoping the IDE would be slightly faster, but there is a constant slight delay (I assume LSP is kicking in) - ctlr+click works better, almost always - faster handling big main form (open, close) - commenting lines works without a glitch (10.2: sometimes when I want to comment a line, as soon as I press CTRL+/ the cursor jumps up and down and it comments the first line in the unit. very annoying) - 64bit compiler compiles faster and always (10.2 would crash often) - error insight is improved and more accurate - Structure view improved, faster and less jittery (10.2 would occasionally hang for a bit on large form) - compiler hints improved, more are shown right from the start so you can sort them out (10.2 would suddenly surprise you with a few more that were not shown before) - I like the new Options window, the size persists, especially Library window - context option to close units: Close - All to the right, is pretty nice, too! They did break one thing (well, it was broken in 10.3 already, still not fixed), but is not a deal breaker (at this point): - Debug Watch list evaluator is broken for some simple cases ( https://en.delphipraxis.net/topic/6751-simple-debugger-bug-in-111/ ) Embarcadero did a good job with D11.1!
  20. Mike Torrettinni

    date

    Nice, thanks!
  21. Mike Torrettinni

    Delphi 11.1 - a month later

    I noticed this error most of the time in only 1 unit and I finally was able to refactor it (it was using a lot of other units). No more of this error since then! 🙂
  22. Mike Torrettinni

    date

    I have a few overloads for YY conversion, mostly used to convert from imported text files: function GetYYFromDate(const aDate: TDate): integer; overload; begin // 01/01/2019 -> 19 Result := FormatDateTime('yy', aDate).ToInteger; end; function GetYYFromDate(const aDate: TDateTime): integer; overload; begin // 01/01/2019 01:01:01 -> 19 Result := FormatDateTime('yy', aDate).ToInteger; end; function GetYYFromDate(const aDate: string): integer; overload; begin // '01/01/2019' -> 19 Result := Copy(aDate, Length(aDate) - 2, Length(aDate)).ToInteger; end; function GetYYFromYear(const aYear: string): integer; overload; begin // '2019' -> 19 Result := Copy(aYear, Length(aYear) - 2, Length(aYear)).ToInteger; end; function GetYYFromYear(const aYear: integer): integer; overload; begin // 2019 -> 19 Result := aYear mod 100; end;
  23. Mike Torrettinni

    Bookmarks dead?

    Very good news! I'm glad our little 'positive' nudge helped achieve this goal!
  24. Mike Torrettinni

    pageControl

    Each TabSheet has a TabVisible property, if you set it to False it will hide that tab. To hide/show a TabSheet there is Visible property. I see that linked documentation in 1 post up is working now. Still wanted to point out the 2 similarly named properties, they could choose better naming.
  25. Mike Torrettinni

    Delphi 11.1 - a month later

    I didn't know this. I see that they did improve High DPI in 11 (https://blogs.embarcadero.com/new-in-rad-studio-11-high-dpi-ide-and-form-designing/) I will have to re-check. Last time I ran my projects on 4K monitor and various scalings, it looked good, not perfect, but usable.
×