Freeman35 Posted January 15, 2019 Share Posted January 15, 2019 Hello, I need to discard browser popup menu. But not all in application. I mean I don't wanna use "MainModule.BrowserOptions.boDisableMouseRightClick = True" My code is: procedure TFRM_.EDT_MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin if Button=mbRight then POP_1.Popup( X, Y, Sender); Result is on screenshot. Browser popup on my popup. both opened. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 15, 2019 Share Posted January 15, 2019 6 minutes ago, Freeman35 said: I need to discard browser popup menu. But not all in application. I mean I don't wanna use "MainModule.BrowserOptions.boDisableMouseRightClick = True" Hello, Can you try this old solution? http://forums.unigui.com/index.php?/topic/3137-is-it-possible-to-change-unimainmodulebrowseroptions-at-runtime/&do=findComment&comment=21489 Quote Link to comment Share on other sites More sharing options...
Freeman35 Posted January 15, 2019 Author Share Posted January 15, 2019 Thank you it been helpful for me. procedure TFRM_.EDT_MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin if Button=mbRight then begin MainModule.UniMainModule.BrowserOptions:= [boDisableMouseRightClick]; UniSession.AddJS('document.oncontextmenu = document.body.oncontextmenu = function () { return false; }'); end; end; procedure TFRM_.EDT_MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin if Button=mbRight then begin POP_1.Popup( X, Y, Sender); MainModule.UniMainModule.BrowserOptions:= []; UniSession.AddJS('document.oncontextmenu = document.body.oncontextmenu = function () { return true; }'); end; end; Why I used MouseDown, 'cos need delay for run, before popup. regards. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 15, 2019 Share Posted January 15, 2019 Sorry, You should not use this code in this way. This code should work independently, say when you want to prevent or show a standard pop-up window ... 1 hour ago, Sherzod said: But not all in application It seems I didn't quite understand what you wanted. Quote Link to comment Share on other sites More sharing options...
Freeman35 Posted January 15, 2019 Author Share Posted January 15, 2019 I wanna use this code in dbgrid filter use. I mean, Example: I have two columns and two TUniEdit for filter. But this string can be in sql where clause "Equal, NotEqual, Starts ,Ends, Contains" for this selection I have popmenu. I need this popup menu just in TUniEdit for filter usage. and not everytime. If end user want, then it will popup via right click. not always. I hope could tranlate my ideas thank you. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.