As a followup, I can now get mouse clicks using:
EVT_LEFT_DOWN( $mytextctrl, \&mymousehandler);
But in my handler I still have no idea how to map the X,Y to the word in my
text (or statictext or listctrl or anything).
I tried playing with HitTest but got an error:
sub mymousehandler {
my ($self, $event) = @_;
my ($result, $col, $row);
$self->HitTest( $result, $col, $row);
}
Can't locate object method "HitTest" via package "Wx::TextCtrl" at
Narrowtest_ui.pm line 140.
(I am using wxWidgets 2.6.3 with Perl Wx-0.26)
---- Original message: ---------------------------------
I am trying to get what word and what line a user clicks on in a TextCtrl.
I cannot figure out how to get mouse clicks, much less map that to a word, in a
TextCtrl.
I tried using EVT_LEFT_DOWN but I am not getting any events.
Even if I did get the events, how on Earth will I map it to the word clicked
on? Do I have to use a fixed width font and calculate the width of the window,
where the text would wrap, where the scroll is, etc?
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
|