Inicio > Componentes > Componente TSaveComps

Componente TSaveComps

Share Button

(versión 1.4)

Permite guardar la posicion y tamaño de todos los componentes que se encuentran en el formulario. Utilizapara ello un fichero INI.
Basta con colocar el componente en el formulario y activarlo; Cuando la aplicación se cierra graba la posición/tamaño y al volver a ejecutarla los recupera de forma automática.

NOTA: Es indispensable para grabar la posición y tamaño de un componente que tenga definida la propiedad Name (para controles creados en RunTime).

Imagen del ejemplo

Historial:
(version 1.4): Añadido un evento (OnNotExistComponent) que facilita el trabajo con componentes creados en tiempo de ejecución (runtime); Se han revisado los componentes para trabajar con Delphi 2005/2006.

(versión 1.3): El componente permite guardar propiedades de tipo TStrings (Lines, Items,…)

(versión 1.2): Para la versión 1.2 se ha añadido la posibilidad de poder añadir propiedades por parte del usuario que se grabarán (propiedad SavedProperties).

Download Descargar componente

5/5 - (1 voto)
Categories: Componentes Tags: , ,
  1. Noémie
    martes, 23 de noviembre de 2010 a las 12:01 | #1

    Hi.
    I am using your TSaveComps component to save and load the state of a form with several components.

    I sucessfully Saved and load with an INI file but I would like to know if it possible to reset the form to its original state (The state which is in the Delphi designer).

    I mean for exemple :

    1. Opening of the application –> The form looks like the original form (Without any modification by TSaveComps)
    2. Moving the controls on runtime with TSelectOnRuntime
    3. Saving the state with TSaveComps
    4. Closing the application.

    And Then another session of the application

    1. Opening of the application –> The form looks like the original form (Without any modification by TSaveComps)
    2. Loading the state as saved previously
    3. Reinit the form to have the original form (The one without the SaveComps)

    I tried to set SaveComps.Active to false, I tried to set IniFileName to an empty string but nothing seems to work. Am I missing something?..

    I hope you will understand my request.

    Thank you

    Noémie

  2. Noémie
    martes, 23 de noviembre de 2010 a las 12:05 | #2

    Hi, me again,

    I found the solution to save the original form at the beginning of the application but I was hoping maybe it could exists another solution

  3. Neftalí
    martes, 23 de noviembre de 2010 a las 12:54 | #3

    Hello Noémie.
    I have tried to disable the component TSaveComps (Active=False) and the StateSaved is not restored when the applicacion start.

    May be i not been understanding your problem. ;-(

    Regards.

  4. Noémie
    martes, 23 de noviembre de 2010 a las 14:44 | #4

    Hi, Thanks for your answer.

    I am looking for a way to reinit the form to its original layout without restarting the application

  5. Neftalí
    martes, 23 de noviembre de 2010 a las 19:04 | #5

    @Noémie
    Hello Noémie.
    If you want to turn the form to the initial state, you have two possibilities:
    (1) Close the form (free) and open with the componente disabled.
    (2) Save the Initial state and turn all the controls to the initial state with this saved file.

    Regards.

  6. Cristopher
    jueves, 23 de diciembre de 2010 a las 17:59 | #6

    Además de tu componente TSelectOnRuntime en vez de guardar los componentes en Runtime de un formulario puede usarse tambien en un TPanel?

  7. Neftalí
    viernes, 24 de diciembre de 2010 a las 10:12 | #7

    @Cristopher
    Hola Cristofer. No entiendo muy bien tu pregunta. Puedes usar el componente con un TPanel y con cualquier otro, pero no entiendo la relación con guardarlos en Runtime. ¿?¿?¿

    ¿Puedes explicarmelo mejor?

    Un saludo.

  8. Engel Prensa
    miércoles, 18 de enero de 2023 a las 19:40 | #8

    Buenas Tardes Maestro Germán Estévez, tengo poco tiempo estudiando programacion y ver su pagina me ha generado un gran interes en este lenguaje. E intentado buscar documentacion de como funcionan tus componentes TsaveComps y TSelectOnRunTime y las maneras de usarlo. Un saludos maestro

  9. lunes, 23 de enero de 2023 a las 11:49 | #9

    @Engel Prensa
    Hola engel, gracias por el comentario.
    Son componentes sencillos, revisa los ejempos. lo normal es que solo haya que “soltarlos” en el formulario y activarlos mediante la propiedad Active.
    Revisa el código de los ejemplos.

  1. Sin trackbacks aún.