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

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1983
    • zapsolution
Re: Early WIP on v2.55
« Reply #105 on: November 06, 2018, 11:13:41 pm »
I couldn't get the correct size of the menu font (using skFontMenu) within the UpdateMenuBar, with the CetTextExtentPoint32 API.

This is the reason of the misalignment   :(

I shall try another approach tomorrow.
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Early WIP on v2.55
« Reply #106 on: November 07, 2018, 10:11:31 am »
I couldn't get the correct size of the menu font ... with the CetTextExtentPoint32 API.

You're drawing your menu text using GDI+. You should probably retrieve the text metrics using GdipMeasureString() rather than an ordinary WinAPI?
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 #107 on: November 07, 2018, 11:47:09 am »
No, i have switched back to DrawTextEx (GDI32).

I think i have fixed the problem, but that was a hard one to deal with, because the value returned by Windows when using owner drawn menu doesn't match the size returned by the GetTextExtentPoint32.

GdipMeasureString is also returning values not always reliable, i had to do all kind of contorsion to live with it in GDImage…  ???

I shall send you a new pandora to test on Seven as soon as i have cleaned up the code from all the changes i have done.
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Early WIP on v2.55
« Reply #108 on: November 07, 2018, 12:11:43 pm »
Good news!

BTW can your skinned trackbars display tooltips as per their TBS_TOOLTIPS style?
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 #109 on: November 07, 2018, 01:45:33 pm »
Mike

While testing the new menu, i came upon a small glitch when using "Fancy modes" altogether with Mesh animation (animation is ignored).
Patrice
(Always working with the latest Windows version available...)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1983
    • zapsolution
Re: Early WIP on v2.55
« Reply #110 on: November 07, 2018, 02:05:36 pm »
Here is pandora, tell me how it goes by you (and Seven).

If it works, then i will create the official binary with VS2010.
« Last Edit: November 07, 2018, 02:20:45 pm by Michael Lobko-Lobanovsky »
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Early WIP on v2.55
« Reply #111 on: November 07, 2018, 02:19:57 pm »
Will do, thank you!

... a small glitch ... animation is ignored ...

It isn't a glitch but a feature. ;D

Texture inspection and fancy modes use their own common render procs except for the historical "ambient reflection". They are lightweight simplified procedures with minimum if-branching, no lighting or texturing (in fancy modes) but basic material colors only, no transparencies nor billboards nor animation, mesh-wise or model-wise. All this stuff would only distract the user from the main objectives of the two modes -- close examination of texture looks and quality, and awesome shader admiration, respectively. :)

What about the tooltips in your skinned trackbars?
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 #112 on: November 07, 2018, 02:33:09 pm »
The new menubar draws as expected and looks beautiful. 8)
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 #113 on: November 07, 2018, 02:42:12 pm »
Perhaps we could use this.

void skSetToolTipText (IN HWND hObj, IN WCHAR* zText) { // dllexport
    TOOLINFO ti = {0};
    wstring sText;
    if (zText) { sText = REPLACE(zText, $ZLIM, $CR); }
    HWND hTooltip = zToolTipData(0, 0);
    if (IsWindow(hTooltip)) {
        ti.cbSize   = sizeof(ti);
        ti.hinst    = skInstance();
        ti.uFlags   = TTF_IDISHWND;
        ti.hwnd     = skPopupOwner(hObj);
        ti.uId      = (UINT_PTR) hObj;
        ti.lpszText = (WCHAR*) sText.c_str();
        // Add tooltip now.
        SendMessage(hTooltip, TTM_UPDATETIPTEXT, 0, (LPARAM) &ti);
    }
}

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

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Early WIP on v2.55
« Reply #114 on: November 07, 2018, 02:53:47 pm »
OK so I get it there is no built in support for automatic tooltips in skinned trackbars ATM, contrary to what we can get using a TBS_TOOLTIPS style in a Windows ordinary trackbar?
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 #115 on: November 07, 2018, 03:01:22 pm »
New pandora on its way to check it when the TBS_TOOLTIPS style is being used.

Added:

Ok check with this, and tell me if this is what you want.

void SetThumbLocation(IN HWND hWnd, IN long x, IN long y) {
    RECT rc = {0}; float sIncrement = 0.0f;
    long tx = 0, ty = 0, tMin = 0, tMax = 0, tVal = 0, nRange = 0, nWidth = 0, nHeight = 0, imgW = 0, imgH = 0;
    UINT uMsg = 0;

    skGetBitmapSize(g_BtnTrack, imgW, imgH);
    imgW = imgW / 2;

    tMin = (long) SendMessage(hWnd, TBM_GETRANGEMIN, 0, 0);
    tMax = (long) SendMessage(hWnd, TBM_GETRANGEMAX, 0, 0);

    GetClientRect(hWnd, &rc);
    nWidth = rc.right; nHeight = rc.bottom;

    if (TrackOrientation(hWnd) == TRACK_HORZ) {
        tx = min(max(x - imgW / 2, 0), nWidth - imgW);
        ty = (nHeight - imgW) / 2;
        nRange = nWidth - imgW;
        sIncrement = (float) ((float) (tMax - tMin) / (float) nRange);
        tVal = (long) ((sIncrement * tx) + tMin);
        uMsg = WM_HSCROLL; }
    else {
        tx = (nWidth - imgW) / 2;
        ty = min(max(y - imgH / 2, 0), nHeight - imgH);
        nRange = nHeight - imgH;
        sIncrement = (float) ((float)(tMax - tMin) / (float) nRange);
        tVal = (long) ((sIncrement * ty) + tMin);
        uMsg = WM_VSCROLL;
    }
    SendMessage(hWnd, TBM_SETPOS, 0, tVal);
    SendMessage(skPopupOwner(hWnd), uMsg, MAKLNG(GetDlgCtrlID(hWnd), tVal), (LPARAM) hWnd);

    if (CheckWindowStyle(hWnd, TBS_TOOLTIPS)) { skSetToolTipText(hWnd, STRL(tVal)); }
}


Note: You must have first used something like this:
skCreateToolTip(hCtrl, L"  Stray light intensity  ");
at the time of the control skinning.
« Last Edit: November 07, 2018, 03:11:45 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 #116 on: November 07, 2018, 04:45:23 pm »
Dastisch fantastisch! :o It works!!! ;D

But Patrice, my trackbars are gradated in integer steps of their full integer ranges and that's what the automatic tooltip displays. But I'd rather the tooltip displays the true value of my resultant parameter which is a float result of (float)curpos * (float)step, where curpos may be e.g. 12345 and step, 0.001f.

Can we bypass this automated way and probably not use TBS_TOOLTIPS but still be able to display my current true float parameters?

Perhaps something with TTN_NEEDTEXT?
« Last Edit: November 07, 2018, 05:31:56 pm by Michael Lobko-Lobanovsky »
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 #117 on: November 07, 2018, 04:53:48 pm »
Mike

I can create a specific static function for that purpose, where you post in real time the WCHAR string that must be shown while dragging the trackbar thumb. But we must use a new TBS_CUSTOMTIPS style for that purpose ;)

It is up to you to give me the TBS_CUSTOMTIPS constant value that is not already being used.
« Last Edit: November 07, 2018, 04:59:27 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 #118 on: November 07, 2018, 04:57:34 pm »
TBS_CUSTOMTIPS? What's this? :o

Don't your tooltips send TTN_NEEDTEXT notifications like ordinary tooltip controls?
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 #119 on: November 07, 2018, 05:01:32 pm »
TTN_NEEDTEXT, i have never used that one, i must read the MSDN doc on how to use it  ???
Patrice
(Always working with the latest Windows version available...)