Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

AutoCompletion

Posted on 2004-04-04
4
Medium Priority
?
308 Views
Last Modified: 2010-05-18
This is a little difficult to explain.

Okay, basically, you know in Delphi where you type Form1. and a little box pops up and gives you a list of possible valid autocompletions?

Well, I'm trying to implement something similar. In an RxRichEdit control, if someone tries to autocomplete something, I want a little box to popup and give them a list of possible completions.

Well, I've done most of it, I just need a little help. So far I've done it as a nonbordered form with a virtual string tree component for the list, now all I need to do is get the top/left values for the form so it can popup where the keyboard cursor is..

I have no clue how to do this and I have searched high and low.

Any help would be appreciated greatly.
0
Comment
Question by:DelphiAddict
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 

Author Comment

by:DelphiAddict
ID: 10752436
Keyboard caret not cursor. Sorry.
0
 
LVL 11

Expert Comment

by:ZhaawZ
ID: 10752970
You can use function GetCaretPos(var lpPoint : TPoint) to get relative position (top/left) of cursor (caret) in active component.
0
 
LVL 11

Accepted Solution

by:
ZhaawZ earned 800 total points
ID: 10753001
var
  p : TPoint;
begin
GetCaretPos(p);
p := RxRichEdit.ClientToScreen(p);
(* p.X will be absolute left position of caret, p.Y - top position of caret. Now these could be also top/left values for the form *)
end;
0
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10753514

procedure TForm1.RichEdit1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var
  pt : TPoint;
begin
 GetCaretPos(pt);
 pt :=  RxRichEdit.ClientToScreen(pt);
 PopUpMenu1.PopUp(pt.x, pt.Y);
end;

Shane
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question