Have to wait 5 seconds for choosing popup menu item

Hi,

Popup menu displays the values well, but I should wait 5 seconds until I could choose the item. The number of item is just 5.
There is no event in the Popup menu.

What is the problem?

Thanks.
Changwon.

I think this is a UI_PopupMenu issue (Jeremi UI custome). No problem in the normal popup menu…

It would be hard to contact him.
Do you think there is any workaround for resolving this issue?

[quote=194162:@changwon lee]I think this is a UI_PopupMenu issue (Jeremi UI custome). No problem in the normal popup menu…

It would be hard to contact him.
Do you think there is any workaround for resolving this issue?[/quote]

I downloaded the demo project from jeremieleroy.com and see no lag on Windows in the UI_PopupMenu that has 4 items there.

From what I see there, the code in Open and MouseDown is very small and does very little. Is it possible that you have some recursion in Open that would explain what you report ?

Did you run the profiler?

MainWindow generates item lists and open DBConnectWindow, and there is a popup menu.
There is no code in Open event of DBConnectWindow.

DBConnectWindow.Show

  Dim i As Integer
  Dim finalTnsLists(-1) As String
  
  finalTnsLists = getTNS
  
  For i=0 To UBound(finalTnsLists)
    DBConnectWindow.tnsPopupMenu.AddRow(finalTnsLists(i).UPPERCASE)
  Next

Ashot:
I don’t know the profiler. What is it? Anyway I don’t use it.

[quote=194187:@changwon lee]MainWindow generates item lists and open DBConnectWindow, and there is a popup menu.
There is no code in Open event of DBConnectWindow.

DBConnectWindow.Show

  Dim i As Integer
  Dim finalTnsLists(-1) As String
  
  finalTnsLists = getTNS
  
  For i=0 To UBound(finalTnsLists)
    DBConnectWindow.tnsPopupMenu.AddRow(finalTnsLists(i).UPPERCASE)
  Next

Ashot:
I don’t know the profiler. What is it? Anyway I don’t use it.[/quote]

Where is the code you posted ?

“Profile code” is an option in the Project menu. When checked, after your app quits, it creates a report that appears under Profiles in the navigator that will tell you which methods were fired and how long each has taken. That is often how you can spot recursion and possibly slow down.

From Profiler, I don’t see much time for the PopupMenu.
There is a button on MainWindow and when I clicked it then it launches the DBConnectWindow, and there is a popupMenu in the window.

finalTnsLists = getTNS

what does this line do? does it establish a connection to a database or remote resource? if so, that is most likely the problem.
Do you need to call this EVERYTIME you do the popup? or can it be called once?

getTNS method returns the list of TNS alias, and user is supposed to choose the one to connect a database.
PopupMenu just displays the list of it.
Database connection doesn’t happen a lot but the popupMenu’s delay(lag) wouldn’t make the Application look good.

[quote=194207:@changwon lee]getTNS method returns the list of TNS alias, and user is supposed to choose the one to connect a database.
PopupMenu just displays the list of it.
Database connection doesn’t happen a lot but the popupMenu’s delay(lag) wouldn’t make the Application look good.[/quote]

That getTNS method, how long does it take to provide the result ? Can you try to count Ticks before you call it and after ? It could be there the lag originates.