salvica
15-02-2013, 21:51:00
Se me rompió el ordenador y he montado uno nuevo, no se si he metido la pata, con Windows Home Premium 64 bits. He instalado mi viejo Delphi-7 y los componentes de terceros que siempre han funcionado en XP (no he tenido ningún problema) y me las prometía tan feliz :D, hasta que ...
Creo un proyecto nuevo, añado un TPageControl con tres o cuatro pestañas, activo OwnerDraw a true (como mandan los cánones), copio la procedure OnDrawTab de un proyecto viejo que siempre ha funcionado, y ... :eek::eek: PIERDO LAS CAPTION DE LAS PESTAÑAS :eek::eek:
procedure TForm1.Form_OnCreate(Sender: TObject);
begin
{ activar el dibujo de las pestañas }
PageControl.OwnerDraw := true;
end;
procedure TForm1.PageControl_OnDrawTab(Control: TCustomTabControl;
TabIndex: Integer; const Rect: TRect; Active: Boolean);
var
Offset : integer;
Texto : string;
begin
{ dibujar el PageControl en tiempo de ejecución }
with Control.Canvas do begin
//Texto := Trim(TPageControl(Control).Pages[TabIndex].Caption);
Texto := Trim(PageControl.Pages[TabIndex].Caption);
Font.Name := 'MS Sans Serif';
Font.Size := 10;
if Active then begin
Font.Color := clRed; //
Font.Style := [fsBold];
end else begin
Font.Color := clBlack; //
Font.Style := [];
end;
FillRect(Rect);
Offset := (Rect.Right-Rect.Left-TextWidth(Texto)) div 2;
TextOut(Rect.Left+offset, Rect.Top+2, Texto);
end;
end;
Asi, sin más.
Se me ha puesto una cara de panoli ... :mad::mad::mad:
¿Aguien sabe como se soluciona esto?
No me vale lo de cambiar a Delphi 2545, porque no vivo de esto :cool:
En mi portátil, con el mismo Windows a 32 bits, no tengo ningún problema.
Gracias adelantadas
Salvica
Creo un proyecto nuevo, añado un TPageControl con tres o cuatro pestañas, activo OwnerDraw a true (como mandan los cánones), copio la procedure OnDrawTab de un proyecto viejo que siempre ha funcionado, y ... :eek::eek: PIERDO LAS CAPTION DE LAS PESTAÑAS :eek::eek:
procedure TForm1.Form_OnCreate(Sender: TObject);
begin
{ activar el dibujo de las pestañas }
PageControl.OwnerDraw := true;
end;
procedure TForm1.PageControl_OnDrawTab(Control: TCustomTabControl;
TabIndex: Integer; const Rect: TRect; Active: Boolean);
var
Offset : integer;
Texto : string;
begin
{ dibujar el PageControl en tiempo de ejecución }
with Control.Canvas do begin
//Texto := Trim(TPageControl(Control).Pages[TabIndex].Caption);
Texto := Trim(PageControl.Pages[TabIndex].Caption);
Font.Name := 'MS Sans Serif';
Font.Size := 10;
if Active then begin
Font.Color := clRed; //
Font.Style := [fsBold];
end else begin
Font.Color := clBlack; //
Font.Style := [];
end;
FillRect(Rect);
Offset := (Rect.Right-Rect.Left-TextWidth(Texto)) div 2;
TextOut(Rect.Left+offset, Rect.Top+2, Texto);
end;
end;
Asi, sin más.
Se me ha puesto una cara de panoli ... :mad::mad::mad:
¿Aguien sabe como se soluciona esto?
No me vale lo de cambiar a Delphi 2545, porque no vivo de esto :cool:
En mi portátil, con el mismo Windows a 32 bits, no tengo ningún problema.
Gracias adelantadas
Salvica