Closed DigitalMills closed 4 days ago
Hi @DigitalMills
Does this happen when an event has occurred, I.e. hovering over it?
Hi @Wagnerp, this occurs when attempting to render any form.cs with a ribbon group component within it. The issue occurs before any hover events can take place.
Hi @Wagnerp, this occurs when attempting to render any form.cs with a ribbon group component within it. The issue occurs before any hover events can take place.
Hi @DigitalMills
Can you try nightly
please, as I think it's been fixed?
Hi @Wagnerp ,
Unfortunately we're still experiencing the same issue on the latest nightly
build.
thanks
Hi @DigitalMills
Is it possible to upload a clip to show what's going on?
Hi @Wagnerp,
please find video and screenshot attached:
https://github.com/user-attachments/assets/292e3b75-5af7-4868-a1b9-d4570afdb802
Hi @DigitalMills
Does it just happen on a contextual tab?
@Wagnerp Here's our stack trace for you, appears to relate to Krypton.Toolkit.PaletteOffice2010Base.GetRibbonBackColorStyle.
It seems closely associated with the Ribbon Group component
at System.Windows.Forms.MessageBox.Show(String text, String caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton) at Krypton.Toolkit.DebugTools.NotImplemented(String outOfRange, String callingFilePath, Int32 lineNumber, String callingMethod) at Krypton.Toolkit.PaletteOffice2010Base.GetRibbonBackColorStyle(PaletteRibbonBackStyle style, PaletteState state) at Krypton.Toolkit.PaletteRedirect.GetRibbonBackColorStyle(PaletteRibbonBackStyle style, PaletteState state) at Krypton.Toolkit.PaletteRibbonBackInheritRedirect.GetRibbonBackColorStyle(PaletteState state) at Krypton.Toolkit.PaletteRibbonBack.GetRibbonBackColorStyle(PaletteState state) at Krypton.Toolkit.PaletteRibbonBack.GetRibbonBackColorStyle(PaletteState state) at Krypton.Ribbon.ViewDrawRibbonGroup.RenderNormalBefore(RenderContext context) at Krypton.Ribbon.ViewDrawRibbonGroup.RenderBefore(RenderContext context) at Krypton.Toolkit.ViewComposite.Render(RenderContext context) at Krypton.Toolkit.ViewComposite.Render(RenderContext context) at Krypton.Toolkit.ViewControl.OnPaint(PaintEventArgs e) at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer) at System.Windows.Forms.Control.WmPaint(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at Krypton.Toolkit.ViewControl.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(HWND hWnd, MessageId msg, WPARAM wparam, LPARAM lparam)
Hi @DigitalMills
Is this a duplicate of #1299?
cc. @Smurf-IV & @giduac
Hi @DigitalMills (cc: @Wagnerp )
We need a bit more info to be able replicate this properly:
Hi @DigitalMills
Is this a duplicate of #1299?
cc. @Smurf-IV & @giduac
@Wagnerp Indeed it seems that this is present in more themes. :thumbsup:
Hi @DigitalMills
Is it possible to attach a sample?
@giduac
Is it possible to get the values into a buffer.
@PWagner1 for my error the state being sent that throws an error is 'ContextNormal'
Seems one of the PaletteRibbonBackStyle types is missing a PaletteState of ContextNormal:
@DigitalMills
Thanks for the response. Indeed we found this as well.
We both might reproduce the error in a different way. Therefore, what we would like to know from you is how the error is provoked in code on your side. So we can be sure to catch all possibilities for the fix.
@giduac
Correct me if this is wrong, but I've added:
case PaletteState.ContextNormal:
return PaletteRibbonColorStyle.RibbonGroupAreaBorderContext;
@PWagner1
Unfortunately I can't get a breakpoint on GetRibbonBackColorStyle method to confirm the style and the state, hopefully the above will suffice.
The application is rendering a new form when the issue occurs.
@giduac
Correct me if this is wrong, but I've added:
case PaletteState.ContextNormal: return PaletteRibbonColorStyle.RibbonGroupAreaBorderContext;
Do let me know if you'd like me to test any builds with changes above
@PWagner1
These 5 states need checking:
PaletteState.ContextPressed
PaletteState.ContextTracking
PaletteState.ContextCheckedTracking
PaletteState.ContextNormal
PaletteState.ContextCheckedNormal
The error is present in ALL themes and can be provoked by setting the ContextName property: KRibbon.SelectedTab.ContextName
Before making any changes make sure to reproduce the error...
Hi @giduac & @DigitalMills
I don't quite understand what's going on. If you use the Ribbon + Navigator + Workspace
demo, it works as expected, yet if you try to do it yourself, it ends up with showing the said dialog. There are no structural changes between V90 & V4.
cc. @Smurf-IV
Hi @giduac & @DigitalMills
I don't quite understand what's going on. If you use the
Ribbon + Navigator + Workspace
demo, it works as expected, yet if you try to do it yourself, it ends up with showing the said dialog. There are no structural changes between V90 & V4.cc. @Smurf-IV
I also get the error in Workspace Navigator test form:
https://github.com/user-attachments/assets/ac570a59-91d2-411e-b0b7-55e19bc6a408
Also happens when no context is created and only the ContextName property is set.
Hi @giduac & @DigitalMills I don't quite understand what's going on. If you use the
Ribbon + Navigator + Workspace
demo, it works as expected, yet if you try to do it yourself, it ends up with showing the said dialog. There are no structural changes between V90 & V4. cc. @Smurf-IVI also get the error in Workspace Navigator test form:
devenv_vQ2PUdeg2u.mp4
@giduac
Would you mind testing on the changes I've recently pushed, using the Ribbon
test, as it's a clone of the Ribbon + Navigator + Workspace
demo app? Thanks :)
My branch is up-to-date until:
Is that correct ?
I don't think this has anything to do with themes per se, rather this is a fundamental Ribbon
issue.
Our branches are on par... I have my own local branch here. Where there have been no corrections and the error is still present on all levels.
I don't think this has anything to do with themes per se, rather this is a fundamental
Ribbon
issue.
The error ends up in theme code where those styles are missing. So it's either that or who put those styles in the ribbon ???
Our branches are on par... I have my own local branch here. Where there have been no corrections and the error is still present on all levels.
I don't think this has anything to do with themes per se, rather this is a fundamental
Ribbon
issue.The error ends up in theme code where those styles are missing. So it's either that or who put those styles in the ribbon ???
If you do a diff comparison on the same block of code on V90 and V4 by CF, there are no changes in the case statements being used, which makes it even more odd.
The one who added those states to the ribbon didn't update the themes with those styles, I would say. So if you want to get to the bottom of that will be possible starting point.
For the fix: If you change the ribbon it will possibly be a breaking change. So my choice would be to add the styles to the themes...
So my choice would be to add the styles to the themes...
Do you mean adding new PaletteRibbonColorStyle
definitions?
No the missing case styles that come up now in the error. Those are the things that are missing or not ?
No the missing case styles that come up now in the error. Those are the things that are missing or not ?
Ahh adding the missing cases, might be better to add all of them. Yes the switch
might be big, but we would cover all eventualities.
Not all of those I listed are triggered in the error but also not present. So it makes sense imo to check all those states and see if they should be part of the fix
Once that has been established a standard fix for all themes can be devised.
@giduac
Hold on... could it be because KRibbon.SelectedTab
might be null
?
if selectedtab is null could the contextname be set and the case be triggered?
if selectedtab is null could the contextname be set and the case be triggered?
@PWagner1 well ?
if selectedtab is null could the contextname be set and the case be triggered?
@PWagner1 well ?
@giduac
Just trying something...
@giduac & @giduac
Yes!!!! It's now fixed!
All it required was...
PR coming soon
You sure that all the states should react the same ?
You sure that all the states should react the same ?
No, that will be the second part. For now, let's deal with the crux of the bug, then add the colour states :)
Oh, those can differ among the themes, yes ?
also, like in PaletteOffice2010Base some of these context styles are already addressed. Like ContextCheckedNormal
here...
case PaletteRibbonBackStyle.RibbonGroupArea:
switch (state)
{
case PaletteState.Normal:
case PaletteState.CheckedNormal:
return PaletteRibbonColorStyle.RibbonGroupAreaBorder3;
case PaletteState.ContextCheckedNormal:
return PaletteRibbonColorStyle.RibbonGroupAreaBorder4;
case PaletteState.Tracking:
return PaletteRibbonColorStyle.RibbonGroupNormalTrackingLight;
case PaletteState.FocusOverride:
return PaletteRibbonColorStyle.RibbonTabFocus2010;
default:
// Should never happen!
Debug.Assert(false);
DebugTools.NotImplemented(state.ToString());
break;
}
Oh, those can differ among the themes, yes ?
Yes, as the statements can be rearranged. For now, I'm just setting a default for them, it might not look pretty but at least it wont crash applications.
Should finish the rest straight after that ???
and make it whole
can I work on 1241 now ?
;)
Should finish the rest straight after that ???
The statements will be moved into position once we know it's working
can I work on 1241 now ?
Yes, go ahead :)
Hi @DigitalMills
Please try using the next nightly
build.
Hi @DigitalMills
Please retry using nightly
build >= .253
cc. @Smurf-IV & @giduac
Describe the bug Not Implemented Exception thrown for GetRibbonBackColorStyle for PaletteOffice2010Base.cs
To Reproduce Steps to reproduce the behavior:
Expected behavior Ribbon Group renders and paints
Actual behavior Error is thrown, suggesting part of the flow is not yet implemented. Stack trace:
System.ComponentModel.Win32Exception (2): An error occurred trying to start process 'https://github.com/Krypton-Suite/Standard-Toolkit/issues/new/choose' with working directory 'C:\Git\Aireforge\Aireforge Suite\OmniCompare\bin\Debug\net8.0-windows'. The system cannot find the file specified. at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start(ProcessStartInfo startInfo) at Krypton.Toolkit.DebugTools.NotImplemented(String outOfRange, String callingFilePath, Int32 lineNumber, String callingMethod) at Krypton.Toolkit.PaletteOffice2010Base.GetRibbonBackColorStyle(PaletteRibbonBackStyle style, PaletteState state) at Krypton.Toolkit.PaletteRedirect.GetRibbonBackColorStyle(PaletteRibbonBackStyle style, PaletteState state) at Krypton.Toolkit.PaletteRibbonBackInheritRedirect.GetRibbonBackColorStyle(PaletteState state) at Krypton.Toolkit.PaletteRibbonBack.GetRibbonBackColorStyle(PaletteState state) at Krypton.Toolkit.PaletteRibbonBack.GetRibbonBackColorStyle(PaletteState state) at Krypton.Ribbon.ViewDrawRibbonGroup.RenderNormalBefore(RenderContext context) at Krypton.Ribbon.ViewDrawRibbonGroup.RenderBefore(RenderContext context) at Krypton.Toolkit.ViewComposite.Render(RenderContext context) at Krypton.Toolkit.ViewComposite.Render(RenderContext context) at Krypton.Toolkit.ViewControl.OnPaint(PaintEventArgs e) at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer) at System.Windows.Forms.Control.WmPaint(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at Krypton.Toolkit.ViewControl.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(HWND hWnd, MessageId msg, WPARAM wparam, LPARAM lparam)
Screenshots
Desktop (please complete the following information):
OS: Microsoft Windows 11 Business Version: 10.0.22631 Build 22631 Framework/.NET Version: net8.0-windows Toolkit Version: 90.24.7.204-beta