Dialog size behaviour: VO dialog appears narrower (only width!) in X#

This forum is meant for questions and discussions about the X# language and tools
stefan.ungemach
Posts: 71
Joined: Thu Jul 15, 2021 10:46 am
Location: Germany

Dialog size behaviour: VO dialog appears narrower (only width!) in X#

Post by stefan.ungemach »

I have a strange issue regarding the display of dialogs: On the same machine a dialog with the same size (proven by a debugview output immediately before the Show) of 118x146 pixel looks different in VO and X#:

Visual Objects (correct):

 
dialogVO.png
dialogVO.png (2.07 KiB) Viewed 1037 times
XSharp:

 
dialogXsharp.png
dialogXsharp.png (2.73 KiB) Viewed 1037 times
Since the controls are clipped it is obviously not a scaling problem. It's also confusing that there is only a width difference.

If I set the size manually to something bigger directly before the show for measurements, the controls have the same size on both dialogs. Only the X# dialog is drawn smaller than coded.

There is no window editor involved, everything is generated by code.
User avatar
robert
Posts: 4529
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Dialog size behaviour: VO dialog appears narrower (only width!) in X#

Post by robert »

Stefan,
This looks like the manifest for "XP styles" was not included in your app.
Please choose the "suppress default win32 manifest" on the application properties page, and add the manifest from your VO program as resource to your project.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
stefan.ungemach
Posts: 71
Joined: Thu Jul 15, 2021 10:46 am
Location: Germany

Dialog size behaviour: VO dialog appears narrower (only width!) in X#

Post by stefan.ungemach »

Thank you. How exactly would I do that (I can i.e. add a "native resource template (rct)", or an xml file where I could put the contents of my resource XML from VO into)?

Is it possible to do it once (in an assembly) fr all projects which use it instead of adding it seperately to each project?
stefan.ungemach
Posts: 71
Joined: Thu Jul 15, 2021 10:46 am
Location: Germany

Dialog size behaviour: VO dialog appears narrower (only width!) in X#

Post by stefan.ungemach »

Addition: in VO I have

RESOURCE CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST %executabledir%adkomm.man

in one of the framework libraries. In X# I added a new resource "manifest.rc" and put this in it:

CREATEPROCESS_MANIFEST_RESOURCE_ID RC_RT_MANIFEST "B:adkomm.man"

Unfortunately it doesn't change anything. Is there something I'm missing, and how could I verify the success?
User avatar
robert
Posts: 4529
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Dialog size behaviour: VO dialog appears narrower (only width!) in X#

Post by robert »

Stefan,
- Create a new app from the VO MDI template
- This contains a file cctl6.man
- It also contains Standard Shell.Manifest.rc
- copy these to your project folder
- Include both in the project. Make sure that the item type for the RC file is a "NativeResource"
- The resource file assumes that the manifest is in a resources folder. If you put it in the same folder, then adjust the contents of the rc file.

Of course, you can put these in a shared folder, shared by all of your apps.
If you want to automatically include it in all of your apps then you would have to make a common file that is included in each project file.
An alternative is to create a Directory.Build.Props or Directory.Build.Targets file in the root of your solution. The contents of these files is automatically included by MsBuild.
I think a props file would work. See
https://thomaslevesque.com/2017/09/18/c ... ild-props/
for more info

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
stefan.ungemach
Posts: 71
Joined: Thu Jul 15, 2021 10:46 am
Location: Germany

Dialog size behaviour: VO dialog appears narrower (only width!) in X#

Post by stefan.ungemach »

Robert,

I've tried this. Here is my project:
 
Untitled.png
Untitled.png (5.62 KiB) Viewed 1036 times
The cctl6.man is copied from the new VO MDI App. The Manifest.rc has the same contents as Standard.Shell.Manifest:
​​​​​​​ 
Untitled2.png
Untitled2.png (72.21 KiB) Viewed 1036 times
The results are still the same. I'm sure I missed something stupid, but I don't have a clue...
User avatar
robert
Posts: 4529
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Dialog size behaviour: VO dialog appears narrower (only width!) in X#

Post by robert »

Stefan,
Please do not embed images in the messages, but use attachments.
There is something broken with the website. We will look at that asap.
But right now we cannot read your message

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
stefan.ungemach
Posts: 71
Joined: Thu Jul 15, 2021 10:46 am
Location: Germany

Dialog size behaviour: VO dialog appears narrower (only width!) in X#

Post by stefan.ungemach »

Project with manifest.png
Project with manifest.png (74.58 KiB) Viewed 1036 times
stefan.ungemach
Posts: 71
Joined: Thu Jul 15, 2021 10:46 am
Location: Germany

Dialog size behaviour: VO dialog appears narrower (only width!) in X#

Post by stefan.ungemach »

Project settings.png
Project settings.png (78.98 KiB) Viewed 1036 times
leon-ts
Posts: 435
Joined: Fri Feb 03, 2017 1:43 pm

Dialog size behaviour: VO dialog appears narrower (only width!) in X#

Post by leon-ts »

Stefan,
This is not the full version of the manifest. I'm not sure if the manifest is actually causing the problem you describe, but if it is, try this manifest (just replace the description and app version with yours):
Example.man.zip
(806 Bytes) Downloaded 108 times
Best regards,
Leonid
Post Reply