Re: New Era - Tool Tips
Posted in 1997
Jason Jonas wrote: > Rod Weir wrote: > > > > Hello everybody! > > > > Does anyone know how to code tooltips into a New Era V2.0 application? > > > > I know the theory behind it, but before I attempt, I thought that I would > > just see if anyone has already been able to do this. > > > > Here's my theory! (simplified version) > > > > 1. API call to establish a timer. (I think DCHVCL has a timer in it also) > > 2. API to determine mouse position. > > 3. API to determine object at mouse position > > 4. Display tooltip accordingly > > > > How does that sound? > > > > Any comments would be greatly appreciated. > > i haven't even figured out how to capture a timer event in newera. have > you successfully done this? > > -jason Possibly this example contains some extra code, because this is a some extraction from my experimental program. Don't forget to KillTimer() !!! ################ # settimer.4gl INCLUDE SYSTEM "ixwindow.4gh" BEGIN_C #include <windows.h> #include <stdlib.h> #include <stdio.h> #include <commdlg.h> #define ID_EXPTIMER 88 END_C BEGIN_C void CALLBACK ExpTimerProc(HWND hwnd, UINT msg, UINT idTimer, DWORD dwTimer) { MessageBox( hwnd, "NOTE!", "Timer Activated!", MB_OK ); } END_C FUNCTION timer_setup( winwhich ixWindow ) RETURNING VOID BEGIN_C { UINT res; HWND hwnd; HINSTANCE hinst; TIMERPROC lpfnExpTimerProc; /* NewEra(ixWindow) to Windows(HWND) link */ hwnd = __getHWndFromixWindow( winwhich ); hinst = (HINSTANCE) GetWindowWord(hwnd, GWW_HINSTANCE); if( hinst == NULL ) MessageBox( hwnd, "Warning!", "GetWindowWord() Error!", MB_OK ); lpfnExpTimerProc = (TIMERPROC) MakeProcInstance((FARPROC) ExpTimerProc, hinst); /* Install timer */ res = SetTimer(hwnd, ID_EXPTIMER, 10000, lpfnExpTimerProc); if( res == 0 ) MessageBox( hwnd, "Warning!", "SetTimer() Error!", MB_OK ); } END_C END FUNCTION -- timer_setup() # settimer.4gl << ################## ################ # exptimer.4gl HANDLER ixButton::winSnap_btnTimer_activate() RETURNING VOID VARIABLE winTmp ixWindow LET winTmp = getWindow() CALL timer_setup( winTmp ) END HANDLER -- ixButton::winSnap_btnTimer_activate # exptimer.4gl << ################## Vardan -- vardan@sterling.ru Vardan Aroustamian Sterling Group, Moscow, Russia