/*
* HelloWorldAppView.h
*
* Plik wygenerowany przez rodowisko programistyczne Carbide 2.0
* Modyfikacje: Pawe Gala
*/

 
#ifndef __HELLOWORLDAPPVIEW_h__
#define __HELLOWORLDAPPVIEW_h__

#include <coecntrl.h>


class CHelloWorldAppView : public CCoeControl
    {
public:
    static CHelloWorldAppView* NewL(const TRect& aRect);
    static CHelloWorldAppView* NewLC(const TRect& aRect);

    virtual ~CHelloWorldAppView();

public:
    // Metody z klasy bazowej
    void Draw(const TRect& aRect) const;
    virtual void SizeChanged();
    virtual void HandlePointerEventL(const TPointerEvent& aPointerEvent);

private:
    void ConstructL(const TRect& aRect);
    CHelloWorldAppView();
    };

#endif // __HELLOWORLDAPPVIEW_h__


/*
* HelloWorldAppView.cpp
*
* Plik wygenerowany przez rodowisko programistyczne Carbide 2.0
* Modyfikacje: Pawe Gala
*/

#include <coemain.h>
#include "HelloWorldAppView.h"


CHelloWorldAppView* CHelloWorldAppView::NewL(const TRect& aRect)
    {
    CHelloWorldAppView* self = CHelloWorldAppView::NewLC(aRect);
    CleanupStack::Pop(self);
    return self;
    }

CHelloWorldAppView* CHelloWorldAppView::NewLC(const TRect& aRect)
    {
    CHelloWorldAppView* self = new (ELeave) CHelloWorldAppView;
    CleanupStack::PushL(self);
    self->ConstructL(aRect);
    return self;
    }

void CHelloWorldAppView::ConstructL(const TRect& aRect)
    {
    // Utworzenie okna dla kontrolki widoku
    CreateWindowL();

    // Ustawienie rozmiaru widoku
    SetRect(aRect);

    // Aktywowanie widoku - od tej chwili widok bdzie gotowy do narysowania.
    ActivateL();
    }
    
CHelloWorldAppView::CHelloWorldAppView()
    {
    }

CHelloWorldAppView::~CHelloWorldAppView()
    {
    }

void CHelloWorldAppView::Draw(const TRect& /*aRect*/) const
    {
    CWindowGc& gc = SystemGc();

    // Czyszczenie obszaru widoku (uyte zostan standardowe kolory
    // rodowiska uruchomieniowego).
    TRect drawRect(Rect());
    gc.Clear(drawRect);
    }
    
void CHelloWorldAppView::SizeChanged()
    {
   // Zmieni si rozmiar obszaru widoku. W takiej sytuacji
   // naley ponownie narysowa jego zawarto.
    DrawNow();
    }

void CHelloWorldAppView::HandlePointerEventL(const TPointerEvent& aPointerEvent)
    {
    // W tym miejscu mona wykona czynnoci przygotowawcze do
    // obsuenia zdarzenia zwizanego ze wskanikiem wywietlacza.

    // Wywoanie metody z klasy bazowej
    CCoeControl::HandlePointerEventL(aPointerEvent);
    }
