Changeset 458


Ignore:
Timestamp:
10/25/08 06:38:35 (3 years ago)
Author:
adamk
Message:

Now we use SplitterWindows? the way they are supposed to be used

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Padre/Wx/MainWindow.pm

    • Property svn:eol-style set to native
    r451 r458  
    8080    $self->GetToolBar->Realize; 
    8181 
    82     # Create the layout boxes for the main window 
     82    # Create the status bar 
     83    $self->{statusbar} = $self->CreateStatusBar; 
     84    $self->{statusbar}->SetFieldsCount(4); 
     85    $self->{statusbar}->SetStatusWidths(-1, 100, 50, 100); 
     86 
     87    # Create the splitters but do not populate them yet 
    8388    $self->{main_panel} = Wx::SplitterWindow->new( 
    8489        $self, 
     
    8893        Wx::wxNO_FULL_REPAINT_ON_RESIZE | Wx::wxCLIP_CHILDREN, 
    8994    ); 
     95    $self->{main_panel}->SetSashGravity(1); 
    9096    $self->{upper_panel} = Wx::SplitterWindow->new( 
    9197        $self->{main_panel}, 
     
    95101        Wx::wxNO_FULL_REPAINT_ON_RESIZE | Wx::wxCLIP_CHILDREN, 
    96102    ); 
     103    $self->{upper_panel}->SetSashGravity(1); 
    97104 
    98105    # Create the right-hand sidebar 
     
    136143    ); 
    137144 
    138     # Add the bits to the layout 
    139     $self->{main_panel}->SplitHorizontally( 
     145    # Populate the layout 
     146    $self->{main_panel}->Initialize( 
    140147        $self->{upper_panel}, 
    141         $self->{output}, 
    142         $self->window_height, 
    143148    ); 
    144149    $self->{upper_panel}->SplitVertically( 
    145150        $self->{notebook}, 
    146151        $self->{rightbar}, 
    147         $self->window_width - 200, 
     152        -150, 
    148153    ); 
    149  
    150     # Create the status bar 
    151     $self->{statusbar} = $self->CreateStatusBar; 
    152     $self->{statusbar}->SetFieldsCount(4); 
    153     $self->{statusbar}->SetStatusWidths(-1, 100, 50, 100); 
    154154 
    155155    # Special Key Handling 
     
    11161116sub show_output { 
    11171117    my $self = shift; 
    1118     my $on   = shift; 
     1118    my $on   = @_ ? $_[0] ? 1 : 0 : 1; 
    11191119    unless ( $on == $self->{menu}->{view_output}->IsChecked ) { 
    11201120        $self->{menu}->{view_output}->Check($on); 
    11211121    } 
    1122     $self->{main_panel}->SetSashPosition( 
    1123         $self->window_height - ($on ? 300 : 0) 
    1124     ); 
     1122    if ( $on and not $self->{main_panel}->IsSplit ) { 
     1123        $self->{main_panel}->SplitHorizontally( 
     1124            $self->{upper_panel}, 
     1125            $self->{output}, 
     1126            -100, 
     1127        ); 
     1128    } 
     1129    if ( $self->{main_panel}->IsSplit and not $on ) { 
     1130        $self->{main_panel}->Unsplit; 
     1131    } 
    11251132    return; 
    11261133} 
     
    12271234} 
    12281235 
    1229  
    123012361; 
Note: See TracChangeset for help on using the changeset viewer.