donlego Posted June 10 Posted June 10 hello 1 have a runtime created , how to popup top position is on newbtn top and newbtn left , coz , the monitor resolution on client is difrent Quote NewCol := TUniDBGridColumn(AGRID.Columns.Add); NewCol.ActionColumn.Enabled := true; NewCol.Title.Caption := '#'; NewCol.Title.Alignment := taCenter; NewCol.Width := 15; NewCol.Flex := 0; NewBtn := TUniGridActionButton(NewCol.ActionColumn.Buttons.Add); NewBtn.Width := 15; NewBtn.ButtonId := 100; NewBtn.IconCls := 'fa fa-ellipsis-v fa-center-action'; NewBtn.Hint:='Action Menu'; AGRID.OnColumnActionClick := PlayWithGrid.GlobalActionButtonClick; and the function globalactionmenu is Quote class procedure PlayWithGrid.GlobalActionButtonClick(Column: TUniDBGridColumn; ButtonId: Integer); var Grid: tunidbgrid; Frm: Tuniform; Popup: TuniPopupMenu; MI: TUniMenuItem; i: Integer; begin // tombol ... if ButtonId <> 100 then exit; Grid := tunidbgrid(Column.Grid); Frm := Tuniform(GetParentForm(Grid)); if Frm = nil then exit; Popup := TuniPopupMenu(Frm.FindComponent('UniPopupMenu1')); for i := 0 to Popup.Items.Count - 1 do begin if SameText(Popup.Items[i].Caption, 'Tambah') then begin if Popup.Items[i].Visible = true then Popup.Items[i].Visible := false; end; if SameText(Popup.Items[i].Caption, 'Refresh') then begin if Popup.Items[i].Visible = true then Popup.Items[i].Visible := false; end; if SameText(Popup.Items[i].Caption, 'Export') then begin if Popup.Items[i].Visible = true then Popup.Items[i].Visible := false; end; end; // MI := Popup.FindComponent('ambah1') as TUniMenuItem; // if MI <> nil then // MI.Visible := False; if Popup <> nil then begin Popup.Popup(Mouse.CursorPos.x, Mouse.CursorPos.y - 170); // Popup.PopupAtCursor; end; end; Quote
donlego Posted June 10 Author Posted June 10 1 hour ago, Sherzod said: Hello, I will check. Thank you, @Sherzod I look forward to your update Quote
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.