FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Windows 8 Metro style - A Class TMetro test
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Windows 8 Metro style - A Class TMetro test
Posted: Fri Sep 23, 2011 03:05 PM
Enhanced version:

metro2.prg
Code (fw): Select all Collapse
#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


regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 566
Joined: Thu Aug 30, 2007 03:40 PM
Re: Windows 8 Metro style - A Class TMetro test
Posted: Fri Sep 23, 2011 03:11 PM

Antonio, right, nice job.

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

thanks

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Windows 8 Metro style - A Class TMetro test
Posted: Fri Sep 23, 2011 05:16 PM
better... :-)



metro2.prg
Code (fw): Select all Collapse
#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
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Windows 8 Metro style - A Class TMetro test
Posted: Fri Sep 23, 2011 05:31 PM


Code (fw): Select all Collapse
#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
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Windows 8 Metro style - A Class TMetro test
Posted: Fri Sep 23, 2011 08:29 PM

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

Posts: 566
Joined: Thu Aug 30, 2007 03:40 PM
Re: Windows 8 Metro style - A Class TMetro test
Posted: Fri Sep 23, 2011 08:41 PM

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

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Windows 8 Metro style - A Class TMetro test
Posted: Fri Sep 23, 2011 08:57 PM
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 :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 566
Joined: Thu Aug 30, 2007 03:40 PM
Re: Windows 8 Metro style - A Class TMetro test
Posted: Fri Sep 23, 2011 09:02 PM
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 :

Posts: 566
Joined: Thu Aug 30, 2007 03:40 PM
Re: Windows 8 Metro style - A Class TMetro test
Posted: Fri Sep 23, 2011 09:15 PM
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.



pehaps this change until final version.
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Windows 8 Metro style - A Class TMetro test
Posted: Fri Sep 23, 2011 09:50 PM

To All

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

Rick Lipkin

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Windows 8 Metro style - A Class TMetro test
Posted: Sat Sep 24, 2011 03:28 PM
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
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Windows 8 Metro style - A Class TMetro test
Posted: Sat Sep 24, 2011 03:50 PM
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
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM
Re: Windows 8 Metro style - A Class TMetro test
Posted: Sat Sep 24, 2011 04:12 PM

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 ...

=====>

Bayron Landaverry
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala

FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10

FiveWin, One line of code and it's done...

Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Windows 8 Metro style - A Class TMetro test
Posted: Sat Sep 24, 2011 05:19 PM

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

Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM
Re: Windows 8 Metro style - A Class TMetro test
Posted: Sat Sep 24, 2011 05:37 PM

Good work Otto!!!

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

=====>

Bayron Landaverry
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala

FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10

FiveWin, One line of code and it's done...