FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Visual Objects UDC en FiveWin :-)
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Visual Objects UDC en FiveWin :-)
Posted: Thu Oct 11, 2012 03:18 PM
Original implementación en VO:


udc.prg
Code (fw): Select all Collapse
#include "FiveWin.ch"

function Main()

   local oDlg, oGet, oFont 
   local cUDC, cTest, cResult := Space( 500 )  

   DEFINE FONT oFont NAME "Courier New" SIZE 0, -16

   cUDC = PadR( "RENAME DATAFIELD <x> AS <y> ALIAS <a> => " + ;
                "<a>->( DbFieldInfo( DBS_ALIAS, FieldPos( <x> ), <y> ) )", 500 )

   cTest := PadR( 'RENAME DATAFIELD "class" AS "_class" ALIAS Test', 500 )

   SetDlgGradient( { { 1, RGB( 199, 216, 237 ), RGB( 237, 242, 248 ) } } )

   DEFINE DIALOG oDlg TITLE "UDC Tester" ;
      SIZE 500, 500

   @ 1,   1.5 SAY "UDC" OF oDlg SIZE 80, 8
   
   @ 2,     1 GET oGet VAR cUDC MEMO SIZE 235, 50 FONT oFont
   
   oGet:bGotFocus = { || oGet:SetSel( 0, 0 ) }
   
   @ 5.5, 1.5 SAY "Test code" OF oDlg SIZE 80, 8

   @ 7.2,   1 GET cTest MEMO SIZE 235, 50 FONT oFont

   @ 10,  1.5 SAY "Resulting code" OF oDlg SIZE 80, 8

   @ 12.5,  1 GET cResult MEMO SIZE 235, 50 UPDATE FONT oFont

   @ 12.5,  5 BUTTON "Save" OF oDlg SIZE 45, 13

   @ 12.5, 17 BUTTON "Test" OF oDlg SIZE 45, 13 ;
      ACTION ( Test( cUDC, cTest, @cResult ), oDlg:Update() )

   @ 12.5, 29 BUTTON "Exit" OF oDlg SIZE 45, 13 ACTION oDlg:End()

   ACTIVATE DIALOG oDlg CENTERED
   
   oFont:End()

return nil

function Test( cUDC, cTest, cResult )

   local hPP := __pp_init()
   
   if ! __pp_addRule( hPP, "#xcommand " + AllTrim( cUDC ) )
      MsgAlert( "Error in UDC" )
      return nil
   endif   
   
   cResult = __pp_process( hPP, AllTrim( cTest ) )
   
return nil




Source code and EXE:
http://code.google.com/p/fivewin-contributions/downloads/detail?name=udc.zip&can=2&q=
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1283
Joined: Fri Feb 10, 2006 02:34 PM
Re: Visual Objects UDC en FiveWin :-)
Posted: Mon Oct 15, 2012 05:44 AM

Antonio

UDC ? --> Y esta que significa ? :D

Salutacions, saludos, regards

"...programar es fácil, hacer programas es difícil..."

UT Page -> https://carles9000.github.io/
Forum UT -> https://discord.gg/bq8a9yGMWh
HIX -> https://github.com/carles9000/hix
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Visual Objects UDC en FiveWin :-)
Posted: Mon Oct 15, 2012 09:04 AM

"User Defined Command" :-)

Comando Definido por el usuario

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1283
Joined: Fri Feb 10, 2006 02:34 PM
Re: Visual Objects UDC en FiveWin :-)
Posted: Mon Oct 15, 2012 09:08 AM

Antonio -> Gracias :D

Cuando miro las matriculas de los coches, mi cabeza siempre traduce las 3 letras de la matricula a jerga informatica. Esta no la tenia :lol:

Salutacions, saludos, regards

"...programar es fácil, hacer programas es difícil..."

UT Page -> https://carles9000.github.io/
Forum UT -> https://discord.gg/bq8a9yGMWh
HIX -> https://github.com/carles9000/hix
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Visual Objects UDC en FiveWin :-)
Posted: Mon Oct 15, 2012 10:54 AM

Normalmente usan "UD" para "User defined"...

UDF: User Defined Functions

etc...

:-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 564
Joined: Thu Oct 13, 2005 09:23 AM
Re: Visual Objects UDC en FiveWin :-)
Posted: Mon Oct 15, 2012 02:48 PM

Carles,
A mi me pasa lo mismo. Voy a esperar a que llegue la matricula RDD para cambiar el coche que FWH se me pasó :D

Saludos,

Posts: 1515
Joined: Thu Oct 30, 2008 02:37 PM
Re: Visual Objects UDC en FiveWin :-)
Posted: Mon Oct 15, 2012 02:57 PM

Hace dos semanas vi un coche con matricula DBF. Y seguramente el dueño no sabe ni lo que llevaba. :D

Continue the discussion