Ejemplo n.º 1
0
 void UpdateLayout()
 {
     if (Child()) {
         InternalSetExpand(
             Child(),
             WinPoint(
                 XExpand() == 0 ? 0 : XExpand(),
                 YExpand() == 0 ? 0 : YExpand()
             )
         );
         Child()->UpdateLayout();
         InternalSetSize(WinPoint(
             Child()->XSize(),
             Child()->YSize()
         ));
         InternalSetOffset(Child(), WinPoint(0, 0));
     } else {
         InternalSetSize(
             WinPoint(
                 max(0, XExpand()),
                 max(0, YExpand())
             )
         );
     }
 }
Ejemplo n.º 2
0
    void UpdateLayout()
    {
        Update();

        InternalSetSize(
            WinPoint::Cast(GetImage()->GetBounds().GetRect().Size())
        );
        Pane::UpdateLayout();
    }
Ejemplo n.º 3
0
    void UpdateLayout()
    {
        InternalSetSize(
            WinPoint(
                max(m_ppainter->GetXSize(), m_sizeMin.X()),
                max(       GetExpand().Y(), m_sizeMin.Y())
            )
        );

        UpdateScrollBar();
    }
Ejemplo n.º 4
0
    GaugeValuePane(Surface* psurface, 
                Number* pnumber, Number* ptime,
                const Color& colorFlash,
                const Color& colorEmpty) :
        ValuePane(pnumber, ptime),
        m_psurface(psurface),
        m_colorFlash(colorFlash),
        m_colorEmpty(colorEmpty),
        m_minValue(0.0f),
        m_maxValue(1.0f),
        m_value(0),
        m_valueOld(0),
        m_valueFlash(0),
        m_timeLastChange(ptime->GetValue())
    {
        pnumber->Update();
        SetValue(pnumber->GetValue(), true);
        assert(m_psurface);
        assert(m_minValue < m_maxValue);

        InternalSetSize(m_psurface->GetSize());
        NeedPaint();
    }
Ejemplo n.º 5
0
    ListPaneOldImpl(WinPoint size, int nItemHeight, bool bScroll, Pane* ppane) :
        m_iSelItem(-1),
        m_iTopItem(0),
        m_nItemHeight(nItemHeight),
        m_bMouseSel(false)
    {
        m_nItemWidth = size.X();
        m_pEventSource = new IntegerEventSourceImpl();
        m_pRightClickEventSource = new IntegerEventSourceImpl();	// TE: Initialized RightClick event
        m_pDoubleClickEventSource = new IntegerEventSourceImpl();	// TE: Initialized RightClick event
        m_pMouseOverEventSource = new IntegerEventSourceImpl();
        m_pEventScroll = new EventSourceImpl();
        
        m_cVisibleItems = size.Y()/nItemHeight;
    
        TRef<RowPane> pRowPane = new RowPane();
        m_pBlankPane = new Pane();
        InternalSetSize(m_pBlankPane, size);
        pRowPane->InsertAtBottom(m_pBlankPane);

        // Add the scroll bar
        TRef<Modeler> pModeler = GetModeler();
        
        TRef<Image> pImageUp      = pModeler->LoadImage(AWF_CONTROL_UP_ARROW,            true);
        TRef<Image> pImageUpSel   = pModeler->LoadImage(AWF_CONTROL_SELECTED_UP_ARROW,   true);
        TRef<Image> pImageDown    = pModeler->LoadImage(AWF_CONTROL_DOWN_ARROW,          true);
        TRef<Image> pImageDownSel = pModeler->LoadImage(AWF_CONTROL_SELECTED_DOWN_ARROW, true);

        TRef<ButtonPane> pbuttonUp   = CreateButton(new ImagePane(pImageUp),   new ImagePane(pImageUpSel),   false, 0.1f, 0.5f);
        TRef<ButtonPane> pbuttonDown = CreateButton(new ImagePane(pImageDown), new ImagePane(pImageDownSel), false, 0.1f, 0.5f);

        if (bScroll) {
            m_pScrollPane =
                CreateScrollPane(
                    new ColumnPane(),//new BorderPane(0, MakeColorFromCOLORREF(TrekResources::BlackColor())),
                    ThumbPane::Create(pModeler, false, NULL),
                    pbuttonUp, pbuttonUp->GetEventSource(),
                    pbuttonDown, pbuttonDown->GetEventSource(),
                    false, 0.25f, 1, 1, 1, 1
                );

			// mdvalley: another pointer &ClassName
            AddEventTarget(&ListPaneOldImpl::OnScroll, m_pScrollPane->GetEventSource());
            m_pScrollPane->SetPageSize(m_cVisibleItems);
            m_pScrollPane->SetSize(0);
        
  
            m_pScrollBar = 
                //new EdgePane( new JustifyPane( JustifyPane::Center, WinPoint(17, size.Y()-2), m_pScrollPane));
                //new EdgePane( 
                m_pScrollPane;// );

            TRef<ColumnPane> pcol = new ColumnPane();

            if (ppane) {
                pcol->InsertAtBottom(ppane);
            }

            pcol->InsertAtBottom(m_pScrollBar);
            pcol->InsertAtBottom(new Pane(NULL, WinPoint(0, 8)));

            pRowPane->InsertAtBottom(pcol);
        }

        InsertAtBottom(pRowPane);
    }
Ejemplo n.º 6
0
 void UpdateLayout()
 {
     InternalSetSize(m_rect.Size());
     Pane::UpdateLayout();
 }
Ejemplo n.º 7
0
void Pane::SetSize(const WinPoint& point)
{
    InternalSetSize(point);
    NeedLayout();
}