Page 2 of 5

Re: Windows 8 Metro style - A Class TMetro test

PostPosted: Fri Sep 23, 2011 3:05 pm
by Antonio Linares
Enhanced version:

metro2.prg
Code: Select all  Expand view
#include "FiveWin.ch"
#include "xbrowse.ch"

function Main()

   local oWnd, oFont, oBrw, oFont2
   local aItems := { "Personalize", "Users", "Wireless" }
   
   DEFINE FONT oFont NAME "Segoe UI Light" SIZE 0, -52    

   DEFINE FONT oFont2 NAME "Segoe UI Light" SIZE 0, -32    

   DEFINE WINDOW oWnd STYLE nOr( WS_POPUP, WS_VISIBLE ) ;
      COLOR RGB( 170, 170, 170 ), CLR_WHITE
     
   @ 2, 10 SAY "Control Panel" FONT oFont SIZE 300, 100
   
   @ 2, 80 SAY "Personalize" FONT oFont SIZE 300, 100
     
   @ 10, 7 XBROWSE oBrw ARRAY aItems COLSIZES 800 CELL ;
      FONT oFont2 SIZE 400, 650 NOBORDER OF oWnd
     
   oBrw:nDataLines = 2  
   oBrw:lRecordSelector = .F.
   oBrw:lHeader   = .F.
   oBrw:lHScroll  = .F.
   oBrw:lVScroll  = .F.
   oBrw:nStretchCol = 1
   oBrw:bClrStd = { || { RGB( 170, 170, 170 ), CLR_WHITE } }
   oBrw:bClrSelFocus = { || { CLR_WHITE, RGB( 34, 177, 76 ) } }
   oBrw:SetColor( "B/W*" )
   
   oBrw:CreateFromCode()
   oBrw:SetFocus()
   
   ACTIVATE WINDOW oWNd MAXIMIZED ;
      ON CLICK oWnd:End()
     
return nil        


Image

Re: Windows 8 Metro style - A Class TMetro test

PostPosted: Fri Sep 23, 2011 3:11 pm
by norberto
Antonio, right, nice job.

Called from: => LEN(0)
Called from: BAR.prg => GRADIENTFILL(908)

thanks

Re: Windows 8 Metro style - A Class TMetro test

PostPosted: Fri Sep 23, 2011 5:16 pm
by Antonio Linares
better... :-)

Image

metro2.prg
Code: Select all  Expand view
#include "FiveWin.ch"
#include "xbrowse.ch"

function Main()

   local oWnd, oFont, oBrw, oFont2, oFont3
   local aItems := { "Personalize", "Users", "Wireless" }
   
   DEFINE FONT oFont NAME "Segoe UI Light" SIZE 0, -52    

   DEFINE FONT oFont2 NAME "Segoe UI Light" SIZE 0, -32    

   DEFINE FONT oFont3 NAME "Segoe UI Light" SIZE 0, -16    

   DEFINE WINDOW oWnd STYLE nOr( WS_POPUP, WS_VISIBLE ) ;
      COLOR RGB( 170, 170, 170 ), CLR_WHITE
     
   @ 2, 10 SAY "Control Panel" FONT oFont SIZE 300, 100
   
   @ 2, 80 SAY "Personalize" FONT oFont SIZE 300, 100
     
   @ 10, 7 XBROWSE oBrw ARRAY aItems COLSIZES 800 CELL ;
      FONT oFont2 SIZE 400, 650 NOBORDER OF oWnd
     
   oBrw:nDataLines = 2  
   oBrw:lRecordSelector = .F.
   oBrw:lHeader   = .F.
   oBrw:lHScroll  = .F.
   oBrw:lVScroll  = .F.
   oBrw:nStretchCol = 1
   oBrw:bClrStd = { || { RGB( 170, 170, 170 ), CLR_WHITE } }
   oBrw:bClrSelFocus = { || { CLR_WHITE, RGB( 34, 177, 76 ) } }
   oBrw:SetColor( "B/W*" )
   
   oBrw:CreateFromCode()
   oBrw:aCols[ 1 ]:bPaintText = { | oCol, hDC, cText, aCoors, aColors, lHighlight | DrawRow( oCol, hDC, cText, aCoors, oFont3 )  }
   oBrw:SetFocus()
   
   ACTIVATE WINDOW oWNd MAXIMIZED ;
      ON CLICK oWnd:End()
     
return nil        

function DrawRow( oCol, hDC, cText, aCoors, oFont )

   local hOldFont
   local aItems := { "Customize your lock screen and user tile",;
                     "Change your account or add new ones",;
                     "Choose if apps notify you" }

   DrawText( hDC, cText, aCoors )
   aCoors[ 1 ] += 45
   hOldFont = SelectObject( hDC, oFont:hFont )
   DrawText( hDC, aItems[ oCol:oBrw:KeyNo ], aCoors )
   SelectObject( hDC, hOldFont )
   
return nil  

Re: Windows 8 Metro style - A Class TMetro test

PostPosted: Fri Sep 23, 2011 5:31 pm
by Antonio Linares
Image

Code: Select all  Expand view
#include "FiveWin.ch"
#include "xbrowse.ch"

function Main()

   local oWnd, oFont, oBrw, oFont2, oFont3
   local aItems := { "Personalize", "Users", "Wireless", "Notifications", "Privacy", "General", "Search" }
   
   DEFINE FONT oFont NAME "Segoe UI Light" SIZE 0, -52    

   DEFINE FONT oFont2 NAME "Segoe UI Light" SIZE 0, -32    

   DEFINE FONT oFont3 NAME "Segoe UI Light" SIZE 0, -16    

   DEFINE WINDOW oWnd STYLE nOr( WS_POPUP, WS_VISIBLE ) ;
      COLOR RGB( 170, 170, 170 ), CLR_WHITE
     
   @ 2, 10 SAY "Control Panel" FONT oFont SIZE 300, 100
   
   @ 2, 80 SAY "Personalize" FONT oFont SIZE 300, 100
     
   @ 9, 7 XBROWSE oBrw ARRAY aItems COLSIZES 800 CELL ;
      FONT oFont2 SIZE 400, 700 NOBORDER OF oWnd
     
   oBrw:nDataLines = 2  
   oBrw:lRecordSelector = .F.
   oBrw:lHeader   = .F.
   oBrw:lHScroll  = .F.
   oBrw:lVScroll  = .F.
   oBrw:nStretchCol = 1
   oBrw:bClrStd = { || { RGB( 170, 170, 170 ), CLR_WHITE } }
   oBrw:bClrSelFocus = { || { CLR_WHITE, RGB( 34, 177, 76 ) } }
   oBrw:SetColor( "B/W*" )
   
   oBrw:CreateFromCode()
   oBrw:aCols[ 1 ]:bPaintText = { | oCol, hDC, cText, aCoors, aColors, lHighlight | DrawRow( oCol, hDC, cText, aCoors, oFont3 )  }
   oBrw:SetFocus()
   
   ACTIVATE WINDOW oWNd MAXIMIZED ;
      ON CLICK oWnd:End()
     
return nil        

function DrawRow( oCol, hDC, cText, aCoors, oFont )

   local hOldFont
   local aItems := { "Customize your lock screen and user tile",;
                     "Change your account or add new ones",;
                     "Turn wireless and airplane mode on or off",;
                     "Choose if apps notify you",;
                     "Control how apps use your personal info",;
                     "Change time zone and keyboard settings",;
                     "Pick what/where you want to search" }

   DrawText( hDC, cText, aCoors )
   aCoors[ 1 ] += 45
   hOldFont = SelectObject( hDC, oFont:hFont )
   DrawText( hDC, aItems[ oCol:oBrw:KeyNo ], aCoors )
   SelectObject( hDC, hOldFont )
   
return nil  

Re: Windows 8 Metro style - A Class TMetro test

PostPosted: Fri Sep 23, 2011 8:29 pm
by Otto
Hello Norberto,

>Win32 aplications runs in desktop mode in windows 8.(old start menu).
What do you mean by that? I have WINHOTEL in a metro UI tile. So I can start the program from the MetroUI.

I am playing around with windows 8 on a desktop PC with mouse and on a notebook with touch screen.
I like the new design.
But I think it is not clear at the moment how a real working program ( WORD, EXCEL, Outlook or other applications will look in future ). So I think it is an excellent start if we can try to design programs now with Antonio’s help in windows 8 look.
Maybe MetroUI is only used by WINDOWS and not for own programs but the “Control Panel” style will be everywhere.

I also feel that Ribbonbar does not fit any more to the new Metro design. Although Windows Explorer is new in Windows 8 it doesn’t look – for me – modern. Otherwise the new Internet Explorer is very attractive.
Best regards,
Otto

Re: Windows 8 Metro style - A Class TMetro test

PostPosted: Fri Sep 23, 2011 8:41 pm
by norberto
Otto, You can see in Building windows 8 blog, http://blogs.msdn.com/b/b8/ , but i read in several places: you can make appl to metro UI (native) , but only in Html5 + Java, pehaps it change in final version.
Ribbonbar is incorporated in Explorer, and improved.

regards

Norberto

Re: Windows 8 Metro style - A Class TMetro test

PostPosted: Fri Sep 23, 2011 8:57 pm
by Antonio Linares
Otto,

I have WINHOTEL in a metro UI tile. So I can start the program from the MetroUI


Could you please explain how you did it ? Is there a video or step by step explanation ? It may be quite simple but I wasn't aware to do it :-)

Re: Windows 8 Metro style - A Class TMetro test

PostPosted: Fri Sep 23, 2011 9:02 pm
by norberto
Otto , i can put my appl in metro UI too, but like an link, not an metro UI native, Metro UI is immersive.

Office 15 is in Metro UI style :

Image

Re: Windows 8 Metro style - A Class TMetro test

PostPosted: Fri Sep 23, 2011 9:15 pm
by norberto
HI, in picture, we can see two types of appl :metro UI appl and desktop appl, some people says to interact with metro UI tiles, only in Html5+java.

FWH appl will run in windows 8, but like desktop appl, i can put it in metro UI, but in static tile, not interactive Tile.

Image

pehaps this change until final version.

Re: Windows 8 Metro style - A Class TMetro test

PostPosted: Fri Sep 23, 2011 9:50 pm
by Rick Lipkin
To All

Just curious if Win 8 still supports ADO ? as in sqloledb ?? without the need for the dot net framework ?

Rick Lipkin

Re: Windows 8 Metro style - A Class TMetro test

PostPosted: Sat Sep 24, 2011 3:28 pm
by James Bott
This is a good article on the subject.

Microsoft's Metro proves the PC is dead
http://www.zdnet.com/blog/perlow/microsofts-metro-proves-the-pc-is-dead/18705

The title is somewhat misleading. It might be better as "Microsoft's Metro proves the Win32 API is dead." If you read between the lines it implies that we are going full circle back to the mainframe era where all data resides on a large computer (in the "cloud") and we access it using PC's (desktops, notebooks, tablets, smart-phones) instead of the old dumb terminals we used to have.

Regards,
James

Re: Windows 8 Metro style - A Class TMetro test

PostPosted: Sat Sep 24, 2011 3:50 pm
by James Bott
Also see this article:

WinRT Is Replacing Win32
http://www.winsupersite.com/blog/supersite-blog-39/windows8/winrt-replacing-win32-140605

Add be sure to read the comments at the end. One programmer says that WinRT is still using Win32 DLLs, but if you code to WinRTs API, then this frees Microsoft to later eliminate the Win32 DLLs.

Also there is mention that Metro Apps will only be allowed to be sold through a MS store and they will have to be approved by MS, all just the same as Apple. I don't like it.

Regards,
James

Re: Windows 8 Metro style - A Class TMetro test

PostPosted: Sat Sep 24, 2011 4:12 pm
by Bayron
I think is time to think about it, but is not to worry about it...

As you know, there is many people that has not migrated from WinXP to Win7, regarless of many advantages... I think the same will happen to this new technology, It will win at the end, but not without war, and after many years...

Right now it will take more than a year just to come out, and I guess more than 10 years to be fully acepted.

In the mean time (x)Harbour and FiveWin, will have the time to port from Win32 to WinRT for the END OF THE DAYS of Win32...

We may or not may be there at first, but we will there to stay....

EDITED:
You won't beleive how many people have DOS app's still working...

Rick: Is my understanding that
Win8 supports Win32 still == Will support our app's as they are (NOT IN METRO)
Next Windows will only support WinRT == We may have a problem without porting our app's ...

Re: Windows 8 Metro style - A Class TMetro test

PostPosted: Sat Sep 24, 2011 5:19 pm
by Otto
Hello Antonio,
To show my program in MetroUI I did:

1) First I made a desktop Shortcut.
In my case this is located in c:\users\demo\desktop\winhotel- Shortcut.lnk
2) I created a folder WINHOTEL in
c:\users\demo\appData\roaming\microsodt\windows\Start menu\Programs
3) I copied the winhotel-shortcut.lnk to this new folder.

Then if you open the MetroUI again your application is there.

Best regards,
Otto

Re: Windows 8 Metro style - A Class TMetro test

PostPosted: Sat Sep 24, 2011 5:37 pm
by Bayron
Good work Otto!!!

The Metro UI sounded only like a Menu, so it had to be a way!!!