Print Page | Close Window

StatusBar repaint problem

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=10551
Printed Date: 07 October 2024 at 10:54pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: StatusBar repaint problem
Posted By: AndreiKr
Subject: StatusBar repaint problem
Date 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)

То потом наблюдается та же картина, что и при прорисовке текста.
Подскажите, как эту проблему порешать, очень хочется иметь нормальный рабочий статусбар.



Replies:
Posted By: Aaron
Date 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....


Posted By: younicke
Date 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


Posted By: AndreiKr
Date 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.






Posted By: Oleg
Date Posted: 08 May 2008 at 9:24am
Hi,
 
try call DoEvents after you set text.
 


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: AndreiKr
Date 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.


Posted By: AndreiKr
Date 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?..




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net