Jump to content

ULIK

Members
  • Content Count

    81
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by ULIK

  1. Uwe, where do I find this groups dialog? Is this a new feature you are working on? Found it! Thanks!
  2. ULIK

    Testers needed for GExperts Instant Grep expert

    I played around with this expert and added two things: - display with gutter: - two buttons to refresh or clear results: refresh can be used, when typing something on editor itself that modifies the result positions. If you like it, feel free to add it to repository. Please note: all modifications were only tested on Delphi XE11, but they should run on earlier versions too. As I'm not familiar with GX development: I have simply assigned two icons from GX Icon folder to speedbutton glyph, which probably is not the common way for GX. So you might change this to better fit the GX universe. Attached is a patch file with my changes: InstantGrepWithGutter.patch
  3. ULIK

    Testers needed for GExperts Instant Grep expert

    Minor glitch: label l_PressEsc should set Layout to tlCenter to align it with checkbox (but I'm not sure, if this property is available back to Delphi 7). A suggestion for an interim solution for the missing 'Original Position': procedure PaintFileHeader(_Rect: TRect); ... LineText := Format(SLine, [Res.Idx + 1]); // Add additional text for original position, which is always the very first entry on listbox if _Index = 0 then LineText := LineText + ' (' + Module + ')'; ... You might also use a different color for original position: procedure PaintLines(_Rect: TRect); ... if odSelected in _State then begin BGNormal := clHighLight; LbCanvas.Font.Color := clHighLightText; BGMatch := BGNormal; end else if _Index = 0 then begin // as original position is not a real result, just let it gray BGNormal := clBtnFace; LbCanvas.Font.Color := clWindowText; BGMatch := BGNormal; end else begin BGNormal := clWindow; LbCanvas.Font.Color := clWindowText; BGMatch := RGB(250, 255, 230); end; Just some ideas, but a gutter would be much better. Feel free to add what you like.
  4. ULIK

    Testers needed for GExperts Instant Grep expert

    I have attached you a Subversion patch file. It's just a quick&dirty change, so have a look on it (especially for the new resource string. This might not be necessary). GX_GrepInstantGrep.pas.patch
  5. ULIK

    Testers needed for GExperts Instant Grep expert

    I have change the code a little bit and this is my current result of Instant Grep dialog: If the active editor file changes, the dialog changes it's caption too. If you are interested, I can send the necessary modifications.
  6. ULIK

    Icons missing?

    MMX 15.1.7, Delphi XE 11.3 When opening the drop down menu for visibility icon, icons seems to be missing (as far as I remember earlier versions had shown it) :
  7. ULIK

    Testers needed for GExperts Instant Grep expert

    Next thing I noticed: I placed the window on a second monitor right beside the maximized IDE main window on first monitor. No problem. Now I closed Instant Grep and opened it again: the Window is placed on my first monitor instead of second one. And how do I clear a former hit list? Entering a blank search phrase does not clear it. Also closing and reopening does not clear it.
  8. ULIK

    Testers needed for GExperts Instant Grep expert

    Doing a first short test: I was irritated as every hit is divided be the filename. As Instant Grep displays it's result only based on current editor file, why not just add the filename only to caption (see attached image)? Second: I compiled the current source, closed Delphi 11.3 and installed the new DLL. Now the first start showed that error: Following starts do not show it anymore. And why is the roaming profile? Shouldn't this be stored on LOCAL_APP_DATA? Third, if there is no hit I would not show the entry 'Original Position'. At first I wondered, if this was a wrong hit of grep search, because I see something on result list I do not expect. If you want to show the original position, make it more clearer that this is *not* a search result. kind regards, Ulrich
  9. If I remember right: yes, it should work.
  10. Hi, when I print an image using GDI+ DrawImage method on a high DPI system (192 DPI), the result differs from what printer is used. Next is my test code: procedure TForm1.Button1Click(Sender: TObject); var DC: HDC; gpGraphics: TGPGraphics; gpImage: TGPBitmap; gpPen: TGPPen; nLogPixUI: Integer; nLogPx: Integer; png: TpngImage; rDest: TGPRectF; rectImage: TRect; rectImage72: TRect; begin memo1.Clear; // Just to get some information on the image png := TPngImage.Create; try png.LoadFromFile('image.png'); memo1.Lines.Add(Format('PNG.Width: %d', [png.Width])); memo1.Lines.Add(Format('PNG.Height: %d', [png.Height])); memo1.Lines.Add(Format('PNG.Res: %d, %d', [png.PixelInformation.PPUnitX, png.PixelInformation.PPUnitY])); finally png.Free; end; if PrintDialog1.Execute(Handle) then begin Printer.BeginDoc; try gpGraphics := TGPGraphics.Create(Printer.Canvas.Handle); try // let's use pixel gpGraphics.SetPageUnit(UnitPixel); // get device DPI DC := gpGraphics.GetHDC; try nLogPx := GetDeviceCaps(DC, LOGPIXELSX); memo1.Lines.Add(Format('Log. Pixel Device: %d', [nLogPx])) finally gpGraphics.ReleaseHDC(DC); end; // and create an image rectangle based on some MS Ink coordinates nLogPixUI := Screen.MonitorFromWindow(Self.Handle).PixelsPerInch; memo1.Lines.Add(Format('Log. Pixel Screen: %d', [nLogPixUI])); // create the image rectangle, based on a 90x90 pixel rectangle (just for test) rectImage.Create( MulDiv(10, nLogPx, nLogPixUI), MulDiv(10, nLogPx, nLogPixUI), MulDiv(100, nLogPx, nLogPixUI), MulDiv(100, nLogPx, nLogPixUI) ); // center coordinates system on image midpoint gpGraphics.TranslateTransform(rectImage.CenterPoint.X, rectImage.CenterPoint.y); gpPen := TGPPen.Create(ColorRefToARGB(ColorToRGB(clRed)), 1); try // create a red rectangle around the image gpGraphics.DrawRectangle(gpPen, - rectIMage.Width/2, - rectImage.Height/2, rectImage.Width, rectImage.Height); // load the image gpImage := TGPBitmap.Create('image.png', False); try memo1.Lines.Add(Format('Img.Width: %d', [gpImage.GetWidth])); memo1.Lines.Add(Format('Img.Height: %d', [gpImage.GetHeight])); memo1.Lines.Add(Format('Img.Res: %f, %f', [gpImage.GetHorizontalResolution, gpImage.GetVerticalResolution])); // create the destination rectangle for printing based on rectImage rDest.X := -rectIMage.Width/2; rDest.Y := -rectIMage.Height/2; rDEst.Width := rectIMage.Width; rDest.Height := rectImage.Height; gpGraphics.SetInterpolationMode(InterpolationModeHighQualityBicubic); gpGraphics.SetSmoothingMode(SmoothingModeHighQuality); gpGraphics.DrawImage(gpImage, rDest, 0, 0, gpImage.GetWidth, gpImage.GetHeight, UnitPixel); finally gpImage.Free; end; finally gpPen.Free; end; finally gpGraphics.Free; end; finally Printer.EndDoc; end; end; end; When I run this code against the attached image (see below) on a 96 DPI desktop system, everything is fine when printing on Microsoft PrintToPDF as well as any other installed printer: Next I run the same code on a SurfacePro 7 with 192 DPI. Now the result differs from used printer: HP Universal PS as well as SnagIt produce the expected output: But Microsoft Print to PDF, OneNote for Windows 10 and a HP Laserjet 400 MFP M425dw (607BA1) printer creates a wrong output: rectangle size is fine but content not. So the question is: why produces the output on different printers different outputs? It looks like the wrong output includes some scaling between 96 and 192 DPI but DrawImage should be independent of it, when setting source, destination explicitly. Especially why this is printer dependent? Any ideas, what causes this problem? Thanks, Ulrich forgot to mention: Delphi XE 10.2 Tokyo used image for printing:
  11. I finally found a solution for this problem: the PNG images I printed had no pHYs chunks set (as they were initially created during runtime). As soon as the missing chucks were added, printing from high DPI systems works fine. The point is: it doesn't matter what exact values you are using, it's just that those chunks had to be set to a somewhat reasonable value. function TPaImageStrokeHelper.FixPNGPixelInformation(APNGImage: TPngImage): Boolean; begin Result := False; if not Assigned(APNGImage) then exit; if not APNGImage.HasPixelInformation then begin APNGImage.PixelInformation.PPUnitX := 3780; // relates to 96 DPI: 3780 Points / Meter APNGImage.PixelInformation.PPUnitY := 3780; APNGImage.PixelInformation.UnitType := utMeter; Result := True; end; end;
  12. Oh, didn't realized that you also added an exe. You're right: running your exe I can reproduce this behavior when styles are active.
  13. I just tested your project against 10.2 as well as 11.3 and both do not show that behavior. Here the messages stop as soon as mouse stops, styles active or not.
  14. D11.2, latest MMX Build 2540: I have a problem when closing a running app inside IDE: Editor layout switches back from debug desktop to standard desktop. and then an access violation occurs inside MMX code explorer (which is hidden on debug, but docked in standard desktop). The AV does not happened every time but frequently enough for a report 😉 . And I have seen this on several different projects over the last months. Do you have an idea what could cause this? Attached is part of written full bug report. Thank you! bugreport_IDE_MMX.txt
  15. After 5 hours of work there was no AV when switching between layout with and without MMX Explorer docked. So far it looks like you have fixed the problem. Thank you very much for looking on this problem!
  16. ULIK

    pdfDoc

    Hi, if you need to get a working solution, you have to use a third party solution for creating a PDF. Why not use SynPDF as suggested? Easy to use, they offer sample code (read their start page til the end!) and there is even a forum where you can ask.
  17. Thanks for the hint. Will try it today. As I get it frequently (but not every time): let me know if I can do some debugging for you. kind regards, Ulrich
  18. MMX 15.1.4 2540 Delphi XE 11.2 (Delphi 11 Version 28.0.46481.1287) started DPI unaware on 96 DPI primary monitor when I rename a method on class explorer, the resulting dialog is a little bit too small on lower text part:
  19. ULIK

    Can anybody confirm, pls

    Yes, happens here too.
  20. ULIK

    Form ObjectAtPoint() does not working or "me" not working :)

    Then you can't use ObjectAtPoint . You will have to write your own version of it (not that hard, just iterate over all the children and see if position is inside and if it is visible. If so, do the testing on that found control again to get the inner controls of it (if any).
  21. ULIK

    Form ObjectAtPoint() does not working or "me" not working :)

    What do you mean by nope!? Definitely HitTest = False is the reason, why ObjectAtPoint will not recognize the button. You had to step through all the inherited calls down to TControl. ObjectAtPoint. Here the line if PointInObject(LP.X, LP.Y) and CheckHitTest(HitTest) then is the critical part. The first condition is true if over a button, but the second one makes it always fail. Btw: you had to call ObjectAtPoint with Screen coordinates: LIControl := ObjectAtPoint(ClientToScreen(LPointF));
  22. ULIK

    Form ObjectAtPoint() does not working or "me" not working :)

    The problem is: Button1.HitTest := False. This makes it invisible for ObjectAtPoint. See end of 'TControl.ObjectAtPoint' code
  23. ULIK

    Inspect variables during debug

    That's because testvar is of type ITest and not TTest that contains the member fields.
  24. Hi, Delphi XE11.1 on a current Windows 10 system: I have a bunch of problems when moving a maximized windows between monitors of different scales: - regular size changes - depending on border style setting, application behaves different Steps to reproduce: - compile attached application perMonitorV2 aware - set up multiple monitors: * M1 100% 2560x1440 (primary) * M2 200% 3840 x 2160 * M1 left of M2 1. problem: - run app on M1 - maximize window - send it to second monitor using WIN + Shift + Arrow right - send it back to first monitor - change back maximized state --> size of regular window has changed 2. problem - modify the app and remove comments to set the BorderStyles: if cbToggleFullscreen.Checked then begin BorderStyle := bsNone; WindowState := wsMaximized; end else begin WindowState := wsNormal; BorderStyle := bsSizeable; end; - again run on M1 - click check box (to maximize and set the border style) - send it to second monitor using WIN + Shift + Arrow right --> this does not work the first time and you have to do it again to move the window to second screen! ???? - send it to second monitor using WIN + Shift + Arrow right (second time) --> now the app is on second screen but no longer maximized 3. Problem (related to second) - start app from problem (2) say on M2 - click check box to maximize and change the border style - change DPI scaling for M2 - click check box again to get normal sized window: size has changed! Problem 3 seems to depend on BorderStyle change. If I test it with original app, the size persists. Can someone confirm that problems? And is there a solution for it, especially for the second/third? Thank you, Uli TestDPIFullscreen.zip
×