Sure ... the sample textield.pl doesnt behave the same way. This is
weird. I put the txtfield in from the example you provided.
my script is attached.
At 07:40 AM 11/13/01, you wrote:
They do? Can you share your script with the list? Or have you tried looking
at the sample that I referenced? I'm attaching a copy, in case you don't
have them.
-Pete
> -----Original Message-----
> From: Steven Swenson [mailto:[EMAIL PROTECTED]
> Sent: 12 November 2001 23:52
> To: Peter Eisengrein
> Subject: RE: [perl-win32-gui-users] Text boxes -- Interactive
>
>
> Hi Peter,
>
> Thanks... Small problem though these fields double echo
> keyboard input. An
> improvement :) but still a problem.
>
> --Steve
>
>
>
>
> At 08:18 AM 11/12/01, you wrote:
> >Two Textfields from the sample textfield.pl
> >
> >### Single line, colored
> >$Textfield = $Window->AddTextfield(
> > -name => "Textfield",
> > -left => 10,
> > -top => 10,
> > -text => "sample text",
> > -width => 180,
> > -height => 22,
> > -foreground => [0,255,0],
> > -background => [0,0,0],
> >);
> >
> >### multiline with scroll bars
> >$Multitext = $Window->AddTextfield(
> > -name => "Multitext",
> > -multiline => 1,
> > -autohscroll => 0,
> > -vscroll => 1,
> > -hscroll => 1,
> > -left => 10,
> > -top => 140,
> > -width => 180,
> > -height => 180,
> >);
> >
> > > -----Original Message-----
> > > From: Steven Swenson [mailto:[EMAIL PROTECTED]
> > > Sent: 11 November 2001 20:45
> > > To: perl-win32-gui-users@lists.sourceforge.net
> > > Subject: [perl-win32-gui-users] Text boxes -- Interactive
> > >
> > >
> > > Anyone have an example of interactive textboxes? I tried
> > > using the
> > > examples in the documentaion I could find but all I am
> getting is the
> > > prompt label displayed... no place to enter text.
> > >
> > > --Steve
> > >
> > >
> > > _______________________________________________
> > > Perl-Win32-GUI-Users mailing list
> > > Perl-Win32-GUI-Users@lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
> > >
>
use Win32::GUI;
$Menu = new Win32::GUI::Menu(
File => "&File",
Text =>"",
);
$Window = new Win32::GUI::Window(
-name => "Window",
-title => "Steve's Window",
-left => 100,
-top => 100,
-width => 500,
-height => 400,
-menu => $Menu,
);
$Window ->AddProgressBar(
-name => "Progbar",
-width=>250,
-height=>20,
-top =>100,
-left=>125,
-smooth =>0,
-vertical =>0
);
$Window->Progbar->SetPos (0);
$Window->Progbar->SetRange(0,10);
$Window->Progbar->SetStep (1);
$Window->AddLabel(
-name =>"ProgLabel",
-align => "center",
-text =>"Overall Progress",
-width => 100,
-height =>50,
-top => 150,
-left=>150
);
$Window->AddLabel(
-name =>"PendLabel",
-align => "left",
-text =>"Pending",
-width => 100,
-height =>20,
-top => 25,
-left=>0
);
$Window->AddLabel(
-name =>"FinLabel",
-align => "center",
-text =>"Completed Jobs",
-width => 100,
-height =>20,
-top => 25,
-left=>400
);
$Window->AddListbox (
-name => "Done",
-align => "center",
-width => 100,
-height => 200,
-left => 400,
-top => 50,
-multisel => 1,
-autohscroll => 0,
-vscroll => 1,
-hscroll => 1,
-sort =>1
);
$Window->AddListbox (
-name => "Agenda",
-align => "center",
-top => 50,
-width => 100,
-height => 200,
-multisel => 1,
-autohscroll => 0,
-vscroll => 1,
-hscroll => 1,
-sort =>1
);
$Window->AddButton(
-name => "Remove",
-align => "center",
-text => "Remove",
-left => 200,
-top => 200
-width => 100,
-height =>50,
);
$Textfield = $Window->AddTextfield(
-name => "Textfield",
-left => 50,
-top => 300,
-text => "sample text",
-width => 180,
-height => 22,
-prompt => "Sample TextField:",
#-foreground => [0,255,0],
#-background => [0,0,0],
);
#$Multitext = $Window->AddTextfield(
# -name => "Multitext",
# -multiline => 1,
# -autohscroll => 0,
# -vscroll => 1,
# -hscroll => 1,
# -left => 200,
# -top => 280,
# -width => 180,
# -height => 180,
#);
$Window->Show();
@Stuff = ("First","Second","Third", "Fourth");
foreach $item (@Stuff)
{
$Window->Agenda->Add($item);
}
$screen = $Window->GetDC();
$i=1;
$fin =0;
while( ($fin == 0 ))
{
$i++;
Win32::GUI::DoEvents();
$position = int ($Window->Done->Count() * 10 / (4));
$Window->Progbar->SetPos($position);
$screen->TextOut(200,250,"Overall Progress : $position");
}
sub Done_DblClick
{
&Done_GotFocus;
&Remove_Click;
}
sub Done_GotFocus
{
$removefrom = "Done";
}
sub Agenda_DblClick
{
&Agenda_GotFocus;
&Remove_Click;
}
sub Agenda_GotFocus
{
$removefrom = "Agenda";
}
sub Remove_Click
{
# which one is selected ?
if ($removefrom eq "Done")
{
$todo = $Window->Done->SelectedItem();
if (($todo == -1)|| ($Window->Done->Count() == 0))
{
}
else
{
$item = $Window->Done->GetString($todo);
$Window->Done->RemoveItem($todo);
$Window->Agenda->Add($item);
$todo = -1;
}
}
else
{
$todo = $Window->Agenda->SelectedItem();
if (($todo == -1)|| ($Window->Agenda->Count() == 0))
{
}
else
{
$item = $Window->Agenda->GetString($todo);
$Window->Agenda->RemoveItem($todo);
$Window->Done->Add($item);
$todo = -1;
}
}
}
sub Window_Terminate
{
print "Terminated !!!!!\n";
$fin = 1;
return -1;
}