Exemple #1
0
Pane::Pane(Pane* pchild, const WinPoint& size) :
    m_index(0),
    m_pparent(NULL),
    m_paintSize(0, 0),
    m_paintOffset(0, 0),
    m_bHiddenPaint(false),
    m_offset(0, 0),
    m_expand(0, 0),
    m_size(size),
    m_bHidden(false),
    m_bXExpandable(true),
    m_bYExpandable(true),
    m_bSelected(false),
	m_bOpaque(false),
    m_bPaintAll(true),
    m_bNeedPaint(true),
	m_dwDataSize( 0 ),
	m_pPaneVerts( NULL )
//	m_dwFillVertsDataSize( 0 ),
//	m_pFillVerts( NULL )
{
    if (pchild) {
        InsertAtBottom(pchild);
    }
}
//O(n^2) time and O(n) space complexity
//Reverse stack using only push pop, you are not alloweded to use any other stack
int ReverseStack(struct SimpleStack *s){

    if(IsStackEmpty(s)){
       return ;
    }
    int data = Pop(s);
    ReverseStack(s);
    InsertAtBottom(s,data);
}
Exemple #3
0
void Reverse(Node** stack){
    if(StackEmpty(*stack)){
    return;
    }
int tmpData=Pop(&(*stack));

Reverse(&(*stack));

InsertAtBottom((*stack),tmpData);

}
Exemple #4
0
    TabPaneImpl() :
        m_nPaneIDCurrent(-1),
        m_fShowSelPane(false)
    {
        m_pColumnPane = new ColumnPane();
        m_pButtonBarPane = CreateButtonBarPane(true);
        m_pColumnPane->InsertAtBottom(m_pButtonBarPane);
        InsertAtBottom(m_pColumnPane);
        m_pEventSource = new IntegerEventSourceImpl();
		// mdvalley: Pointer, class name
        AddEventTarget(&TabPaneImpl::OnSelectTab, m_pButtonBarPane->GetEventSource());
    }
void InsertAtBottom(struct SimpleStack *s, int d ){

    if(IsStackEmpty(s)){
        Push(s,d);
        return;
    }
    else{
        int temp = Pop(s);
        InsertAtBottom(s,d);
        Push(s,temp);
    }
}
Exemple #6
0
    ChatListPaneImpl(const WinPoint& ptSize):
        m_ptItemSize(ptSize.X(), 12), m_bAutoscroll(true), m_bIgnoreScrollingEvents(false)
    {
        m_bPlayerChatsOnly = true;
        m_pListPane = ListPaneOld::Create(ptSize, 12, true, NULL),
        InsertAtBottom(m_pListPane);
		//mdvalley: I hate C3867.
        AddEventTarget(&ChatListPaneImpl::OnListSelect, m_pListPane->GetEventSource());
        AddEventTarget(&ChatListPaneImpl::OnScroll, m_pListPane->GetScrollEvent());
        UpdateContents();
        m_keyboardDelegate = IKeyboardInput::CreateDelegate(this);
        GetWindow()->AddKeyboardInputFilter(m_keyboardDelegate);
    }
Exemple #7
0
void InsertAtBottom(Node* stack,int data){

if(StackEmpty(stack)){
Push(&stack,data);
return;
}

int tmpData=Pop(&stack);
InsertAtBottom(stack,data);
Push(&stack,tmpData);


}
Exemple #8
0
    void UpdatePane()
    {
        TRef<Pane> pPane;
        
        if (!m_mapPanes.Find(m_nValueCurrent, pPane))
            pPane = m_pPaneDefault;

        if (pPane != m_pPaneCurrent)
        {
            if (m_pPaneCurrent)
                RemoveChild(m_pPaneCurrent);
            if (pPane)
                InsertAtBottom(pPane);
            m_pPaneCurrent = pPane;
        }
    }
Exemple #9
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);
    }
Exemple #10
0
    SelectionPane(IEventSource* peventSourceOnSelChange)
    {
        InsertAtBottom(m_prowPane = new RowPane());
		// mdvalley: needs pointer and class.
        AddEventTarget(&SelectionPane::OnSelChange, peventSourceOnSelChange);
    }
Exemple #11
0
    HelpPaneImpl(Modeler* pmodeler, const ZString& strTopic, PagePaneIncluder* ppagePageIncluder) :
        m_pmodeler(pmodeler)
    {
        //
        // Exports
        //

		m_pmodeler->SetColorKeyHint( true );

        m_pnsData = pmodeler->CreateNameSpace("helpdata");

        //
        // Exports
        //

        m_pns = pmodeler->GetNameSpace("helppane");

        //
        // The Help pane
        //

        TRef<Pane> ppane;
        CastTo(ppane, m_pns->FindMember("helpPane"));
        InsertAtBottom(ppane);

        //
        // Buttons
        //

        CastTo(m_pbuttonBack, m_pns->FindMember("backButton"   ));
		// mdvalley: OnButtonBack now pointered and with class named.
		AddEventTarget(&HelpPaneImpl::OnButtonBack, m_pbuttonBack->GetEventSource());

        CastTo(m_pbuttonClose, m_pns->FindMember("closeButton"));

        //
        // Default attributes
        //

        TRef<FontValue>  pfont;
        TRef<ColorValue> pcolor;
        TRef<ColorValue> pcolorMain;
        TRef<ColorValue> pcolorSecondary;
        TRef<ColorValue> pcolorHighlight;

        CastTo(pfont,           m_pns->FindMember("helpFont"          ));
        CastTo(pcolor,          m_pns->FindMember("helpColor"         ));
        CastTo(pcolorMain,      m_pns->FindMember("mainLinkColor"     ));
        CastTo(pcolorSecondary, m_pns->FindMember("secondaryLinkColor"));
        CastTo(pcolorHighlight, m_pns->FindMember("highlightColor"    ));

        //
        // The Nav pane
        //

        CastTo(m_pnavPane,       m_pns->FindMember("navPane"      ));

        //
        // PagePanes
        //

        CastTo(m_ppageMain,      m_pns->FindMember("mainPage"     ));
        CastTo(m_ppageSecondary, m_pns->FindMember("secondaryPage"));

        m_ppageMain->SetAttributes(
            pfont->GetValue(),
            pcolor->GetValue(),
            pcolorMain->GetValue(),
            pcolorSecondary->GetValue(),
            pcolorHighlight->GetValue()
        );

        m_ppageSecondary->SetAttributes(
            pfont->GetValue(),
            pcolor->GetValue(),
            pcolorMain->GetValue(),
            pcolorSecondary->GetValue(),
            pcolorHighlight->GetValue()
        );

        //
        // Includer
        //

        m_ppageMain     ->SetPagePaneIncluder(ppagePageIncluder);
        m_ppageSecondary->SetPagePaneIncluder(ppagePageIncluder);

        //
        // Scroll Bars
        //

        CastTo(m_pscrollMain,      (Pane*)m_pns->FindMember("mainPageScrollBar"));
        CastTo(m_pscrollSecondary, (Pane*)m_pns->FindMember("secondaryPageScrollBar"));
        
        //
        // Sink topic event
        //

        TRef<MainSink> psinkMain = new MainSink(this);

        m_ppageMain     ->GetMainLinkEventSource()->AddSink(psinkMain);
        m_ppageSecondary->GetMainLinkEventSource()->AddSink(psinkMain);
        m_pnavPane      ->GetEventSource()        ->AddSink(psinkMain);

        TRef<SecondarySink> psinkSecondary = new SecondarySink(this);

        m_ppageMain     ->GetSecondaryLinkEventSource()->AddSink(psinkSecondary);
        m_ppageSecondary->GetSecondaryLinkEventSource()->AddSink(psinkSecondary);

        //
        // Set the initial page
        //

        SetTopic(strTopic);
    }