Page 1 of 2

Loosing buttons in RibbonBar

Posted: Mon Jun 25, 2012 10:20 pm
by Bayron
Just started to use FWH12.04, I used to compile with FWH10.02, but I have noticed a couple of times already that I am loosing images from RibbonBar..., today lost them all from all folders...
I moved from folder to folder but did't got them back until I opened a dialog that used BlurEffect...

Image

I am thinking it was a really bad idea upgrading FiveWin and moving from xHarbour1.21 to Harbour 3.2 at the same time...

I am opening this thread in case somebody has experience with RibbonBar and loosing buttons and can help me out... and to share my solutions in case a reach one...

So far in 4 days after upgrading, I have lost images about 6 times... After moving back to Harbour 3.0 I have experienced none so far... Hope that's it...

Re: Loosing buttons in RibbonBar

Posted: Mon Jun 25, 2012 11:12 pm
by Bayron
So far, removing from window:

Code: Select all

STYLE nOr( WS_POPUP )
It seem to make the difference...

Re: Loosing buttons in RibbonBar

Posted: Tue Jun 26, 2012 3:03 am
by Bayron
Well, it seem that the class has a problem with the painting...

The problem can be seen when the bar is resized with or maximized or restored from maximized...

It did not happen when minimized

I don't think I can make an contained example to reproduce the problem...

Re: Loosing buttons in RibbonBar

Posted: Tue Jun 26, 2012 7:36 am
by Antonio Linares
Bayron,

Are you using BMPs there ? From resources or loaded from files in disk ?

Re: Loosing buttons in RibbonBar

Posted: Tue Jun 26, 2012 3:00 pm
by Bayron
Yes they are BMP's loaded from resources...

What I found out is that if I don't mess with the RibbonBar, everything is ok... The problem was that I was using WS_POPUP. This caused some problems, which I solved with my own refreshing function:

Code: Select all

FUNCTION RefRBar()

    For n = 1 To Len(oRBar:aDialogs)
        oRBar:aDialogs[n]:Refresh()

        For m = 1 to Len(oRBar:aDialogs[n]:aControls)
            oRBar:aDialogs[n]:aControls[m]:Refresh()
            
            For l = 1 to Len(oRBar:aDialogs[n]:aControls[m]:aControls)
                oRBar:aDialogs[n]:aControls[m]:aControls[l]:Refresh()
            
            EndFor
            
        EndFor

    EndFor
    
    oBtn101:Refresh()
    oBtn102:Refresh()
    oBtn103:Refresh()
    oBtn104:Refresh()
    
RETURN NIL
 
This controled the problem with xHarbour, but didn't with Harbour...

I think the problem may also be caused because I paint 4 BTNBMP's in the RibbonBar... But the ribbon is working fine now with the buttons...

So far I removed:
The Window Style,
The refresh function,
The BlurEffect and
The Maximize and Restore Functions

If I Reactivate the Window Style, The Group's brush is lost only on the initial painting of the window, and then is OK... This behavior can be replicated by just using this style in samples\Ribbon.prg

Re: Loosing buttons in RibbonBar

Posted: Wed Jun 27, 2012 1:41 am
by Bayron
I guess that the function that I just found in tribbon.prg is a lot more sophisticated, and therefore better to use...

Code: Select all

RefreshRibbonBarBtn( oRb )
I will try to use it on the window data :bGotFocus, so far It does not flickers so I'll see....

Re: Loosing buttons in RibbonBar

Posted: Sun Jul 01, 2012 7:44 pm
by Bayron
The problem with loosing images from resources has continued, this time I noticed that even the resource used with REDEFINE BITMAP on a standard Dialog was missing when all images where lost from the RibbonBar...

This has never happend to me and only started when upgraded to FWH12.04 from 10.2

After this finding, I doubt the problem is RibbonBar, and it may be somewhere else...

Code: Select all

REDEFINE BITMAP

Re: Loosing buttons in RibbonBar

Posted: Sun Jul 01, 2012 7:51 pm
by lucasdebeltran

Re: Loosing buttons in RibbonBar

Posted: Tue Jul 03, 2012 9:02 am
by Bayron
Hi Lucas, thanks for your response...

The bitmaps are from resources, so I don't know what I can do to check them up...
So far I done a lot of things:

I Replaced all the bitmaps for new ones...
I Reduced the size of them...
I made sure none of them had Alpha Channel...
I made a function to refresh the Ribbon Bar On Focus and On Painted...

It seems that the problem is not the RibbonBar at all, but that I am loosing all the bitmaps from resources, and I can't figure out why... It just started when I moved to FWH12.04 and Harbour 3.0...

My next thing is moving back to xHarbour1.21 and see what happens...

Re: Loosing buttons in RibbonBar

Posted: Tue Jul 03, 2012 9:06 am
by Antonio Linares
Byron,

We have also seen it but it is quite dificult to reproduce it. The fact is that sometimes don't paint and then paint fine again. So it can't be an invalid handle.

If you could find an example to reproduce it then surely we would be able to fix it, thaks for all your help :-)

Re: Loosing buttons in RibbonBar

Posted: Tue Jul 03, 2012 10:15 am
by Bayron
Hi Antonio, thanks for looking up to it... There are two things:

They happen randomly...
Probably tomorrow or the next day I will leaving to Honduras for a few days... Up to two weeks, so I'll see if I can do something...

Re: Loosing buttons in RibbonBar

Posted: Tue Jul 03, 2012 11:04 am
by Bayron
So far, I have reproduced the problem compilling with Harbour3.0 and 3.2...

When I compile wiht xHarbour 1.2.1, It does not happens... (or it's not as fast to reproduce)!!!!

It's 5:00 Am already... Sorry I can't stay testing any longer... It's bed time for today...

Re: Loosing buttons in RibbonBar

Posted: Tue Jul 03, 2012 11:13 am
by Antonio Linares
Bayron,

Thanks for your help :-)

Re: Loosing buttons in RibbonBar

Posted: Sat Jul 14, 2012 12:27 am
by Bayron
Hello everybody,

The only way I found to prevent loosing the buttons was to move back to xHarbour...

If somebody knows of a solution, I'll apreciate his help...

Re: Loosing buttons in RibbonBar

Posted: Thu Jul 19, 2012 11:51 am
by Antonio Linares
Bayron,

Trying to get a reproduceable example.

I have seen it ocassionally with Harbour and Windows 8, and I was not sure if it could be related to Windows 8...