Hledam autory pro tenhle blog.

Hledam autory pro tenhle blog.Pokud te bada bavi a programujes nebo zacinas tak nevahej a stan se autorem.

středa 13. dubna 2011

Nase prvni aplikace

Zdravim.
Konecne se dostavame k prvni aplikaci.Predem se omlouvam ze nepouzivam interpunkci, ale hacky, atd.me zbytecne zdrzujou.
Predpokladam, ze jste se uz seznamili s uzivatelskym prostredim SDK.
Nebudu tady vypisovat zakladni funkce, pokud nekdo nebude neco vedet at napise komentar a doplnim to.S SDK zacinam, takze navody delam podle mych,zkusenosti, takze necekejte ze budou na profesionalni urovni.Snad nekomu pomuzou v zacatcich.
Dost reci jdeme na nasi aplikaci.

Jako vsude jinde, tak i my zacneme s "Hello World" a pridame vypis textu po kliknuti na tlacitko.


Zvolime File>new>bada Apllication Project
Zadame nazev projektu treba:Test
Zvolime bada Form Based Application
Klikneme na Finish.














Vytvori se nam projekt, kterej obsahuje tlacitko ok.Vypalime projekt ctrl+B a spustime v simulatoru.
Pokud stlacime tlacitko "OK" tak v "Output"se nam vypise text >OK Button is clicked!
To same plati i pres testovani primo v mobilu pres USB.












Ted si ukazeme jak pridat dalsi tlacitko ktere po kliknut vypise nas text.
Dvakrat klikneme na >/Res/480x800/IDF_FORM1
Pak v pravo rozklikneme IDF_FORM1.Vidime ze tam mame pridane tlacitko>IDC_ButonOK

V Properties(viz.obrazek), muzeme zmenit barvu pozadi na treba cernou aby jsem to meli prehlednejsi.
Z nabidky ToolBox pridame nove tlacitko >Button, ktere se bude mit name IDC_BUTTON_1 a text nastavime TEST
Pridame Label IDC_LABEL1




Otevreme >inc>Form1.h a doplnime identifikaci tlacitka a Labelu.
// ID noveho tlacitka
static const int ID_BUTTON_TEST=102;
Osp::Ui::Controls::Button *__pButtonTEST;
// ukazatel na novy label
Osp::Ui::Controls::Label *__pLabel;



Otevreme >src>Form1.cpp a nadefinujeme tlacitko a label

//definice button a Label
__pLabel = static_cast<label *="">(GetControl(L"IDC_LABEL1"));
Button* pButton1 = static_cast<button *="">(GetControl (L"IDC_BUTTON_1"));
pButton1-&gt;SetActionId(ID_BUTTON_TEST);
pButton1-&gt;AddActionEventListener(*this);




Ted jeste musime nastavit akci co ma delat tlacitko po stlaceni v nasem pripade vypsat nas text.

case ID_BUTTON_TEST:
__pLabel->SetText(L"Huraa !!!");//nas text
this->RequestRedraw(true);
break;

Vypalime projekt ctrl+B a spustime simnulator

Po kliknut na tlacitko text nam vypise nas text.
Shrnuti:
Zalozime novy projekt,pridame novy button a label.
Nadefinujeme button a label.
Priradime akci buttonu po stlaceni.
Vypalime a otestujeme v simulatoru.
:)

Seznam Namespace Eng

Sice v Eng, ale myslim ze to je jasne :)

Osp /This namespace is the root namespace of bada
Osp::App /This namespace contains classes for application development
Osp::Base /This namespace contains classes and interfaces for basic features
Osp::Base::Collection /This namespace contains classes and interfaces for various collections
Osp::Base::Runtime /This namespace contains classes for running applications
Osp::Base::Utility /This namespace contains classes for various utilities
Osp::Commerce::Store /This namespace contains classes and interfaces for commerce-related services
Osp::Content /This namespace contains classes and interfaces for content management and search services
Osp::Device /This namespace contains the classes and interfaces for data synchronization and device management
Osp::Graphics /This namespace contains classes for drawing-related functionalities
Osp::Graphics::Opengl /This namespace contains interfaces for OpenGL(R)
Osp::Io /This namespace contains the classes and interfaces for basic I/O
Osp::Locales /This namespace contains classes that define culture-related information
Osp::Locations /This namespace contains classes and interfaces for location-related information and services
Osp::Locations::Controls /This namespace contains classes and interfaces for map-based services
Osp::Locations::Services /This namespace contains classes and interfaces for location-based services
Osp::Media /This namespace contains classes and interfaces for media processing services
Osp::Messaging /This namespace contains classes and interfaces for messaging services
Osp::Net /This namespace contains classes and interfaces for network account, connection and addressing utilities
Osp::Net::Bluetooth /This namespace contains classes and interfaces for Bluetooth services
Osp::Net::Http /This namespace contains classes and interfaces for HTTP 1.1 client programming
Osp::Net::Sockets /This namespace contains classes and interfaces for TCP or UDP socket programming
Osp::Net::Wifi /This namespace contains classes and interface for Wi-Fi management
Osp::Security/This namespace contains classes and interfaces for security services
Osp::Security::Cert /This namespace contains classes and interfaces for manipulating the X.509 digital certificate
Osp::Security::Crypto /This namespace contains classes and interfaces for cryptographic primitives
Osp::Social /This namespace contains classes and interfaces for managing the social information of the user
Osp::Social::Services /This namespace contains classes and interfaces for social-related services
Osp::System /This namespace contains classes and interfaces for System
Osp::Telephony /This namespace contains classes and interfaces of the Telephony service
Osp::Text /This namespace contains classes for representing character encoding and decoding
Osp::Ui /This namespace contains classes and interfaces that act as the UI foundation for your applications
Osp::Ui::Controls /This namespace contains classes and interfaces for creating rich user interface components for your applications
Osp::Uix /This namespace contains classes and interfaces for UI extension services
Osp::Web /This namespace contains classes and interfaces to interact with the browser engine
Osp::Web::Controls /This namespace contains classes and interfaces to interact with the browser engine
Osp::Xml /This namespace contains interfaces to manipulate XML documents