Jump to content

uligerhardt

Members
  • Content Count

    97
  • Joined

  • Last visited

Posts posted by uligerhardt


  1. 2 minutes ago, Alexander Sviridenkov said:

    Thanks for reporting, this error appears when clickng to Create without selected project. Now fixed.

    Note that to select project you need to click on folder icon next to Project label

    I have the error when clicking on the folder icon without clicking Create. But I'll just try the new version. 🙂


  2. 5 hours ago, Van said:

    I've installed a new version of Delphi 11.3 on windows ll and I have the same problem with the form's right/bottom edges disappearing after you add a TTitlebar. The problem persists even after removing the Titlebar.

    Any idea how to resolve this?

    Never used TTitlebar but this sounds like there are related units left in the uses clause after removing the component. So maybe the problem hides in some initialization section?


  3. If you're prepared to write a wizard you might find something in this fragments from a very old wizard I no longer use:

    procedure TMyWizMainForm.ShowInMessageView(const FileName, MessageStr: string;
      LineNumber, ColumnNumber: Integer);
    var
      MessageServices: IOTAMessageServices40;
    begin
      MessageServices := BorlandIDEServices as IOTAMessageServices40;
      MessageServices.ClearCompilerMessages;
      MessageServices.ClearToolMessages;
      MessageServices.AddToolMessage(FileName, MessageStr, '.....', LineNumber, ColumnNumber);
      ShowMessageView;
    end;
    
    procedure TMyWizMainForm.ShowUnitSource(const FileName: string);
    begin
      (BorlandIDEServices as IOTAActionServices).OpenFile(FileName);
    end;
    
    procedure TMyWizMainForm.ShowParseError(e: EParseError);
    var
      EditorServices: IOTAEditorServices;
      TopView: IOTAEditView;
      EditActions: IOTAEditActions;
    begin
      ShowInMessageView(CurrUnit, e.Message, e.LineNo, e.ColumnNo);
      EditorServices := BorlandIDEServices as IOTAEditorServices;
      TopView := EditorServices.TopView;
      if TopView = nil then
      begin
        ShowUnitSource(CurrUnit);
        TopView := EditorServices.TopView;
      end;
      if TopView <> nil then
      begin
        EditActions := TopView as IOTAEditActions;
        EditActions.NextError;
      end;
    
      Close;
      Beep;
    end;

    It works (worked?) by inserting a custom line into the IDE's message window and make the IDE jump there.

    • Like 1

  4. 21 minutes ago, dummzeuch said:

    There is no option (as far as I know, I might have missed it). And I remember seeing a comment in the original formatter sources from Egbert van Nes that he implemented this behaviour because he couldn't get the formatter handle these comments in any useful manner without breaking the source code.

     

    If anybody really wants to use that kind of comments: I am accepting patches.

    OK then, I'll see if I can give it a try.


  5. 23 minutes ago, Lars Fosdal said:

    /off-topic Preferences of code.  I like begin/end for clarity.
    However, I also like unusual breaks before then and strange indentations of single statements.  If only I could convince the formatter to do my bidding.

    
    procedure MyProcedure(a, b: Boolean);
    begin
      if a
      then begin
        if b 
         then Beep
          else Beep
      end  
      else begin
        if b // Kommentar
         then Beep
          else Beep;
      end;
    end;

     

    I'd just use begin/end here too, but that's difficult because of my charcter counting colleague. 😉


  6. I have disabled the "Always break line between else and if" option, and I'm happy with the results.

     

    However my colleague insists on having nested if-elses without begin/end pairs and on top mixes this with comments. A simplified example:

    procedure MyProcedure(a, b: Boolean);
    begin
      if a then
        if b then
          Beep
        else
          Beep
      else
        // Kommentar
        if b then
          Beep
        else
          Beep;
    end;


    This gets formatted to

    procedure MyProcedure(a, b: Boolean);
    begin
      if a then
        if b then
          Beep
        else
          Beep
      else
        {// Kommentar} if b then
          Beep
        else
          Beep;
    end;

    Is there an option to keep the lines separate under these circumstances? Do you deem the current behavior desirable?


  7. 21 hours ago, Remy Lebeau said:

    I don't know if this is covered in the documentation (I can't find it), but in TMetaFile's source code is the following comment:

     

    Thanks, I didn't see that comment. And indeed it mostly works without the cloning. However without passing a reference DC <> 0 resolution/size still get mixed up. But as mentioned in my postscriptum I found a compatible DC, so that's only a cosmetic problem. :-))


  8. I have an existing enhanced TMetafile in memory (technically speaking an array of them - it's a print preview) and want to add some text to it (page numbers). How can I best achieve that?

     

    First I tried creating a TMetafileCanvas for the MF and added my text. But creating the TMetafileCanvas clears the existing MF, so no luck. Could I supress the clearing somehow?

     

    The next idea was to clone the original MF:

        OrigMF := // my metafile in memory
        CloneMF := TMetafile.Create;
        try
          CloneMF.Assign(OrigMF);
          MFCanvas := TMetafileCanvas.Create(CloneMF, 0);
          try
            MFCanvas.Draw(0, 0, OrigMF);
            // Draw my stuff on MFCanvas
          finally
            MFCanvas.Free;
          end;
          OrigMF.Assign(CloneMF);
        finally
          CloneMF.Free;
        end;

    but I didn't manage to preserve the page dimensions, font sizes etc. The reference DC used to create OrigMF is gone and the combinations of properties like Width, MMWidth and Inch that I tried didn't help.

    How could I clone OrigMF retaining these informations (that must be stored inside)? 

     

    PS: While writing this post I managed to dig out a reference DC that worked. But answers would be still interesting.


  9. I had a look in the source code and decided I don't want to mess up GExperts' shortcut management. 😅

    However I discovered that the relevant actions (actListSelectNext/actListSelectPrevious in TfmGrepResults) have SecondaryShortCuts assigned. These don't work for me out of the box but I assigned them in the config dialog:

    1137571084_2022-09-3018_18_38-GExpertsConfiguration.thumb.png.fbd2844160cd9189eaf2bc252d06d38a.png

     

    I'll check how that works out for me.


  10. 3 hours ago, dummzeuch said:

    As for changing the functionality depending on the focus: Once you have used it once, the editor window has the focus, so how could the software know what you want?

    I guess one could track the most recently focused one of the "target" lists.

    3 hours ago, dummzeuch said:

    But anyway: GExperts can either use the shortcuts or not, there is no way that I know of to pass them on to the IDE.

    Maybe it could work to have the shortcuts enabled (i.e. <> 0) only if the Grep result list is focused? I'll see if I can play a bit with that.

×