Re: [perl-win32-gui] Patch for 0.0.340 on Threaded Perl 5.005.03

1999-07-16 Thread Joel Oliveira

Im interested...
 This attached patch includes all 3 of Paul Moores patchs and one of my
 own which fixes build 340 for compilation under threaded perl 5.005.03
 and adds in 2 additional events and one method:

 BN_PUSHED,
 BN_UNPUSHED,
 GetDlgItem

 I made the diff using Cygwin's diff. If there is a better utility to
 use, let me know.

 If anyone is interested in binaries, email me.

 [EMAIL PROTECTED]





[perl-win32-gui] text color

1999-07-16 Thread Khoa Doan

I created a DialogBox with a color text.  The problem is when another window
(e.g. command prompt shell) covered the DialogBox and is dragged it out so
the DialogBox is shown up, the color text is disappeared.   I can only see
the DiaglogBox with the color text again, if I cover another window on the
DialogBox where the color text supposes to be displayed, and re-click the
DialogBox.

Is a way to keep the color text not to be disappeared like that ?

Here is my sample code:
Use Win32::GUI;

$W = new Win32::GUI::DialogBox(
-name   =   "Window",
-left   =240,
-top   =200,
-width=500,
-height   =300,
);

$W-Show();

Win32::GUI::Dialog();

Sub Window_Resize {
   Textcolor();
}

sub Window_Activate {
   Textcolor();
}

sub Window_Terminate {
   return -1;
}

sub Textcolor {
$W-BeginPaint();
$W-SetBKMode(1);
$W-SetTextColor(0,0,255);
$W-TextOut(100,35,"This is a test");
}

Thanks,

Khoa D.




[perl-win32-gui] Color Picker Sample

1999-07-16 Thread Eric Hansen

# Eric Hansen, ITSi, Dallas, TX July 1999
use Win32::GUI;
use Time::localtime;

# Hide the Dos Window 
($DOShwnd, $DOShinstance) = GUI::GetPerlWindow();
GUI::Hide($DOShwnd);

$mm=localtime-mon()+1;
$dd=localtime-mday();
@fields = split(/ /,ctime());
$lastfld=$#fields;
$=$fields[$lastfld];
$Today=sprintf("%4s%02s%02s",$,$mm,$dd);

$W = new GUI::DialogBox (
-title= "Change Color On The Fly",
-left = 100, 
-top  = 20, 
-width= 250, 
-height   = 250,
-name = "Window",
);
 
$Font = new Win32::GUI::Font(
-name = "Courier New",
-size = 12,
-weight = 700,
-height = -14,
);

$BeginDateButton = $W-AddButton(-name = "BeginDateButton",
  -text  = "Color", 
  -left = 145, 
  -top = 100,
  -group = 1,
  -tabstop = 1,
  -height = 25, 
  -width = 30 );

$BeginDate = $W-AddTextfield(-name = "BeginDate",
  -text  = $Today, 
  -font = $Font,
  -foreground = 0x8080FF,# soft red
  -left = 65, 
  -top = 100, 
  -group = 1,
  -tabstop = 1, 
  -height = 20,
  -width = 75 );
$BeginDate-SetFocus();
$BeginDate-Select(0,length($BeginDate-Text()));
$BeginDate-SendMessage(197, 8, 0);  # limit to 8 characters input

$W-Show; 
GUI::Dialog();

sub BeginDateButton_Click {
   my $text = $BeginDate-Text();
   my $color = GUI::ChooseColor(-owner = $W);
   if ($color) {
$BeginDate-Change(-foreground = $color, -text = $text);
   }
}

Window_Terminate {
GUI::Show($DOShwnd);
return -1;
}

# End Script


-Original Message-
From:   Moore, Paul [SMTP:[EMAIL PROTECTED]]
Sent:   Friday, July 16, 1999 3:28 AM
To: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'
Subject:RE: [perl-win32-gui] Win32::GUI Tutorial, part 1

 From: christopher paul [mailto:[EMAIL PROTECTED]]
 
 would be cool to see some things like "how to call up a color 
 picker" a "file-open/save dialog" .. also eric's dbgrid would
 make a great chapter, if he's keen.
 

Thanks for the encouragement. I'll certainly look at colour pickers and
file dialogs - but I haven't got to the point where *I* know how to use
them yet, so I'll take things in the order I discover them for now.

I'll look at the dbgrid, but I was also thinking of using (when I get a
bit more advanced!) listviews and DBI to do a SQL query viewer (my job
is as a DBA, so it's relevant to me), as a way of learning list views.
Maybe I could include a comparison with the dbgrid approach...

Anyway, it's good to know the stuff is useful.

Paul.