Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: VisualMessageBoxForm throws exception when used with custom theme #1552

Closed
lukas2-werner opened this issue Jun 21, 2024 · 23 comments
Closed
Labels
area:themes All things to do with themes. bug Something isn't working fixed This issue has been fixed. version:90 All things to do with V90.
Milestone

Comments

@lukas2-werner
Copy link

Describe the bug
The following message pops up if I open a KryptonMessageBox while a custom theme is loaded:
image
looking at the stack trace:
image
It seems it is this line that is causing the bug:

this.kwlblMessageText.InputControlStyle = Krypton.Toolkit.InputControlStyle.PanelClient;

Desktop (please complete the following information):

  • OS: [Windows 11]
  • .NET Version: [8]
  • Toolkit Version: [90.24.6.169-alpha]
@lukas2-werner lukas2-werner added the bug Something isn't working label Jun 21, 2024
@giduac
Copy link
Contributor

giduac commented Jun 21, 2024

Hi @lukas2-werner,

Can you please state which custom theme you are using?
Can you provide a sample program that reproduces the error please?

@lukas2-werner
Copy link
Author

I use this theme https://github.com/Krypton-Suite/Theme-Palettes/blob/alpha/Palettes/Other/Asphalt_v19.xml
Unfortunately I cannot provide the program.
The bug was introduced in this commit and as far as I can tell the InputControlStyle should not be set to PanelClient but left in its default state.
If I remove that line everything works.

@giduac
Copy link
Contributor

giduac commented Jun 21, 2024

Hi @lukas2-werner

I understand that you cannot provide the actual program and we don't need that.
But can you please provide new small sample program that reproduces the error clearly.

In that way we don't have guess or try all kind of combinations to reproduce the error.

TY.

@lukas2-werner
Copy link
Author

I just tried it with a random example 'Test MessageBox Clipping 2022' from Standard-Toolkit-Demos.
Change to latest nightly.
Change this line to:

string themePath = @"......Asphalt_v19.xml";

KryptonCustomPaletteBase palette = new();
using (Stream stream = new FileStream(themePath, FileMode.Open))
{
    palette.Import(stream);
}
kryptonManager.GlobalCustomPalette = palette;

Start the example and switch to custom theme.
Pressing a button to open the MessageBox produces the error

@PWagner1
Copy link
Contributor

This is triggered (possibly) by a missing case in a switch statement. The debug tools are really helping with locating these types of bugs.

@giduac
Copy link
Contributor

giduac commented Jun 21, 2024

@lukas2-werner Ty.

@Wagnerp, That sounds a like a case for you ...

@PWagner1
Copy link
Contributor

Hi @giduac

Building on my last response, the bug is in GetPalettePanel in KryptonCustomPaletteBase

@lukas2-werner

Can you please provide a sample that triggers this bug all the time?

@lukas2-werner
Copy link
Author

I just tried it with a random example 'Test MessageBox Clipping 2022' from Standard-Toolkit-Demos. Change to latest nightly. Change this line to:

string themePath = @"......Asphalt_v19.xml";

KryptonCustomPaletteBase palette = new();
using (Stream stream = new FileStream(themePath, FileMode.Open))
{
    palette.Import(stream);
}
kryptonManager.GlobalCustomPalette = palette;

Start the example and switch to custom theme. Pressing a button to open the MessageBox produces the error

Hi @Wagnerp
I can reproduce the error with the steps above. Let me know if you need further info.

@PWagner1
Copy link
Contributor

I just tried it with a random example 'Test MessageBox Clipping 2022' from Standard-Toolkit-Demos. Change to latest nightly. Change this line to:

string themePath = @"......Asphalt_v19.xml";

KryptonCustomPaletteBase palette = new();
using (Stream stream = new FileStream(themePath, FileMode.Open))
{
    palette.Import(stream);
}
kryptonManager.GlobalCustomPalette = palette;

Start the example and switch to custom theme. Pressing a button to open the MessageBox produces the error

Hi @Wagnerp I can reproduce the error with the steps above. Let me know if you need further info.

Hi @lukas2-werner

What happens if you directly feed the path into the Import() function, i.e. Import("<#PATH-TO-FILE#>\Asphalt_v19.xml")?

@lukas2-werner
Copy link
Author

The same thing happens.

@PWagner1 PWagner1 self-assigned this Jul 2, 2024
@PWagner1 PWagner1 added the under investigation This bug/issue is currently under investigation. label Jul 2, 2024
@PWagner1 PWagner1 added this to the Version 90 milestone Jul 2, 2024
@PWagner1 PWagner1 added the area:themes All things to do with themes. label Jul 2, 2024
@PWagner1
Copy link
Contributor

PWagner1 commented Jul 2, 2024

@Smurf-IV Is there a way to do a recursive upgrade of palettes, as many of them are still on v19 & the current version is 21?

cc. @giduac

@giduac
Copy link
Contributor

giduac commented Jul 2, 2024

@Wagnerp
Which files is it about?
What needs changing?

@PWagner1
Copy link
Contributor

PWagner1 commented Jul 3, 2024

@Wagnerp Which files is it about? What needs changing?

@giduac

The custom palette XML files need updating to use the latest schema. It can be done individually using https://github.com/Krypton-Suite/Theme-Palettes/tree/master/Applications/Source/Palette%20Upgrade%20Tool, but I wonder if it can be extended to accept a folder as a input/output?

@Smurf-IV
Copy link
Member

Smurf-IV commented Jul 3, 2024

@Wagnerp Which files is it about? What needs changing?

@giduac

The custom palette XML files need updating to use the latest schema. It can be done individually using https://github.com/Krypton-Suite/Theme-Palettes/tree/master/Applications/Source/Palette%20Upgrade%20Tool, but I wonder if it can be extended to accept a folder as a input/output?

Create an item in the Themes repo backlog please?

@giduac
Copy link
Contributor

giduac commented Jul 17, 2024

@Wagnerp Which files is it about? What needs changing?

@giduac

The custom palette XML files need updating to use the latest schema. It can be done individually using https://github.com/Krypton-Suite/Theme-Palettes/tree/master/Applications/Source/Palette%20Upgrade%20Tool, but I wonder if it can be extended to accept a folder as a input/output?

@Wagnerp
Is the version discrepancy the cause of this bug?

@PWagner1
Copy link
Contributor

@Wagnerp Which files is it about? What needs changing?

@giduac
The custom palette XML files need updating to use the latest schema. It can be done individually using https://github.com/Krypton-Suite/Theme-Palettes/tree/master/Applications/Source/Palette%20Upgrade%20Tool, but I wonder if it can be extended to accept a folder as a input/output?

@Wagnerp Is the version discrepancy the cause of this bug?

@giduac

Need to test, but the toolkit should prompt the user to upgrade the palette XML if it's incompatible...

@PWagner1
Copy link
Contributor

@Smurf-IV & @giduac

Are you having issues doing anything in the demos?

image

@Smurf-IV
Copy link
Member

@Smurf-IV & @giduac

Are you having issues doing anything in the demos?

Yes; that has been happening today, was not sure if it was a Weirdness with 17.11 p4 or not, because when you go and open the file, the warnings go away?!?!?!

@Smurf-IV
Copy link
Member

Does not appear in VS 17.10.4 (It just complains about the use of .Net 9 SDK!)

@PWagner1
Copy link
Contributor

Hi @lukas2-werner

Looks like a palette version incompatibility issue. Have you tried upgrading it?

cc. @Smurf-IV & @giduac

@lukas2-werner
Copy link
Author

Yes, I used the Palette Upgrade Tool but the result is the same.
I tested different alpha releases and found that this commit 3d25e5a#diff-909c8db448444eaef31624917ade63e1ebd73f8c72998db89db7851e48443d6c is where it broke. Before that everything works.

@giduac giduac self-assigned this Aug 14, 2024
@giduac giduac removed the under investigation This bug/issue is currently under investigation. label Aug 14, 2024
@giduac giduac added fixed This issue has been fixed. version:90 All things to do with V90. labels Aug 14, 2024
@giduac
Copy link
Contributor

giduac commented Aug 14, 2024

Hi @lukas2-werner,
cc: @Wagnerp

Keep an eye on discord for the notification when the next nightly will be released.
Please let us know your findings.

@lukas2-werner
Copy link
Author

I tested the 90.24.8.232-alpha and it works.
Thank you for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:themes All things to do with themes. bug Something isn't working fixed This issue has been fixed. version:90 All things to do with V90.
Projects
None yet
Development

No branches or pull requests

4 participants