Hi folks, I'm a newcomer but have already discovered the addictive nature of Win32::GUI. So here's my 2 cents worth.
Fonts: Strangely enough, I have found that for the kind of thing you describe you don't need to go into all the font definition stuff, as long as you know how to use ->SetCharFormat() and its main parameters: -name => "aValidFontname", -bold => 0/1, -underline => 0/1, -italic => 0/1, -height => pointsize in latest version, otherwise try 195 for starters, -color => 0xBBGGRR. You can change any of them on the fly, one or more at a time. Hereis something that works for me in a multi-lingual dictionary I use intensively. I have found that it is best to use "old-fashioned" fonts, i.e. those that use only the chars 0 - 255. (e.g. Windows 1251). The RichEdit will happily accept Unicode, but I have yet to find a way to persuade Perl to collect it from the control. I also tend to ask for things in my searching and mangling that Perl probably doesn't support. You will also need to have set up the necessary keyboard layouts for Cyrillic, Central European, whatever. Let's assume you have a standard font that identifies itself as 'Arial' and a Cyrillic font that identifies itself as 'ArialCyr' and - this is certainly important under Win 2000 - that has an OEM charset. I had to change mine with a font editor because otherwise Win 2000 used Arial for anything resembling Arial. There are lots of fonts "out there" that will serve very well - I just happened to want Arial. Now assume you have already defined a RichEdit called $riched, and you want to apply the Cyrillic font to the whole of the contents (before or after puttting something into it). # select everything in the RichEdit - this should cope with a lot of content! $riched->Select(0, 0xFFFFFF); # apply our standard font $riched->SetCharFormat (-name, "Arial"); # now all the text is standard Arial # select everything again $riched->Select(0, 0xFFFFFF); $riched->SetCharFormat (-name, "ArialCyr"); # any western text is still Arial, but any accented characters # now display as Cyrillic. If you switch to a Cyrillic keyboard (I use Russian Typewriter) you can enter Cyrillic text directly. If you put the ->SetCharFormat() stuff (without the ->Select() ) into a button handler, you can also change individual selections by simply selecting on screen and clicking on the button. # e.g assuming you have some text selected sub boldBtn_Click { $riched->SetCharFormat( -bold, 1); (Also, until Aldo 'improved' the event handling, you could subclass the RichEdit to get at the _Keypress event and write a handler to do neat things like using ctrl-B for bold, etc. Would the real Aldo please - pretty please - stand up and write enough of the new documentation to let us know if there is some way to get at all those other juicy events.) Timers: Why not simply create the timer when you need it?. # define a holder my $timer1; later, when you need it, from almost anywhere, even in a sub: # let's have a an 0.1 second timer $timer1 = GUI::Timer->New('tim1', 100); # and a sub to handle it sub tim1_Timer { dosomething() ; } Fed up with it? # bye-bye timer GUI::KillTimer ($timer1); Is anyone out there doing anything about that Win32::GUI 'repository'? I've got some .558 odds and ends that might be of interest, and would like to see what else is around. jeb.ca seems to have gone into hibernation before I ever got there. Regards Alan Lindsey On 9 Aug 2002 at 12:04, [EMAIL PROTECTED] wrote: Send Perl-Win32-GUI-Users mailing list submissions to perl-win32-gui-users@lists.sourceforge.net To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users or, via email, send a message with subject or body 'help' to [EMAIL PROTECTED] You can reach the person managing the list at [EMAIL PROTECTED] When replying, please edit your Subject line so it is more specific than "Re: Contents of Perl-Win32-GUI-Users digest..." Today's Topics: 1. Question about timers and fonts (Christian Kappler) 2. (no subject) (Eric Hansen) --__--__-- Message: 1 From: "Christian Kappler" <[EMAIL PROTECTED]> To: "Perl-Win32-GUI Mailinglist" <Perl-Win32-GUI-Users@lists.sourceforge.net> Date: Fri, 9 Aug 2002 17:43:36 +0200 Subject: [perl-win32-gui-users] Question about timers and fonts Hi listers, I am not that familiar with windows GUI programming. So my questions might be stupid, but I hope someone could help me with answers... 1. I would like to create a timer that is initially disabled. As I understand the docu for Win32::GUI I have to set the elapse time of the timer to 0 to disable it. So I thought $Window = new Win32::GUI::Window(-name => 'Window',-height => 600, -width => 800); $MyTimer = $Window->AddTimer('MyTimer',0); should create a window with a initially disabled timer and that $MyTimer->Interval(0); would disable it later on. But I found that the timer executed my event subroutine sub MyTimer_Timer {...} very very often instead of being disabled. What am I doing wrong here? How can I (initially) disable a timer? Maybe it has to do with my system? I am using Win32::GUI version 0.0.558 under WinXp Home. 2. I would like to use the font object of Win32::GUI. I will need it to display Western Europe characters as well as other types of characters (like cyrillic). In the docu I found many options for this object, where I do not know what they mean or which values might be valid for them. Here are some of the options from the which I do not understand: -escapement -weight -charset (Okay, this is for character sets. Is their a special notation for this?) -outputprecision -clipprecision -family -quality -name (Has the -name to be equivalent to the name of a font which is installed on the computer?) -face And from the GetMetrics() mehtod: -ascent -descent -ileading -eleading -avgwidth -overhang -aspectx -aspecty -firstchar -lastchar -breakchar -flags Maybe there is somewhere a more detailed documentation about using of fonts which I could read? I am specially interested if -name has to be equivalent to the name of a font installed on my computer and which values are valid for the -charset option? Thanks for all your hints and advice in advanced. Regards, Christian *** Christian Kappler *** --__--__-- Message: 2 From: "Eric Hansen" <[EMAIL PROTECTED]> To: Perl-Win32-GUI-Users@lists.sourceforge.net Date: Fri, 09 Aug 2002 11:27:10 -0500 Subject: [perl-win32-gui-users] (no subject) Has anyone written a business application for order entry, inventory management, accounting? I would like to find one written in GUI Perl with source code so I can make any customizations I may need. Thanks!! Eric _________________________________________________________________ Send and receive Hotmail on your mobile device: http://mobile.msn.com --__--__-- _______________________________________________ Perl-Win32-GUI-Users mailing list Perl-Win32-GUI-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users End of Perl-Win32-GUI-Users Digest