Re: [Plib-users] R: Problem with a PUI-Win32-Native
Brought to you by:
sjbaker
From: John F. F. <joh...@cy...> - 2008-03-01 18:09:28
|
The calls to "puMouse" on lines 133 and 140 have a first argument of one; which is defined (see pu.h, line 37) to be the middle mouse button. The active mouse button for the menu defaults to the left mouse button, which has a value of zero. The "WM_LBUTTONDOWN" and "WM_LBUTTONUP" blocks should call "puMouse ( PU_LEFT_BUTTON, ...". Here is what the section of code will look like if all three buttons are supported: case WM_LBUTTONDOWN: oldMousePos.x = currentMousePos.x = LOWORD (lParam); oldMousePos.y = currentMousePos.y = HIWORD (lParam); if( puMouse ( PU_LEFT_BUTTON, PU_DOWN, currentMousePos.x, currentMousePos.y )) { }//MessageBox(NULL,"DOWN","down",MB_OK); } break; case WM_LBUTTONUP: currentMousePos.x = LOWORD (lParam); currentMousePos.y = HIWORD (lParam); if( puMouse ( PU_LEFT_BUTTON, PU_UP, currentMousePos.x, currentMousePos.y )) {}// MessageBox(NULL,"UP","UP",MB_OK); } break; case WM_MBUTTONDOWN: oldMousePos.x = currentMousePos.x = LOWORD (lParam); oldMousePos.y = currentMousePos.y = HIWORD (lParam); if( puMouse ( PU_MIDDLE_BUTTON, PU_DOWN, currentMousePos.x, currentMousePos.y )) { }//MessageBox(NULL,"DOWN","down",MB_OK); } break; case WM_MBUTTONUP: currentMousePos.x = LOWORD (lParam); currentMousePos.y = HIWORD (lParam); if( puMouse ( PU_MIDDLE_BUTTON, PU_UP, currentMousePos.x, currentMousePos.y )) {}// MessageBox(NULL,"UP","UP",MB_OK); } break; case WM_RBUTTONDOWN: oldMousePos.x = currentMousePos.x = LOWORD (lParam); oldMousePos.y = currentMousePos.y = HIWORD (lParam); if( puMouse ( PU_RIGHT_BUTTON, PU_DOWN, currentMousePos.x, currentMousePos.y )) { }//MessageBox(NULL,"DOWN","down",MB_OK); } break; case WM_RBUTTONUP: currentMousePos.x = LOWORD (lParam); currentMousePos.y = HIWORD (lParam); if( puMouse ( PU_RIGHT_BUTTON, PU_UP, currentMousePos.x, currentMousePos.y )) {}// MessageBox(NULL,"UP","UP",MB_OK); } break; The button box appears not to have a callback defined. - John -----Original Message----- From: pos...@ca... Sent: Friday, February 29, 2008 8:54 AM To: PLIB Users Subject: Re: [Plib-users] R: Problem with a PUI-Win32-Native > I'm not a PUI user so I don't know if this could be useful, yet in your code > I reported below: > > case WM_LBUTTONDOWN: > oldMousePos.x = currentMousePos.x = LOWORD (lParam); > oldMousePos.y = currentMousePos.y = HIWORD (lParam); > if( puMouse ( 1, PU_DOWN, currentMousePos.x, > currentMousePos.y )) > ==>> //{ }//MessageBox(NULL,"DOWN","down",MB_OK); } > isMouseActive = true; > > Looking at the pointed line, are you sure you want to set isMouseActive = > true when the call to puMouse returns 1? This is what actually happens since > the subject line is commented out. Which is different, I see, from the > similar code line for the button up case. > > Paolo > Thanks. You are right. The line was twice commented. However this boolean controled only the activation of the later drawn triangle manipulator. I discarded the calls to the gl drawings and manipulation in the following code (below), keeping only PUI renderings. The problem remains : the PUI display correcly, yet no callbacks. I'm wondering about this warning in the documentation : "[...] #define PU_USE_NATIVE before you include pu.h - and PUI will try to figure out what it needs to know using native commands such as those in the wgl/glX/agl library - in the absence of a windowing library. This may result in "some problems" if you want to do "certain operations" for which PUI needs to query the windowing library. Use of PU_USE_NATIVE is not recommended in systems that allow you to resize the window or open multiple windows." |