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

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Early WIP on v2.55
« Reply #285 on: December 13, 2018, 05:17:14 pm »
Thank you, Patrice!

Ultimately, I want to have two gP.hGL's side by side in the gP.hMain window. The border between them is to be controlled by a vertical splitter control, so that the hGL windows shrink and stretch as the splitter is dragged in between them from right to left and back.

There's no need for transparency in gP.hMain. It'll still be obscured by two gP.hGL's on top of 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 #286 on: December 14, 2018, 03:49:05 am »
Yeah, the red one is what I have in mind, with two gP.hGL's on both sides of it shrinking and stretching as it moves left or right. The minimum width of each gP.hGL should be able to reach 0 so that the splitter could abut snugly the gray panel on the right, and the main window border, on the left. Forget about gP.hGL's aspect ratios for the moment; the main thing now is to let the splitter do its job.

However I wouldn't mind if both splitters are operable with one correction: idc_win2 and idc_win3 should be to the right of the red splitter rather than to the left.

TIA!


(Patrice, if that's too much of a job for you, don't hesitate to tell me and I'll design something simpler. It's just that I thought it would be great to have a skinnable splitter if you don't have one yet...)
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1980
    • zapsolution
Re: Early WIP on v2.55
« Reply #287 on: December 14, 2018, 09:39:45 am »
My friend

To say the truth, i would have used something simpler than a splitter, aka a button to switch from one gP.hGL to another (see the attached screen shot).
That would keep the existing code unchanged, and we could display it using an effect like for the control panel overlay when showing/hidding the texture's one.
We just have to change the text of the new button from "<" to ">" to indicate the open or close mode.

BTW there is now a "vector subscript out of range" when trying to run OR in debug mode when loading a model.
See in the new ResetCamera()
Code: [Select]
void ResetCamera() {
//    MobjMesh* pMesh = &gtm_meshes[0]; // MLL 10-18-2018: see below

    if (gP.nObjectLoaded) {
        MobjMesh* pMesh = &gtm_meshes[0]; // PAT: 12-14-2018 avoid the subscript out of range
        gP.rTargetPos[0] = gM.center[0];
        gP.rTargetPos[1] = gM.center[1];
        gP.rTargetPos[2] = gM.center[2];

        gP.rCameraPos[0] = gP.rTargetPos[0];
        gP.rCameraPos[1] = gP.rTargetPos[1];
        gP.rCameraPos[2] = 3.05f;

        gl_AdjustNearPlane();
        gP.rPitch = gP.rYaw = gP.rRoll = 0.0f; // MLL 10-28-2018:

        for (int i = 0; i < gM.numberOfMeshes; i++, pMesh++) // MLL 10-18-2018: reset mesh rotation angles
            pMesh->pMaterial->rotangle = 0.0f;
    }
}

PS: I could however translate the slider code, if you think it would make our life easier.
But then, first try the Visual Studio internal border/splitter they are now using to resize the display of the individual controls to limit the number of redraw messages.

Added:
Tell me if you want the code with the new button, i made also a couple of very minor changes.
« Last Edit: December 14, 2018, 10:26:50 am 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 #288 on: December 14, 2018, 11:09:10 am »
1. Thanks for the code fix!

2. No problem, I will do as I'm doing in the FBSL Eclecta editor: dragging starts on LMB down over the horizontal bar above the edit field. The moving cursor drags a grayscale pixel XOR line similar to how the Windows windows' oulines (hehe) are drawn when resized without repainting their contents. The LMB released, the two edit fields appear delineated with a horizontal bar similar to the one where dragging has started.

I'll do the same but vertically in ObjReader. Just provide me with a nicely skinned narrow vertical bar adjacent snugly to the right side gray panel for me to be able to change the cursor to the splitter shape when hovering above the bar.

3. Are the changes you made effectively hot fixes or just code reformatting?
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 #289 on: December 14, 2018, 11:11:43 am »
Your "button" is perfect as a bar I was talking about!!! :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: 1980
    • zapsolution
Re: Early WIP on v2.55
« Reply #290 on: December 14, 2018, 01:02:39 pm »
Quote
2. No problem, I will do as I'm doing in the FBSL Eclecta editor: dragging starts on LMB down over the horizontal bar above the edit field. The moving cursor drags a grayscale pixel XOR line similar to how the Windows windows' oulines (hehe) are drawn when resized without repainting their contents. The LMB released, the two edit fields appear delineated with a horizontal bar similar to the one where dragging has started.
See what Microsoft does in Visual Studio, that is very close to what you describe.

Quote
Just provide me with a nicely skinned narrow vertical bar adjacent snugly to the right side gray panel for me to be able to change the cursor to the splitter shape when hovering above the bar
For me, the easiest and more versatile solution is to create another GDImage control just like for the control panel overlay with one multiplle state sprite image to figure the dots or an horizontal arrow, using a callback to monitor mouse interactions.

Quote
Are the changes you made effectively hot fixes or just code reformatting?
As i said, minor code changes, to display the correct verion #, and to clear the main caption when loading a new model from the previous name, and perhaps a few other little things (winmerge will come to rescue to see them)
« Last Edit: December 14, 2018, 01:18: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 #291 on: December 14, 2018, 01:35:11 pm »
For me, the easiest and more versatile solution is to create another GDImage control just like for the control panel overlay with one multiplle state sprite image to figure the dots or an horizontal arrow, using a callback to monitor mouse interactions.

Whatever -- I just need a nice looking distinct "vertical bar" window with an easy access to its message pump, that can display a splitter cursor as its class cursor, drift freely anywhere within gP.hMain's client area bounds, and serve as a visible border between two gP.hGL's (or gP.hGL to the left of it and any other graphics window that I might need, to the right of it) when in any position other than the rightmost one.
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1980
    • zapsolution
Re: Early WIP on v2.55
« Reply #292 on: December 14, 2018, 02:28:44 pm »
Working on the new GDImage Splitter.h  :)


Added:
Please add this into pandora at line 4936
    switch (uMsg) {

    case WM_NCHITTEST: // 12-14-2018
         nResult = ForwardEventMessage(hWnd, uMsg, wParam, lParam);
         if (nResult == HTCAPTION) { return nResult; }
         break;
    case WM_MOVING: // 12-14-2018
         nResult = ForwardEventMessage(hWnd, uMsg, wParam, lParam);
         if (nResult == 1) { return nResult; }
         break;


    case WM_ACTIVATEAPP:
« Last Edit: December 14, 2018, 03:55:33 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 #293 on: December 14, 2018, 04:45:56 pm »
Done.

But I'll still need both the DLL and LIB from the official distro when everything is debugged and working.
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1980
    • zapsolution
Re: Early WIP on v2.55
« Reply #294 on: December 14, 2018, 05:05:53 pm »
One more needed to display the WE cursor used by the splitter.
The LIB kept unchanged.

Line 5284
    case WM_SETCURSOR:
         if (LOWORD(lParam) == 0x01) {
            UseThisTool = zGetToolToUse(hWnd);
            if (UseThisTool) {
               return Usetool(hWnd, uMsg, wParam, lParam, UseThisTool);
            }

            if (ForwardEventMessage(hWnd, uMsg, wParam, lParam)) {
               return 1;
            }
            if ((zFlagMouseCapture(0, 0) > -1) || (CursorOverObject > -1)) {
               if (CursorOverObject > -1) {
                  SetCursor(LoadCursor(NULL, IDC_SIZEALL));
               }
               return 1;
            }

            if ((nStaticZoomID) && (hWnd == nStaticZoomCtrl)) {
               SetCursor(LoadCursor(gn_DllInstance, MAKEINTRESOURCE(HAND2)));
               return 1;
            }
         } else if (ForwardEventMessage(hWnd, uMsg, wParam, lParam)) {
             return 1;
         }

         break;
« Last Edit: December 14, 2018, 05:07:32 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1980
    • zapsolution
Re: Early WIP on v2.55
« Reply #295 on: December 14, 2018, 05:11:20 pm »
So far the moving of the splitter is constraint within the GL viewport size, and that works well.

Further customization could be done from the SplitterCallback.
Patrice
(Always working with the latest Windows version available...)

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Early WIP on v2.55
« Reply #296 on: December 14, 2018, 05:24:31 pm »
But it shouldn't be literally constrained to it because the splitter itself is supposed to be moving the right edge of (shrinking the width of) existing GL window, i.e. literally "change the OpenGL viewport size".  ::)
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 #297 on: December 14, 2018, 06:38:11 pm »
OK! Can't wait to see your progress. :)
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1980
    • zapsolution
Re: Early WIP on v2.55
« Reply #298 on: December 14, 2018, 07:29:51 pm »
Mike

Here is the splitter code + LIB and DLL

A you said small is beautiful…

You should easily find your way in, the point you will have to do, is inside MoveOverlay() where an offset should be used on the x location at the time the moving of the OGL controls is performed, you will have to use a new global parameter.

The Splitter callback is the place to use, to process the messages you want to monitor.

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

Michael Lobko-Lobanovsky

  • Administrator
  • *****
  • Posts: 1481
Re: Early WIP on v2.55
« Reply #299 on: December 14, 2018, 07:45:50 pm »
Thank you very much, Patrice!

I will study the patch and then I will come back to you if I have any questions or remarks. :)
Mike
(3.6GHz Intel Core i5 Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, Windows 7 Ultimate Sp1)