Fixed a layout problem when resizing

This commit is contained in:
Zane U. Ji 2013-10-11 20:57:14 +08:00
parent e1bd4b433c
commit 8d041e9433
2 changed files with 14 additions and 26 deletions

View File

@ -63,7 +63,7 @@ InsertPanel::InsertPanel (
wxLB_SORT | wxLB_HSCROLL );
sizer->Add ( edit, 0, wxGROW | wxTOP, 0 );
sizer->Add ( list, 0, wxGROW | wxTOP, 0 );
sizer->Add ( list, 1, wxGROW | wxTOP, 0 );
sizer->Layout();
list->Show ( false );
}
@ -105,15 +105,11 @@ void InsertPanel::update (
for ( it = entitySet.begin(); it != entitySet.end(); it++ )
list->Append ( *it );
list->Show ( true );
wxSize clientSize = GetClientSize();
wxSize editSize = edit->GetSize();
wxSize listSize =
wxSize ( clientSize.GetWidth(), clientSize.GetHeight() - editSize.GetHeight() );
list->SetSize ( listSize );
#if wxCHECK_VERSION(2,9,0)
list->Update();
//sizer->Layout();
#else
sizer->Layout();
#endif
return;
}
@ -146,15 +142,11 @@ void InsertPanel::update (
for ( it = elementSet.begin(); it != elementSet.end(); it++ )
list->Append ( *it );
list->Show ( true );
wxSize clientSize = GetClientSize();
wxSize editSize = edit->GetSize();
wxSize listSize =
wxSize ( clientSize.GetWidth(), clientSize.GetHeight() - editSize.GetHeight() );
if ( clientSize.IsFullySpecified() && editSize.IsFullySpecified() )
list->SetSize ( listSize );
#if wxCHECK_VERSION(2,9,0)
list->Update();
#else
sizer->Layout();
#endif
}
void InsertPanel::OnEnter ( wxCommandEvent& event )

View File

@ -61,7 +61,7 @@ LocationPanel::LocationPanel ( wxWindow *parentWindowParameter, int id ) :
structureEdit->SetIndentationGuides ( true );
sizer->Add ( edit, 0, wxGROW | wxTOP, 0 );
sizer->Add ( structureEdit, 0, wxGROW | wxTOP, 0 );
sizer->Add ( structureEdit, 1, wxGROW | wxTOP, 0 );
sizer->Layout();
structureEdit->Show ( false );
}
@ -91,15 +91,11 @@ void LocationPanel::update (
structureEdit->SetReadOnly ( false );
structureEdit->SetText ( structure );
structureEdit->SetReadOnly ( true );
wxSize clientSize = GetClientSize();
wxSize editSize = edit->GetSize();
wxSize structureSize =
wxSize ( clientSize.GetWidth(), clientSize.GetHeight() - editSize.GetHeight() );
if ( clientSize.IsFullySpecified() && editSize.IsFullySpecified() )
structureEdit->SetSize ( structureSize );
#if wxCHECK_VERSION(2,9,0)
structureEdit->Update();
#else
sizer->Layout();
#endif
}
else
{