I still have unresolved architecture of CMS, so with the new Quiky finally came the time to deal with it once and for all. I'm getting really tired of looking for notes or articles on so many places I've created over the years.
I'm also annoyed I have a several source code versions for it in various stages of finish, but each one is missing something or is not universal enough. I want to merge code for Quid Help, this blog, Quiky and several old websites I'm still maintaining.
Maybe my burden is CMS was my first big project, back in 2005. I can't believe it's almost 2 decades ago! So I know what the end result should be, but I don't have everything figured out.
For example, I've always had troubles doing minor edits, because it took too long to find the text in GUI or database. So I lean more towards text files, which have their own issues, like navigation. And I need some metadata for each article, because Quiky now can sort files only alphabetically, which is problematic if you don't include date in the file name and that looks ugly.
I've noticed I'm not using Quiky that often I “should” be and I figured out why: startup time. The WPF app is beautiful, but slow. There aren't quick and easy fixes for that, so I started looking around.
ChatGPT suggested Metapad and TedNPad editors, which truly start instantly. The reason is no surprise: C++.
I failed to set up C++ dev properly in VS Code, so I opted for Visual Studio Community instead, which would probably be a better choice anyway. With everything set I started experimenting. First I created simple “textarea” app and it's startup was instant as well.
Because I already know what the future Quiky should look like (I'm not satisfied with the separate view/edit modes), I was looking for a Win32 component that can handle formatting and images.
In GitHub repository of Windows Classic Samples from Microsoft I found PadWrite, which was pretty much the foundation I wanted. Using trial and error with ChatGPT I implemented reading and writing files, but got stuck for a while on encodings. Ultimately I settled with just support for UTF-8 and basic ANSI, leaving the rest for my future self.
What I really love about PadWrite is that the TextEditor is coded from scratch. I mean, to my amazement even text selection is created by RenderTarget.FillRectangle
. Holy cow! I even had to implement basic stuff, like double-click to select a whole word, myself.
Of course it's a double-edged sword, with the sharper side on my throat, but since I'm doing Quiky mainly for myself (due to all the other note taking and text editing apps) I'm not that concerned about all that missing standard features of contemporary text editors.
As a startup goes, I did a quick test using CamStudio recording at 100 fps and PadWrite started in about 30 ms, while empty .NET 8 WinForms started 11× slower.
To be honest, "cold" startup of the new C++ Quiky still takes several seconds and even then it's not as fast as e.g. Metapad, probably because PadWrite was designed to also initialize D2D or DirectWrite. Nevertheless, it's still WAY faster, than .NET version of Quiky.
Qip implementation
WYSIWYG content editor