Board index » delphi » "Smart Moving" dailog help needed
b...@droste1.com (Bill Artemik)
![]() Delphi Developer |
Sun, 15 Dec 2002 03:00:00 GMT
|
b...@droste1.com (Bill Artemik)
![]() Delphi Developer |
Sun, 15 Dec 2002 03:00:00 GMT
"Smart Moving" dailog help needed
I'm writing a Help dialog. The control needs to be able to know how to
move itself out of the way of the form below it when it's pointing to a TWinControl on another form (e.g. the dialog is really just a TForm with style fsStayOnTop) the user can click on a help rect. that will give some info and take them to the control on the active form below it. This part works fine already... I just need to tell the dialog "Hey, you're blocking the view... move" to an intelligent location. Does anyone know how I can figure out where this is and move the form Thanks for any help! Bill Artemik "The TWO rules for success in life are: 1. NEVER tell them everything you know." |
Bruce Robert
![]() Delphi Developer |
Sun, 15 Dec 2002 03:00:00 GMT
Re:"Smart Moving" dailog help neededQuote"Bill Artemik" <b...@droste1.com> wrote in message Quote> I'm writing a Help dialog. The control needs to be able to know how to to the control will return one relative to the screen. Using aPoint := targetControl.ClientToScreen (Point (0, 0)); and SystemParametersInfo (SPI_GetWorkArea, 0, @WorkAreaRect, 0); In conjunction with targetControl Width &Height, and the help forms Top, |
M.H. Avegaar
![]() Delphi Developer |
Sun, 15 Dec 2002 03:00:00 GMT
Re:"Smart Moving" dailog help neededThe following function places a form next (above, below, left, right) to another form: procedure MoveForm(Form1, Form2: TCustomForm; Align: TAlign); "Bill Artemik" <b...@droste1.com> schreef in bericht Quote> I'm writing a Help dialog. The control needs to be able to know how to |
Bill Artem
![]() Delphi Developer |
Sun, 15 Dec 2002 03:00:00 GMT
Re:"Smart Moving" dailog help neededThat works! Thanks to both of you for the solutions! That works! Bill On Wed, 28 Jun 2000 17:24:16 +0200, "M.H. Avegaart" Quote<avega...@NOSPAMmccomm.nl> wrote: Programmer / Analyst Droste Consultants, Inc. b...@droste1.com "The TWO rules for success in life are: 1. NEVER tell them everything you know." |
Christo Craus
![]() Delphi Developer |
Sun, 15 Dec 2002 03:00:00 GMT
Re:"Smart Moving" dailog help neededQuote"Bill Artemik" <b...@droste1.com> wrote in message Quote> I'm writing a Help dialog. The control needs to be able to know how to dialog so that it does not hide the TWinControl. To get the screen coordinates of the TWinControl use TWinControl.ClientToScreen: var scrnpt, pt : TPoint; pt.x := 0; Christo Crause |
Bill Artem
![]() Delphi Developer |
Sun, 15 Dec 2002 03:00:00 GMT
Re:"Smart Moving" dailog help neededSpoke too soon... I can now get the coordinates of the control on the main form but is I tried to see if the Point.x IN [elf.Left .. (Self.Left + Any Ideas (or examples) of the math / logic I need here? I don't Quote<ccra...@ing.sun.ac.za.REMOVE> wrote: Programmer / Analyst Droste Consultants, Inc. b...@droste1.com "The TWO rules for success in life are: 1. NEVER tell them everything you know." |
M.H. Avegaar
![]() Delphi Developer |
Mon, 16 Dec 2002 03:00:00 GMT
Re:"Smart Moving" dailog help neededDid you know that Windows already contains TRect calculation functions ? Look up SetRect, SetRectEmpty, CopyRect, InflateRect, IntersectRect, UnionRect, SubstractRect, OffsetRect, IsRectEmpty, EqualRect and PtInRect. In your case: var "Bill Artemik" <b...@droste1.com> schreef in bericht Quote> Spoke too soon... |
Bill Artem
![]() Delphi Developer |
Mon, 16 Dec 2002 03:00:00 GMT
Re:"Smart Moving" dailog help neededNo, I didn't know these functions existed! Thanks. I'm dealing with a component on the form and a StayOnTop form, though. Is there a way to convert the TPoint coordinates to a TRect? I know This gives me the Upper Left and Bottom Right coordinates relative the Thanks for the tips on the IntresectRect and UnionRect (and all the Quote<avega...@NOSPAMmccomm.nl> wrote: Programmer / Analyst Droste Consultants, Inc. b...@droste1.com "The TWO rules for success in life are: 1. NEVER tell them everything you know." |