Jump to content

Uwe Raabe

Members
  • Content Count

    2885
  • Joined

  • Last visited

  • Days Won

    169

Everything posted by Uwe Raabe

  1. Uwe Raabe

    TPopupMenu with group headers

    Add an OnDrawItem or OnAdvancedDrawItem event handler to these menu items with something like the following code: ACanvas.Font.Style := [TFontStyle.fsBold]; ACanvas.TextRect(ARect, 1, 1, StripHotkey((Sender as TMenuItem).Caption)); As obviously styles are involved, you might have to take that into account, too.
  2. "Use constants" the boss told us: const cDecimals0 = 0; cDecimals1 = 1; cDecimals2 = 2; cDecimals3 = 3; cDecimals4 = 4; cDecimals5 = 5; cDecimals6 = 6; cDecimals7 = 7; cDecimals8 = 8; cDecimals9 = 9; cDecimals10 = 10; cDigits0 = 0; cDigits1 = 1; cDigits2 = 2; cDigits3 = 3; cDigits4 = 4; cDigits5 = 5; cDigits6 = 6; cDigits7 = 7; cDigits8 = 8; cDigits9 = 9; cDigits10 = 10; cDigits11 = 11; cDigits12 = 12; cDigits13 = 13; cDigits14 = 14; cDigits15 = 15; cDigits16 = 16; cDigits17 = 17; cDigits18 = 18; cDigits19 = 19; cDigits20 = 20; cDigits21 = 21; cDigits22 = 22; cDigits23 = 23; cDigits24 = 24; cDigits25 = 25; cDigits26 = 26; cDigits27 = 27; cDigits28 = 28; cDigits29 = 29; cDigits30 = 30; cDigits31 = 31; cDigits32 = 32; cDigits33 = 33; cDigits34 = 34; cDigits35 = 35; cDigits36 = 36; cDigits37 = 37; cDigits38 = 38; cDigits39 = 39; cDigits40 = 40; cEndPos0 = 0; cEndPos1 = 1; cEndPos2 = 2; cEndPos3 = 3; cEndPos4 = 4; cEndPos5 = 5; cEndPos6 = 6; cEndPos7 = 7; cEndPos8 = 8; cEndPos9 = 9; <snip...> cEndPos997 = 997; cEndPos998 = 998; cEndPos999 = 999; cEndPos1000 = 1000; cEndPos9000 = 9000; cIndex0 = 0; cIndex1 = 1; cIndex2 = 2; cIndex3 = 3; cIndex4 = 4; cIndex5 = 5; cIndex6 = 6; cIndex7 = 7; cIndex8 = 8; cIndex9 = 9; cIndex10 = 10; cIndex11 = 11; cIndex12 = 12; cLength1 = 1; cLength2 = 2; cLength3 = 3; cLength4 = 4; cLength5 = 5; cLength6 = 6; cLength7 = 7; cLength8 = 8; cLength9 = 9; cLength10 = 10; cLength11 = 11; cLength12 = 12; cLength13 = 13; cLength14 = 14; cLength15 = 15; cLength50 = 50; cLength102 = 102; cLength117 = 117; cLength298 = 298; cLength618 = 618; cLength800 = 800; cStartPos0 = 0; cStartPos1 = 1; cStartPos2 = 2; cStartPos3 = 3; cStartPos4 = 4; cStartPos5 = 5; cStartPos6 = 6; cStartPos7 = 7; cStartPos8 = 8; cStartPos9 = 9; <snip...> cStartPos995 = 995; cStartPos996 = 996; cStartPos997 = 997; cStartPos998 = 998; cStartPos999 = 999; cStartPos1000 = 1000;
  3. Might be tricky to persuade the third party lib to create your new classes rather than its own.
  4. I'm probably going to regret it, but I'll throw this one into the discussion: function BlankControl(EditControl: TObject; const EditMess: string; ShowErrorMsg: Boolean; MaxLen: Integer): Boolean; begin Result := False; try if EditControl is TCustomEdit then Exit(length(trim((EditControl as TCustomEdit).Text)) < MaxLen); if EditControl is TComboBox then Exit(length(trim((EditControl as TComboBox).Text)) < MaxLen); if EditControl is TDBComboBox then Exit(length(trim((EditControl as TDBComboBox).Text)) < MaxLen); if EditControl is TDBRadioGroup then Exit((EditControl as TDBRadioGroup).Value = ''); if EditControl is TDBLookupComboBox then Exit((EditControl as TDBLookupComboBox).Text = ''); if EditControl is TDBCheckBox then Exit((EditControl as TDBCheckBox).State = cbGrayed); finally if Result then Showerror(EditControl, EditMess, false, ShowErrorMsg); end; end;
  5. Ehm! That Exit call will only exit procedure gotoTrue, but not function BlankControl. Funny, that such a suggested improvement perfectly qualifies for the reason of this thread
  6. Uwe Raabe

    What is this syntax?

    Yes, here: Enumerated Types with Explicitly Assigned Ordinality
  7. Uwe Raabe

    Add 2 controls to same row coulomb gridpanel

    Put a TPanel in the grid cell and place the label and LED onto that panel. The vertical alignment of a TLabel is controlled by its Layout property,
  8. As ProcessMessage already does all the work, there is not much to do in the body of this loop.
  9. Uwe Raabe

    upcoming language enhancements?

    Well, obviously announcing is easier than implementing.
  10. Uwe Raabe

    upcoming language enhancements?

    There definitely is a plan! The problem is how much of that plan turns into reality.
  11. Uwe Raabe

    Delphi on virtual machine and licence

    Would you mind writing in English, please? Otherwise a Personal Message would be a better choice.
  12. Uwe Raabe

    Delphi on virtual machine and licence

    I also use Delphi in many VMs. To overcome the installation limit I have switchen to a Network Named License and make use of my own license server (ELC). This allows me to install Delphi on as many VMs I want as long I have it running on up to three machines simultaneously.
  13. That menu item should be enabled whenever you have the CPU window open while debugging.
  14. Uwe Raabe

    D10.4.2 where's setting to not debug into RTL ?

    SelectiveDebugging
  15. Uwe Raabe

    Prevent from closing when....

    The VCL already provides such a flag for you: TApplication.ModalLevel
  16. Usually the MMX setup installs the app and also registers it into the Delphi IDE. You only have to select it as the default viewer.
  17. I expect the dataset to be closed when SQL changes. Otherwise the records would not match the SQL anymore. One can easily extend this to all other properties that have influence on the data retrieved and the way it can be accessed. What would be the benefit of an immediate exception here? The author of the code wants to change the SQL, so what would be the gain from that exception (which happens at runtime btw.)? The dataset has to be closed anyway to change the SQL, so why not closing it automatically? Unfortunately this option is not available in the poll (at least as I understand it).
  18. Uwe Raabe

    Class tree utility released

    Of you compile with packages and allow external packages be loaded dynamically.
  19. Uwe Raabe

    Class tree utility released

    Both tools have a completely different approach. While DelphiAST analyzes source code, the class tree utility requires the classes to be compiled into the exe.
  20. Uwe Raabe

    Edit Entity shortcut inconsistent

    If possible, could you be a bit more specific? I mean, that is a bit vague, isn't it?
  21. Uwe Raabe

    Format uses clause

    You have to activate that option:
  22. Uwe Raabe

    Format uses clause

    You can define the group names per project in MMX Properties - Project options: A single identifier is treated as a group prefix which has to be followed by a dot (like System, VCL, FireDAC). You can also use wildcards like Rz* for all units from Raize Components (KSVC). Unit names not covered in one of the schemes above can be listet in brackets. This is the setting for MMX itself: (ToolsApi,DesignIntf,DCCStrs,DockForm,TabDock);Winapi;System.Win;System;Xml;Vcl;VirtualTrees*;Rz*;Tb*;Png*;MMX The settings are stored in the dproj file.
  23. It needs some code to be added, but you can declare a const array[<enumeration>] of Integer with values 0 in all places where the enumeration is used in some way. const cCheckProjectType: array[TProjectType] of Integer = (0, 0, 0, 0); If you now extend TProjectType the compiler will stop at all places where such a declaration is present and you can inspect the code around for correct TProjectType usage. After that is done you extend the array values to make the compiler continue to the next problematic position.
  24. Uwe Raabe

    Using Attributes in class declarations

    Very good point 👍
  25. Enclosing the loops with a qryItemReceita.DisableControls/EnableControls should help a bit.
×