Author Topic: Early WIP on v2.55  (Read 140401 times)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1983
    • zapsolution
Re: Early WIP on v2.55
« Reply #360 on: December 20, 2018, 01:41:59 pm »
About the custom color control, we can adjust its height size as we want, and we can turn it on or off.
We can also managed the size of the popup window, to put it outside of the viewport when we do not want it, indeed plainty of solutions.

About the custom help, i am thinking that we could even have a list on the left of the control to load and display a specfic rtf topic file ;)
The blue icon on the bottom right is to show or hide the help control.
The provided Windows WordPad is just perfect to create the rtf files.
« Last Edit: December 20, 2018, 01:47:02 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Early WIP on v2.55
« Reply #361 on: December 20, 2018, 02:33:23 pm »
WordPad's markup RTF is nearly 100% compatible with the standard RichEdit20's capabilities. OTOH MS Word's RTF deviates from WordPad and RichEdit20 in many ways and yields weird visuals in too many cases.

I don't think the blue help button should be there where it is now. I think we'd better use a standard [?] button in the top right corner of the caption bar if only WinLIFT supports it.

Re. custom color controls, I agree to putting them at the tool window bottom, hidden. The tool window should grow down to no more than extra 30% of its usual height and should reveal the hidden control in response to the usual Color button press. Then the tool window should also show up another button called Select next to its existing Reset button. The Select button press will fetch the given selected color to the shader and will at the same time close (hide) the color control, shrink the tool window back to its usual size, and hide the Select button itself.

Do you agree to such a scenario? If yes then can we rely on your practical implementation of it soon, i.e. before your RTF help system materializes?
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1983
    • zapsolution
Re: Early WIP on v2.55
« Reply #362 on: December 20, 2018, 03:25:53 pm »
Quote
Do you agree to such a scenario? If yes then can we rely on your practical implementation of it soon, i.e. before your RTF help system materializes?
My friend, too late, i am already working on the help system (that's something i wanted to have for long).
But i shall do my best to work on custom color control, as soon as i have sorted out the basic features of richedit.
« Last Edit: December 20, 2018, 03:29:02 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1983
    • zapsolution
Re: Early WIP on v2.55
« Reply #363 on: December 20, 2018, 04:08:20 pm »
Ok, i have the fundamental of the help system working, now switching back on the color control ;)
« Last Edit: December 20, 2018, 05:07:50 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Early WIP on v2.55
« Reply #364 on: December 20, 2018, 05:13:36 pm »
My friend, too late, i am already working on the help system ...

Gees, am I not familiar with this feeling of excitement and impatience myself when I can't think of anything else before I get me that toy that I've been dreaming of for ages? ;D
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1983
    • zapsolution
Re: Early WIP on v2.55
« Reply #365 on: December 20, 2018, 06:18:08 pm »
Here is my suggestion for the color picker, we coul use a parameter to show or hide it, because the dialog size won't change.

Note: I can't skin the combo on the fly because it is an ownerdrawn control, using subclassing to display the list with an offset to the left.
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Early WIP on v2.55
« Reply #366 on: December 20, 2018, 06:28:40 pm »
Patrice,

I decided to make gP.redraw a real BOOL = 1 instead of that BASIC-ish funny long = -1. We aren't supporting BASIC any more, and we should abandon its evil practices here and in all other cases.
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Early WIP on v2.55
« Reply #367 on: December 20, 2018, 06:40:26 pm »
Here is my suggestion for the color picker ...

How do we abandon incorrect choices/cancel the operation without a Select button?

Quote
... we coul use a parameter to show or hide it, because the dialog size won't change.

... show in response to the Color button click but hide in response to what event, may I ask? I suggest pressing an ESC keyboard key.

Quote
Note: I can't skin the combo on the fly because it is an ownerdrawn control, using subclassing to display the list with an offset to the left.

Whose control is that, yours or 3rd party's?
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1983
    • zapsolution
Re: Early WIP on v2.55
« Reply #368 on: December 20, 2018, 07:12:19 pm »
This color picker is a GDImage control, we could add an extra button,
I have to check the code you are using with the native Windows control, to better figure what to do

So far i did this (search for if (ShowColorPick) { )

#define IDT_COLORPICK   59999 // PAT: 12-20-2018

Code: [Select]
HWND CreateToolWindow(IN long ShowColorPick = 0) {
    if (!IsWindow(gP.hTool)) {
        HWND hCtrl = NULL, hWnd = NULL;
        WNDCLASSEX wcx = { 0 };
        WCHAR zClass[MAX_PATH]; ClearMemory(zClass, sizeof(zClass));
        wcscopy(zClass, L"ZTOOLW");

        wcx.cbSize = sizeof(wcx);
        long IsInitialized = GetClassInfoEx(gP.hInstance, zClass, &wcx);
        if (!IsInitialized) {
            wcx.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;
            wcx.lpfnWndProc = ToolProc;
            wcx.cbClsExtra = 0;
            wcx.cbWndExtra = 0;
            wcx.hInstance = gP.hInstance;
            wcx.hIcon = LoadIcon(wcx.hInstance, L"PROGRAM");
            wcx.hCursor = LoadCursor(NULL, IDC_ARROW);
            wcx.hbrBackground = NULL;
            wcx.lpszMenuName = NULL;
            wcx.lpszClassName = zClass;
            wcx.hIconSm = wcx.hIcon;
            if (RegisterClassEx(&wcx)) { IsInitialized = TRUE; }
        }

        if (IsInitialized) {
            DWORD dwStyle = WS_POPUP | WS_CAPTION; // | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN;
            DWORD dwExStyle = WS_EX_TOOLWINDOW;
            hWnd = CreateControl(dwExStyle, zClass, L"Controls", dwStyle, 0, -1000, ToolW, ToolH, gP.hMain, 0, gP.hInstance, 0);
            if (IsWindow(hWnd)) {

                Path_Combine(zClass, skSkinFolder(), L"DLG_Info.png");
                skStaticImage(hWnd, zClass, 6, 6, 366, 196, 777);

                wcscopy(zClass, L"button"); dwStyle = WS_CHILD | BS_AUTOCHECKBOX;
                hCtrl = CreateControl(0, zClass, L"", dwStyle, 42, 50, 16, 16, hWnd, IDT_CHECK01, gP.hInstance, 0);
                hCtrl = CreateControl(0, zClass, L"", dwStyle, 42, 96, 16, 16, hWnd, IDT_CHECK02, gP.hInstance, 0);
                hCtrl = CreateControl(0, zClass, L"", dwStyle, 42, 142, 16, 16, hWnd, IDT_CHECK03, gP.hInstance, 0);

                WCHAR zFont[MAX_PATH]; ClearMemory(zFont, sizeof(zFont));
                Path_Combine(zFont, skSkinFolder(), L"trebuc.ttf");

                wcscopy(zClass, L"static"); dwStyle = WS_CHILD;
                hCtrl = CreateControl(0, zClass, L"Cap 1", dwStyle, 85, 29, 164, 20, hWnd, IDT_CAPTION01, gP.hInstance, 0);
                hCtrl = CreateControl(0, zClass, L"Cap 2", dwStyle, 85, 75, 220, 20, hWnd, IDT_CAPTION02, gP.hInstance, 0);
                hCtrl = CreateControl(0, zClass, L"Cap 3", dwStyle, 85, 121, 164, 20, hWnd, IDT_CAPTION03, gP.hInstance, 0);

                long xOffset = 120;
                hCtrl = CreateControl(0, zClass, L"", dwStyle, 85 + xOffset, 29, 50, 20, hWnd, IDT_VALUE01, gP.hInstance, 0);
                hCtrl = CreateControl(0, zClass, L"", dwStyle, 85 + xOffset, 75, 50, 20, hWnd, IDT_VALUE02, gP.hInstance, 0);
                hCtrl = CreateControl(0, zClass, L"", dwStyle, 85 + xOffset, 121, 50, 20, hWnd, IDT_VALUE03, gP.hInstance, 0);

                wcscopy(zClass, TRACKBAR_CLASS); dwStyle = WS_CHILD | TBS_BOTH | TBS_NOTICKS | TBS_TOOLTIPS;
                hCtrl = CreateControl(0, zClass, L"", dwStyle, 85, 50, 166, 16, hWnd, IDT_SLIDE01, gP.hInstance, 0);
                SendMessage(hCtrl, TBM_SETRANGE, TRUE, MAKELONG(0, 100)); SendMessage(hCtrl, TBM_SETPOS, TRUE, 50);
                hCtrl = CreateControl(0, zClass, L"", dwStyle, 85, 96, 166, 16, hWnd, IDT_SLIDE02, gP.hInstance, 0);
                SendMessage(hCtrl, TBM_SETRANGE, TRUE, MAKELONG(0, 100)); SendMessage(hCtrl, TBM_SETPOS, TRUE, 50);
                hCtrl = CreateControl(0, zClass, L"", dwStyle, 85, 142, 166, 16, hWnd, IDT_SLIDE03, gP.hInstance, 0);
                SendMessage(hCtrl, TBM_SETRANGE, TRUE, MAKELONG(0, 100)); SendMessage(hCtrl, TBM_SETPOS, TRUE, 50);

                wcscopy(zClass, L"button"); dwStyle = WS_CHILD | BS_CENTER | BS_VCENTER | BS_NOTIFY;
                hCtrl = CreateControl(0, zClass, L"But 1", dwStyle, 282, 47, 60, 20, hWnd, IDT_BUT01, gP.hInstance, 0);
                hCtrl = CreateControl(0, zClass, L"But 2", dwStyle, 282, 93, 60, 20, hWnd, IDT_BUT02, gP.hInstance, 0);
                hCtrl = CreateControl(0, zClass, L"But 3", dwStyle, 282, 139, 60, 20, hWnd, IDT_BUT03, gP.hInstance, 0);
                dwStyle |= WS_VISIBLE;
                hCtrl = CreateControl(0, zClass, L"Reset", dwStyle, 292, 218, 80, 27, hWnd, IDT_RESET, gP.hInstance, 0);


                skSkinWindow(hWnd, L"");// "Dock|Undock|Minimize|Maximize|Restore|Close");

                // PAT: 12-20-2018
                if (ShowColorPick) {
                    hCtrl = zColorCtrl(6, 220, ToolW - 114, 30, hWnd, IDT_COLORPICK, zGetPickColor(0, 0));
                }

                skCreateToolTip(GetDlgItem(hWnd, IDT_SLIDE01), L"");
                skCreateToolTip(GetDlgItem(hWnd, IDT_SLIDE02), L"");
                skCreateToolTip(GetDlgItem(hWnd, IDT_SLIDE03), L"");

                // We use the new trebuc.ttf private font stored into the Reader resource folder
                skSetLabelFont(GetDlgItem(hWnd, IDT_CAPTION01), zFont, 14, skARGB(255, 255, 255, 255), FontStyleRegular);
                skSetLabelFont(GetDlgItem(hWnd, IDT_CAPTION02), zFont, 14, skARGB(255, 255, 255, 255), FontStyleRegular);
                skSetLabelFont(GetDlgItem(hWnd, IDT_CAPTION03), zFont, 14, skARGB(255, 255, 255, 255), FontStyleRegular);
                skSetLabelFont(GetDlgItem(hWnd, IDT_VALUE01), zFont, 14, skARGB(255, 255, 255, 255), FontStyleRegular);
                skSetLabelFont(GetDlgItem(hWnd, IDT_VALUE02), zFont, 14, skARGB(255, 255, 255, 255), FontStyleRegular);
                skSetLabelFont(GetDlgItem(hWnd, IDT_VALUE03), zFont, 14, skARGB(255, 255, 255, 255), FontStyleRegular);
                skSetLabelFont(GetDlgItem(hWnd, IDT_BUT01), zFont, 14, skARGB(255, 255, 255, 255), FontStyleRegular);
                skSetLabelFont(GetDlgItem(hWnd, IDT_BUT02), zFont, 14, skARGB(255, 255, 255, 255), FontStyleRegular);
                skSetLabelFont(GetDlgItem(hWnd, IDT_BUT03), zFont, 14, skARGB(255, 255, 255, 255), FontStyleRegular);
                skSetLabelFont(GetDlgItem(hWnd, IDT_RESET), zFont, 14, skARGB(255, 255, 255, 255), FontStyleRegular);

                long nWidth, nHeight, w, h, x, y;
                RECT rw; GetWindowRect(gP.hMain, &rw); nWidth = rw.right - rw.left; nHeight = rw.bottom - rw.top;
                RECT rc; GetWindowRect(hWnd, &rc); w = rc.right - rc.left; h = rc.bottom - rc.top;
                x = rw.left + (nWidth - w) / 2;
                y = rw.top + (nHeight - h) / 2;
                MoveWindow(hWnd, x, y, w, h, 0);

                gP.hTool = hWnd;
            }
        }
    }

    if (!IsWindowVisible(gP.hTool)) {
        SetToolwinParams(gP.hTool);
        ShowWindow(gP.hTool, SW_SHOW);
    }

    return gP.hTool;
}

We could put the extra button on the left of the color picker, and reduce the width of the control accordingly.
But i can live with the Windows control for now.

Added
I have checked the SetToolwinParams, and i better understand now what to do   :-[
« Last Edit: December 20, 2018, 07:33:23 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Early WIP on v2.55
« Reply #369 on: December 20, 2018, 08:05:19 pm »
Thank you for your effort, Patrice!

But please make it HWND CreateToolWindow(IN BOOL bShowColorPick = FALSE), will you? ;)
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Early WIP on v2.55
« Reply #370 on: December 20, 2018, 08:08:02 pm »
While we're at it, can you make it so that the tool window first pops up not in the center of the screen, but exactly at the bottom left corner of the viewport?
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1983
    • zapsolution
Re: Early WIP on v2.55
« Reply #371 on: December 20, 2018, 09:47:11 pm »
Here is how it looks with the [OK] button
Patrice
(Always working with the latest Windows version available...)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1983
    • zapsolution
Re: Early WIP on v2.55
« Reply #372 on: December 20, 2018, 11:37:03 pm »
Because i am using now a #32770 container for the color picker, i can hide the combo if you want?

The use of a container also allows us to show/hide the whole color picker easiliy.

See the attachment
« Last Edit: December 20, 2018, 11:47:58 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Early WIP on v2.55
« Reply #373 on: December 21, 2018, 12:17:17 am »
Yes Patrice, thanks for your time!

This one looks much more to my liking if only you can't make the combo size exactly as large as the colored square on the left side of the picker.

If you still can resize it a little larger then let's have it visible and functional too. It's much handier for many simple purposes than the full blown picker. :)
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1983
    • zapsolution
Re: Early WIP on v2.55
« Reply #374 on: December 21, 2018, 09:44:58 am »
There is a conflitc between the toastwindow and toolwindow, when showing the popup.
This is because of the non-cooperative timer effect used in the toastwindow, that must be reworked, the same problem occures when using OGL animations at the time the toastwindow shows up.

For the color picker, the color picker itsel could be resized to any size, however the combo header height must match the size of a single list line (indeed the ownerdrawn color square cell).

Patrice
(Always working with the latest Windows version available...)