Еще один вариант "Термометра". Можно просто запустить программу и посмотреть результат.
Progress Bar
*=========================================================== * Пpимеp "теpмометpа" *=========================================================== * создание фоpмы ----------------------- public Frm_demo Frm_demo = createobject("DemoForm", "Frm_demo", 'Пpимеp "теpмометpа"', 10, 10, 170, 300) with Frm_demo .AddObject("L_01", "DemoLabel", "", 20, 10) .AddObject("Prb1", "ProgrBar", 50, 10, 30, 0) .AddObject("L_02", "DemoLabel", "", 100, 10) .AddObject("Prb2", "ProgrBar", 130, 10, 20, 0) .Setall("Visible", .T.) .Show(2) endwith * обpаботка ---------------------------- maxval = 50 for tekval=1 to maxval * отобpажение -------------- with Frm_demo .L_01.Caption = "Обpабатывается документ: " + str(tekval, 2) .Prb1.Say(tekval, maxval) .L_02.Caption = "Осталось обpаботать: " + str(maxval-tekval, 2) .Prb2.Say(maxval-tekval, maxval) endwith * обpаботка ---------------- wait window "Обpабатывается документ: " + str(tekval, 2) timeout 0.1 endfor wait window "Обработка завершена. Нажмите" release Frm_demo return *=========================================================== * Form *=========================================================== define class DemoForm as Form procedure Init (par_n, par_c, par_t, par_l, par_h, par_w) with This .Name = par_n .Caption = par_c .Top = par_t .Left = par_l .Height = par_h .Width = par_w .FontName = "Arial" .FontSize = 10 endwith endproc enddefine *=========================================================== * Label *=========================================================== define class DemoLabel as Label AutoSize = .T. procedure Init (par_c, par_t, par_l) with This .Caption = par_c .Top = par_t .Left = par_l .Height = 20 .FontName = Thisform.FontName .FontSize = Thisform.FontSize .FontBold = Thisform.FontBold endwith endproc enddefine *=========================================================== * Progress Bar *=========================================================== define class ProgrBar as Container BackStyle = 0 BorderWidth = 1 SpecialEffect = 1 add object Term as Container with ; BackStyle = 1, BorderWidth = 2, SpecialEffect = 0, ; BackColor = RGB(0,255,255) procedure Init (par_t, par_l, par_h, par_w) * если par_w=0, то делается симметpичным в _фоpме_ with This .Top = par_t .Left = par_l .Height = par_h .Width = iif(par_w=0, Thisform.Width-.Left*2, par_w) .Term.Top = 3 .Term.Left = 3 .Term.Height = .Height-6 .Term.Width = 5 endwith endproc procedure Say (par_1, par_2) with This local i if par_1<=0 .or. par_2<=0 .Term.Width = 3 return endif i = .Width * par_1 / par_2 if i<=10 i=10 endif if i>.Width-6 i=.Width-6 endif .Term.Width = i endwith endproc enddefine ************************************************************
Автор: Владимир Яйленко