-
Content Count
1489 -
Joined
-
Last visited
-
Days Won
36
Everything posted by Dave Nottage
-
Moving on from my prior question, I have posted this on SO, however I've started a new thread here in case someone that can help might otherwise miss it 🙂 My prior question here: Post on SO for the current problem: https://stackoverflow.com/questions/61514990/setting-an-enum-property-on-a-net-object
-
Thread programming without sleep or WaitFor events
Dave Nottage replied to turkverisoft's topic in Delphi IDE and APIs
Then you should not be using UDP, since order of packets is not guaranteed. With UDP, every packet should be considered data independent of all others. -
WebBroker option not visible in File > New > Other >Delphi projects after installing Delphi 10.3.3
Dave Nottage replied to Ramu's topic in Delphi IDE and APIs
It's not entirely obvious from File|New|Other|Delphi. From there, select the Web folder, and Web Server Application. They're all WebBroker solutions, but that's also not obvious until the second page. -
I have some .NET interop code where I've managed to load objects and read properties, however I am having trouble with setting a property on an object. Here's the relevant parts of the Delphi code: uses mscorlib_TLB, Winapi.ActiveX; type // Irrelevant parts of the code omitted TDotNetObject = class(TObject) private FTarget: OleVariant; FType: _Type; public procedure SetProperty(const APropertyName: string; const AValue: OleVariant; const AIndex: Integer = -1); end; function VariantToPSafeArray(const AValue: Variant): PSafeArray; begin Result := PSafeArray(VarArrayAsPSafeArray(AValue)); end; procedure TDotNetObject.SetProperty(const APropertyName: string; const AValue: OleVariant; const AIndex: Integer = -1); var LPropertyInfo: _PropertyInfo; LIndex: PSafeArray; begin if AIndex >= 0 then LIndex := VariantToPSafeArray(VarArrayOf([AIndex])) else LIndex := nil; LPropertyInfo := FType.GetProperty(APropertyName, BindingFlags_Instance or BindingFlags_Public or BindingFlags_NonPublic); if LPropertyInfo <> nil then LPropertyInfo.SetValue(FTarget, AValue, LIndex); end; procedure UpdateDefectStatus(const ADefectID, AStatus: Integer); var LObject: TDotNetObject; begin // ** Code to obtain the object omitted *** LObject.SetProperty('Status', AStatus); end; An error is thrown when LPropertyInfo.SetValue is called in TDotNetObject.SetProperty: The Status property type in C# is declared: public enum DefectStatus { /// <summary> /// Defect Reported. /// </summary> Reported, /// <summary> /// Defect assessed. /// </summary> Assessed, /// <summary> /// Defect on work order. /// </summary> OnWorkOrder, /// <summary> /// Defect closed. /// </summary> Closed } I found a solution for how to handle this situation using C# here: https://stackoverflow.com/a/13270302/3164070 However I'm a bit lost as to how to do the same in Delphi. Any ideas?
-
Setting a "nullable" property on a .NET object
Dave Nottage replied to Dave Nottage's topic in Windows API
I've posted a new question after help from Olivier: https://stackoverflow.com/questions/61514990/setting-an-enum-property-on-a-net-object If anyone can help, it would be greatly appreciated. -
WebModu class does not exist in Delphi 10.3
Dave Nottage replied to Ramu's topic in Delphi IDE and APIs
The recommended thing to do is to migrate to IntraWeb (from WebSnap, which is where WebModu is from) -
NSHighResolutionCapable = true scaling problems on MacOS 10.13
Dave Nottage replied to Chris Pim's topic in FMX
I followed this link to here: https://quality.embarcadero.com./browse/RSP-27197 I'd use the change that Erik suggested. -
Setting a "nullable" property on a .NET object
Dave Nottage replied to Dave Nottage's topic in Windows API
I've posted a question about this on SO which has received some attention: https://stackoverflow.com/questions/61334031/setting-a-nullable-property-on-a-net-object ..and I think I may be closer to a solution. Can someone check the code for the InvokeToObject method to see if I'm missing anything critical? -
Howto call initWithDelegate and CBCentralManagerOptionShowPowerAlertKey
Dave Nottage replied to Rollo62's topic in Cross-platform
They're ugly, but they are true. In your case however you should need only use dictionaryWithObject (since there is only one value), thus: var LDict: NSDictionary; LBooleanValue: Pointer; begin LBooleanValue := TNSNumber.OCClass.numberWithBool(True); LDict := TNSDictionary.Wrap(TNSDictionary.OCClass.dictionaryWithObject(LBooleanValue, NSObjectToID(CBCentralManagerOptionShowPowerAlertKey))); end; -
Has the relevance of UIRequiredDeviceCapabilities changed since IOS13 ?
Dave Nottage replied to Rollo62's topic in Cross-platform
You'll need to be more specific.- 4 replies
-
- firemonkey
- bluetooth-le
-
(and 1 more)
Tagged with:
-
Excellent! I was not aware of that property; thanks 🙂
-
I see what the problem is now: it's because selecting Segoe UI at design-time results in the Family value not being stored in the .fmx, because it's the default for Windows. I'd consider that a design fault, since it does not account for using a font with the same name on platforms other than Windows. Easiest solution: use something that looks like Segoe UI, but isn't 🙂 Any other solution would seem a bit difficult..
-
That's because you have Family in the StyledSettings property set to True in the Object Inspector (i.e. at design time). You need to set it to False
-
It also works for me just by having the Font.Family property in TextSettings set to the correct value (i.e. Anton) at design time. Using the button and code was just to demonstrate that there's a very obvious change in the font. I suspect there's something else wrong with your project, which is why I asked to post a test case.
-
I'm using Delphi 10.3.3, the latest released version of Xcode (11.4), building against the latest iOS SDK (13.4) and it works on my iPhone X which has iOS 13.4. I've attached my test project (which uses the Anton font, from here: https://fonts.google.com/specimen/Anton). Perhaps if you have a test project, you could attach it so it might be discovered what is going wrong. CustomFontDemo.zip
-
Actually it did - sorry, I used the workaround. I think isolation has caused some memory loss
-
Yes, that's what PAServer runs to discover what SDKs are on the Mac. Actually, I'm not sure now whether PAServer will show anything when it copies the files to the local machine. I was hoping it would display an error (if any). You should not need to, no. In case there is something really wrong though, on the Mac can you: Go to the Applications folder in Finder Right click on Xcode and click Show Package Contents Navigate to: Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs and make sure there's a MacOSX.sdk folder there (with subfolders) The only other thing I can think of is a rights issue (i.e. PAServer somehow does not have rights to the SDK subfolders), but that's a stretch
-
Your moniker says you're using Delphi 10.2 Tokyo. Is that still the case? Adding macOS 10.15.4 SDK works OK for me using 10.3.3. If you are using 10.3.3, it might be useful to turn on verbose mode in PAServer (v command)
-
Yes, as per the article. Make sure you're actually deploying the font files (Project|Deployment in the Delphi IDE), and to the correct Remote Path. i.e: .\ Also make sure that the entries in info.plist.TemplateiOS.xml match exactly with the actual filename - filenames are case sensitive on iOS.
-
Your info.plist.TemplateiOS.xml file is incorrect. Instead of: <key>Segoe UI</key> It should be: <key>UIAppFonts</key> As per the article
-
http://firemonkeyblog.blogspot.com/2014/12/how-to-use-custom-font-in-ios-delphi.html
-
The whole point is to shift controls up when they would be otherwise covered by the virtual keyboard. There is no point in shifting them down. In order to do that, you would need to have a control (e.g. a TLayout) at the top of the scrollbox and change the height so that the other controls move down. It is way more trouble than it is worth, and I doubt that users would even expect it to happen.
-
Please indicate what you mean by "before", e.g. was it a different version of Delphi? Deploying to a device with a different version of iOS, if so, which version(s)? Were your applications deploying the custom fonts? .
-
I must be missing something. What's the actual issue?
-
Yes, that is a drawback of using a datamodule. That said, different custom styles for the same controls inside the same application seems like inconsistent UI design to me.