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

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Early WIP on v2.55
« Reply #375 on: December 21, 2018, 10:43:49 am »
There is a conflitc between the toastwindow and toolwindow, when showing the popup.

I think all the timed animations and objects in the app should use one and the same timer, SyncTimer()->WM_SYNC_NOTIFY->gl_TimerView(). Then all the animations will be mutually sync'ed, smooth and non-interfering.
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1982
    • zapsolution
Re: Early WIP on v2.55
« Reply #376 on: December 21, 2018, 11:23:57 am »
Absolutly, this is the best solution!

Moreover our central timer is working in a specific thread.

I am not sure when to show or hide the color picker, also the "OK" button seems redundent to me with the "Color" button.
Because in case "Color" button is pressed, no need to click first on "OK" we just have to use the color already selected.

Here is the current "ToolWindow.h" code, to check the changes i have done…

WARNING, zGetPickColor is using long rather than COLORREF thus i have added the GetPickColor function for that purpose.

Note: zGetPickColor(ZD_ARGB, 1) is the way to setup the initial color value.

The ColorPicker visibility is setup with ShowColorPicker/HideColorPicker, indeed no need for the bShowColorPick parameter in CreateToolWindow.
« Last Edit: December 21, 2018, 12:57:40 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1982
    • zapsolution
Re: Early WIP on v2.55
« Reply #377 on: December 21, 2018, 01:24:39 pm »
Add this into ShowToast

void ShowToast() {
    if (!(GetMenuState(gP.hMnu, MENU_HELP_TOAST, MF_BYCOMMAND) & MF_CHECKED)) // MLL 11-15-2018: show only if allowed
        return;
    if (IsWindow(gP.hToast)) {
        ZD_DoEvents();
        if (IsWindowVisible(gP.hToast))
            HideToast(); // MLL 11-15-2018: allow toasts to come in quick succession
        WCHAR zFile[MAX_PATH]; ClearMemory(zFile, sizeof(zFile));
        RECT lpr; GetWindowRect(gP.hToast, &lpr);
        Path_Combine(zFile, skSkinFolder(), L"furtiv.wav");
        if (FileExist(zFile)) { PlaySound(zFile, NULL, SND_FILENAME | SND_ASYNC); }
        MoveWindow(gP.hToast, lpr.left, lpr.top + Height(lpr), Width(lpr), 0, 0);
        ShowWindow(gP.hToast, SW_SHOWNOACTIVATE);
        for (long K = 1; K < Height(lpr); K++) {
            MoveWindow(gP.hToast, lpr.left, lpr.top + Height(lpr) - K, Width(lpr), K, 0);
            ZI_UpdateWindow(gP.hToast, 1);
            //Sleep(1); // ditto
            ZD_DoEvents();

        }
        MoveWindow(gP.hToast, lpr.left, lpr.top, Width(lpr), Height(lpr), 0);
        ZI_UpdateWindow(gP.hToast, 1);
        toastTimerID = SetTimer(gP.hToast, 0xABC, 15000, toastTimerFunc); // MLL 11-15-2018: close this toast in 15 secs
    }
}
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Early WIP on v2.55
« Reply #378 on: December 21, 2018, 01:37:19 pm »
Thank you for your work, Patrice!

I'm currently finishing off two more visual enhancements to OR: 3 states of grid opaqueness (solid=100%, glass=50%, ghost=10%) and 1 sec long camera reset animation (linear interpolation between the latest current pos translation/rot angles and zero pos and rot). I'll test, and comment on, your color picker shortly when I'm through with my work. :)

I am not sure when to show or hide the color picker, also the "OK" button seems redundent to me with the "Color" button.
Because in case "Color" button is pressed, no need to click first on "OK" we just have to use the color already selected.

No problem, I'll fix it myself as appropriate.

There's no redundancy in the OK button because the user should have a chance to cancel color selection any time without making a final choice and assigning the new color value. Thus
-- pressing a specific "Color" button will set forward which color exactly the picker is going to control and will also show the picker and OK button;
-- ESC will cancel color selection and will hide the picker and OK button without actually assigning the new color value to the color being selected; and
-- pressing OK will assign the new color value to the color being selected and will hide the picker and OK button.

ShowToast() updated, thanks!
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1982
    • zapsolution
Re: Early WIP on v2.55
« Reply #379 on: December 21, 2018, 04:52:37 pm »
Please change this in Main.cpp at line 3186

                    //hCtrl = skStaticImage(gP.hMain, gP.mt.FullName, /*1041*/ 1065 - skGetSystemMetrics(SK_CXFRAMELEFT), 10 - (skGetSystemMetrics(SK_CYCAPTION) + skGetSystemMetrics(SK_CYMENU)), 34, 32, IDC_GRAPHIC_CARD);
                    GetViewRect(gP.hMain, &rc);
                    hCtrl = skStaticImage(gP.hMain, gP.mt.FullName, skGetSystemMetrics(SK_CXFRAMELEFT) + Width(rc) - SPLITTER_WIDTH, 10 - (skGetSystemMetrics(SK_CYCAPTION) + skGetSystemMetrics(SK_CYMENU)), 34, 32, IDC_GRAPHIC_CARD);

                    skSetAnchorCtrl(hCtrl, ANCHOR_RIGHT);
« Last Edit: December 21, 2018, 04:54:21 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 #380 on: December 21, 2018, 06:47:25 pm »
Hehe, I got many more menu entries than you so for me, this line lies somewhere in the mid-200's. ;)

OK, here's my patch that implements a variable opacity scene grid and model reset animation (active on default).

I'm sending you many files because I have changed all the long=-1 vars that were present in gl_DrawScene() to genuine C BOOLeans throughout the entire solution. So you'll have to do quite a bit of merging before your project compiles. Sorry for that but we should've done it long ago anyway.
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1982
    • zapsolution
Re: Early WIP on v2.55
« Reply #381 on: December 21, 2018, 07:55:54 pm »
Really i couldn't see the advantage of boolean over long (the size in memory is the same, and long is more versatile among the different languages i am using).
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Early WIP on v2.55
« Reply #382 on: December 21, 2018, 09:14:17 pm »
C is a strictly typed language. BOOL is a data type that can have two values: 1 and 0, TRUE and FALSE, YES and NO. This is what most (but not all) of our gP flags are doing. Thus strategically I was acting in my own right and within the C paradigm.

Do you like the model orientation reset animation? That's how it works in 3ds Max when you click the Home gismo. I like it. :)
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 #383 on: December 21, 2018, 09:22:24 pm »
Here is the current "ToolWindow.h" code, to check the changes i have done…

I'm sorry Patrice,

But what you attached there was a ToastWindow, not ToolWindow, file. ???
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1982
    • zapsolution
Re: Early WIP on v2.55
« Reply #384 on: December 21, 2018, 09:27:32 pm »
Oh, no all the time i have spent working on the colorpicker has been lost, i have overwritten my code with yours.  :'(

I made a backup this afternoon, let's see if i can restore it…

Added
Here is my backup with boolean used rtaher than long.
« Last Edit: December 21, 2018, 09:34:37 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 #385 on: December 21, 2018, 09:34:58 pm »
Didn't I tell you to merge with, rather than overwrite your own one with, the code I sent you? That's because you stood awake too long last night, my friend. :)

Seriously, I'm sorry about the loss. If you haven't got a workable backup, I can live without the mods for some reasonable length of time.

Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1982
    • zapsolution
Re: Early WIP on v2.55
« Reply #386 on: December 21, 2018, 09:36:51 pm »
see my backup attached to my previous post.




I am not sure when to show or hide the color picker, also the "OK" button seems redundent to me with the "Color" button.
Because in case "Color" button is pressed, no need to click first on "OK" we just have to use the color already selected.

Here is the current "ToolWindow.h" code, to check the changes i have done…

WARNING, zGetPickColor is using long rather than COLORREF thus i have added the GetPickColor function for that purpose.

Note: zGetPickColor(ZD_ARGB, 1) is the way to setup the initial color value.

The ColorPicker visibility is setup with ShowColorPicker/HideColorPicker, indeed no need for the bShowColorPick parameter in CreateToolWindow.
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Early WIP on v2.55
« Reply #387 on: December 22, 2018, 05:55:26 am »
No Patrice,

Your latest changes to ToastWindow.h don't work correctly for rotating lights. When the light panel is also visible and the lights are rotating, the toast window's sliding animation is so-o-o-o-o-o-o slo-o-o-o-o-w...

I rolled the code (starting on line 41 in ToastWindow.h) back to the following:

........
    if (IsWindow(gP.hToast)) {
        //ZD_DoEvents();
        if (IsWindowVisible(gP.hToast))
            HideToast(); // MLL 11-15-2018: allow toasts to come in quick succession
        WCHAR zFile[MAX_PATH]; ClearMemory(zFile, sizeof(zFile));
        RECT lpr; GetWindowRect(gP.hToast, &lpr);
        Path_Combine(zFile, skSkinFolder(), L"furtiv.wav");
        if (FileExist(zFile)) { PlaySound(zFile, NULL, SND_FILENAME | SND_ASYNC); }
        MoveWindow(gP.hToast, lpr.left, lpr.top + Height(lpr), Width(lpr), 0, 0);
        ShowWindow(gP.hToast, SW_SHOWNOACTIVATE);
        for (long K = 1; K < Height(lpr); K++) {
            MoveWindow(gP.hToast, lpr.left, lpr.top + Height(lpr) - K, Width(lpr), K, 0);
            ZI_UpdateWindow(gP.hToast, 1);
            Sleep(1); // ditto
            //ZD_DoEvents();
        }
        MoveWindow(gP.hToast, lpr.left, lpr.top, Width(lpr), Height(lpr), 0);
        ZI_UpdateWindow(gP.hToast, 1);
        toastTimerID = SetTimer(gP.hToast, 0xABC, 15000, toastTimerFunc); // MLL 11-15-2018: close this toast in 15 secs
    }
........



(Shit happens. ;))
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 #388 on: December 22, 2018, 06:12:15 am »
OK, I agree to your vision of color picking in the tool windows.

Attached are ToolWindow.h cleaned of bloat, and constants.h with the tool window constants added.

Thanks again for your work!
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1982
    • zapsolution
Re: Early WIP on v2.55
« Reply #389 on: December 22, 2018, 09:56:23 am »
I may have an idea to fire the toastwindow in a more cooperative way, i have to experiment with it first.

Added
The experiment went fine for me.  ;)

Thus for you to try, here is my patch using the new WM_POPUPTOAST (RegisterWindowMessage) to preserve the message flow.
« Last Edit: December 22, 2018, 12:14:00 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)