[perl-win32-gui-users] RE: Tab between controls in a Window

2004-08-11 Thread Daniel Jordan
Glenn,

For some reason, that code doesn't work on my machine.
 When I try to tab, it just beeps at me.  I tried
updating both perl and Win32::GUI, but that didn't
help either.  Oh well, at least I have something that
works.  (And by the way, thanks for your response.)

Dan



Original Message:

From: "Glenn W Munroe" <[EMAIL PROTECTED]>
To: "'Daniel Jordan'" <[EMAIL PROTECTED]>,

Subject: RE: [perl-win32-gui-users] Tab between
controls in a Window 
using an Accelerator table
Date: Tue, 10 Aug 2004 10:27:04 +0200

Daniel,

When I read this, I thought that the problem would be
a missing 
-dialogui
option, but then I saw you had that. After that, I
removed the "hack" 
code
and it still worked--am I missing the point? On my
system, you can tab
between textfields using the following code:


use Win32::GUI;

my $window = Win32::GUI::Window 
-> new (
-name => 'window',
-text => "Window",
-width => 300,
-height => 200,
-dialogui => 1,
);

$t1 = $window
-> AddTextfield (-name => 't1',
 -left => 30,
 -top => 50,
 -width => 100,
 -height => 22,
 -tabstop => 1,
 -prompt => ["Text 1",50],
 );

$t2 = $window
-> AddTextfield (-name => 't2',
 -left => 30,
 -top => 100,
 -width => 100,
 -height => 22,
 -tabstop => 1,
 -prompt => ["Text 2",50],
 );

$t1 -> SetFocus();
$window -> Show();

sub window_Terminate { -1 }

Win32::GUI::Dialog();




Glenn 


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



[perl-win32-gui-users] ESC Key, How to stop program termination?

2004-08-11 Thread Eric Hansen
My Win32::GUI program terminates when the ESC key is pressed.
I only want my users to be able to mouse click File->Exit, or
The X in the upper right corner of the window/dialogbox to end
The program.  How can the ESC key be trapped?   Thanks,  -Eric
 
Exit_Click {
   return -1;
}
Window_Terminate {
   return -1;
}





[perl-win32-gui-users] RE: ESC Key, How to stop program termination?

2004-08-11 Thread Eric Hansen
$A = new Win32::GUI::AcceleratorTable(
"Esc"   => "Esc");

$M = new Win32::GUI::Menu(
"&File" => "File",
" > E&xit"  => "Exit");

$W = new Win32::GUI::Window (
-title=> "Some Title",
-menu => $M,
-accel=> $A,
-name => "Window",
-left => 125, 
-top  => 25, 
-width=> 550, 
-height   => 580);

sub Esc_Click {
   my $question  = "Do you wish to Exit the Program?";
   my $ans   = Win32::GUI::MessageBox($W,$question,"Some Title",36,);
   #-- 6=yes, 7=no
   if ($ans == 7) {return;}
   return -1;   #-- stops event handler
}

-Original Message-
From: Eric Hansen [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 11, 2004 4:26 PM
To: 'perl-win32-gui-users@lists.sourceforge.net'
Subject: ESC Key, How to stop program termination?

My Win32::GUI program terminates when the ESC key is pressed.
I only want my users to be able to mouse click File->Exit, or
The X in the upper right corner of the window/dialogbox to end
The program.  How can the ESC key be trapped?   Thanks,  -Eric
 
Exit_Click {
   return -1;
}
Window_Terminate {
   return -1;
}





[perl-win32-gui-users] RE: ESC Key, How to stop program termination?

2004-08-11 Thread Eric Hansen
This does not work. But I did discover that a DialogBox closes on ESC,
So if you want to prevent this, make it a Window and you don't need
An accelerator object.

-Original Message-
From: Eric Hansen [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 11, 2004 4:46 PM
To: 'perl-win32-gui-users@lists.sourceforge.net'
Subject: RE: ESC Key, How to stop program termination?

$A = new Win32::GUI::AcceleratorTable(
"Esc"   => "Esc");

$M = new Win32::GUI::Menu(
"&File" => "File",
" > E&xit"  => "Exit");

$W = new Win32::GUI::Window (
-title=> "Some Title",
-menu => $M,
-accel=> $A,
-name => "Window",
-left => 125, 
-top  => 25, 
-width=> 550, 
-height   => 580);

sub Esc_Click {
   my $question  = "Do you wish to Exit the Program?";
   my $ans   = Win32::GUI::MessageBox($W,$question,"Some Title",36,);
   #-- 6=yes, 7=no
   if ($ans == 7) {return;}
   return -1;   #-- stops event handler
}

-Original Message-
From: Eric Hansen [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 11, 2004 4:26 PM
To: 'perl-win32-gui-users@lists.sourceforge.net'
Subject: ESC Key, How to stop program termination?

My Win32::GUI program terminates when the ESC key is pressed.
I only want my users to be able to mouse click File->Exit, or
The X in the upper right corner of the window/dialogbox to end
The program.  How can the ESC key be trapped?   Thanks,  -Eric
 
Exit_Click {
   return -1;
}
Window_Terminate {
   return -1;
}