ListBox OnDrawItem eavent and AnimEfect.PageChange.Active

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #33443
    gamemaster
    Participant

    Hi

    Situation:
    I had form with one TsPageControl with 3 pages and lot components on it (~30). Page 2 (of that page control) has big image 800×600. TsSkinMenager.AnimEfect.PageChange.Active:=False. Im using 6.44 version.

    Problem 1:
    Each time i change page it update controls. But that update is visual very bad. First it update form, then pagecontrol then one by on components inside… Its very fast ~100 ms but can be see with naked eye. For example: after changing from page 2 to page 3 in TsPanel on page 3 you can see part of image from last page. Fast after its updated and all is ok. But that glitch is problem.

    Question 1:
    So how to do transition betwine pages to be instant. Or how to update whole page and then display it to avoid component by component update?

    Problem 2:
    With AnimEfect.PageChange.Active:=True and AnimEfect.PageChange.Time:=0 can solve Problem 1. No updating component by component. All updated at once and its good but… when change page all OnDrawItem eavents of TListBox as well as TsListBox is trigered 2-3 times. It has no visual effects but effect performance since TlistBox is Owner drawed with images. With AnimEfect.PageChange.Active:=False OnDrawItem is not triggered at page changing.

    Question 2:
    How to make OnDrawItem eavent to ignore that unnecessary calls (if it is unnecessary)?

    Question 3:
    Is there any other way to make instant page changin that update all components at once and then display it without caling OnDrawItem eavent.

    Example:
    TListBox is on page 2. It has 3 visible items to draw with Style:=lbOwnerDrawFixed. TsSkinMenager.AnimEfect.PageChange.Time:=0. Test code was:
    Form1.Caption:=Form1.Caption+'*';
    placed in OnDrawItem of TListBox.
    After changing to page 3 OnDrawItem is not called. Its ok because it shouldn't. Then after changing from page 3 back to page 2 i got:

    1) AnimEfect.PageChange.Active:=False
    Form caption has value '***' because of OnDrawItem.
    Controls updated one by one.

    2) AnimEfect.PageChange.Active:=True
    Form caption has value '*********'.
    Controls updated all at once.

    Hope it helped to understend problem.

    #41210
    Support
    Keymaster

    Hello

    Solution with Enabled animation must be used, I think, and we must solve a second problem with OnDrawItem event.
    I'll try to make a test application soon for this purpose. Maybe you have such application? If yes, then solving a problem will be faster.

    #41225
    gamemaster
    Participant

    QUOTE (Support @ Dec 8 2009, 04:10 PM) <{POST_SNAPBACK}>
    Hello

    Solution with Enabled animation must be used, I think, and we must solve a second problem with OnDrawItem event.
    I'll try to make a test application soon for this purpose. Maybe you have such application? If yes, then solving a problem will be faster.

    #41226
    Sereby
    Participant

    just add it here as an attachment and he will get it when he is back on the board

    #41229
    gamemaster
    Participant

    Here is source
    [attachment=3619:ACBug.zip]
    Upload source cous need recompilation in 2 cases. Also i explane all problems in project not in aditional file. There are 2 aditional problems not related to this topic.

    Here exe compiled on first way.
    [attachment=3620:Project1.exe]
    Here exe compiled on second way.
    [attachment=3621:Project2.exe]

    Must download both exe or source ( and compile source with and without sSkinManager1.AnimEffects.PageChange.Active)

    #41286
    Support
    Keymaster

    Thank you! I'll try it soon.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.