예제 #1
0
//Resize logics
void ExpandoTextCtrl::AdjustCtrl(long newHeight) {

    //If the required height is more than the maxHieght, decrease it to that
    if(maxHeight != -1 && newHeight > maxHeight) {
        newHeight = maxHeight;
    }

    //If the required height is less than the minHieght, increase it to that
    if(minHeight != -1 && newHeight < minHeight) {
        newHeight = minHeight;
    }

    decHeight = newHeight;

    SetMinSize(wxSize(GetMinSize().GetWidth(), newHeight));

    //If requested height between min and max height, resize the Expando
    if(newHeight != GetSize().GetHeight()) {

        bool hasSizer = GetContainingSizer() != NULL;

        if(!hasSizer) {
            SetSize(GetSize().GetWidth(), newHeight);
        }

        //Throw a LayoutNeeded Event
        wxExpandEvent evt(wxEVT_ETC_LAYOUT_NEEDED, GetId());
        evt.SetEventObject(this);
        evt.height = newHeight;
        evt.numLines = GetNumberOfLines();
        GetEventHandler()->ProcessEvent(evt);
    }
}
예제 #2
0
void TimelinePanel::addChild(Effect* effect) {
  EffectPanel* child = new EffectPanel(scrollMe, effect, isConstant, this, wxID_ANY);
  effectBox->Add(child, wxSizerFlags(0).Expand().Center());
  children.push_back(child);
  
  if (speedBox != 0) speedBox->Show(true);
  if (children.size() >= NUM_EFFECT_TYPES) addButton->Show(false);
  GetContainingSizer()->SetVirtualSizeHints(GetParent());
}
예제 #3
0
파일: infobar.cpp 프로젝트: 3v1n0/wxWidgets
wxInfoBarGeneric::BarPlacement wxInfoBarGeneric::GetBarPlacement() const
{
    wxSizer * const sizer = GetContainingSizer();
    if ( !sizer )
        return BarPlacement_Unknown;

    const wxSizerItemList& siblings = sizer->GetChildren();
    if ( siblings.GetFirst()->GetData()->GetWindow() == this )
        return BarPlacement_Top;
    else if ( siblings.GetLast()->GetData()->GetWindow() == this )
        return BarPlacement_Bottom;
    else
        return BarPlacement_Unknown;
}
예제 #4
0
void TimelinePanel::destroyChild(EffectPanel* child) {
  std::vector<EffectPanel*>::iterator iter = children.begin();
  for (; iter != children.end(); iter++) {
    if (*iter == child) {
      children.erase(iter);
      break;
    }
  }
  child->Destroy();
  
  if (children.size() <= 0 && speedBox != 0) speedBox->Show(false);
  addButton->Show(true);
  GetContainingSizer()->SetVirtualSizeHints(GetParent());
}
예제 #5
0
wxInfoBarGeneric::BarPlacement wxInfoBarGeneric::GetBarPlacement() const
{
    wxSizer * const sizer = GetContainingSizer();
    if ( !sizer )
        return BarPlacement_Unknown;

    // FIXME-VC6: can't compare "const wxInfoBarGeneric *" and "wxWindow *",
    //            so need this workaround
    wxWindow * const self = const_cast<wxInfoBarGeneric *>(this);
    const wxSizerItemList& siblings = sizer->GetChildren();
    if ( siblings.GetFirst()->GetData()->GetWindow() == self )
        return BarPlacement_Top;
    else if ( siblings.GetLast()->GetData()->GetWindow() == self )
        return BarPlacement_Bottom;
    else
        return BarPlacement_Unknown;
}