Hmm, it's still not working for me.

Here, i'll post what I currently have:  (All thats relevant)

  $main = Win32::GUI::Window->new(-width=>429,
     -height=>532,
     -style=> WS_MINIMIZEBOX | WS_SYSMENU,
     -text=>'Test',
     -name=>'Main',
     -menu=>$menu,
     -dialogui=>1
    );

  $main->AddRichEdit(-width=>380,
     -height=>119,
     -name=>'reDesc',
     -top=>108,
     -left=>20,
     -wrap=>1,
     -autovscroll=>1,
     -ultiline=>1,
     -style=> WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL |
              ES_LEFT | ES_MULTILINE,
     -exstyle=> WS_EX_CLIENTEDGE,
    );

#This IS executing, I can tell because $changes is being set to 1...
sub reDesc_Change{
  $changes = 1;
  my ($x,$y) = $main->reDesc->Selection;
  my $currentline = $main->reDesc->LineFromChar($x);

  while (1)
  {
     my $firstline = $main->reDesc->FirstVisibleLine;
     my $linecount = $main->reDesc->SendMessage(0x00ba,0,0);
     my $lastline = $firstline + $linecount - 1;
     last if ($lastline >= $currentline);
     $main->reDesc->SendMessage(0x00b5,1,0);
  }
  return 1;
}


A lot of that was pieced together from what I could figure out from previous posts (BTW, it looks like the search function is ALMOST fixed). Unfortunately... it isn't working... It's possible that one of the settings above are preventing it...

----Original Message Follows----

Well, to get the _Change event working, just send this message:
$RichEdit->SendMessage(0x445, 0, 1);

This will help me. This has probably been posted before. I wish the search function on the mailing archives would work. Ah well, if wishes were fishes...

Unfortunately, theres a slight problem...

This line is complaining that it needs another paramater.

my $currentline = $RichEdit->LineFromChar;

Sorry, forgot something:

($x,$y) = $RichEdit->Selection;
$currentline = $RichEdit->LineFromChar;

should be:

$currentline = $RichEdit->LineFromChar($y);

Of course, you could also put $x, but if you're actively typing, your selection size will be 0 and $x and $y will be the same, and if you have a longer bit selected, you probably want the whole selection visible.



_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. http://www.hotmail.com


Reply via email to