[perl-win32-gui-users] richedit setting background-color of some text

2003-07-20 Thread Richard Bennett
(sorry if this message comes through twice)

Hi,

I am parsing a textfile into a richedit control, and want to highlight
certain words.
I can do this by changing the fontcolor like this:

if(/wordtohighlight/) {
$Textbox->SetCharFormat(-color => "#55");
}
while parsing the file,

but I can't find how to change the background color for the same words (not
the whole page)
I know the control supports it, as it displays text that was highlighted in
Word just fine.
Any ideas?

Richard.




RE: [perl-win32-gui-users] Click subroutine doesn't get control when script is executing

2003-07-20 Thread Dennis Putnam
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

At 03:58 AM 7/20/2003, you wrote:
>In the typiucal windows way (which we can do in PERL), is to start a
>TIMER.
>The classic to this approach is a "setup" pogram with the prograss bar.
>
>When you start your script, you will need to set a WM_TIMER for some
>time slice,
>eg, every 2 seconds.
>
>If you're building your own GUI, then before the
>WitEvent/DoModal/Whatever, you;ll want
>to put it in there.
>
>
>Here's the Win32::GUI package's description...Hope this helps out :)
>   SNIP

Thanks for the reply, it might. However, it is not clear what I do in the 
timer event. Should it just be a NOOP so that the event simply interrupts 
processing (do I even need it)? If a button click has occurred will the 
click event will be triggered or do I need to check something in the timer 
event to see if the button was clicked?



-BEGIN PGP SIGNATURE-
Version: PGPfreeware 6.5.8 for non-commercial use 
Comment: Be sure to use my most recent key -  created 6/16/03

iQA+AwUBPxqgW/34lmKmdrVUEQLQxQCgjXvWttFxS+p+xrfd56m7RBm+jGQAl3Mo
Hc02Lhz7oqbeNP9k6jQnO30=
=8b8P
-END PGP SIGNATURE-





[perl-win32-gui-users] AddTimer problem

2003-07-20 Thread Dennis Putnam
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

It seems that even the simplest things get complicated.

I created a timer thus:

my $timer1=$window->AddTimer('T1',250);

How much simpler can one get then that? Anyway, this produces an error at 
every timeout:

"Use of uninitialized value in subroutine entry at myscript.pl line 183.:

Line 183 is:

Win32::GUI::Dialog();

I know the timer is causing the problem because if I comment it out the 
error goes away. What value is it talking about? How do I find out? What 
can I do to fix this? TIA.

-BEGIN PGP SIGNATURE-
Version: PGPfreeware 6.5.8 for non-commercial use 
Comment: Be sure to use my most recent key -  created 6/16/03

iQA/AwUBPxrylf34lmKmdrVUEQLaAwCff05mMkCyBC6iI2AHuqUPCEvkIcYAn3+k
X0Op4/ys1/kBag1/74bxqwqM
=24ih
-END PGP SIGNATURE-





Re: [perl-win32-gui-users] AddTimer problem

2003-07-20 Thread Dennis Putnam
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

At 09:58 PM 7/20/2003, you wrote:
>A bald guess, but I've gotten this particular error several times when I 
>wrote an event handler that didn't return a value.  It's worth a look...

Thanks for the suggestion. It was worth a look but alas did not help.

-BEGIN PGP SIGNATURE-
Version: PGPfreeware 6.5.8 for non-commercial use 
Comment: Be sure to use my most recent key -  created 6/16/03

iQA/AwUBPxteZf34lmKmdrVUEQLarQCfbbprJ0Ej4QDZeeMGxuLtnkq6YagAoJMH
zPCVFbO14j7MHMLkHgDHbBpk
=BwyG
-END PGP SIGNATURE-





RE: [perl-win32-gui-users] Click subroutine doesn't get control when script is executing

2003-07-20 Thread Stuart Arnold
In the typiucal windows way (which we can do in PERL), is to start a
TIMER.
The classic to this approach is a "setup" pogram with the prograss bar.

When you start your script, you will need to set a WM_TIMER for some
time slice,
eg, every 2 seconds.

If you're building your own GUI, then before the
WitEvent/DoModal/Whatever, you;ll want
to put it in there.


Here's the Win32::GUI package's description...Hope this helps out :)

Timer
The Timer object is a special kind of control: it has no appearance, its
only purpose is to trigger an event every specified amount of time. 

The synopsis to create a Timer object is: 


new Win32::GUI::Timer( PARENT, NAME, ELAPSE )



PARENT->AddTimer( NAME, ELAPSE )


NAME
the name for the Timer object (used to lookup the associated event). 

ELAPSE
the number of milliseconds after which the Timer() event will be
triggered. 

Once you've created the Timer object, you can change the ELAPSE
parameter with the Interval() method, or disables it with the Kill()
method. Note that Kill(), despite of its name, does not destroy the
Timer object, so you can re-enable it later with Interval(). 

Example: 


# creates a Timer that is called every 1 second

$Window->AddTimer( "Clock", 1000 );



sub Clock_Timer {
print "one second passed.\n";
}


Methods: Interval, Kill 


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Dennis Putnam
Sent: Saturday, July 19, 2003 11:19 PM
To: perl-win32-gui-users@lists.sourceforge.net
Subject: [perl-win32-gui-users] Click subroutine doesn't get control
when script is executing



-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I have a script that is started by a button. It can be a long process
and I 
would like to give the user the option of cancelling execution at any
time. 
Unfortunately, it seems that when the script is running all buttons
become 
disabled or at least the click events are never allowed to get control.

How do I set up a cancel button and click event that can interrupt
script 
processing? TIA.

-BEGIN PGP SIGNATURE-
Version: PGPfreeware 6.5.8 for non-commercial use 
Comment: Be sure to use my most recent key -  created 6/16/03

iQA/AwUBPxoKC/34lmKmdrVUEQKNqgCg7wi6hsuC0pqoA+Bl0oxB6/DtswgAn1Te
JDvHL8SgVGlC7tIJXR5zXvZI
=1L53
-END PGP SIGNATURE-




---
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
___
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users





[perl-win32-gui-users] richedit setting background-color of some text

2003-07-20 Thread Richard Bennett
Hi,

I am parsing a textfile into a richedit control, and want to highlight
certain words.
I can do this by changing the fontcolor like this:

if(/wordtohighlight/) {
$Textbox->SetCharFormat(-color => "#55");
}
while parsing the file,

but I can't find how to change the background color for the same words (not
the whole page)
I know the control supports it, as it displays text that was highlighted in
Word just fine.
Any ideas?

Richard.