Sub Textfield_Change {
my $text=$Textfield->Text();
$text=uc($text); # uc uppercase function, or lc lowercase
function
$Textfield->Text($text);
}
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Johan Lindstrom
Sent: Wednesday, November 06, 2002 1:41 PM
To: [email protected]
Subject: Re: [perl-win32-gui-users] "Number" and "Case" TEXTFIELDS
At 10:49 2002-11-06 -0500, Magnone, Angelo wrote:
>Has anyone had any luck getting the "Number" and "Case" fields to work
>using The GUI Loft?
>
>Is there any way to "force" a TEXTFIELD to upper case?
>Is there any way to "force" a TEXTFIELD to numbers only?
Here's a workaround for you (until I fix the bug in TGL) and a bug
report
for Aldo:
The workaround:
If you disable Wantreturn for your Textfield, the Numbers stuff will
start
working.
The explanation:
The Numbers property of a Textfield is implemented in TGL as -addstyle
=>
0x2000. The default settings for a Textfield in TGL is "Wantreturn",
which
is also implemented with an -addstyle. These two clash.
The bug report (or feature request if this is the indtended behaviour):
The options passed to Add****() methods seems to be, at some point,
treated
as a hash, not as an array, i.e. two entries with -addstyle will clobber
each other.
Test case below. Uncomment the second -addstyle to see the numbers
option
fail. Fails for 0.0.558.
#!/usr/local/bin/perl -w
use strict;
use Win32::GUI;
my $winMain = new Win32::GUI::Window(
-left => 13,
-top => 32,
-width => 439,
-height => 260,
-name => "winMain",
-text => "-addstyle demo",
);
$winMain->AddTextfield(
-text => "tfTest",
-name => "tfTest",
-left => 0,
-top => 0,
-width => 400,
-height => 22,
-addstyle => 0x2000,
# -addstyle => 4096,
);
$winMain->Show();
Win32::GUI::Dialog();
__END__
/J
-------- ------ ---- --- -- -- -- - - - - -
Johan Lindström Sourcerer @ Boss Casinos [EMAIL PROTECTED]
Latest bookmark: "BASTET.COM - free Win32 software."
http://www.bastet.com/software/software.html
dmoz: /Computers/Software/Operating_Systems/Windows/ 114
-------------------------------------------------------
This sf.net email is sponsored by: See the NEW Palm
Tungsten T handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
_______________________________________________
Perl-Win32-GUI-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users