A Generic ownerdraw system for DCBROWSE

This forum is for eXpress++ general support.
Message
Author
User avatar
rdonnay
Site Admin
Posts: 4733
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: A Generic ownerdraw system for DCBROWSE

#31 Post by rdonnay »

I also noticed that 'up' or 'down' key pressed for few seconds, do the same. But only in network environment.
I would have suspected that those keys would do the same if my theory is correct.
Apparently, it is taking too long to load the array with information from the database when accessing via the network.
This would likely cause the event queue to fill up.

Try adding the following code to the top of METHOD XbpOwnerDrawBrowseGeneric:customDrawCell( oPS, aInfo ) in OWNERGEN.PRG.

Code: Select all

IF !::lOwnerDraw // ownerdrawing is switched off, let the system draw
  RETURN .T.
ENDIF

// <<<<<<< start
nEvent := NextAppEvent(@mp1,@mp2,@oXbp)

IF nEvent == xbeM_Wheel
  RETURN .t.
ELSEIF nEvent == xbeP_Keyboard .AND. mp1 $ { xbeK_UP, xbeK_DOWN }
  RETURN .t.
ENDIF
// <<<<<<<< end
You will also need to add #include "appevent.ch" at the top of the file.
The eXpress train is coming - and it has more cars.

c-tec
Posts: 379
Joined: Tue Apr 20, 2010 1:36 am
Location: SALZBURG/AUSTRIA
Contact:

Re: A Generic ownerdraw system for DCBROWSE

#32 Post by c-tec »

Hello,
here also on local machine, so not network related
regards
Rudolf
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

Janko
Posts: 111
Joined: Sat Mar 20, 2010 8:36 am
Location: Cerklje

Re: A Generic ownerdraw system for DCBROWSE

#33 Post by Janko »

Roger,

I tested it and could not generate an error. EXE localy is running approximately with same speed as before, but EXE in network is refreshing OWNERDRAW browsers significantly slower, sometimes with errors in coloring. I did test remotely, tomorrow I intend to test it live, and will comment. I wonder if Rudolf succeded to solve his case.

Thank you
Best regards
JAnko

Janko
Posts: 111
Joined: Sat Mar 20, 2010 8:36 am
Location: Cerklje

Re: A Generic ownerdraw system for DCBROWSE

#34 Post by Janko »

Roger,

sorry, yesterday I was testing browser remotely. Today, I did it again live in network environment and application froze again. Image in attachment.

Waiting for another solution
Janko
Attachments
17.7.2015, 7:12
17.7.2015, 7:12
Clipboard.jpg (914.86 KiB) Viewed 12106 times

User avatar
rdonnay
Site Admin
Posts: 4733
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: A Generic ownerdraw system for DCBROWSE

#35 Post by rdonnay »

I don't know how I can help you if i cannot reproduce this.
I will try to simulate a slow network in the test application by putting some sleep() calls in the code.
Maybe I can reproduce the problem this way.
The eXpress train is coming - and it has more cars.

Zdeno Bielik
Posts: 147
Joined: Thu Jan 28, 2010 9:24 am
Location: Nitra, Slovakia
Contact:

Re: A Generic ownerdraw system for DCBROWSE

#36 Post by Zdeno Bielik »

Roger,
I will try to simulate a slow network in the test application by putting some sleep() calls in the code.
or try install CpuKiller http://www.cpukiller.com – sometimes I used this for similar tasks - it worked super!
It is shareware-30day trial, but for your tests may be it is enough.

Zdeno

User avatar
rdonnay
Site Admin
Posts: 4733
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: A Generic ownerdraw system for DCBROWSE

#37 Post by rdonnay »

No matter what I do, I cannot get it to lock up.
Someone needs to give me an .EXE that has the lockup problem so I can verify that it will lockup on my computer.
The eXpress train is coming - and it has more cars.

User avatar
Auge_Ohr
Posts: 1407
Joined: Wed Feb 24, 2010 3:44 pm

Re: A Generic ownerdraw system for DCBROWSE

#38 Post by Auge_Ohr »

Zdeno Bielik wrote:or try install CpuKiller http://www.cpukiller.com – sometimes I used this for similar tasks - it worked super!
it is not the CPU ...

Ownerdraw is too slow, special when "paint much", so timeing will not match Windows Queue which is running in GUI-Thread.
same have happend with VB ... this is why M$ does not use Ownerdraw ( old NT Standard ) and more but "real" Customdraw e.g. Listview, TreeView.

Code: Select all

      oLv:SetLvNotifyCB( NM_CUSTOMDRAW , {|o,notify_code,lp| oLv:OnCustomDraw(lp) } ) 
p.s. Xbase++ use GDI for 2D Render not 3D or DirectX. Xbase++ does not use 2D Hardware Acceleration.

most modern GFK does have a "bad" 2D Engine ... special Nvidea :naughty:
onboard GFK Chip like 2D GPU Intel HD 4600 have much better 2D Performance Benchmark
greetings by OHR
Jimmy

Janko
Posts: 111
Joined: Sat Mar 20, 2010 8:36 am
Location: Cerklje

Re: A Generic ownerdraw system for DCBROWSE

#39 Post by Janko »

Roger,

I've sent you to your private mail a link to my dropbox with EXE and PRGs.

Best regards
JAnko

User avatar
rdonnay
Site Admin
Posts: 4733
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: A Generic ownerdraw system for DCBROWSE

#40 Post by rdonnay »

I got all your files but this is turning into a real big project for me and it's not even an eXpress++ problem. The generic ownerdraw stuff I posted was a Sample program, not a new eXpress++ feature.

I think that it's time to get Alaska Software involved in this discussion.
Maybe they can shed some light on a solution.
The eXpress train is coming - and it has more cars.

Post Reply