Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - StatusBar repaint problem
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

StatusBar repaint problem

 Post Reply Post Reply
Author
Message
AndreiKr View Drop Down
Newbie
Newbie
Avatar

Joined: 03 May 2008
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndreiKr Quote  Post ReplyReply Direct Link To This Post Topic: StatusBar repaint problem
    Posted: 08 May 2008 at 5:14am
Привет, Олег.
Имею такую проблему, причем именно в 12 версии.
1. Открываю ADO recordset в асинхронном режиме. Когда я зачитываю данные, такой recordset порождает событие FetchData. В процедуру обработки события FetchData передается параметр Progress, который я вывожу в виде текста в статусбаре. В 11.2.2 было все нормально, текст изменялся в процессе зачитки данных. В 12.0.0 не смотря на то, что событие нормально генерится (я это наблюдаю по Debug.print), статусбар в процессе обработки мертвый. Очевидно, изменен алгоритм прорисовки?
2. На всякий случай делаю следующую вещь - модифицирую функцию вывода текста в статусбар для получения отладочной информации.

Function WriteStatusBarText(InputText As String)
On Error GoTo err1
Dim Pane As StatusBarPane
Set Pane = tcu.CommandBars.StatusBar.Pane(0)
Pane.Text = InputText
Set Pane = tcu.CommandBars.StatusBar.Pane(0)
Debug.Print Pane.Text
Exit Function
err1:
ErrorReport "WriteStatusBarText"
End Function

После вывода в панель текста, на всякий случай перечитываю данные

Вот кусок из Immediate Window
Records Affected: 2225 All Records: 34601
Records Affected: 2240 All Records: 34601
Records Affected: 2255 All Records: 34601
Records Affected: 2270 All Records: 34601
Records Affected: 2285 All Records: 34601
Records Affected: 2300 All Records: 34601
Records Affected: 2315 All Records: 34601
Records Affected: 2330 All Records: 34601
Records Affected: 2345 All Records: 34601
Records Affected: 2360 All Records: 34601
Records Affected: 2375 All Records: 34601
Records Affected: 2390 All Records: 34601
Records Affected: 2405 All Records: 34601
Records Affected: 2420 All Records: 34601
Records Affected: 2435 All Records: 34601
Records Affected: 2450 All Records: 34601
Records Affected: 2465 All Records: 34601
Records Affected: 2480 All Records: 34601
Records Affected: 2495 All Records: 34601
Records Affected: 2510 All Records: 34601
Records Affected: 2525 All Records: 34601
Records Affected: 2540 All Records: 34601
Records Affected: 2555 All Records: 34601
Records Affected: 2570 All Records: 34601
Records Affected: 2585 All Records: 34601
То есть мы наблюдаем, что вывод данных в панель статуса происходит, происходит их сохранение, если их можно прочитать из панели. Но прорисовка в статусе в это время не происходит.

Но при этом в статусбаре текст не изменяется, остается содержимое, которое было до начала обработки. Если сделать Ctrl+Break, и посмотреть в статус, то в этот момент данные будут отображены(те, что оказались в момент прерывания).

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

Что еще интересно. Если я подвешиваю стандартный прогресс в статусбар, то все работает нормально, прогресс идет, все хорошо
Set Pane = CommandBars.StatusBar.AddPane(1)
Pane.Handle = Me.ProgressBar1.hwnd

Но если я делаю прогресс через
Dim ProgressPane As StatusBarProgressPane
Set ProgressPane = CommandBars.StatusBar.AddProgressPane(2)

То потом наблюдается та же картина, что и при прорисовке текста.
Подскажите, как эту проблему порешать, очень хочется иметь нормальный рабочий статусбар.
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 08 May 2008 at 6:41am
Hi,
 
My russian is a little rusty. Think you better try this in english  
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2
Language: Visual Basic 6.0

Zero replies is not an option....
Back to Top
younicke View Drop Down
Senior Member
Senior Member
Avatar

Joined: 11 March 2005
Status: Offline
Points: 107
Post Options Post Options   Thanks (0) Thanks(0)   Quote younicke Quote  Post ReplyReply Direct Link To This Post Posted: 08 May 2008 at 7:09am
yeah right!

i didnt understand a word he said.

if you cant speak english maybe you could try some translator over the web so that we may be able to understand what your concerns are
Back to Top
AndreiKr View Drop Down
Newbie
Newbie
Avatar

Joined: 03 May 2008
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndreiKr Quote  Post ReplyReply Direct Link To This Post Posted: 08 May 2008 at 8:17am
Ok, Fellows, I may translate.
This question was for Oleg Chernyahovsky, as you know, he speak Russian.
My problem in delayed repaint of StatusBar in version 12.0.0, when I write text in StatusBarPane. Problem occured, when application write text intensively, for example, in cycle, or when events follow one for others often.

In version 11.2.2 all works fine.

If I use standard progressbar in statusbar (ControlCustom), all works fine in both versions. If I use ProgressBarPane, I have same problem.

If I use Timer (function, not a control), and write text to statusbar with interval 0.1 sec, it's works, if I write text more frequently, statusbar is frozen before ending execution.




Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 08 May 2008 at 9:24am
Hi,
 
try call DoEvents after you set text.
 
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
AndreiKr View Drop Down
Newbie
Newbie
Avatar

Joined: 03 May 2008
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndreiKr Quote  Post ReplyReply Direct Link To This Post Posted: 08 May 2008 at 10:14am
Yes, Oleg, it's work in usual cycles, and I am very pleased. But in fetch_data event procedure it worsk very strange. Sometimes works, sometimes no...

Now, for this case I'm use timer function, for estimation time, when I may put my text. If delay more then 0.01 sec, it's works normally.
Back to Top
AndreiKr View Drop Down
Newbie
Newbie
Avatar

Joined: 03 May 2008
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndreiKr Quote  Post ReplyReply Direct Link To This Post Posted: 08 May 2008 at 12:49pm
Now I tested my application throuth slowly internet connection. Acyncronous Recordsets with progress in StatusBar works normally without DoEvents. May be, that's right... If connection is fast, for what progress on 2 seconds?..

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.141 seconds.