Author Topic: Custom Lighting Control  (Read 13687 times)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Custom Lighting Control
« Reply #15 on: February 05, 2018, 08:56:49 pm »
I'll do it immediately as soon as I find a way to marry the panel and IPS to the full screen mode.

WS_EX_TOOLWINDOW alone has fixed the other issues. I don't think it's going to interfere with the Windows 10 DWM, so selective usage is unlikely to be necessary.

Changing the parent from gP.hMain to gP.hGL didn't produce any effect.
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: Custom Lighting Control
« Reply #16 on: February 05, 2018, 09:11:07 pm »
if in ToggleFullScreen() you REM OUT
MoveWindow(gP.hGL, 0, 0, screenWidth, screenHeight, FALSE);
that works,

but then the OpenGL viewport doesn't cover the full display correctly.

Here is to code in am using now in CreateOverlay
Code: [Select]
// Create a popup GDImage overlay window
HWND CreateOverlay(IN HINSTANCE hInstance) {
    RECT lpr; GetWindowRect(gP.hGL, &lpr);
    DWORD dwStyle = WS_POPUP; // | WS_BORDER; // | WS_VISIBLE;
    DWORD dwExStyle = WS_EX_ACCEPTFILES | WS_EX_TOOLWINDOW;
    HWND hWnd = CreateWindowEx(dwExStyle, GDImageClassName, NULL, dwStyle, lpr.left, lpr.top, OVERLAY_WIDTH, Height(lpr), gP.hMain, 0, hInstance, NULL);
    if (IsWindow(hWnd)) {
        // Add tooltip support to the GDImage control.
        HWND hTip = ZI_CreateToolTip(hWnd, L"");
        if (hTip) {
            SetWindowTheme(hTip, L"", L""); // Important, we must disable the Windows theme to use our own set of colors
            SendMessage(hTip, TTM_SETTIPTEXTCOLOR, skGetSysColor(SKCOLOR_TIPTEXT), 0);
            SendMessage(hTip, TTM_SETTIPBKCOLOR, skGetSysColor(SKCOLOR_TIPBACK), 0);
        }

        // Use gradient background
        ZI_SetProperty(hWnd, ZI_GradientTop, ZD_ARGB(163, 127,127,127));
        ZI_SetProperty(hWnd, ZI_GradientBottom, ZD_ARGB(163, 63,63,63));

        ZI_DwmEnable(hWnd);
        // Setup the messages to monitor
        MonitorMessages(hWnd, (LONG_PTR) GDImageCallBack);

        CreateColorObjects(hWnd);

    }
    return hWnd;
}

I have done more changes and code cleaning, but that will wait until tomorrow ;)
« Last Edit: February 05, 2018, 09:38:04 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1983
    • zapsolution
Re: Custom Lighting Control
« Reply #17 on: February 06, 2018, 08:38:32 pm »
Here is the best i could do.

That is a problem we have already been fighting with, a couple years ago...
Use WinMerge to see the changes i have done in ToggleFullScreen(), and gl_LoadModel.

I spent two days trying to find the best compromise  ::)

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

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1983
    • zapsolution
Re: Custom Lighting Control
« Reply #18 on: February 07, 2018, 04:17:26 pm »
Here is a new widget, added to the SL panel, put rotate.png into your Reader skin folder.

And apply the attached patch.
« Last Edit: February 07, 2018, 04:24:23 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Custom Lighting Control
« Reply #19 on: February 07, 2018, 04:57:33 pm »
Nice and useful in full screen. :)
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)