Jump to content

aehimself

Members
  • Content Count

    364
  • Joined

  • Last visited

  • Days Won

    7

aehimself last won the day on August 31

aehimself had the most liked content!

Community Reputation

125 Excellent

Technical Information

  • Delphi-Version
    Delphi 10.3 Rio

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. aehimself

    Do not show drag image immediately?

    Manually handling it in OnMouseMove works perfectly.
  2. aehimself

    Do not show drag image immediately?

    Hello, I have a pagecontrol descendant, where I overridden the DoDrag method to show the picture of the dragged tab: Procedure TPageControl.DoStartDrag(Var DragObject: TDragObject); Var tab: TRect; bmp, tabbmp: TBitMap; Begin inherited; If DragObject <> nil Then Exit; // Create a bitmap of the tab button under cursor tab := Self.TabRect(Self.ActivePage.TabIndex); bmp := TBitmap.Create; bmp.Canvas.Lock; tabbmp := TBitmap.Create; Try bmp.Height := Self.Height; bmp.Width := Self.Width; tabbmp.Height := tab.Height; tabbmp.Width := tab.Width; Self.PaintTo(bmp.Canvas.Handle, 0, 0); tabbmp.Canvas.CopyRect(tabbmp.Canvas.ClipRect, bmp.Canvas, tab); DragObject := TPageControlExtraDragObject.Create(tabbmp); Finally bmp.Canvas.Unlock; FreeAndNil(tabbmp); FreeAndNil(bmp); End; End; When the user clicks on one of the tabs I'm manually initiating the dragging process by Self.BeginDrag(False);. When I went into BeginDrag, I saw that if you do not specify a dragging threshold, it takes this value from Mouse.DragThreshold, which is 5 pixels. This - to me - means that the dragging is NOT initiated unless the button is still down, and the cursor went at least 5 pixels away from the initiating position. What happens now is that the DoStartDrag event fires immediately, the bitmap is taken and is drawn as a fly-out immediately. Even it I am just switching tabs, which is kind of annoying. So the question is... if my logic is right (and the DoStartDrag should be fired based on distance) why it is firing immediately? If not, is there a simple setting I forgot to add or I manually have to handle this by MouseMove? I'm using Delphi 10.4.1, but the "issue" was present in 10.4 and 10.3 as well.
  3. aehimself

    best way to display a list of panels?

    Possible, however there are no requests like that for the time being. And this is why I hate to implement something new. The next hour when I published the resizable multi-line editor an other request came in, that "it would be nice" if the editor would resize with the form itself, instead of showing a scrollbar 😄
  4. aehimself

    10.4.1 Released today

    I'll only post a picture.
  5. aehimself

    best way to display a list of panels?

    Just a small update, I managed to implement the resizing logic and it was really, really easy. Most of my time went away by drawing the transparent, themed, system default resize gripper... ...which almost can not be seen on dark styles, so totally with it! 👍 Frames above and below are adjusting properly, not changing places or jumping around. Overflow is handled correctly by the alClient scrollbox, if the contents grow too large for the window. The only thing is that I did not use splitters, I wrote the resizing logic myself (which is awfully long, like 10 lines of code?) Procedure TMultiLineParamFrame.ResizeHandleImageMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); Begin _resizing := True; SetCapture(Self.Handle); End; Procedure TMultiLineParamFrame.ResizeHandleImageMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); var relative: TPoint; begin If Not _resizing Then Exit; relative := ScreenToClient(Mouse.CursorPos); If relative.Y > 47 Then Height := relative.Y; // Burned in magic number, because we all love them! End; Procedure TMultiLineParamFrame.ResizeHandleImageMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); Begin ReleaseCapture; _resizing := False; End; Drawing the gripping handle: Constructor TMultiLineParamFrame.Create(AOwner: TComponent); Var bmp: TBitmap; Begin inherited; _resizing := False; bmp := TBitmap.Create; Try bmp.Height := 16; bmp.Width := 16; bmp.TransparentColor := clYellow; bmp.Canvas.Brush.Color := bmp.TransparentColor; bmp.Canvas.FillRect(Rect(0, 0, bmp.Width, bmp.Height)); StyleServices.DrawElement(bmp.Canvas.Handle, StyleServices.GetElementDetails(tsGripper), Rect(0, 0, bmp.Width, bmp.Height)); ResizeHandleImage.Picture.Assign(bmp); Finally FreeAndNil(bmp); End; End;
  6. aehimself

    TSMBIOS or equivalent?

    I just found this awesome thing of @RRUZ, called TSMBIOS. Unfortunately though it seems to be abandoned now, and the only result I get on an Ubuntu 18.04 server is a nullpointer exception; even if I execute it via sudo (or su). Does anyone know about an updated fork of this component or something similar; which can gather hardware information on Windows and Linux?
  7. aehimself

    How do get all strings from a version resource

    Nice job. I think soon I'll need something like this in one of my applications - at least I'll know where to look 🙂
  8. aehimself

    Delphi 6 all of a sudden wants to be activated

    Especially if our own code is doing things like this. God, how many hours we already spent debugging something which only triggers when several, rare conditions are met 🙂
  9. aehimself

    looking for UI design ideas for tracking a process

    Really nice idea! As the shapes are not even that complicated, it could be custom-drawn on a TWinControl-descendant and call it a component. I like it.
  10. aehimself

    git workflow question

    With all respect, I don't think Git structure is the root cause here; refactoring the 850 EXEs to one single application plus modules (not necessarily .DLLs) would worth more on the long run in my opinion. Most of us, Delphi developers were hired to maintain old, large (and often poorly written) legacy applications; I know how likely the management approves 1-2 devs to "break free" and start re-designing everything. But, with properly structured and divided code, you'll quickly see that there will be no need of mapping one git repository to a number of drives. Thus, achieving your current goal to reduce merge conflicts.
  11. aehimself

    Use of Ansistring in Unicode world?

    I'm using String for string everywhere with no noticeable performance penalty (although, I never had to write performance-critical programs so far). If I know that encoding is in the game (e.g.: receiving data from a web browser) or I'm working with binary data I'm using TBytes. Pretty happy until now.
  12. aehimself

    Securing your data over time

    Damn it. First of all, have the highest possible levels of my admiration. As for the location... damn it again. I should re-structure my IT equipment at home.
  13. aehimself

    Securing your data over time

    If you mean you physically remove and transport disks between houses on a regular basis for years, you have my highest possible admiration. I'm just too lazy to do that, I give up after a month or two. I still have so much to learn 😞
  14. aehimself

    looking for UI design ideas for tracking a process

    First things first, I am horrible in UI design. With that said... Considering the fact that one main step can not change without all the sub-steps complete, my main UI would only show the currently active step. "Project XY is in Pending Signoff state" list of substeps below, with a fancy green checkmark right next to the substeps already accomplished. Don't make a dfference between optional and required ones - the main step will change anyway if all required ones are completed. This applies to the user and admin interface too. I don't really care when the previous main step's substeps were completed if my only purpose is to approve something / check how my thing is progressing. Have a history, as a side menu option. But then again, I am really, really bad in UI design. It's just how I would do it. Edit:
  15. aehimself

    Securing your data over time

    That is a really valid point. So you need 2 fireproof safes. 1 for the library, 1 for the server 🙂 That is not possible. How are you writing data on a media, which is not physically in a drive? Again, I am strictly talking about home-use "hacky" but safe-enough solutions. I have trust issues. I'll not buy critical equipment (like a fire extinguisher or car tires) second hand. If I want my data safe - brand new safe. If not - no safe at all. 400 EUR is a bit off the hobby limit in my opinion. But then again - how much one is willing to and how much one can spend on their hobby is a subjective factor.
×