On Wednesday 04 May 2016 21:55:10 Krzysztof wrote: > Hi Martin, > > I would like to show extra info abot row in hint when mouse is over > the row (not immedietaly, just like normal delayed hint). I assigned > OnShowHint event but have two problems: > > 1. How to adjust mouse position to grid position? Tried this: > > procedure TGenericListWidget.GridHint(const sender: tobject; > var info: hintinfoty); > begin > info.caption := 'Test > '+IntToStr(grid.cellatpos(grid.widgetpostoclientpos(info.mouserefpos)).row) >; end; > > ...and this: > > procedure TGenericListWidget.GridHint(const sender: tobject; > var info: hintinfoty); > begin > info.caption := 'Test > '+IntToStr(grid.cellatpos(grid.clientpostowidgetpos(info.mouserefpos)).row) >; end; > > ... but it always find wrong row. Are they correct functions? In LCL > they have names ScreenToClient / ClientToScreen, is it same? > " grid.cellatpos(translateclientpoint(info.mouserefpos,nil,grid)) " It translates client coordinates from one widget to another, nil means screen. There is also TranslateWidgetPoint() which translates widget coordinates.
MSEgui widgets have several nested rectangular areas. The outer most is "widgetrect", the next inner is "paintrect". The area between "widgetrect" and "paintrect" is used by TFrame in order to paint frames, buttons, scrollbars... Some widgets have an additional "clientrect" nested in "paintrect" which can be bigger than "paintrect" and can be shifted. Most widget-procedures expect points based on "clientrect" origin. Nested in "clientrect" is "innerclientrect" where the padding is defined by TFrame.FrameI_* settings. Text widgets place the text in "innerclientrect" for example. > 2. Hint is show only once when mouse enter into grid widget, then it > is disabled. How to reset / force hint show when mouse enter into new > row? > Activate TWidget.OptionsWidget ow_multiplehint. Hint: it is probably simpler to use T*Grid.DataCols[n].OnShowHint. Martin ------------------------------------------------------------------------------ Find and fix application performance issues faster with Applications Manager Applications Manager provides deep performance insights into multiple tiers of your business applications. It resolves application problems quickly and reduces your MTTR. Get your free trial! https://ad.doubleclick.net/ddm/clk/302982198;130105516;z _______________________________________________ mseide-msegui-talk mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

