Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Компоненты";
Текущий архив: 2005.08.28;
Скачать: [xml.tar.bz2];

Вниз

Можно ли убрать поля в PageControl   Найти похожие ветки 

 
chis   (2004-08-31 17:41) [0]

При размещении во вкладках компонента с алигном типа клиент остаются поля. Заказчику это почему-то очень не нравится, а как их срубить я не знаю. Помогите плз.


 
Awex   (2004-08-31 21:16) [1]

{******************************************}
{  Sphere Component Library                }
{ (c) 2003, 2004 by Sphere Software Group  }
{******************************************}

unit sphPageControl;

interface

uses
 Windows, Messages, Classes, CommCtrl, ComCtrls;

type
 TExStyle = (exsStandard, exsFlat, exsUltraFlat);

 TxPageControl = class(TPageControl)
 protected
   FExStyle: TExStyle;
   procedure SetExStyle(Value: TExStyle);
   procedure WndProc(var Message: TMessage); override;
 public
   constructor Create(Owner: TComponent); override;
 published
   property ExStyle: TExStyle read FExStyle write SetExStyle default exsStandard;
 end;

 TxTabControl = class(TTabControl)
 protected
   FExStyle: TExStyle;
   procedure SetExStyle(Value: TExStyle);
   procedure WndProc(var Message: TMessage); override;
 public
   constructor Create(Owner: TComponent); override;
 published
   property ExStyle: TExStyle read FExStyle write SetExStyle default exsStandard;
 end;

implementation

constructor TxPageControl.Create(Owner: TComponent);
begin
 inherited Create(Owner);
 ExStyle := exsStandard;
 HotTrack := true;
end;

procedure TxPageControl.SetExStyle(Value: TExStyle);
begin
 if FExStyle <> Value then
 begin
   FExStyle := Value;
   Realign;
 end;
end;

procedure TxPageControl.WndProc(var Message: TMessage);
begin
 inherited WndProc(Message);
 if (FExStyle <> exsStandard) and (Message.Msg = TCM_ADJUSTRECT) then
 begin
   if FExStyle = exsFlat then
   begin
     if TabPosition = tpTop then
     begin
       PRect(Message.LParam)^.Left := 2;
       PRect(Message.LParam)^.Right := ClientWidth - 2;
       PRect(Message.LParam)^.Top := PRect(Message.LParam)^.Top - 2;
       PRect(Message.LParam)^.Bottom := ClientHeight - 2;
     end
     else
       if TabPosition = tpBottom then
       begin
         PRect(Message.LParam)^.Left := 0;
         PRect(Message.LParam)^.Right := ClientWidth;
         PRect(Message.LParam)^.Top := PRect(Message.LParam)^.Top - 4;
         PRect(Message.LParam)^.Bottom := PRect(Message.LParam)^.Bottom + 2;
       end;
   end
   else
   begin
     if TabPosition = tpTop then
     begin
       PRect(Message.LParam)^.Left := 0;
       PRect(Message.LParam)^.Right := ClientWidth;
       PRect(Message.LParam)^.Top := PRect(Message.LParam)^.Top - 4;
       PRect(Message.LParam)^.Bottom := ClientHeight;
     end
     else
       if TabPosition = tpBottom then
       begin
         PRect(Message.LParam)^.Left := 0;
         PRect(Message.LParam)^.Right := ClientWidth;
         PRect(Message.LParam)^.Top := PRect(Message.LParam)^.Top - 4;
         PRect(Message.LParam)^.Bottom := PRect(Message.LParam)^.Bottom + 2;
       end;
   end;
 end;
end;

{ TxTabControl }

constructor TxTabControl.Create(Owner: TComponent);
begin
 inherited Create(Owner);
 ExStyle := exsStandard;
 HotTrack := true;
end;

procedure TxTabControl.SetExStyle(Value: TExStyle);
begin
 if FExStyle <> Value then
 begin
   FExStyle := Value;
   Realign;
 end;
end;

procedure TxTabControl.WndProc(var Message: TMessage);
begin
 inherited WndProc(Message);
 if (FExStyle <> exsStandard) and (Message.Msg = TCM_ADJUSTRECT) then
 begin
   if FExStyle = exsFlat then
   begin
     if TabPosition = tpTop then
     begin
       PRect(Message.LParam)^.Left := 2;
       PRect(Message.LParam)^.Right := ClientWidth - 2;
       PRect(Message.LParam)^.Top := PRect(Message.LParam)^.Top - 2;
       PRect(Message.LParam)^.Bottom := ClientHeight - 2;
     end
     else
       if TabPosition = tpBottom then
       begin
         PRect(Message.LParam)^.Left := 0;
         PRect(Message.LParam)^.Right := ClientWidth;
         PRect(Message.LParam)^.Top := PRect(Message.LParam)^.Top - 4;
         PRect(Message.LParam)^.Bottom := PRect(Message.LParam)^.Bottom + 2;
       end;
   end
   else
   begin
     if TabPosition = tpTop then
     begin
       PRect(Message.LParam)^.Left := 0;
       PRect(Message.LParam)^.Right := ClientWidth;
       PRect(Message.LParam)^.Top := PRect(Message.LParam)^.Top - 4;
       PRect(Message.LParam)^.Bottom := ClientHeight;
     end
     else
       if TabPosition = tpBottom then
       begin
         PRect(Message.LParam)^.Left := 0;
         PRect(Message.LParam)^.Right := ClientWidth;
         PRect(Message.LParam)^.Top := PRect(Message.LParam)^.Top - 4;
         PRect(Message.LParam)^.Bottom := PRect(Message.LParam)^.Bottom + 2;
       end;
   end;
 end;
end;

end.



Страницы: 1 вся ветка

Форум: "Компоненты";
Текущий архив: 2005.08.28;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.47 MB
Время: 0.036 c
3-1121325854
Juice
2005-07-14 11:24
2005.08.28
Программа для визуальной проэктировки баз данных ?


14-1123073749
Виталий Панасенко
2005-08-03 16:55
2005.08.28
Меркантильная тема...


14-1123263982
SergP
2005-08-05 21:46
2005.08.28
Еще раз об БД Access


3-1121767950
Magic
2005-07-19 14:12
2005.08.28
ADO+LIKE (не работает)


14-1123252381
Джо
2005-08-05 18:33
2005.08.28
Фотошоп или натура?





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский