Metro style Apps in Windows 8


We have seen a lot of news from the past week. There is a new technology announced from Microsoft: Metro Style App and Windows Run Time. This is software platform under new Microsoft upcoming OS Windows 8, which can run on various hardware: PC, Notebook, Tablet and Phone. Great source about this can be found on http://www.buildwindows.com/ and related msdn web site. There are also plenty of sessions about all programming languages and platforms, so if you want to be uptodate with the latest Microsoft technologies don’t lose time, go to site and learn about new Metro style Apps and Windows 8.

I am going to show two diagrams which are very important, in order to understand how metro style apps and Windows Runtime stand in Windows 8 and what about existing .NET platform.

Arhitecture diagram of Windows 8 for developer perspective is shown here.

Windows 8 Architecture diagram

As can be see Windows Runtime is neither .NET nor a part of it. This is brand new platform natively supported by Windows 8. C# and VB are not exclusively .NET languages. By C# you can program .NET applications and Metro style App as well.

Regarding the Windows Runtime you can develop Windows 8 Metro style apps in several languages like C++, C# and VB, as well as JavaScript and HTML5. Every Metro style App goes through Language projection before access Windows Runtime and Windows 8 Core. Language projection has similar logic as IL in .NET but it is completely different technology.

The big thing is that every language supports asynchronous programming model which metro style applications gives responsiveness and better user experience.

You can also mix the JavaScript and C# components. Just make a C# components define it as WinMD file output type, include in JavaScript and HTML project and use it as ordinary JavaScript component. We can see this in further blog post. With WinMD file you can reuse some C# components and use them in HTML and JavaScript project.

Windows Runtime architecture

That’s all for the first blog post about new Windows 8 and Metro style app. In the next post we going to talk about WCF service and consuming it in Metro style apps.

Interview with famouswhy.com


Regarding my open source project ScreenPainter which I published on Code Project in 2004, several sites asked me if I could put my application on their site as a freeware software.

One of the site (famouswhy.com) send me request to make an interview with me, which you can see below or visit the link.

BHGridCtrl – Zadnja implementacija


Zadnja implementacija BHGridCtrl projekta, podrazumijevala je povezivanje tabela sa bazom podataka preko ADO. Zadnjom verzijom podaci koji se učitaju nije moguće vršiti modifikaciju. Za zadnji primjer potrebno je imati instaliran SQL server i NorthWind bazu podataka. Svi podaci u tabeli se mogu isprintati i implementirane su funkcije za printanje GridKontrole, zaglavlja i podnožja. Primjer sa zadnjom implementiranom verzijom BHGriCtrl možete skinuti sa ovog  linka. Primjer je kompajliran sa VS 2008.

BHGridCtrl -III dio. Implementacija spajanja ćelija (merge cells)


image

Implementacija spajanja ćelija u Grid kontroli nastavak je razvoja ove kontrole. Spajanje ćelija omogućeno je članom:

CArray<CBHCellRange, CBHCellRange&> m_MergedCellArray;

koji čuva infomacija o spojenim ćelijama. Manipulacija oko spajanja ćelija vrši se preko sljedećih metoda:

//Cell merge support
void UnMergedCells(int nStartRow, int nStartCol, int nEndRow,int nEndCol);
void   MergedCells(int nStartRow, int nStartCol, int nEndRow,int nEndCol);
CBHCellRange GetMergedRange(CCellID celMerged);

Prvom metodom rastavljamo jednu ćeliju na osnovne početne ćelije, dok s drugom metodom spajamo ćelije. U oba slučaja argumenti metoda se startne kolone i vrste.

Treća metoda GetMergedRange(CCelID cellMerged) – je metoda koja provjerava i vraća cjelokupan spojeni region u kojem se nalazi data ćelija, a koja je prosljeđena kao argument. U biti sve tri metode manipulišu poljem ćelija koji je definisan na početku.

Ćelije se mogu spajati bilo da se radi o zaleđenim ili standardnim kolonama ili vrstama. Jedino  se ne mogu spajati jedna zaleđena i druga obična ćelija.

Način na koji se iscrtavaju spojene ćelije je da se odredi širina i dužina ćelije, stim da se preko navedene metode (GetMergedRange) provjerava da li je dotična ćelija u sastavu grupe ćelija koje su spojene. Na taj način se prva u nizu ćelija iscrta, dok ostale ćelije u grupi spojenih ćelija se ne iscrtavaju.

Source code za ovu verziju možete skinuti ovdje.