I created a floating window with this code, but i don't know how to detect when user touches it, or to get pointer position on this window when user touches it.
Code:User::LeaveIfError(ws.Connect()); screen = new(ELeave) CWsScreenDevice(ws); screen->Construct(); RWindowGroup wg(ws); User::LeaveIfError(wg.Construct(reinterpret_cast<TUint32>(&wg), EFalse)); CleanupClosePushL(wg); wg.SetOrdinalPosition(10, ECoeWinPriorityAlwaysAtFront); CWindowGc* gc; User::LeaveIfError(screen->CreateContext(gc)); CleanupStack::PushL(gc); RWindow window(ws); User::LeaveIfError(window.Construct(wg, reinterpret_cast<TUint32>(&wg) + 1)); CleanupClosePushL(window); window.SetBackgroundColor(TRgb(0x90, 0x90, 0x90)); window.Activate(); window.SetExtent(TPoint(0, 0), TSize(50, 300)); window.SetVisible(ETrue); gc->Activate(window); TRect rect = TRect(window.Size()); window.Invalidate(rect); window.BeginRedraw(rect); gc->SetBrushStyle(CGraphicsContext::ESolidBrush); gc->Clear(); gc->SetBrushColor(TRgb(0, 255, 0)); gc->DrawRect(rect); window.EndRedraw(); gc->Deactivate(); ws.Flush();
thanks.

Reply With Quote

