Вниз
Скачать: CL | DM;

Прогресс Бар в СтатусБар   Найти похожие ветки 

← →
Denis_Visma   (2004-06-21 12:10) [0]

Уважаемые помогите! Я посмотрел по поиску, но ничего не нашел, помогите с этим разобраиться. Мне надо сделать сабж. Я конечно мог бы найти компоненты которые это позволяют, но это уже краяний метод, можно ли это сделать руцями?
Спасибо.


← →
serge ©   (2004-06-21 12:11) [1]

ProgressBar1.Parent:=StatusBar1;
ProgressBar1.LEft:=...; ProgressBar1.Top:=...;


← →
Думкин ©   (2004-06-21 12:12) [2]

Рэй Конопка.


← →
Denis_Visma   (2004-06-21 12:16) [3]

в смысле?


← →
Думкин ©   (2004-06-21 12:17) [4]


> [3] Denis_Visma   (21.06.04 12:16)

У него описано сие в книге про компоненты.


← →
Denis_Visma   (2004-06-21 12:24) [5]

а можно примерчик рабочего кода...я делаю как выше было сказано, так прогресс ьар пропадает...


← →
serge ©   (2004-06-21 12:26) [6]

Left and Top properties are relative to StatusBar component.


← →
han_malign ©   (2004-06-21 12:28) [7]

procedure DrawSimpleHProgressBar(aCanvas: TCanvas; const aRect: TRect; aColor: TColor;
  aText: string; aPercent: byte; aHCenterText: boolean);
var W,H,X,Y: integer;
   _rect: TRect;
   _clr: TColor;
   _bs: TBrushStyle;
begin
  if(aPercent>100)then aPercent:=0;
  W:=aRect.Right-aRect.Left+1; H:=aRect.Bottom-aRect.Top+1;
  _rect:=aRect;
  if(aPercent>0)then begin
     _rect.Right:=aRect.Left+W*aPercent div 100-1;
     _clr:=aCanvas.Brush.Color;
     aCanvas.Brush.Color:=aColor;
     aCanvas.FillRect(_rect);
     aCanvas.Brush.Color:=_clr;
     aText:=aText+" "+IntStr(aPercent)+"%";
     _rect.Left:=_rect.Right+1;
     _rect.Right:=aRect.Right;
  end;
  if(_rect.Right>=_rect.Left)then aCanvas.FillRect(_rect);
  Y:=(H-aCanvas.TextHeight(aText))div 2;
  if(Y<0)then Y:=0;
  X:=(W-aCanvas.TextWidth(aText))div 2;
  if(X<0)then X:=0;
  if((X>Y)and not aHCenterText)then
     if(Y>0)then X:=Y
     else if(X>2)then X:=2;
  _bs:=aCanvas.Brush.Style;
  aCanvas.Brush.Style:=bsClear;
  aCanvas.TextOut(aRect.Left+X,aRect.Top+Y,aText);
  aCanvas.Brush.Style:=_bs;
end;


← →
Denis_Visma   (2004-06-21 12:32) [8]

Спасибо. Вопрос закрыт



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

Скачать: CL | DM;



Память: 0.46 MB
Время: 0.024 c
1-1087742551
Zema
2004-06-20 18:42
2004.07.04
Подскажите Мастера, как симмитировать нажатие клавиши...


14-1086700096
hgd
2004-06-08 17:08
2004.07.04
Расстояние до объекта


4-1081365522
cerber1
2004-04-07 23:18
2004.07.04
Поиск каретки в системе


14-1087437268
Думкин
2004-06-17 05:54
2004.07.04
С днем рождения! 17 июня


14-1087369345
Saturn
2004-06-16 11:02
2004.07.04
Delphi 8




   Наверх