Hi People,
Well, I don't think I can afford to spend any more time on this. If
this is the new Linux/Ubuntu/KDE look and feel I'll go with it, although
I do have a sort of attachment to the old MSW GroupBox style StaticBox.
Post by Vadim ZeitlinSCg> The children/siblings thing doesn't seem to make any difference at
SCg> this stage.
Are you sure about this? I'd be curious to see an example of both side by
side.
Below I have posted some wxPerl code that produced this:
http://tinypic.com/usermedia.php?uo=fNkd6hpTbcOBYGP6kePD9Ih4l5k2TGxc#.U5bjBXKVthE
Unless I have missed something silly, I think the code conforms to
standards.
However I am surprised by two things.
1) The need for this line (delete it and it doesn't work).
$i_Main_Menu->{Main_Menu_Logon_Group_Sbx}->SetSizer($i_Main_Menu->{Main_Menu_Panel_Flex_Grid_Szr});
2) The need for the sizer to be specified ([300,200]). Replacing it with
wxDefaultSize and it also doesn't work.
Code follows.
Regards
Steve
#!/usr/bin/perl -w --
########################################################################################
#
# Main calling module.
#
########################################################################################
package i_Mage;
use Wx qw[:everything];
use Wx::Event qw( EVT_MENU );
use base qw(Wx::Frame);
use strict;
use warnings;
sub new {
my( $i_Main_Menu, $parent, $id, $title, $pos, $size, $style, $name
) = @_;
$parent = undef unless defined $parent;
$id = wxID_ANY unless defined $id;
$title = "" unless defined $title;
$pos = wxDefaultPosition unless defined $pos;
$size = wxDefaultSize unless defined $size;
$name = "" unless defined $name;
$style = wxNO_BORDER unless defined $style;
$i_Main_Menu = $i_Main_Menu->SUPER::new( $parent, $id, $title,
wxDefaultPosition, [300,200], $style, $name );
$i_Main_Menu->{Main_Menu_Sizer}= Wx::BoxSizer->new(wxVERTICAL);
$i_Main_Menu->SetSizer($i_Main_Menu->{Main_Menu_Sizer});
$i_Main_Menu->{Main_Menu_Panel}=Wx::Panel->new($i_Main_Menu, wxID_ANY,
wxDefaultPosition, [300,200],);
$i_Main_Menu->{Main_Menu_Sizer}->Add($i_Main_Menu->{Main_Menu_Panel}, 0,
0, 5);
$i_Main_Menu->{Main_Menu_Logon_Group_Sbx} =
Wx::StaticBox->new($i_Main_Menu->{Main_Menu_Panel}, wxID_ANY, ("User
logon/out"),wxDefaultPosition, [300,200] );
$i_Main_Menu->{Main_Menu_Logon_Group_Sbx}->SetLabel(("User
logon/out (logged in: ") . ("none") . ")");
$i_Main_Menu->{Main_Menu_SBox_Szr}=
Wx::StaticBoxSizer->new($i_Main_Menu->{Main_Menu_Logon_Group_Sbx},
wxHORIZONTAL);
$i_Main_Menu->{Main_Menu_Panel_Flex_Grid_Szr} =
Wx::FlexGridSizer->new(2, 2, 5, 5);
$i_Main_Menu->{Main_Menu_SBox_Szr}->Add($i_Main_Menu->{Main_Menu_Panel_Flex_Grid_Szr},
0, 0, 5);
$i_Main_Menu->{User_Id_Lbl} =
Wx::StaticText->new($i_Main_Menu->{Main_Menu_Logon_Group_Sbx}, wxID_ANY,
("User"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
$i_Main_Menu->{User_Id_Txt} =
Wx::TextCtrl->new($i_Main_Menu->{Main_Menu_Logon_Group_Sbx}, wxID_ANY,
"", wxDefaultPosition, wxDefaultSize, );
$i_Main_Menu->{User_Password_Lbl} =
Wx::StaticText->new($i_Main_Menu->{Main_Menu_Logon_Group_Sbx}, wxID_ANY,
("Password"), wxDefaultPosition, wxDefaultSize, );
$i_Main_Menu->{User_Password_Txt} =
Wx::TextCtrl->new($i_Main_Menu->{Main_Menu_Logon_Group_Sbx}, wxID_ANY,
"", wxDefaultPosition, wxDefaultSize, wxTE_PASSWORD);
$i_Main_Menu->{Main_Menu_Panel_Flex_Grid_Szr}->Add($i_Main_Menu->{User_Id_Lbl},
0, 0, 5);
$i_Main_Menu->{Main_Menu_Panel_Flex_Grid_Szr}->Add($i_Main_Menu->{User_Id_Txt},
0, 0, 5);
$i_Main_Menu->{Main_Menu_Panel_Flex_Grid_Szr}->Add($i_Main_Menu->{User_Password_Lbl},
0, 0, 5);
$i_Main_Menu->{Main_Menu_Panel_Flex_Grid_Szr}->Add($i_Main_Menu->{User_Password_Txt},
0, 0, 5);
##########################################################################################################
$i_Main_Menu->{Main_Menu_Logon_Group_Sbx}->SetSizer($i_Main_Menu->{Main_Menu_Panel_Flex_Grid_Szr});
##########################################################################################################
$i_Main_Menu->Layout();
return $i_Main_Menu;
}
1;
package i_Mage_Main_App;
use base qw(Wx::App);
use strict;
sub OnInit {
my( $self ) = shift;
my $i_Mage = i_Mage->new();
$self->SetTopWindow($i_Mage);
$i_Mage->Show(1);
return 1;
}
# end of class i_Mage_Main_App
package main;
unless(caller){
my $gl_i_Mage_app = i_Mage_Main_App->new();
$gl_i_Mage_app->MainLoop();
}
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users