rohit.kawade@globant.com Posted January 29, 2016 Share Posted January 29, 2016 Hi, How to use right click on unidbgrid. My right click is working but I am showing listbox. Can we use popupmenu instead of listbox? How to use popmenu with rightclick? Thanks. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 29, 2016 Share Posted January 29, 2016 Hi, Please look the demo example: C:\Program Files (x86)\FMSoft\Framework\uniGUI\Demos\Desktop\GridContextMenu Best regards. Quote Link to comment Share on other sites More sharing options...
rohit.kawade@globant.com Posted January 29, 2016 Author Share Posted January 29, 2016 I dragged popup-menu on the form and added some items. then executed as follows. procedure TMainForm.UniDBGrid1CellContextClick(Column: TUniDBGridColumn; X, Y: Integer); begin PopupMenu1.Popup(X,Y); end; But I don't see popup menu on the form. Do I need to set any property to form? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 29, 2016 Share Posted January 29, 2016 Probably you are using a standard PopupMenu instead of uniPopupMenu.. Please check Quote Link to comment Share on other sites More sharing options...
rohit.kawade@globant.com Posted January 29, 2016 Author Share Posted January 29, 2016 Yeah, my mistake. I was using PopupMenu instead of uniPopupMenu. Thanks a lot. Quote Link to comment Share on other sites More sharing options...
warat mookdaanan Posted October 17, 2019 Share Posted October 17, 2019 In PC i can make right click popup menu procedure TFrameProduct.UniDBGrid1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin if Button = mbRight then UniPopupMenu1.Popup(X, Y, UniDBGrid1); end; but my tablet android when i want to popup menu How to use popmenu with rightclick in android tablet? Thank Quote Link to comment Share on other sites More sharing options...
x11 Posted May 11, 2020 Share Posted May 11, 2020 Контекстное меню прячется за меню браузера. Как скрыть меню браузера? The context menu is hidden behind the browser menu. How to hide the browser menu? procedure TfrdParentRefStreet.dbgStreetsCellContextClick( Column: TUniDBGridColumn; X, Y: Integer); begin pmGrid.Popup(x, y, dbgStreets); end; Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 11, 2020 Share Posted May 11, 2020 4 minutes ago, x11 said: Кликаю в одном месте сетки, а меню всплывает в другом месте. Здравствуйте, Какое событие используете? Quote Link to comment Share on other sites More sharing options...
x11 Posted May 11, 2020 Share Posted May 11, 2020 CellContextClick Quote Link to comment Share on other sites More sharing options...
x11 Posted May 11, 2020 Share Posted May 11, 2020 Я отредактировал сообщение, теперь другая проблема. См. выше. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 11, 2020 Share Posted May 11, 2020 14 minutes ago, x11 said: Как скрыть меню браузера? UniMainModule.BrowserOptions = boDisabledMouseRightClick = True Quote Link to comment Share on other sites More sharing options...
x11 Posted May 11, 2020 Share Posted May 11, 2020 А если нужно прятать меню браузера только на время показа UniPopupMenu? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 11, 2020 Share Posted May 11, 2020 7 minutes ago, x11 said: А если нужно прятать меню браузера только на время показа UniPopupMenu? Попробуйте, Quote Link to comment Share on other sites More sharing options...
x11 Posted May 11, 2020 Share Posted May 11, 2020 К сожалению, на момент всплытия меню, не удается отключить контекстное меню браузера procedure TfrdParentRefStreet.dbgStreetsCellContextClick( Column: TUniDBGridColumn; X, Y: Integer); begin MainModule.UniMainModule.BrowserOptions := MainModule.UniMainModule.BrowserOptions + [boDisableMouseRightClick]; UniSession.AddJS('document.oncontextmenu = document.body.oncontextmenu = function () { return false; }'); pmGrid.Popup(x, y, dbgStreets); MainModule.UniMainModule.BrowserOptions := MainModule.UniMainModule.BrowserOptions - [boDisableMouseRightClick]; UniSession.AddJS('document.oncontextmenu = document.body.oncontextmenu = function () { return true; }'); end; Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 11, 2020 Share Posted May 11, 2020 1 hour ago, x11 said: К сожалению, на момент всплытия меню, не удается отключить контекстное меню браузера function cellcontextmenu(sender, td, cellIndex, record, tr, rowIndex, e, eOpts) { e.preventDefault(); } 1 Quote Link to comment Share on other sites More sharing options...
x11 Posted May 11, 2020 Share Posted May 11, 2020 Спасибо. Сочетание двух функций помогло не отключать меню браузера во всем приложении, при этом оно отключилось только при щелчке по ячейке. Хотелось бы попросить разработчиков UniGUI реализовать стандартный такой механизм, чтобы так работало без дополнительных e.preventDefault();, другими словами, если у формы, сетки, списка и т.д. есть привязанное UniPopoupMenu, то чтобы именно оно и всплывало. Т.е. программист, привязывая UniPopoupMenu к какой-нибудь компоненте, уже заранее подразумевает, что у этой компоненты не должно быть браузерного меню. Спасибо ещё раз. 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.