hi rob,
thanks for your support.
I've created a small working example of my script.
juergen
[snip]
#!.\perl.exe
#
use strict;
no strict qw(subs);
##############################
# GUI
use Win32::GUI 1.05 qw( CW_USEDEFAULT
WM_HOTKEY
VK_J
IDI_DEFAULTICON
MB_OK
MB_ICONHAND
ES_WANTRETURN
WS_CLIPCHILDREN
WS_EX_TOPMOST
WM_HSCROLL
WM_VSCROLL
SB_CTL
SB_HORZ
SB_VERT
SB_TOP SB_BOTTOM SB_LINEUP SB_LINEDOWN SB_PAGEUP
SB_PAGEDOWN
SB_LEFT SB_RIGHT SB_LINELEFT SB_LINERIGHT SB_PAGELEFT
SB_PAGERIGHT
SB_THUMBTRACK SB_THUMBPOSITION SB_ENDSCROLL
);
use Win32::GUI::Constants ();
use Win32::API();
use Win32::Sound;
use Win32::ChangeNotify;
use Win32::GUI::SplashScreen();
#
my $main;
my $cfg_window;
my %cfg = (
iconfile => undef,
icon_file => undef,
);
my %config = (
playsound => 0,
showsplash => 0,
monitor_dir => join( "", Win32::GetFullPathName( '.' ) ),
monitor_subdirs => False,
timeout_value => 30,
archive_destination_name => XXX,
);
my %config_tooltips = (
playsound => "start startsound [0]|1",
showsplash => "show splash screen on startup [0]|1",
monitor_dir => "Path to monitoring directory",
monitor_subdirs => "Should subdirectories be monitored? [False]|True",
timeout_value => "timeout value in seconds [30]",
);
#----------------------------
sub do_animation {
my $window = $_[0];
print "do_animation: $window\n";
$window->Animate(
-show => !$window->IsVisible(),
-activate => 1,
-animation => "blend",
-direction => "rl",
-time => 400,
);
$window->BringWindowToTop();
$window->DoEvents();
$window->Update();
}
# --------------------
sub configuration
{
configuration_window(); # create the window
my $count = 0;
my $padding = 10;
$cfg_window->AddGroupbox(
-name => "CFGX",
-title => "Configuration",
-left => 25,
-top => 10,
-width => 400,
-group => 1,
);
foreach my $xx (sort(keys %config))
{
$count = $count + 1;
print "$xx = $config{$xx}\n";
$cfg_window->AddTextfield(
-name => "${xx}_name",
-text => "$config{$xx}",
-tip => "$config_tooltips{$xx}",
-left => 35,
-prompt => [ "$xx:" , 150 ],
-height => 20,
-width => 200,
-top => 25 + ($count * 20),
-width => $cfg_window->CFGX->Width() - (2 * 20),
-tabstop => 1,
);
}
$cfg_window->CFGX->Height(350);
$cfg_window->CFGX->Width(550);
# $cfg_window->{archive_destination_name}->SetFocus();
do_animation($cfg_window);
$cfg_window->SetRedraw(1);
}
# -------------------
sub configuration_window
{
$cfg_window=Win32::GUI::Window->new(
-name => "configwin",
-title => "$cfg{name} - Configuration",
-left => CW_USEDEFAULT,
-size => [ 600, 450 ],
-parent => $main,
-vscroll => 1,
-hscroll => 1,
-helpbutton => 0,
-dialogui => 1,
-resizable => 1,
-onTerminate => sub { do_animation($cfg_window); 0; },
);
my $ncw = $cfg_window->ScaleWidth();
my $nch = 20;
$cfg_window->AddButton(
-name => "CFGOK",
-text => "OK",
-pos => [ 30, $nch ],
);
$cfg_window->AddButton(
-name => "CFGCANCEL",
-text => "CANCEL",
-pos => [ 70, $nch ],
);
}
# ----------------
sub create_MainWindow
{
$main = Win32::GUI::Window->new(
-name => 'Main',
-left => CW_USEDEFAULT,
-addstyle => WS_CLIPCHILDREN,
-width => 100,
-height => 100,
-text => "main".$cfg{title_string},
-menu => $cfg{mainmenu},
-vscroll => 1,
-hscroll => 1,
-size => [800,550],
-helpbutton => 0,
-maximizebox => 0,
-resizable => 1,
-background => {0x00FF00},
-foreground => {0x33AABB},
-dialogui => 1,
# -accel => $cfg{accelerator},
-noflicker => 1,
# -onMinimize => \&toggle_show_state,
-eventmodel => both,
);
}
# ----------------
create_MainWindow();
$main->AddButton(
-visible => 1,
-cancel => 1,
-onClick => configuration(),
);
$main->Show();
Win32::GUI::Dialog();
[/snip]
-------- Original-Nachricht --------
> Datum: Sun, 9 Dec 2007 08:40:23 +0000
> Von: "Robert May" <[EMAIL PROTECTED]>
> An: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> CC: [email protected]
> Betreff: Re: [perl-win32-gui-users] why are the prompts of my textfields not
> shown?
> On 22/11/2007, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > Hi,
> > I've a small application with a configuration window.
> > this window is created with a for-loop and some textfields with "prompt"
> for the values.
> > this window is shown with an Animate().
> > but the prompts aren't shown until i focus it with tabstopps or the
> mouse.
> > what's my problem?
> >
> > thx for help.
> > juergen
>
> Juergen,
>
> As the example you have posted is a snippet and not a complete script
> that I can look at then I can't tell what your problem is. I expect
> that in your do_animation() you only deal with the textfield, and not
> with the associated label, but without seeing more code I can't really
> tell. If you were to post a short but complete example showing your
> problem, then I'm happy to have another look.
>
> Regards,
> Rob.
> >
> > [snip]
> > sub configuration
> > {
> > configuration_window(); # create the window
> > my $count = 0;
> > my $padding = 10;
> >
> > $cfg_window->AddGroupbox(
> > -name => "CFGX",
> > -title => "Configuration",
> > -left => 25,
> > -top => 10,
> > -width => 400,
> > -group => 1,
> > );
> >
> > foreach my $xx (sort(keys %config))
> > {
> > $count = $count + 1;
> > print "$xx = $config{$xx}\n";
> > $cfg_window->AddTextfield(
> > -name => "${xx}_name",
> > -text => "$config{$xx}",
> > -tip => "$config_tooltips{$xx}",
> > -left => 35,
> > -prompt => [ "$xx:" , 150 ],
> > -height => 20,
> > -width => 200,
> > -top => 25 + ($count * 20),
> > -width => $cfg_window->CFGX->Width() - (2 * 20),
> > -tabstop => 1,
> > );
> > }
> >
> > $cfg_window->CFGX->Height(350);
> > $cfg_window->CFGX->Width(550);
> >
> > $cfg_window->{archive_destination_name}->SetFocus();
> > do_animation($cfg_window);
> > $cfg_window->SetRedraw(1);
> > get_configuration();
> > }
> > [/snip]
> >
> > --
> > Psssst! Schon vom neuen GMX MultiMessenger gehört?
> > Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger
> >
> >
> -------------------------------------------------------------------------
> > This SF.net email is sponsored by: Microsoft
> > Defy all challenges. Microsoft(R) Visual Studio 2005.
> > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> > _______________________________________________
> > Perl-Win32-GUI-Users mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
> > http://perl-win32-gui.sourceforge.net/
> >
>
>
> --
> Please update your address book with my new email address:
> [EMAIL PROTECTED]
--
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Perl-Win32-GUI-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
http://perl-win32-gui.sourceforge.net/