Progress - como poner una palabra en asterisco

 
Vista:

como poner una palabra en asterisco

Publicado por andrey (3 intervenciones) el 10/07/2006 04:29:53
como poner una palabra en asterisco
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:como poner una palabra en asterisco

Publicado por DANIEL MIRANDA (6 intervenciones) el 22/07/2006 00:24:58
Muchos han preguntado esto, tambien hay muchas soluciones, he aqui una sencilla con codigo de progress, espero te sirva. Tiene seguridad para modificaciones. Los campos que se muestran son para probar, obviamente tu los quitas en tu aplicacion.


&Scoped-define WINDOW-NAME CURRENT-WINDOW
&Scoped-define FRAME-NAME Dialog-Frame
/*------------------------------------------------------------------------
File:
Description:
Input Parameters:
Output Parameters:
Author: DANIEL MIRANDA ESPINOZA
Created: 20/JUL/2006
SANTIANGO DE CHILE

------------------------------------------------------------------------*/
/* This .W file was created with the Progress AppBuilder. */
/*----------------------------------------------------------------------*/

/* *************************** Definitions ************************** */

/* Parameters Definitions --- */

/* Local Variable Definitions --- */

DEFINE VARIABLE cValorLectura AS CHARACTER NO-UNDO.
DEFINE VARIABLE iPosicion AS INTEGER NO-UNDO.


/* ******************** Preprocessor Definitions ******************** */

&Scoped-define PROCEDURE-TYPE Dialog-Box
&Scoped-define DB-AWARE no

/* Name of first Frame and/or Browse and/or first Query */
&Scoped-define FRAME-NAME Dialog-Frame

/* Standard List Definitions */
&Scoped-Define ENABLED-OBJECTS FILL-IN-3 FILL-IN-4 FILL-IN-5
&Scoped-Define DISPLAYED-OBJECTS FILL-IN-3 FILL-IN-4 FILL-IN-5

/* Custom List Definitions */
/* List-1,List-2,List-3,List-4,List-5,List-6 */

/* *********************** Control Definitions ********************** */

/* Define a dialog box */

/* Definitions of the field level widgets */
DEFINE VARIABLE FILL-IN-3 AS CHARACTER FORMAT "X(256)":U
LABEL "Fill 3"
VIEW-AS FILL-IN
SIZE 14 BY 1 NO-UNDO.

DEFINE VARIABLE FILL-IN-4 AS CHARACTER FORMAT "X(256)":U
LABEL "Fill 4"
VIEW-AS FILL-IN
SIZE 14 BY 1 NO-UNDO.

DEFINE VARIABLE FILL-IN-5 AS CHARACTER FORMAT "X(256)":U
LABEL "Fill 5"
VIEW-AS FILL-IN
SIZE 14 BY 1 NO-UNDO.

/* ************************ Frame Definitions *********************** */

DEFINE FRAME Dialog-Frame
FILL-IN-3 AT ROW 1.48 COL 9 COLON-ALIGNED
FILL-IN-4 AT ROW 2.67 COL 9 COLON-ALIGNED
FILL-IN-5 AT ROW 3.86 COL 9 COLON-ALIGNED
SPACE(23.19) SKIP(0.56)
WITH VIEW-AS DIALOG-BOX KEEP-TAB-ORDER
SIDE-LABELS NO-UNDERLINE THREE-D SCROLLABLE
TITLE "<insert dialog title>".

/* *********************** Procedure Settings ************************ */

/* Settings for THIS-PROCEDURE
Type: Dialog-Box
Allow: Basic,Browse,DB-Fields,Query
Other Settings: COMPILE
*/


/* *********** Runtime Attributes and AppBuilder Settings *********** */

/* SETTINGS FOR DIALOG-BOX Dialog-Frame
*/
ASSIGN
FRAME Dialog-Frame:SCROLLABLE = FALSE
FRAME Dialog-Frame:HIDDEN = TRUE.




/* ************************ Control Triggers ************************ */

&Scoped-define SELF-NAME Dialog-Frame
ON WINDOW-CLOSE OF FRAME Dialog-Frame /* <insert dialog title> */
DO:
APPLY "END-ERROR":U TO SELF.
END.

&Scoped-define SELF-NAME FILL-IN-3
ON CURSOR-LEFT OF FILL-IN-3 IN FRAME Dialog-Frame /* Fill 3 */
OR 'cursor-right':u OF fill-in-3 IN FRAME {&FRAME-NAME}
DO:
APPLY 'value-changed':U TO {&self-name} IN FRAME {&FRAME-NAME}.
RETURN NO-APPLY.
END.

ON VALUE-CHANGED OF FILL-IN-3 IN FRAME Dialog-Frame /* Fill 3 */
DO:
ASSIGN {&self-name}.

IF KEYLABEL(LASTKEY) = "DEL" OR
KEYLABEL(LASTKEY) BEGINS "CURSOR" THEN ASSIGN {&self-name} = ""
cValorLectura = "".


iPosicion = LENGTH({&self-name}).
IF iPosicion <= 0 THEN iPosicion = 1.

fill-in-5:SCREEN-VALUE IN FRAME {&FRAME-NAME} = STRING(iPosicion).

IF KEYLABEL(LASTKEY) = "backspace" THEN
DO:
{&self-name} = FILL("*",LENGTH(cValorLectura) - 1).
iPosicion = LENGTH(TRIM({&self-name})).
cValorLectura = SUBSTRING(cValorLectura,1,iPosicion).
END.
ELSE DO:
IF KEYLABEL(LASTKEY) = ""
THEN cValorLectura = cValorLectura + " ".
ELSE cValorLectura = cValorLectura +
SUBSTRING({&self-name},iPosicion,1).
END.

{&self-name} = FILL("*",LENGTH(cValorLectura)).
DISPLAY {&self-name} WITH FRAME {&FRAME-NAME}.

fill-in-4:SCREEN-VALUE IN FRAME {&FRAME-NAME} = cValorLectura.

END.

&UNDEFINE SELF-NAME


/* *************************** Main Block *************************** */

/* Parent the dialog-box to the ACTIVE-WINDOW, if there is no parent. */
IF VALID-HANDLE(ACTIVE-WINDOW) AND FRAME {&FRAME-NAME}:PARENT eq ?
THEN FRAME {&FRAME-NAME}:PARENT = ACTIVE-WINDOW.

/* Now enable the interface and wait for the exit condition. */
/* (NOTE: handle ERROR and END-KEY so cleanup code will always fire. */
MAIN-BLOCK:
DO ON ERROR UNDO MAIN-BLOCK, LEAVE MAIN-BLOCK
ON END-KEY UNDO MAIN-BLOCK, LEAVE MAIN-BLOCK:
RUN enable_UI.
WAIT-FOR GO OF FRAME {&FRAME-NAME}.
END.
RUN disable_UI.

/* ********************** Internal Procedures *********************** */

PROCEDURE disable_UI :
/*------------------------------------------------------------------------------
Purpose: DISABLE the User Interface
Parameters: <none>
Notes: Here we clean-up the user-interface by deleting
dynamic widgets we have created and/or hide
frames. This procedure is usually called when
we are ready to "clean-up" after running.
------------------------------------------------------------------------------*/
/* Hide all frames. */
HIDE FRAME Dialog-Frame.
END PROCEDURE.

PROCEDURE enable_UI :
/*------------------------------------------------------------------------------
Purpose: ENABLE the User Interface
Parameters: <none>
Notes: Here we display/view/enable the widgets in the
user-interface. In addition, OPEN all queries
associated with each FRAME and BROWSE.
These statements here are based on the "Other
Settings" section of the widget Property Sheets.
------------------------------------------------------------------------------*/
DISPLAY FILL-IN-3 FILL-IN-4 FILL-IN-5
WITH FRAME Dialog-Frame.
ENABLE FILL-IN-3 FILL-IN-4 FILL-IN-5
WITH FRAME Dialog-Frame.
VIEW FRAME Dialog-Frame.
{&OPEN-BROWSERS-IN-QUERY-Dialog-Frame}
END PROCEDURE.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar