From: <tho...@ba...> - 2001-01-31 15:43:12
|
Hello, might be a silly question but anyway: How can I remove all Elements from a Window in case a different Tab on a Tabstrip is clicked and different Elements should be displayed on the Window accordingly? Or can I define separate "Panels" with different Elements for each Tab? mit freundlichen Grüßen/with best regards Thomas Emde nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn BAYER AG IS-CT DPN D-51386 Leverkusen Fon: +49 (0) 214/30-81513 Fax: +49 (0) 214/30-31737 E-Mail: tho...@ba... |
From: Jonathan S. <jso...@al...> - 2001-01-31 16:17:26
|
Here is how I did it: $MainWindow->AddTabStrip( -name =3D> "FindTabStrip", -left =3D> 10, -top =3D> 10, -width =3D> $MainWindow->ScaleWidth - 250, -height =3D> 175, -hottrack =3D> 1, ); $MainWindow->FindTabStrip->InsertItem(-text =3D> "Name"); $MainWindow->FindTabStrip->InsertItem(-text =3D> "Building"); $MainWindow->FindTabStrip->InsertItem(-text =3D> "Adapter Address"); Then in the subs: sub FindTabStrip_Click { if ($MainWindow->FindTabStrip->SelectedItem =3D=3D 0) { $MainMenu->{FindName}->Checked(1); $MainMenu->{FindBuilding}->Checked(0); $MainMenu->{FindAdapter}->Checked(0); $MainWindow->Bld_Label->Hide(); $Building->Hide(); $MainWindow->SelectFromList->Hide(); $BuildingList->Hide(); $MainWindow->Adapt_Label->Hide(); $Adapter->Hide(); $MainWindow->FN_Label->Show(); $FirstName->Show(); $MainWindow->LN_Label->Show(); $LastName->Show(); $FirstName->SetFocus(); } if ($MainWindow->FindTabStrip->SelectedItem =3D=3D 1) { $MainMenu->{FindName}->Checked(0); $MainMenu->{FindBuilding}->Checked(1); $MainMenu->{FindAdapter}->Checked(0); $MainWindow->FN_Label->Hide(); $FirstName->Hide(); $MainWindow->LN_Label->Hide(); $LastName->Hide(); $MainWindow->Adapt_Label->Hide(); $Adapter->Hide(); $MainWindow->Bld_Label->Show(); $Building->Show(); $MainWindow->SelectFromList->Show(); $Building->SetFocus(); } if ($MainWindow->FindTabStrip->SelectedItem =3D=3D 2) { $MainMenu->{FindName}->Checked(0); $MainMenu->{FindBuilding}->Checked(0); $MainMenu->{FindAdapter}->Checked(1); $MainWindow->FN_Label->Hide(); $FirstName->Hide(); $MainWindow->LN_Label->Hide(); $LastName->Hide(); $MainWindow->Bld_Label->Hide(); $Building->Hide(); $MainWindow->SelectFromList->Hide(); $BuildingList->Hide(); $MainWindow->Adapt_Label->Show(); $Adapter->Show(); $Adapter->SetFocus(); } return; } maybe there is an easier way but I didn't know about it so that was the w= ay i got around it. Jonathan Southwick Technical & Network Services Allegheny College, Meadsville, PA jso...@al... ----- Original Message ----- From: <tho...@ba...> To: <per...@li...> Sent: Wednesday, January 31, 2001 10:42 AM Subject: [perl-win32-gui-users] Tabstrips > Hello, > > might be a silly question but anyway: How can I remove all Elements fro= m a > Window in case a different Tab on a Tabstrip is > clicked and different Elements should be displayed on the Window accordingly? > Or can I define separate "Panels" with > different Elements for each Tab? > > mit freundlichen Gr=FC=DFen/with best regards > Thomas Emde > nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn > nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn > > BAYER AG > IS-CT DPN > D-51386 Leverkusen > Fon: +49 (0) 214/30-81513 > Fax: +49 (0) 214/30-31737 > E-Mail: tho...@ba... > > _______________________________________________ > Perl-Win32-GUI-Users mailing list > Per...@li... > http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > |
From: christopher s. <chr...@ya...> - 2001-01-31 16:33:18
|
I found this sub in the old win32 GUI archive thought it might be useful sub Tab_Click { my $current_tab = $W->Tab->SelectedItem(); foreach $key (keys %{$W->Tab}) { # Skip these items - what remains should be just widgets. next if (grep(/^${key}$/,qw(-handle -name -type))); $ref = $W->Tab->{$key}; if ($debug) { print "key: $key"," value: ",$W->Tab->{$key},"\n"; print " -name: ",$ref->{-name},"\n"; print " -text: ",$ref->{-text},"\n"; } # Strip off number from end of -name - use as tabid. # A better way would be to define something like "-tabid => .." # But this does not carry over after the widget is defined. $tabid = substr($ref->{-name},-1); if ($current_tab == $tabid) { $ref->Show(); } else { $ref->Hide(); } } } Hope that helps chris www.perl-resume.com ----- Original Message ----- From: <tho...@ba...> To: <per...@li...> Sent: Wednesday, January 31, 2001 9:12 PM Subject: [perl-win32-gui-users] Tabstrips Hello, might be a silly question but anyway: How can I remove all Elements from a Window in case a different Tab on a Tabstrip is clicked and different Elements should be displayed on the Window accordingly? Or can I define separate "Panels" with different Elements for each Tab? mit freundlichen Grüßen/with best regards Thomas Emde nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn BAYER AG IS-CT DPN D-51386 Leverkusen Fon: +49 (0) 214/30-81513 Fax: +49 (0) 214/30-31737 E-Mail: tho...@ba... _______________________________________________ Perl-Win32-GUI-Users mailing list Per...@li... http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com |
From: Laurent R. <ro...@cl...> - 2001-02-01 22:14:21
Attachments:
TabStrip.zip
|
Hello, An other solution for hide and show TabStrip page. This is a TabStrip test, i have made. I use a GroupBox for each Page, and attach elements on it. Then, just show and hide the good GroupBox. Laurent. ----- Original Message ----- From: <tho...@ba...> > might be a silly question but anyway: How can I remove all Elements from a > Window in case a different Tab on a Tabstrip is > clicked and different Elements should be displayed on the Window accordingly? > Or can I define separate "Panels" with > different Elements for each Tab? > Thomas Emde |