Visual Objects UDC in FiveWin

Visual Objects UDC in FiveWin

Postby Antonio Linares » Thu Oct 11, 2012 3:12 pm

Original implementation in VO:
Image

udc.prg
Code: Select all  Expand view
#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


Image

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
User avatar
Antonio Linares
Site Admin
 
Posts: 42089
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Visual Objects UDC in FiveWin

Postby elvira » Fri Dec 28, 2012 9:40 pm

Sorry, I don´t understand it.

It changes the sintax.
elvira
 
Posts: 516
Joined: Fri Jun 29, 2012 12:49 pm

Re: Visual Objects UDC in FiveWin

Postby Antonio Linares » Sat Dec 29, 2012 11:51 pm

regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42089
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 80 guests

cron