Sisulizer runtime change in high DPI Delphi program - delphi

I have a problem with Sisulizer in a DPI-aware Delphi application. The application works perfect in high DPI, also along multiple monitors with multiple DPI settings.
The problem arrises if the user changes the language (resource) runtime with one or multiple forms shown. We do this using SetNewResourceFile in LaResource.pas. This loads the new resource file and will overwrite all properties of all components. This changes also the left, right, top, bottom, width, height, etc. of the components and thereby change the scaling of all forms and components. So, a form that is scaled 200% is 'reset' to 96ppi after this action. This behavior is not desirable.
Does anybody have a suggestion how to solve this?

I have the issue by adding to following lines of code:
initialization
LaEnabledProperties := STRING_TYPES_C;
Although this solves my issue, it is still a bug in Sisulizer. If you have, for example, a label with different width for each language, it will not work. If have notified Sisulizer and hope that they will fix it.

Related

VCL TButton using TVirtualImageList is painfully slow

I am using Embarcadero C++ 10.3.2.
I switched my VCL buttons to use TVirtualImageList, and this greatly improved their scaling behavior.
Unfortunately, now the buttons appear on the Form at runtime extremely slowly, one by one. I am guessing this is due to the internal scaling of the icon images, as regular buttons behave normally.
I made the buttons the same size as one of the standard image sizes in the TVirtualImageList, but this made little difference. It happens whether the screen is scaled by Windows or not.
Is there any way of speeding this up?

How to expand components in Vaadin?

SpringBoot 2 Vaadin 12.0.3
I've spent some time watching video tutorials and studying online examples of Vaadin. Unfortunately, so much has changed that options that I was hoping to try are no longer there.
CssLayout is no longer there - replaced by Div which does not expose expand(Component).
component.setWidth("300") has no effect.
component.setWidth("300", UNIT.*) does not work because UNIT is not in class path.
component.setWidth("300px") works but it's far from elegant and setting explicit width on a component which displays text is far from ideal.
I have three pseudo horizontal menu items. On a large screen, they'd be truly horizontal. On smaller screen, I'd like them to go into vertical mode.
Combo Box should expand to the width of the longest label.
Text Box should expand to available real estate. (Available width - Combo Box width - Search Button width)
Search Button should expand to the width of the Icon and Label without any wrapping.
Is this possible to achieve using Vaadin 12 Layout/Component contract or do I have to spend time defining such control in CSS file?
Your question implies that there would have been a trivial way of achieving your use case with the built-in layouts in Vaadin 7 or Vaadin 8 without using CSS. What you're describing about automatically switching between horizontal and vertical modes depending on the screen size sounds like something that would require some degree of responsive layouting, which typically implies directly using CSS.
What you could have done in older versions is to have Java logic that either uses a VerticalLayout or a HorizontalLayout depending on the situation. Those two classes are still available for the same kind of use cases. The APIs have changed to better align with the underlying flexbox functionality, but the overall functionality is still the same.
You could also look in to FormLayout (part of the core framework) or the Board layout (separate add-on) which both provide some responsive functionality. They are, however, originally intended for slightly different use cases (forms and dashboards respectively), so it might be slightly challenging to make them fit your exact requirements.

Supporting multiple screen sizes

I want to build a mobile application in Delphi, but I can't seem to figure out how to handle multiple screen sizes. AndroidStudio has a nice relative layout for this, but I can't find anything alike for delphi. Am I supposed to build a multiple form designs for each screen size?
I'm using XE6, I am requoired to use Delphi as the programming language.
I have already figured it out, you have to use the Align property on every single control you add to the form.

Firemonkey iOS component repositioning & resizing

I have a Delphi XE2 Firemonkey application that I want to run on both iPad and iPhone. The iPad and iPhone real estate is different of course and I have been experimenting repositioning and resizing (visual) components according to the platform they are running on - triggered by the forms OnResize event. Started out changing the component "Margins" property with not much success (maybe that relates more to adjacent components...?) and then found the component "Position" property seems to do the job.
Question: Is the Position property the way to go? Or is there a more appropriate way using "Margins" (I seem to have read something about this somewhere, but can no longer find it). Or is there some other method, maybe not based on the OnResize event? (Yes, I am sure this is just 1 question.)
Brief details of the project - displays a costomer database record on the screen using around 30 components, mostly TLabel components, some buttons and search fields or 2 using TEdit's.
Thanks
Really depends on how differently you want to use the extra real-estate.
Do you want to display additional information, or just stretch everything out to use the space? If the latter, then you can use the Scale property.

How to make scrollbars wider/bigger for delphi, (including the scrollbar's arrows)

For accessibility purposes, I need to make the scrollbars for all scrollable controls (lists, list views) wider and the scrollbar arrows bigger.
How to get the scrollbars (handles) from a scrollable control (ex: TListView) ?
How to make the scrollbar and the arrows wider/bigger ?
10x for any hints and code...
Accessibility is something that does not concern a single application, but the whole system. That's why there is no API defined to adjust things like border widths, scrollbar size and similar properties of the native controls only for your program. You can however adjust these settings globally in Windows, either by using the Accessibility Wizard, or by adjusting fonts, colours, border sizes and scrollbar sizes in the Display Properties applet.
For more information you should check out the Microsoft Accessibility page and follow the various links.
Edit: Changing the global settings (as the accepted answer suggests) for the benefit of your own program is rude in the extreme. Please keep in mind that this interferes with all other running programs. It is maybe excusable for a system with a touch screen, where controls need to be large to be usable at all - but on such a system the control sizes would probably already be set correctly.
I'm not sure that you can - You have to change it (and restore back) for whole Windows.
http://www.greatis.com/delphicb/tips/lib/system-captionfont.html
Setting and reading property TNonClientMetrics.iScrollWidth
Edit: I know that this solution is rude, but in common cases is the best that you CAN do. If you have specialized TabletPC application then you usually use only that application at one time, not others. But - almost all Windows applications are not designed to work with so big scroolbars. So when you need to use OS dialogs and other applications then you have to switch it back.
There is no better solution than "while is my touchscreen application running set Window scroolbars big, then return it back". We have exactly this application in real world so I know what I'm talking about.
Of course you can write your own grid control (if you have so much time) or use some thirdparty controls (if you have money and time), but that was not question.

Resources