Krypton-Suite / Standard-Toolkit

An update to Component factory's krypton toolkit to support .NET Framework 4.6.2 - 4.8.1 to .NET 6 - 8
BSD 3-Clause "New" or "Revised" License
399 stars 60 forks source link

[Feature Request]: "Open / Save File Dialog" are in the Main Forms elements - Where is Kryptons' Standard themed equivalent #267

Closed Smurf-IV closed 1 year ago

Smurf-IV commented 3 years ago

Moving on from #243

https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.commondialog?view=net-5.0

Smurf-IV commented 3 years ago

Got lost whilst performing #266 Way too messy - Will not implement (Yet)

Smurf-IV commented 1 year ago

OOki.Dialogs now has a Winform code base which could be used to fix this. https://github.com/ookii-dialogs/ookii-dialogs-winforms

PWagner1 commented 1 year ago

Wonder if the same could be done for transfer & credential dialogs?

Smurf-IV commented 1 year ago

Wonder if the same could be done for transfer & credential dialogs?

Those would be "Extended" feature requests ;-)

Smurf-IV commented 1 year ago

Hmm :-( OOki.Dialogs.Winforms is a thin wrapper over the common FileDialog to force some things to always work.

Smurf-IV commented 1 year ago

Must remember that if setting readonly to force "Vista Style": image

Should be similar to this: image

Smurf-IV commented 1 year ago

This appears to be hard work: https://learn.microsoft.com/en-us/previous-versions/dotnet/articles/ms996463(v=msdn.10)?redirectedfrom=MSDN

PWagner1 commented 1 year ago

This appears to be hard work: https://learn.microsoft.com/en-us/previous-versions/dotnet/articles/ms996463(v=msdn.10)?redirectedfrom=MSDN

Managed to download the msi, here's what's in it Extensible Dialogs Source.zip

Smurf-IV commented 1 year ago

So have been taking the code from Ookii, and Winforms .net 7 and have completed opening the "new" style Open Dialog. But, there is still no "Hook" function just and Show, that then returns a DialogResult, with an event for the "DoFileOk" redirect (So that multiselect can be worked etc.)

Skinning by brute force is also something that has been tried (Via C++ direct) and it seems to fail often: https://forum.codejock.com/problem-skinning-cfiledialog_topic17016.html

So the "only" way left now (I feel) is to have a complete Open / Save / Folder Form set-up, with Krypton controls := a massive effort! But there is "some" guidance for a simplified version: https://learn.microsoft.com/en-us/dotnet/desktop/winforms/controls/creating-an-explorer-style-interface-with-the-listview-and-treeview?view=netframeworkdesktop-4.8&redirectedfrom=MSDN

PWagner1 commented 1 year ago

@Smurf-IV

Have you had a look at the winforms repo, specifically in src/System.Windows.Forms/src/System/Windows/Forms?

Note: All dialogs are related to this

Smurf-IV commented 1 year ago

Yes, Like I stated I used the Winforms 7 code.

Note: All dialogs are related to this

Which is great for FileDialg using the old layout, BUT for the Vista style it is routed through the Com interfaces via https://github.com/dotnet/winforms/blob/main/src/System.Windows.Forms/src/System/Windows/Forms/FileDialog.Vista.cs

Therefore: no HookProc.

Smurf-IV commented 1 year ago

Try this: https://learn.microsoft.com/en-us/archive/msdn-magazine/2002/november/cutting-edge-using-windows-hooks-to-enhance-messagebox-in-net

With some of this: https://github.com/shy2net/WinputManager/blob/master/WinputManager/BaseHook.cs

PWagner1 commented 1 year ago

Try this: https://learn.microsoft.com/en-us/archive/msdn-magazine/2002/november/cutting-edge-using-windows-hooks-to-enhance-messagebox-in-net

Source: Source.zip

Smurf-IV commented 1 year ago

@Wagnerp This is as close as it will allow me to get to a fully themed FileOpen Form: image

Thoughts ?

PWagner1 commented 1 year ago

@Smurf-IV That's fine, we can put it into testing and ask devs for thoughts?

Smurf-IV commented 1 year ago

I'll do the SaveAs and then PR it next w/e

PWagner1 commented 1 year ago

I'll do the SaveAs and then PR it next w/e

I'll continue on the toolbar buttons this week. Something has got mangled up somewhere...

Smurf-IV commented 1 year ago

Darn it.. Have to also take into account scaling .. No PR this w/e !

Smurf-IV commented 1 year ago

And the Shell File Save control(s), is a mess compared with the Open !

Smurf-IV commented 1 year ago

example

example