PDA

Ver la Versión Completa : Poner formularios en vista xp


aanil
06-03-2007, 01:57:05
Como se pone un formulario hecho en Delphi 7 en formato o vista Windows XP, hace tiempo lo hice, pero ya no lo recuerdo.

roman
06-03-2007, 02:01:14
Coloca la componente XPManifest (pestaña Win 32) en el formulario principal.

// Saludos

aanil
06-03-2007, 02:09:36
Gracias Roman

vtdeleon
06-03-2007, 02:09:46
O también puedes agregar la unidad XpMan en el uses.

Saludos

roman
06-03-2007, 02:19:10
XpMan en el uses

Je, je, nunca me había detenido a pensar en ello pues de hecho sólo hasta hace muy poco la utilizo. Ya viendo lo que comentas veo que podemos añadir una tercera opción:


{$R windowsxp.res}


:)

// Saludos

Delphius
06-03-2007, 05:03:23
Buenas,

¿El XPManifiest viene sólo en Delphi 7? Porque en Delphi 6... no lo veo...:(

Me estaba pensando en hacerlo "vistoso" a mi pequeño sistema. Y se me ocurrió la idea de ver si se podría darle el aspecto XP. Y también... dejarlo (si es que se puede) con la posibilidad de habilitar este "comportamiento" dependiedo si el S.O es XP o inferior.

He notado que en torry.net hay varios componentes que simulan el efecto del XP ... pero no me decido por cual probar. ¿Cual me recomendarian?

Saludos,

AzidRain
06-03-2007, 05:36:18
Hay una pequeña unidad que hace precisamente el equivalente de lo Delphi 7, se llama XPManifest. Yo lo tengo, pero no he podido subirlo aqui. Alguien del Club seguramente lo va a poder subir. En realidad el archivo necesario es el .RES que menciona Román.

DarKraZY
06-03-2007, 10:24:37
Hay todavía una cuarta forma posible. La descubrí por casualidad y es utilizando un fichero con estructura xml.

Podéis encontrar ejemplos aquí (http://www.elguille.info/VB/ejemplos/temasXPvb6.htm) y aquí (http://delphi.about.com/library/bluc/text/uc111601a.htm).
Seguro que hay mejores páginas, pero habrá que buscarlas.

Teniendo ese código XML se guarda en un fichero que tenga el mismo nombre que la aplicación pero con extensión Manifest (ejemplo: Project1.exe.Manifest) De esta forma ni siquiera hace falta recompilar los exes con la uses XPMan.

Espero que les sirva!

Saludos!

CrazySoft
06-03-2007, 13:54:07
Hola, tengo una pregunta, como puedo pudo personalizar los colores, definirlos a mi gusto de forma constante

al poner un BitButton en el forulario, no cambia de aspecto en tiempo de ejecución

delphi 6

Gracias

ArdiIIa
06-03-2007, 14:18:15
¿Por que los ficheros que llevan el XPManifest, no pueden comprimirse con el UPX (http://upx.sourceforge.net/)?

seoane
06-03-2007, 14:23:54
¿Por que los ficheros que llevan el XPManifest, no pueden comprimirse con el UPX (http://upx.sourceforge.net/)?

Pues porque lo que hace XPManifext, es guardar el archivo xml del que hablaba DarKraZY como un recurso dentro del propio ejecutable. Como UPX comprime el ejecutable, windows no puede encontrarlo.

ArdiIIa
06-03-2007, 14:26:35
Que caña, seoane... El día que te vayas de vacaciones, llévate un portátil o no se que vamos a hacer aquí... :D

DarKraZY
06-03-2007, 14:28:14
al poner un BitButton en el forulario, no cambia de aspecto

La aplicación no cambia de aspecto en tiempo de diseño. Tan sólo en tiempo de ejecución!

Delphius
06-03-2007, 16:11:42
Gracias, me voy a poner las posibilidades que mencionan.
Si tengo dudas estaré posteando.

Saludos,

amadis
04-04-2007, 16:04:59
Supongo que usar el archivo externo con el XML debe ser lo mas compatible ya que he visto muchos programas hechos en VB que lo traen.

Pero en cuanto a la Unit XPMan y al codigo que mencionaba arriba Roman.

{$R windowsxp.res}


Que es una parte del codigo fuente de la Unit XPMan

unit XPMan;
{$WEAKPACKAGEUNIT ON}
interface

uses
SysUtils, Classes;

type
TXPManifest = class(TComponent)
end;

{$R WindowsXP.res}

implementation

end.


Ahora bien una consulta que me quedo para que sirve
¿¿ {$WEAKPACKAGEUNIT ON} ???

vtdeleon
05-04-2007, 01:18:34
Yo tampoco sé, pero según esto:
The {$WEAKPACKAGEUNIT} directive is used in rare situations where the units in your package may be referencing DLLs that may not be present on every system. To be precise, this directive was actually created as part of a solution to another problem. Specifically, consider two units, each in a separate package, and both units reference the same DLL. If an application uses both of these units, then two copies of the DLL will be loaded into memory, which causes all kinds of problems with initialization and global variables. The solution to this problem is to put the interface unit of the DLL into a common package.

However, what happens if the DLL is not present on the system? The common package cannot be loaded because it is statically linked to the DLL through the interface unit. This is where the $WEAKPACKAGEUNIT directive comes in. Specifically, this directive affects the way a DCU file is stored in a package's DCP and BPL files. If {$WEAKPACKAGEUNIT ON} appears in a unit file, the compiler omits the unit from the BPL file whenever possible, and creates a non-packaged copy of the unit and places it in the package's DCP file. The non-packaged unit will then be statically linked into applications or other packages when needed.

For example, suppose we have a package called Package1 that contains only one unit, Unit1. Now further suppose that Unit1 does not use any further units, but it makes calls to Rare.dll. If the {$WEAKPACKAGEUNIT ON} directive is inserted in Unit1.pas before compiling, Unit1 will not be included in Package1.bpl. As a result, the Rare.dll will not have to be distributed with Package1. However, Unit1 will still be included in Package1.dcp. If Unit1 is referenced by another package or application that uses Package1, Unit1 will be copied from Package1.dcp and compiled directly into the project.
Enlace (http://bdn1.borland.com/article/borcon/files/6106/paper/6106.html)