Clipper On Line • Ver Tópico - HDroidGUI - It's a framework for Android.

HDroidGUI - It's a framework for Android.

Outras bibliotecas visuais e IDEs para Harbour/xHarbour (xHGTK/HbWxW/GtWvT/GtWvW/WvWtools.etc)

Moderador: Moderadores

 

HDroidGUI - It's a framework for Android.

Mensagempor Itamar M. Lins Jr. » 05 Mar 2015 22:48

Para usuários da Hwgui, pouca diferença na sintaxe.

It's a framework for Android, a tool designed to write in Harbour applications for Android based devices - just as HwGUI allows you to write in Harbour GUI applications for Windows and Linux. I even thought about it first, as about HwGUI for Android, but along the way decided that it is better to refuse from thoughts to provide compatibility on prg level with applications on other operating systems - too specific is and the Android platform, and it interface, and the nature of the devices that use Android. Take the size of mobile devices, which is unlikely to significantly change as technological advances - just add a normal keyboard, or double the size of the screen - and the device will simply cease to be mobile. Now, imagine how any familiar desktop application with a bunch of widgets will look at this device ... It is clear that the interface of the application will have to be rewritten to suit the standards of mobile devices. And if so, why should we care about full compatibility with GUI libraries for Windows and Linux ? Application code that uses HDroidGUI, in the part which is responsible for the interface will be different from the code of HwGUI applications, although I try to use the most similar syntax.

http://www.kresin.ru/en/hdroid.html
Avatar de usuário

Itamar M. Lins Jr.
Colaborador

Colaborador
 
Mensagens: 6927
Data de registro: 30 Mai 2007 11:31
Cidade/Estado: Ilheus Bahia
Curtiu: 309 vezes
Mens.Curtidas: 503 vezes

HDroidGUI - It's a framework for Android.

Mensagempor Itamar M. Lins Jr. » 05 Mar 2015 22:52

Novas emoções!!!

#include "hbmemvar.ch"
#include "hdroidgui.ch"

#define HISTORY_SIZE_MAX   32

FUNCTION HDroidMain

   LOCAL oActivity, oFont, oLayV, oLayH1, oBtn1, oBtn2, oBtn3, oEdit1, oText1
   PUBLIC aHistory, nHistLen, nHistCurr

   IF Valtype( aHistory ) != "A"
      aHistory := Array( HISTORY_SIZE_MAX )
      nHistLen := 0
      nHistCurr := 1
   ENDIF

   PREPARE FONT oFont HEIGHT 12
   INIT WINDOW oActivity TITLE "Calculator"

   MENU
      MENUITEM "Version" ACTION hd_MsgInfo(hd_Version()+Chr(10)+hb_Version())
      MENUITEM "Help" ACTION FHelp()
      MENUITEM "Exit" ACTION hd_calljava_s_v( "exit:")
   ENDMENU
      BEGIN LAYOUT oLayV BACKCOLOR "#FFFFFF" SIZE MATCH_PARENT,MATCH_PARENT

         EDITBOX oEdit1 HINT "Input an expression" ON KEYDOWN {|n|onKey(n,oEdit1,oText1)}
               
         BEGIN LAYOUT oLayH1 HORIZONTAL SIZE MATCH_PARENT,32

         BUTTON oBtn2 TEXT " < " TEXTCOLOR 255 SIZE WRAP_CONTENT,MATCH_PARENT FONT oFont ;
               ON CLICK {||onBtnHist(.T.,oEdit1)}
         BUTTON oBtn1 TEXT "Ok" TEXTCOLOR 255 SIZE 0,MATCH_PARENT FONT oFont ;
               ON CLICK {||onBtnCalc(oEdit1,oText1)}
         BUTTON oBtn3 TEXT " > " TEXTCOLOR 255 SIZE WRAP_CONTENT,MATCH_PARENT FONT oFont ;
               ON CLICK {||onBtnHist(.F.,oEdit1)}

         END LAYOUT oLayH1

         TEXTVIEW oText1 TEXTCOLOR 10485760 BACKCOLOR "#FFFFFF" SIZE MATCH_PARENT,MATCH_PARENT SCROLL
   
      END LAYOUT oLayV

   ACTIVATE WINDOW oActivity

   RETURN Nil

STATIC Function OnBtnHist( lBack, oEdit1 )

   IF lBack
      IF nHistCurr >= 2
         oEdit1:SetText( aHistory[--nHistCurr] )
      ENDIF
   ELSE
      IF nHistCurr < nHistLen
         oEdit1:SetText( aHistory[++nHistCurr] )
      ELSE
         nHistCurr := nHistLen + 1
         oEdit1:SetText( "" )
      ENDIF
   ENDIF

   RETURN "1"

STATIC Function OnBtnCalc( oEdit1, oText1 )
   LOCAL s, xRez, bOldError, lRes := .T., n, i, cname, cType
   STATIC aVars := Nil

   IF !Empty( aVars )
      FOR i := 1 to Len( aVars )
         __mvPublic( aVars[i,1] )
         __mvPut( aVars[i,1], aVars[i,2] )
      NEXT
      aVars := Nil
   ENDIF

   s := Alltrim( oEdit1:GetText() )
   IF Empty( s )
      RETURN "0"
   ENDIF

   bOldError := ErrorBlock( { |e|break( e ) } )
   BEGIN SEQUENCE
      xRez := &s
   RECOVER
      xRez := "Error..."
      lRes := .F.
   END SEQUENCE
   ErrorBlock( bOldError )

   oText1:SetText( Iif( xRez == Nil, "Nil", Iif( (cType:=Valtype(xRez))=="A", "Array", ;
         Iif( cType == "O", "Object", ;
         Transform( xRez, "@B" ) ) + Chr(10)+Chr(13) + oText1:GetText() ) ) )

   IF lRes
      IF nHistLen < HISTORY_SIZE_MAX
         aHistory[++nHistLen] := s
      ELSE
         Adel( aHistory, 1 )
         aHistory[nHistLen] := s
      ENDIF
      nHistCurr := nHistLen + 1
      IF ( n := __mvDbgInfo( HB_MV_PRIVATE_LOCAL ) ) > 0
         aVars := {}
         FOR i := 1 to n
            xRez := __mvDbgInfo( HB_MV_PRIVATE_LOCAL, i, @cname )
            Aadd( aVars, { cname, xRez } )
         NEXT
      ENDIF
   ENDIF

   RETURN "1"

STATIC Function OnKey( nKey, oEdit1, oText1 )

   IF nKey == 66
      RETURN OnBtnCalc( oEdit1, oText1 )
   ENDIF

   RETURN "0"

STATIC Function FHelp()
   Local oWnd, oLayV, oText1
   Local s := "Calculator help" + Chr(10) + Chr(10) + ;
      "Use '<' and '>' buttons to navigate via calculattions history." + Chr(10) + Chr(10) + ;
      "You may create variables, assigning values to them, and then use in expressions:"+ Chr(10) + ;
      "   arr := Directory()" + Chr(10) + ;
      "   Len(arr)"

   INIT WINDOW oWnd TITLE "Help"

      BEGIN LAYOUT oLayV BACKCOLOR "#FFFFFF" SIZE MATCH_PARENT,MATCH_PARENT

         TEXTVIEW oText1 TEXT s TEXTCOLOR 10485760 BACKCOLOR "#FFFFFF" SIZE MATCH_PARENT,MATCH_PARENT SCROLL
   
      END LAYOUT oLayV

   ACTIVATE WINDOW oWnd

   RETURN "1"


Saudações,
Itamar M. Lins Jr.
Avatar de usuário

Itamar M. Lins Jr.
Colaborador

Colaborador
 
Mensagens: 6927
Data de registro: 30 Mai 2007 11:31
Cidade/Estado: Ilheus Bahia
Curtiu: 309 vezes
Mens.Curtidas: 503 vezes




Retornar para Outras Bibliotecas Visuais e IDEs

Quem está online

Usuários vendo este fórum: Nenhum usuário registrado online e 7 visitantes


Ola Amigo, espero que meu site e forum tem lhe beneficiado, com exemplos e dicas de programacao.
Entao divulgue o link da Doacao abaixo para seus amigos e redes sociais ou faça uma doacao para o site forum...
MUITO OBRIGADO PELA SUA DOACAO!
Faça uma doação para o forum
cron
v
Olá visitante, seja bem-vindo ao Fórum Clipper On Line!
Efetue o seu login ou faça o seu Registro