-
Content Count
2612 -
Joined
-
Last visited
-
Days Won
154
Everything posted by Uwe Raabe
-
Delphi 11.3 is running in DPI aware mode per default. You have basically two options: in the High DPI designer options switch to automatic mode. That will scale the form according to the current Windows scaling and change all the positions and sizes in your DFMs start the IDE in DPI unaware mode. There should be a suitable entry in your Windows start menu.
-
“Transitive” type redefinitions in interface section
Uwe Raabe replied to Dmitry Onoshko's topic in Algorithms, Data Structures and Class Design
This kind of approach is usually seen when types previously declared in that unit have been moved to another one. Otherwise existing code would no longer compile. My personal preference would be to add all needed units to the uses clause. As always there might be exceptions with valid reasons. -
That won't explain the different appearance of the header. Nevertheless, way too less information to find the cause.
-
What Delphi version are you using? TBitBtn supports Images since Delphi 10.4. If by any chance you are able to use one of the more recent Delphi versions, I suggest to use the image list approach. It is way easier to maintain, especially when you plan to support High DPI in the future.
-
Probably depends on the Delphi version you are using.
-
If you use the Glyph property of TBitBtn, this will indeed be quite tedious. The preferred way is to use the Images property to assign an image list and set the ImageIndex/ImageName and DisabledImageIndex/DisabledImageName to the proper icon. There are also such properties for the Hot, Pressed and Selected states.
-
Actually it contains both:
-
A workaround would be to declare the array as a constant or create a dynamic array on the fly: for I in TArray<Integer>.Create(45, 30, 15) do
-
'View as Text' command menu item?
Uwe Raabe replied to PeterPanettone's topic in Delphi IDE and APIs
AFAIK, this command is only available from the context menu of the form designer. -
While I have the same problem when using alternative registry keys (instead of BDS), I thought of creating a separate management tool, but as ever so often spare time is limited and valuable.
-
This usually happens when MMX has been installed for all users, i.e. as an admin. That will use HKLM for the Experts entry, which will be copied to HKCU when a user starts Delphi. As the installer didn't add these registry entries, it refuses to remove them when uninstalling (this is standard behavior of InnoSetup). Actually, these kind of quirks are the reason why Install for me only is recommended. If you are the only user at the system it doesn't matter at all and if you are not, each user will have its own copy of MMX installed (they can even have different versions). I always try to clean up as neatly as possible when uninstalling, but I didn't find a reliable way to do that without jumping through hoops with the registry and several user folders.
-
You can always configure a different (or even no) shortcut to any MMX command. See MMX properties -> Key bindings.
-
You might already have seen it: When you go to https://quality.embarcadero.com/ there is a notice at the top saying: So be prepared (presumably already today) for not being able to file new reports or edit/comment on existing ones. Searching and reading should be possible. While this will most certainly lead to complaints, it is definitely a good thing and long awaited change.
-
Threadvar "per object"
Uwe Raabe replied to chkaufmann's topic in Algorithms, Data Structures and Class Design
and for class var. -
Serialize/Deserialize Enums with no RTTI
Uwe Raabe replied to Larry Hengen's topic in RTL and Delphi Object Pascal
I know, that probably won't solve your problem, but I usually get rid of these kind of enumerations in favor of proper ones supported by RTTI. The numerical values are handles by record helpers: type TReportTypeCode = (reportTypeCodeSTR, reportTypeCodeLCTR, reportTypeCodeCDR, reportTypeCodeLVCTR, reportTypeCodeEFTR); TReportTypeCodeHelper = record helper for TReportTypeCode private const cMapping: array[TReportTypeCode] of Integer = (102, 106, 113, 14, 145); function GetAsInteger: Integer; procedure SetAsInteger(const Value: Integer); public property AsInteger: Integer read GetAsInteger write SetAsInteger; end; function TReportTypeCodeHelper.GetAsInteger: Integer; begin Result := cMapping[Self]; end; procedure TReportTypeCodeHelper.SetAsInteger(const Value: Integer); begin for var idx := Low(Self) to High(Self) do begin if cMapping[idx] = Value then begin Self := idx; Exit; end; end; raise EInvalidOperation.Create('invalid Integer value for TReportTypeCode'); end; Now there is no more casting to and from Integers. -
IIRC, they dropped the use of MS Document Viewer a while ago. While there are help items for a handful of Windows functions, there also is a hint to the MSDN online library, which IMHO is always the better up-to-date source.
-
Strange - this is what I see:
-
Perhaps the server outage made it one.
-
Variable might not have been initialized
Uwe Raabe replied to shineworld's topic in Delphi IDE and APIs
Given the use of Data in the following lines, I suspect that the begin end should wrap a much larger region. -
Variable might not have been initialized
Uwe Raabe replied to shineworld's topic in Delphi IDE and APIs
👍 -
Variable might not have been initialized
Uwe Raabe replied to shineworld's topic in Delphi IDE and APIs
Reading the code despite of its irritating formatting reveals the problem: WorkOrdersSelectedRow := WorkOrdersGrid.Selection.Top; if FWorkOrderManager.GetWorkOrderDataByIndex(WorkOrdersSelectedRow - 1, Data) then // evaluates file index FileIndex := ARow - 1; if (FileIndex < 0) or (FileIndex >= TWorkOrderData.FILE_DATA_SIZE) then Exit; FileIndex will not be initialized when the if clause fails. BTW, it also irritates that the compiler is charged guilty first. -
Essential Delphi Add-ons
-
What version of Delphi has the least amount of bugs throughout history?
Uwe Raabe replied to Al T's topic in Delphi IDE and APIs
I would love to see a bug-fixes-only release, but I am realistic enough to put my hopes pretty low. I also know that a lot of complaints about missing new features will be triggered by such a release. -
Mean as I am, I tried to pester the wizard with a pretty big chunk: https://github.com/microsoftgraph/msgraph-metadata/blob/master/openapi/v1.0/openapi.yaml Unfortunately it fails with a
-
A look into the GitHub repo reveals: